eth_sendRawTransaction - Robinhood RPC Method
Submit signed transactions to Robinhood Chain. Essential for broadcasting transactions for tokenized assets, DeFi applications, historical state analysis, and EVM smart contracts.
Robinhood RPC endpoint: endpoint URLs, plans and pricing.
Submits a pre-signed transaction for broadcast to Robinhood Chain.
Why Robinhood? Build on an Ethereum-compatible Layer 2 built with Arbitrum Nitro for tokenized real-world assets with Arbitrum Nitro compatibility, ETH gas, sub-second soft confirmations, archive history, and WebSocket access.
When to Use This Method
The eth_sendRawTransaction method serves these key scenarios for Robinhood Chain developers, financial application teams, and EVM builders:
- Submit pre-signed transactions - Broadcast transactions that were signed offline or in a secure enclave, keeping private keys away from the RPC endpoint
- Broadcast from offline signers - Air-gapped devices and hardware wallets first sign, then use this method to push the signed payload to Robinhood
- Resubmit stuck transactions - Replace pending transactions with the same nonce and a higher gas price when the original is not being included in blocks
- Deploy contracts programmatically - Submit contract creation transactions containing compiled bytecode and constructor arguments
Common Use Cases
1. Sign and Send an ETH Transfer
Build, sign, and broadcast a native ETH transfer with proper nonce management. The nonce must be retrieved from the node immediately before signing to avoid conflicts with pending transactions.
import { JsonRpcProvider, Wallet, parseEther, Transaction } from 'ethers';
const provider = new JsonRpcProvider('https://api-robinhood-mainnet-archive.n.dwellir.com/YOUR_API_KEY');
const wallet = new Wallet('PRIVATE_KEY', provider);
async function sendNativeTransfer(to, amountInEth) {
const tx = await wallet.sendTransaction({
to: to,
value: parseEther(amountInEth)
});
console.log('Transaction submitted:', tx.hash);
const receipt = await tx.wait();
console.log(`Confirmed in block ${receipt.blockNumber}, gas used: ${receipt.gasUsed}`);
return receipt;
}
const receipt = await sendNativeTransfer('0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73', '0.01');2. Resubmit a Stuck Transaction
If a pending transaction is not being confirmed due to low gas, submit a replacement with the same nonce and a higher gas price. The replacement must use an increased fee to be accepted by the Robinhood mempool.
import { JsonRpcProvider, Wallet, parseEther } from 'ethers';
const provider = new JsonRpcProvider('https://api-robinhood-mainnet-archive.n.dwellir.com/YOUR_API_KEY');
const wallet = new Wallet('PRIVATE_KEY', provider);
async function speedUpTransaction(originalTxHash, gasMultiplier = 1.5) {
const pendingTx = await provider.getTransaction(originalTxHash);
if (!pendingTx) throw new Error('Transaction not found');
const feeData = await provider.getFeeData();
const replacementTx = {
to: pendingTx.to,
value: pendingTx.value,
data: pendingTx.data,
nonce: pendingTx.nonce,
maxFeePerGas: feeData.maxFeePerGas * BigInt(Math.floor(gasMultiplier * 100)) / 100n,
maxPriorityFeePerGas: feeData.maxPriorityFeePerGas * BigInt(Math.floor(gasMultiplier * 100)) / 100n,
gasLimit: pendingTx.gasLimit
};
const tx = await wallet.sendTransaction(replacementTx);
console.log('Replacement transaction:', tx.hash);
return tx;
}
const newTx = await speedUpTransaction('0x...');3. Deploy a Compiled Contract
Submit a contract deployment transaction containing the compiled bytecode. The to field is omitted for contract creation transactions; the contract address is deterministically derived from the sender address and nonce.
import { JsonRpcProvider, Wallet, ContractFactory } from 'ethers';
const provider = new JsonRpcProvider('https://api-robinhood-mainnet-archive.n.dwellir.com/YOUR_API_KEY');
const wallet = new Wallet('PRIVATE_KEY', provider);
const contractAbi = ['constructor(string memory name, uint256 supply)'];
const contractBytecode = '0x608060...';
async function deployContract(constructorArgs) {
const factory = new ContractFactory(contractAbi, contractBytecode, wallet);
const contract = await factory.deploy(...constructorArgs);
console.log('Deployment tx:', contract.deploymentTransaction().hash);
await contract.waitForDeployment();
console.log('Contract deployed at:', await contract.getAddress());
return contract;
}
const contract = await deployContract(['MyToken', 1000000]);Best Practices
- Always sign transactions client-side: never send private keys to any RPC endpoint, including
https://api-robinhood-mainnet-archive.n.dwellir.com/YOUR_API_KEY - Track nonces carefully to avoid gaps or conflicts: retrieve the pending nonce from
eth_getTransactionCountwith"pending"tag before each signing - The return value is a transaction hash: use
eth_getTransactionReceiptto poll for confirmation status - Handle replacement transactions correctly: the replacement must use the same nonce with a higher gas price
- Use
eth_estimateGasto set an appropriate gas limit before signing and sending
{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": [
"0x02f9040f82123732808405f5e1008308fb6a948e70484544526d0e0ab095165ca57dd77b96206980b903a43593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a54dc0400000000000000000000000000000000000000000000000000000000000000030b009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000f8b0a10e4700000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000275654a894873ce0a4b53824b737166e71f5bed900000000000000000000000000000000000000000000000000f8b0a10e470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002b0bd7d308f8e1639fab988df18a8011f41eacad73002710aa9d744e653720229b99e16e1c461719f92bc645000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000aa9d744e653720229b99e16e1c461719f92bc64500000000000000000000000000000000000000000000000000f8b0a10e4700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000275654a894873ce0a4b53824b737166e71f5bed9c080a0a38aa9bd404837651204bb32f68ce003b34c4228888d77c48d7d13205cf6d2d2a005ce7b264d19499cd448b875a5f443ee2178e5791c53b0aeb150003f810838ae"
],
"id": 1
}Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32000 | Nonce too low | Transaction nonce already used |
| -32000 | Insufficient funds | Account has insufficient balance |
| -32000 | Gas too low | Gas limit insufficient |
| -32000 | Replacement underpriced | Gas price too low for replacement |
Related Methods
eth_estimateGas- Estimate gas requiredeth_gasPrice- Get current gas priceeth_getTransactionReceipt- Get transaction result
eth_accounts
Returns a list of addresses owned by the client on Robinhood Chain. Typically returns an empty array on public RPC endpoints.
eth_getTransactionByHash
Retrieve transaction details by hash on Robinhood Chain. Essential for Robinhood Chain developers, financial application teams, and EVM builders tracking transactions on an Ethereum-compatible Layer 2 built with Arbitrum Nitro for tokenized real-world assets.