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
eth_sendRawTransaction
eth_sendRawTransaction
Submit a signed transaction to the network for execution.Parameters:Use cases:
signedTransaction: Hex- Signed transaction bytes
Hash - Transaction hash- Submit pre-signed transactions
- Broadcast transactions from offline signing
- Send transactions without wallet interaction
eth_sendTransaction
eth_sendTransaction
Sign and send a transaction (requires unlocked account). Most nodes disable this for security.Parameters:
transaction: TransactionRequest- Transaction parametersfrom: Address- Sender address (must be unlocked)to?: Address- Recipient address (omit for contract creation)value?: Quantity- ETH amount in weidata?: Hex- Transaction datagas?: Quantity- Gas limitgasPrice?: Quantity- Gas price (legacy)maxFeePerGas?: Quantity- Max fee (EIP-1559)maxPriorityFeePerGas?: Quantity- Max priority fee (EIP-1559)nonce?: Quantity- Transaction nonce
Response<Hash> - Transaction hasheth_getTransactionByHash
eth_getTransactionByHash
Get transaction details by hash. Returns null if transaction not found.Parameters:Transaction fields:
hash: Hash- Transaction hash
Response<Transaction | null> - Transaction object or nullhash: Hash- Transaction hashfrom: Address- Sender addressto: Address | null- Recipient (null for contract creation)value: Quantity- ETH amount in weiinput: Hex- Transaction datanonce: Quantity- Sender noncegas: Quantity- Gas limitgasPrice: Quantity- Gas priceblockHash: Hash | null- Block hash (null if pending)blockNumber: Quantity | null- Block number (null if pending)transactionIndex: Quantity | null- Index in block (null if pending)
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockHashAndIndex
Get transaction by block hash and transaction index within that block.Parameters:Use cases:
blockHash: Hash- Block hashindex: Quantity- Transaction index in block (0-indexed)
Response<Transaction | null> - Transaction object or null- Iterate through block transactions by index
- Retrieve specific transaction position
- Process transactions sequentially
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionByBlockNumberAndIndex
Get transaction by block number and transaction index within that block.Parameters:Use cases:
blockTag: BlockTag- Block number or tag (‘latest’, ‘earliest’, ‘pending’, ‘safe’, ‘finalized’)index: Quantity- Transaction index in block (0-indexed)
Response<Transaction | null> - Transaction object or null- Get transactions from recent blocks
- Access finalized/safe transactions
- Query specific transaction positions
eth_getTransactionReceipt
eth_getTransactionReceipt
Get transaction receipt (includes status, logs, gas used). Returns null if transaction not mined.Parameters:Receipt fields:
hash: Hash- Transaction hash
Response<TransactionReceipt | null> - Receipt object or nulltransactionHash: Hash- Transaction hashtransactionIndex: Quantity- Index in blockblockHash: Hash- Block hashblockNumber: Quantity- Block numberfrom: Address- Sender addressto: Address | null- Recipient (null for contract creation)cumulativeGasUsed: Quantity- Total gas used in block up to this txgasUsed: Quantity- Gas used by this transactioncontractAddress: Address | null- Created contract address (null if not creation)logs: Log[]- Event logs emittedlogsBloom: Hex- Bloom filter for logsstatus: Quantity- 1 for success, 0 for failure (post-Byzantium)effectiveGasPrice: Quantity- Actual gas price paid
eth_getTransactionCount
eth_getTransactionCount
Get transaction count (nonce) for an address. This is the next nonce to use.Parameters:Block tag semantics:
address: Address- Account addressblockTag: BlockTag- Block to query (‘latest’, ‘earliest’, ‘pending’, ‘safe’, ‘finalized’)
Response<Quantity> - Transaction count (nonce)'latest'- Last mined block (confirmed transactions)'pending'- Includes pending transactions (for sequential submission)'safe'- Safe block (post-merge)'finalized'- Finalized block (post-merge)
- Get next nonce before signing transaction
- Check account activity (nonce = 0 means no transactions)
- Track pending transactions
eth_sign
eth_sign
Sign arbitrary data with an account (requires unlocked account).Parameters:
address: Address- Account to sign with (must be unlocked)message: Hex- Data to sign
Response<Hex> - Signature byteseth_signTransaction
eth_signTransaction
Sign a transaction (requires unlocked account). Returns signed transaction without broadcasting.Parameters:
transaction: TransactionRequest- Transaction to signfrom: Address- Sender address (must be unlocked)to?: Address- Recipient addressvalue?: Quantity- ETH amount in weidata?: Hex- Transaction datagas?: Quantity- Gas limitgasPrice?: Quantity- Gas price (legacy)maxFeePerGas?: Quantity- Max fee (EIP-1559)maxPriorityFeePerGas?: Quantity- Max priority fee (EIP-1559)nonce?: Quantity- Transaction nonce
Response<Hex> - Signed transaction bytesUsage Patterns
Submit and Monitor Transaction
Query Transaction Status
Get Account Nonce
Process Block Transactions
Related
- Block Methods - Query blocks containing transactions
- eth_call - Execute read-only calls
- eth_getLogs - Query transaction event logs
- Transaction Primitive - Transaction data structures
- Error Handling - Handle transaction errors

