zone.waitForTempoBlock
Waits until a zone has imported a Tempo block.
Usage
import { client } from './zones.config'
const info = await client.zone.waitForTempoBlock({
tempoBlockNumber: 123456n,
})
console.log('Imported Tempo block:', info.tempoBlockNumber)import { privateKeyToAccount } from 'viem/accounts'
import { createClient, http, Zone } from 'viem/tempo'
export const client = createClient({
account: privateKeyToAccount('0x...'),
chain: Zone.a,
transport: http(),
})The action polls zone.getZoneInfo and resolves when the zone's tempoBlockNumber reaches the requested block.
Return Type
Returns the same zone metadata as zone.getZoneInfo.
Parameters
tempoBlockNumber
- Type:
bigint
Tempo block number to wait for.
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.