Skip to main content
This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.

Transaction Methods

9 methods for submitting signed transactions, querying transaction data, and managing account nonces.

Overview

Transaction methods handle the full lifecycle: submission, retrieval, receipt tracking, and nonce management.

Methods

Submit a signed transaction to the network for execution.Parameters:
  • signedTransaction: Hex - Signed transaction bytes
Returns: Hash - Transaction hash
Use cases:
  • Submit pre-signed transactions
  • Broadcast transactions from offline signing
  • Send transactions without wallet interaction
Sign and send a transaction (requires unlocked account). Most nodes disable this for security.Parameters:
  • transaction: TransactionRequest - Transaction parameters
    • from: Address - Sender address (must be unlocked)
    • to?: Address - Recipient address (omit for contract creation)
    • value?: Quantity - ETH amount in wei
    • data?: Hex - Transaction data
    • gas?: Quantity - Gas limit
    • gasPrice?: Quantity - Gas price (legacy)
    • maxFeePerGas?: Quantity - Max fee (EIP-1559)
    • maxPriorityFeePerGas?: Quantity - Max priority fee (EIP-1559)
    • nonce?: Quantity - Transaction nonce
Returns: Response<Hash> - Transaction hash
Most public nodes do not support this method. Use eth_sendRawTransaction with client-side signing instead.
Get transaction details by hash. Returns null if transaction not found.Parameters:
  • hash: Hash - Transaction hash
Returns: Response<Transaction | null> - Transaction object or null
Transaction fields:
  • hash: Hash - Transaction hash
  • from: Address - Sender address
  • to: Address | null - Recipient (null for contract creation)
  • value: Quantity - ETH amount in wei
  • input: Hex - Transaction data
  • nonce: Quantity - Sender nonce
  • gas: Quantity - Gas limit
  • gasPrice: Quantity - Gas price
  • blockHash: Hash | null - Block hash (null if pending)
  • blockNumber: Quantity | null - Block number (null if pending)
  • transactionIndex: Quantity | null - Index in block (null if pending)
Get transaction by block hash and transaction index within that block.Parameters:
  • blockHash: Hash - Block hash
  • index: Quantity - Transaction index in block (0-indexed)
Returns: Response<Transaction | null> - Transaction object or null
Use cases:
  • Iterate through block transactions by index
  • Retrieve specific transaction position
  • Process transactions sequentially
Get transaction by block number and transaction index within that block.Parameters:
  • blockTag: BlockTag - Block number or tag (‘latest’, ‘earliest’, ‘pending’, ‘safe’, ‘finalized’)
  • index: Quantity - Transaction index in block (0-indexed)
Returns: Response<Transaction | null> - Transaction object or null
Use cases:
  • Get transactions from recent blocks
  • Access finalized/safe transactions
  • Query specific transaction positions
Get transaction receipt (includes status, logs, gas used). Returns null if transaction not mined.Parameters:
  • hash: Hash - Transaction hash
Returns: Response<TransactionReceipt | null> - Receipt object or null
Receipt fields:
  • transactionHash: Hash - Transaction hash
  • transactionIndex: Quantity - Index in block
  • blockHash: Hash - Block hash
  • blockNumber: Quantity - Block number
  • from: Address - Sender address
  • to: Address | null - Recipient (null for contract creation)
  • cumulativeGasUsed: Quantity - Total gas used in block up to this tx
  • gasUsed: Quantity - Gas used by this transaction
  • contractAddress: Address | null - Created contract address (null if not creation)
  • logs: Log[] - Event logs emitted
  • logsBloom: Hex - Bloom filter for logs
  • status: Quantity - 1 for success, 0 for failure (post-Byzantium)
  • effectiveGasPrice: Quantity - Actual gas price paid
Get transaction count (nonce) for an address. This is the next nonce to use.Parameters:
  • address: Address - Account address
  • blockTag: BlockTag - Block to query (‘latest’, ‘earliest’, ‘pending’, ‘safe’, ‘finalized’)
Returns: Response<Quantity> - Transaction count (nonce)
Block tag semantics:
  • 'latest' - Last mined block (confirmed transactions)
  • 'pending' - Includes pending transactions (for sequential submission)
  • 'safe' - Safe block (post-merge)
  • 'finalized' - Finalized block (post-merge)
Use cases:
  • Get next nonce before signing transaction
  • Check account activity (nonce = 0 means no transactions)
  • Track pending transactions
Sign arbitrary data with an account (requires unlocked account).Parameters:
  • address: Address - Account to sign with (must be unlocked)
  • message: Hex - Data to sign
Returns: Response<Hex> - Signature bytes
eth_sign is dangerous and deprecated. It can sign arbitrary data including valid transactions, enabling phishing attacks. Use typed signing methods like EIP-712 (eth_signTypedData_v4) instead.
Sign a transaction (requires unlocked account). Returns signed transaction without broadcasting.Parameters:
  • transaction: TransactionRequest - Transaction to sign
    • from: Address - Sender address (must be unlocked)
    • to?: Address - Recipient address
    • value?: Quantity - ETH amount in wei
    • data?: Hex - Transaction data
    • gas?: Quantity - Gas limit
    • gasPrice?: Quantity - Gas price (legacy)
    • maxFeePerGas?: Quantity - Max fee (EIP-1559)
    • maxPriorityFeePerGas?: Quantity - Max priority fee (EIP-1559)
    • nonce?: Quantity - Transaction nonce
Returns: Response<Hex> - Signed transaction bytes
Most public nodes do not support this method. Use client-side signing libraries like @noble/secp256k1 or Voltaire’s crypto primitives instead.

Usage Patterns

Submit and Monitor Transaction

Query Transaction Status

Get Account Nonce

Process Block Transactions