TransactionEnvelopeEip2930.toRpc
Converts an TransactionEnvelopeEip2930.TransactionEnvelopeEip2930
to an TransactionEnvelopeEip2930.Rpc
.
Imports
Named
import { TransactionEnvelopeEip2930 } from 'ox'
Examples
import { RpcRequest, TransactionEnvelopeEip2930, Value } from 'ox'
const envelope = TransactionEnvelopeEip2930.from({
chainId: 1,
nonce: 0n,
gas: 21000n,
maxFeePerGas: Value.fromGwei('20'),
to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
value: Value.fromEther('1'),
})
const envelope_rpc = TransactionEnvelopeEip2930.toRpc(envelope)
const request = RpcRequest.from({
id: 0,
method: 'eth_sendTransaction',
params: [envelope_rpc],
})
Definition
function toRpc(
envelope: TransactionEnvelopeEip2930.TransactionEnvelopeEip2930,
): Rpc
Source: src/core/TransactionEnvelopeEip2930.ts
Parameters
envelope
The EIP-2930 transaction envelope to convert.
Return Type
An RPC-formatted EIP-2930 transaction envelope.
Rpc