# waitForTransactionReceipt

> **waitForTransactionReceipt**\<`chain`\>(`client`, `parameters`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`WaitForTransactionReceiptReturnType`\<`chain`\>\>

Defined in: [packages/synapse-core/src/utils/wait-for-transaction-receipt.ts:96](https://github.com/FilOzone/synapse-sdk/blob/5989c4b03ed2fe4cf8b1ef29efe1d4ff1ad4c7bc/packages/synapse-core/src/utils/wait-for-transaction-receipt.ts#L96)

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 Parameters

| Type Parameter |
| ------ |
| <a id="type-parameter-chain"></a> `chain` *extends* `Chain` \| `undefined` |

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `client` | `Client`\<`Transport`, `chain`\> | The client to read the chain with. |
| `parameters` | `WaitForTransactionReceiptParameters`\<`chain`\> | viem's WaitForTransactionReceiptParameters. |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`WaitForTransactionReceiptReturnType`\<`chain`\>\>

The transaction receipt.

## Example

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

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

## Throws

Errors viem's `waitForTransactionReceipt` throws, except null round errors.