Skip to content

waitForTransactionReceipt

waitForTransactionReceipt<chain>(client, parameters): Promise<WaitForTransactionReceiptReturnType<chain>>

Defined in: packages/synapse-core/src/utils/wait-for-transaction-receipt.ts:96

viem’s waitForTransactionReceipt, tolerant of Filecoin null rounds.

While the receipt is missing, viem fetches every block it polls, missed heights included, to look for a replacement, and treats any error other than a missing block as fatal. Lotus answers a null round with an error, which would abort the wait. A null round holds no transactions, so the block lookups of this wait see it as an empty block and the scan carries on to the next height.

Takes the same parameters as viem’s action.

Type Parameter
chain extends Chain | undefined
Parameter Type Description
client Client<Transport, chain> The client to read the chain with.
parameters WaitForTransactionReceiptParameters<chain> viem’s WaitForTransactionReceiptParameters.

Promise<WaitForTransactionReceiptReturnType<chain>>

The transaction receipt.

import { waitForTransactionReceipt } from '@filoz/synapse-core/utils'

const receipt = await waitForTransactionReceipt(client, { hash })

Errors viem’s waitForTransactionReceipt throws, except null round errors.