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
Name | Description |
---|---|
TransactionRequest.toRpc | Converts a TransactionRequest.TransactionRequest to a TransactionRequest.Rpc . |
Types
Name | Description |
---|---|
TransactionRequest.Rpc | RPC representation of a TransactionRequest.TransactionRequest . |
TransactionRequest.TransactionRequest | A Transaction Request that is generic to all transaction types, as defined in the Execution API specification. |