For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_sendRawTransaction - Scroll

Example code for the eth_sendRawTransaction JSON-RPC method. Complete guide on how to use eth_sendRawTransaction JSON-RPC in GetBlock Web3 documentation.

This method submits a signed, serialized transaction to the network for inclusion. It is the only write method on a public endpoint: the transaction must be signed client-side before submission.

Parameters

Parameter
Type
Required
Description

signedTransactionData

string

Yes

0x-prefixed RLP-encoded signed transaction

Request

curl --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": ["0x02f8b101808459682f008459682f0e830186a094..."],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'eth_sendRawTransaction',
    params: ['0x02f8b101808459682f008459682f0e830186a094...'],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);
example.py
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'eth_sendRawTransaction',
        'params': ['0x02f8b101808459682f008459682f0e830186a094...'],
        'id': 'getblock.io'
    }
)

print(response.json())

Response

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

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC protocol version ("2.0")

id

string

Request identifier matching the request

result

string

32-byte transaction hash of the submitted transaction

Use Cases

  • Value Transfers: Broadcast a signed native ETH transfer

  • Contract Calls: Submit signed state-changing contract interactions

  • Contract Deployment: Broadcast signed deployment bytecode

  • Batch Submission: Push a queue of pre-signed transactions in nonce order

Error Handling

Error Code
Message
Description

-32602

Invalid params

Malformed or non-hex signed transaction data

-32000

Nonce too low

The transaction nonce is below the account's current nonce

-32010

Transaction rejected

The transaction failed mempool validation

3

Execution reverted

The transaction reverts on execution

Web3 Integration

Last updated

Was this helpful?