> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Get Block Receipts \[block.getReceipts]

Returns the transaction receipts of a block at a block number, hash, or tag.

## Usage

This example returns the transaction receipts of a block at a block number, hash, or tag.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const receipts = await client.block.getReceipts({ blockNumber: 69420n })
// @log: [
// @log:   {
// @log:     blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d',
// @log:     blockNumber: 69420n,
// @log:     contractAddress: null,
// @log:     cumulativeGasUsed: 21000n,
// @log:     from: '0xa152f8bb749c55e9943a3a0a3111d18ee2b3f94e',
// @log:     gasUsed: 21000n,
// @log:     status: 'success',
// @log:     transactionHash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
// @log:     ...
// @log:   },
// @log:   ...
// @log: ]
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http, publicActions } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
}).extend(publicActions())
```
:::

### Standalone Action

Call `Actions.block.getReceipts` directly by passing the Client as the first argument.

:::code-group
```ts twoslash [example.ts]
import { Actions } from 'viem'
import { client } from './viem.config'

const receipts = await Actions.block.getReceipts(client, { blockNumber: 69420n })
// @log: [
// @log:   {
// @log:     blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d',
// @log:     blockNumber: 69420n,
// @log:     contractAddress: null,
// @log:     cumulativeGasUsed: 21000n,
// @log:     from: '0xa152f8bb749c55e9943a3a0a3111d18ee2b3f94e',
// @log:     gasUsed: 21000n,
// @log:     status: 'success',
// @log:     transactionHash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
// @log:     ...
// @log:   },
// @log:   ...
// @log: ]
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
})
```
:::

## Recipes

### Get Receipts by Block Hash

Pass `blockHash` when the exact block hash is already known.

```ts twoslash
import { Client, http, publicActions } from 'viem'
import { mainnet } from 'viem/chains'

const client = Client.create({
  chain: mainnet,
  transport: http(),
}).extend(publicActions())

const receipts = await client.block.getReceipts({
  blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d', // [!code focus]
})
```

## Return Value

`TransactionReceipt[]`

The block's transaction receipts. When the connected Client's [`chain`](/docs/chains) defines a `codecs.transactionReceipt` codec, each entry reflects that chain's custom receipt shape.

## Parameters

### blockHash

* **Type:** `Hex`

Return the receipts of the block with the given hash.

```ts twoslash
import { Actions, Client, http } from 'viem'
import { mainnet } from 'viem/chains'

const client = Client.create({ chain: mainnet, transport: http() })
// ---cut---
const receipts = await Actions.block.getReceipts(client, {
  blockHash: '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d', // [!code focus]
})
```

### blockNumber

* **Type:** `bigint`

Return the receipts of the block at the given number.

```ts twoslash
import { Actions, Client, http } from 'viem'
import { mainnet } from 'viem/chains'

const client = Client.create({ chain: mainnet, transport: http() })
// ---cut---
const receipts = await Actions.block.getReceipts(client, {
  blockNumber: 69420n, // [!code focus]
})
```

### blockTag

* **Type:** `'latest' | 'earliest' | 'pending' | 'safe' | 'finalized'`
* **Default:** `client.blockTag ?? 'latest'`

Return the receipts of the block at the given tag.

```ts twoslash
import { Actions, Client, http } from 'viem'
import { mainnet } from 'viem/chains'

const client = Client.create({ chain: mainnet, transport: http() })
// ---cut---
const receipts = await Actions.block.getReceipts(client, {
  blockTag: 'safe', // [!code focus]
})
```

## Errors

| Error | Description |
| --- | --- |
| `Actions.block.Errors.BlockNotFoundError` | The block could not be found. |
