Skip to content
LogoLogo

earn.waitForPrivateRedeem

Waits for a Zone gateway to redeem vault shares on the parent Tempo chain.

Usage

Pass the correlation fields returned by earn.privateRedeem.prepare.

import { client } from './viem.config'
 
const result = await client.earn.waitForPrivateRedeem({
  actionId: '0x0000000000000000000000000000000000000000000000000000000000000001',
  fromBlock: 123456n,
  gateway: '0x0000000000000000000000000000000000000001',
})
{ outputAmount: 99_000_000n, tempoBlockNumber: 123457n, ... }

Use tempoBlockNumber from the result with zone.waitForTempoBlock to confirm that the returned assets were imported by the Zone.

Return Type

type ReturnType = {
  actionId: Hex
  outputAmount: bigint
  outputToken: Address
  shares: bigint
  tempoBlockNumber: bigint
  vaultAssets: bigint
  zoneDepositHash: Hex
}

Parameters

actionId

  • Type: Hex

Correlation ID returned by earn.privateRedeem.prepare.

fromBlock

  • Type: bigint

Lower bound for the parent-chain log scan.

gateway

  • Type: Address

Zone gateway address.

pollingInterval (optional)

  • Type: number
  • Default: client.pollingInterval

Polling frequency in milliseconds.

timeout (optional)

  • Type: number
  • Default: 60_000

Maximum time to wait in milliseconds. Set to 0 to disable the timeout.