eth_sendRawTransaction - Base
Example code for the eth_sendRawTransaction JSON-RPC method. Complete guide on how to use eth_sendRawTransaction JSON-RPC in GetBlock Web3 documentation.
The eth_sendRawTransaction method submits a signed transaction to the Base network for broadcast and inclusion in a block. This is the primary method for sending transactions, including ETH transfers, contract calls, and contract deployments.
Parameters
signedTransactionData
string
Yes
The signed transaction data as a hex string
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"],
"id": "getblock.io"
}'const axios = require('axios');
const signedTx = '0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83';
const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'eth_sendRawTransaction',
params: [signedTx],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log('Transaction Hash:', response.data.result);cURL
Axios (JavaScript)
Requests (Python)
Rust
Response
Response Parameters
jsonrpc
string
JSON-RPC protocol version ("2.0")
id
string
Request identifier matching the request
result
string
32-byte transaction hash, or error if failed
Use Cases
ETH Transfers: Send ETH between accounts.
Token Transfers: Execute ERC-20 token transfers.
Contract Interaction: Call contract functions that modify state.
Contract Deployment: Deploy new smart contracts.
DeFi Operations: Execute swaps, liquidity operations.
Error Handling
-32602
Invalid params
Invalid transaction data format
-32603
Internal error
Transaction processing failed
-32000
Nonce too low
Nonce already used
-32000
Insufficient funds
Not enough ETH for gas + value
-32000
Replacement underpriced
Gas price too low to replace pending tx
-32000
Gas limit exceeded
Transaction gas exceeds block limit
Web3 Integration
Last updated
Was this helpful?