Skip to content

BlockOverrides.toRpc

Converts an BlockOverrides.BlockOverrides to an BlockOverrides.Rpc.

Imports

Named
import { BlockOverrides } from 'ox'

Examples

import { BlockOverrides } from 'ox'
 
const blockOverrides = BlockOverrides.toRpc({
  baseFeePerGas: 1n,
  blobBaseFee: 2n,
  feeRecipient: '0x0000000000000000000000000000000000000000',
  gasLimit: 4n,
  number: 5n,
  prevRandao: 6n,
  time: 78187493520n,
  withdrawals: [
    {
      address: '0x0000000000000000000000000000000000000000',
      amount: 1n,
      index: 0,
      validatorIndex: 1,
    },
  ],
})

Definition

function toRpc(
  blockOverrides: BlockOverrides.BlockOverrides,
): Rpc

Source: src/core/BlockOverrides.ts

Parameters

blockOverrides

  • Type: BlockOverrides.BlockOverrides

The block overrides to convert.

blockOverrides.baseFeePerGas

  • Type: bigintType
  • Optional

Base fee per gas.

blockOverrides.blobBaseFee

  • Type: bigintType
  • Optional

Blob base fee.

blockOverrides.feeRecipient

  • Type: Address.Address | undefined
  • Optional

Fee recipient (also known as coinbase).

blockOverrides.gasLimit

  • Type: bigintType
  • Optional

Gas limit.

blockOverrides.number

  • Type: bigintType
  • Optional

Block number.

blockOverrides.prevRandao

  • Type: bigintType
  • Optional

The previous value of randomness beacon.

blockOverrides.time

  • Type: bigintType
  • Optional

Block timestamp.

blockOverrides.withdrawals

  • Type: Withdrawal[]
  • Optional

Withdrawals made by validators.

Return Type

An instantiated BlockOverrides.Rpc.

Rpc