Skip to content

TxEnvelopeEip1559.toRpc

Converts an TxEnvelopeEip1559.TxEnvelopeEip1559 to an TxEnvelopeEip1559.Rpc.

Imports

Named
import { TxEnvelopeEip1559 } from 'ox'

Examples

import { RpcRequest, TxEnvelopeEip1559, Value } from 'ox'
 
const envelope = TxEnvelopeEip1559.from({
  chainId: 1,
  nonce: 0n,
  gas: 21000n,
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: Value.fromEther('1'),
})
 
const envelope_rpc = TxEnvelopeEip1559.toRpc(envelope)
 
const request = RpcRequest.from({
  id: 0,
  method: 'eth_sendTransaction',
  params: [envelope_rpc],
})

Definition

function toRpc(
  envelope: TxEnvelopeEip1559.TxEnvelopeEip1559,
): Rpc

Source: src/core/TxEnvelopeEip1559.ts

Parameters

envelope

  • Type: TxEnvelopeEip1559.TxEnvelopeEip1559

The EIP-1559 transaction envelope to convert.

Return Type

An RPC-formatted EIP-1559 transaction envelope.

Rpc