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 } from 'viem/tempo'
import { http, zoneModerato } from 'viem/tempo/zones'
export const client = createClient({
account: privateKeyToAccount('0x...'),
chain: zoneModerato(7),
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.