Skip to content

waitForCallsStatus

Waits for a call bundle to be confirmed & included on a Block before returning the status & receipts.

Usage

example.ts
import { parseEther } from 'viem'
import { account, walletClient } from './config'
 
const id = await walletClient.sendCalls({
  account,
  calls: [{
    to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
    value: parseEther('1')
  }],
})
 
const { status, receipts } = await walletClient.waitForCallsStatus({ 
  id, 
}) 

Returns

WaitForCallsStatusReturnType

Status and receipts of the calls.

Parameters

id

  • Type: string

Identifier of the call batch.

const { status, receipts } = await walletClient.waitForCallsStatus({
  id: '0xdeadbeef', 
})

pollingInterval

  • Type: number
  • Default: client.pollingInterval

Polling interval in milliseconds.

const { status, receipts } = await walletClient.waitForCallsStatus({
  id: '0xdeadbeef',
  pollingInterval: 1_000, 
})

timeout

  • Type: number
  • Default: 60_000

Timeout in milliseconds before waitForCallsStatus stops polling.

const { status, receipts } = await walletClient.waitForCallsStatus({
  id: '0xdeadbeef',
  timeout: 10_000, 
})