testnet
GitHub

eth_sendRawTransaction

eth_sendRawTransaction(signedTx) → txHash

Broadcasts a signed transaction to the network. Sign the transaction locally (e.g. with ethers.js or viem) and pass the resulting hex-encoded RLP bytes. The node returns the transaction hash immediately; use eth_getTransactionReceipt to wait for inclusion in a block.

Parameters

Name Type Required Description
signedTx string The signed transaction data, hex-encoded with 0x prefix. Produced by signing an EIP-1559 or legacy transaction locally with the sender's private key.

Returns

Type: string

The transaction hash (32 bytes, hex-encoded). The transaction is in the mempool but not yet mined.

Errors

Code Name Description
-32000 Insufficient funds Sender does not have enough OKRW for value + gas
-32000 Nonce too low The transaction's nonce is below the sender's current nonce. Re-fetch with `eth_getTransactionCount` and re-sign.
-32602 Invalid signature The signature does not match the chain ID. Verify chainId is 450815 and the signer used EIP-155 replay protection.

Examples

ethers.js v6 — sign and broadcast

ethers.js handles signing and the RPC call together. For raw control, sign with `wallet.signTransaction(req)` then call `provider.send("eth_sendRawTransaction", [signedHex])`.

import { JsonRpcProvider, Wallet, parseEther } from "ethers";

const provider = new JsonRpcProvider("https://rpc-testnet.maroo.io");
const wallet = new Wallet(process.env.PRIVATE_KEY!, provider);

// `sendTransaction` signs locally and calls eth_sendRawTransaction internally.
const tx = await wallet.sendTransaction({
  to: "0xRecipientAddress",
  value: parseEther("1.5"), // 1.5 OKRW
});
console.log("Tx hash:", tx.hash);

const receipt = await tx.wait();
console.log("Mined in block:", receipt!.blockNumber);

Raw cURL with a pre-signed transaction

Replace the params hex with your locally-signed transaction. Returns `{ jsonrpc, id, result: "0x<txHash>" }` on success.

curl -X POST https://rpc-testnet.maroo.io \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_sendRawTransaction",
    "params": ["0xf86c80...signed-tx-hex..."],
    "id": 1
  }'
Source: maroo
ESC
Type to search