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

