# Block.toRpc

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

## Imports

:::code-group
```ts [Named]
import { Block } from 'ox'
```

```ts [Entrypoint]
import * as Block from 'ox/Block'
```
:::

## Examples

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

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>
```

**Source:** [src/core/Block.ts](https://github.com/wevm/ox/blob/main/src/core/Block.ts#L318)

## Parameters

### block

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

The Block to convert.

## Return Type

An RPC Block.

`Rpc<boolean, blockTag>`
