eth_sendRawTransaction - Monad

This method submits a pre-signed transaction for broadcast to the Monad network.

Parameters

ParameterTypeRequiredDescription
datastringYesThe signed transaction data as a hex string.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_sendRawTransaction",
    "params": ["0xf86c0a8502540be400825208944bbeeb066ed09b7aed07bf39eee0460dfa26152088016345785d8a0000801ba0e2c.."],
    "id": "getblock.io"
}'

sendRawTx.js

javascriptimport axios from 'axios';

const signedTx = "0xf86c0a8502540be400825208944bbeeb066ed09b7aed07bf39eee0460dfa26152088016345785d8a0000801ba0e2c..";

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "eth_sendRawTransaction",
    "params": [signedTx],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => console.log(JSON.stringify(response.data)))
    .catch(error => console.log(error));

send_raw_tx.py

pythonimport requests
import json

url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"

signed_tx = "0xf86c0a8502540be400825208944bbeeb066ed09b7aed07bf39eee0460dfa26152088016345785d8a0000801ba0e2c.."

payload = json.dumps({
    "jsonrpc": "2.0",
    "method": "eth_sendRawTransaction",
    "params": [signed_tx],
    "id": "getblock.io"
})

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)

main.rs

rustuse reqwest::header;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header(header::CONTENT_TYPE, "application/json")
        .body(r#"{
            "jsonrpc": "2.0",
            "method": "eth_sendRawTransaction",
            "params": ["0xf86c0a8502540be400825208944bbeeb066ed09b7aed07bf39eee0460dfa26152088016345785d8a0000801ba0e2c.."],
            "id": "getblock.io"
        }"#)
        .send()
        .await?;
    
    println!("{}", response.text().await?);
    Ok(())
}

Response

response.json

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}

Response Parameters

FieldTypeDescription
resultstringThe 32-byte transaction hash, or zero hash if transaction is not yet available.

Use Case

The eth_sendRawTransaction method is essential for:

  • Submitting signed transactions to the network
  • Wallet transaction broadcasting
  • DeFi protocol interactions
  • Token transfers
  • Smart contract deployments
  • High-frequency trading on Monad

Error Handling

Status CodeError MessageCause
403ForbiddenMissing or invalid ACCESS-TOKEN.
-32602Invalid paramsInvalid transaction data format.
-32000Nonce too lowTransaction nonce already used.
-32000Insufficient fundsNot enough MON for gas.
-32000Gas limit exceededTransaction exceeds block gas limit.
-32003Transaction rejectedTransaction validation failed.

Web3 Integration

ethers-send.js

javascriptimport { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');
const wallet = new ethers.Wallet(privateKey, provider);

const tx = {
    to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
    value: ethers.parseEther('1.0'),
    gasLimit: 21000
};

const txResponse = await wallet.sendTransaction(tx);
console.log('Transaction hash:', txResponse.hash);

// Wait for confirmation (fast on Monad!)
const receipt = await txResponse.wait();
console.log('Confirmed in block:', receipt.blockNumber);