githubEdit

eth_sendRawTransaction - Polygon

Example code for the eth_sendRawTransaction json-rpc method. Сomplete guide on how to use eth_sendRawTransaction json-rpc in GetBlock.io Web3 documentation.

The eth_sendRawTransaction method submits a pre-signed transaction for broadcast to the network. The transaction must be signed with the sender's private key before calling this method.

Parameters

Parameter
Type
Required
Description

signedTransactionData

string

Yes

Signed transaction data in hexadecimal

Request

cURL
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_sendRawTransaction",
    "params": ["0xf86c0885048c273950..."],
    "id": "getblock.io"
}'

Response

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

Response Parameters

Field
Type
Description

jsonrpc

string

JSON-RPC version (2.0)

id

string

Request identifier

result

varies

32-byte transaction hash, or error if transaction failed

Use Case

The eth_sendRawTransaction method is useful for:

  • Transaction submission

  • Token transfers

  • Contract interaction

  • DeFi operations

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

-32600

Invalid Request

Malformed request body

-32602

Invalid params

Invalid method parameters

Web3 Integration

Last updated

Was this helpful?