Skip to content

TransactionRequest

Utilities & types for working with Transaction Requests as defined in the Execution API specification

Examples

import 'ox/window'
import { Provider, TransactionRequest, Value } from 'ox'
 
const provider = Provider.from(window.ethereum!)
 
const request = TransactionRequest.toRpc({ 
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', 
  value: Value.fromEther('0.01'), 
})
 
const hash = await provider.request({
  method: 'eth_sendTransaction',
  params: [request],
})

Functions

NameDescription
TransactionRequest.toRpcConverts a TransactionRequest.TransactionRequest to a TransactionRequest.Rpc.

Types

NameDescription
TransactionRequest.RpcRPC representation of a TransactionRequest.TransactionRequest.
TransactionRequest.TransactionRequestA Transaction Request that is generic to all transaction types, as defined in the Execution API specification.