Skip to content

TransactionRequest.fromRpc

Converts a TransactionRequest.Rpc to a TransactionRequest.TransactionRequest.

Imports

Named
import { TransactionRequest } from 'ox'

Examples

import { TransactionRequest } from 'ox'
 
const request = TransactionRequest.fromRpc({
  to: '0x0000000000000000000000000000000000000000',
  value: '0x2386f26fc10000',
})

Definition

function fromRpc(
  request: Rpc,
): TransactionRequest

Source: src/core/TransactionRequest.ts

Parameters

request

  • Type: Rpc

The RPC request to convert.

request.data

  • Type: 0x${string}

Frame calldata.

request.executionGasLimit

  • Type: 0x${string}

Execution gas budget.

request.flags

  • Type: number

Approval scope and batching bits.

request.mode

  • Type: number

Execution mode.

request.msg

  • Type: 0x${string}

Explicit digest, or empty bytes for the transaction signing hash.

request.scheme

  • Type: 0 | 1 | 2

Signature verification scheme.

request.signature

  • Type: 0x${string}

Encoded signature bytes.

request.signer

  • Type: Address.Address | null | undefined
  • Optional

Signer address; absent for the transaction sender.

request.stateGasLimit

  • Type: 0x${string}

State gas budget.

request.target

  • Type: Address.Address | null | undefined
  • Optional

Target address; absent for the transaction sender.

request.value

  • Type: 0x${string}

Value transferred in wei.

Return Type

A transaction request.

TransactionRequest