> **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.

# Block.toRpc

:::info
`Block.toRpc` is a re-export of ox's [`Block.toRpc`](https://oxlib.sh/api/Block/toRpc). Refer to the ox documentation for the full reference.
:::

Converts a [`Block.Block`](/docs/utilities/block/types#block) to an [`Block.Rpc`](/docs/utilities/block/types#rpc).

## Imports

```ts
import { Block } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Block } from 'viem/utils'

const block = Block.toRpc({
  // ...
  hash: '0xebc3644804e4040c0a74c5a5bbbc6b46a71a5d4010fe0c92ebb2fdf4a43ea5dd',
  number: 19868020n,
  size: 520n
  timestamp: 1662222222n,
  // ...
})
// @log: {
// @log:   // ...
// @log:   hash: '0xebc3644804e4040c0a74c5a5bbbc6b46a71a5d4010fe0c92ebb2fdf4a43ea5dd',
// @log:   number: '0xec6fc6',
// @log:   size: '0x208',
// @log:   timestamp: '0x63198f6f',
// @log:   // ...
// @log: }
```

## Definition

```ts
function toRpc<includeTransactions, blockTag>(
  block: toRpc.Input<includeTransactions, blockTag>,
  _options?: toRpc.Options<includeTransactions, blockTag>,
): Rpc<boolean, blockTag>
```

## Parameters

### block

* **Type:** `toRpc.Input<includeTransactions, blockTag>`

The Block to convert.

## Return Type

An RPC Block.

`Rpc<boolean, blockTag>`
