eth_sendRawTransaction
Submits a pre-signed transaction for broadcast to the network. You must sign the transaction offline first.
Parameters
Section titled “Parameters”DATA— The signed transaction data (hex-encoded).
Returns
Section titled “Returns”DATA (32 bytes) — The transaction hash, or the zero hash if the transaction is not yet available.
Request
Section titled “Request”curl -X POST https://eth-mainnet.blockreq.com/v1/rpc/YOUR_API_KEY \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf86c808504a817c80082520894..."], "id": 1 }'⚠️ This method requires a private endpoint (API key). It is not available on public endpoints.
Response
Section titled “Response”{ "jsonrpc": "2.0", "id": 1, "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"}Code Examples
Section titled “Code Examples”JavaScript (ethers.js v6)
Section titled “JavaScript (ethers.js v6)”import { JsonRpcProvider, Wallet } from "ethers";const provider = new JsonRpcProvider("https://eth-mainnet.blockreq.com/v1/rpc/YOUR_API_KEY");const wallet = new Wallet("0xYOUR_PRIVATE_KEY", provider);
const tx = await wallet.sendTransaction({ to: "0xRecipientAddress", value: "1000000000000000000", // 1 ETH in wei});console.log("Tx hash:", tx.hash);await tx.wait();console.log("Confirmed!");Python (web3.py)
Section titled “Python (web3.py)”from web3 import Web3w3 = Web3(Web3.HTTPProvider("https://eth-mainnet.blockreq.com/v1/rpc/YOUR_API_KEY"))
signed = w3.eth.account.sign_transaction({ "to": "0xRecipientAddress", "value": w3.to_wei(1, "ether"), "gas": 21000, "gasPrice": w3.eth.gas_price, "nonce": w3.eth.get_transaction_count("0xYourAddress"), "chainId": 1}, "0xYOUR_PRIVATE_KEY")
tx_hash = w3.eth.send_raw_transaction(signed.raw_transaction)print(f"Tx hash: {tx_hash.hex()}")RU Cost
Section titled “RU Cost”| Method | Cost |
|---|---|
| eth_sendRawTransaction | 20 RU |