eth_sendRawTransaction - Somnia

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 pre-signed transaction to the Somnia network for execution. This is the primary method for broadcasting transactions. With Somnia's sub-second finality and sub-cent fees, transactions are confirmed rapidly and economically.

Parameters

Parameter
Type
Required
Description

signedTransactionData

string

Yes

The signed transaction data as a hex string

Request Example

curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "eth_sendRawTransaction",
  "params": ["0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"]
}'

Response Example

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

Response Parameters

Parameter
Type
Description

result

string

Transaction hash of submitted transaction

Use Cases

  • Submit signed transactions to the network

  • Deploy smart contracts

  • Transfer SOMI tokens

  • Execute contract functions

  • Batch transaction submission

Error Handling

Error Code
Description

-32602

Invalid params - malformed transaction data

-32603

Internal error - node processing issues

-32000

Transaction rejected - insufficient funds, nonce issues

SDK Integration

Last updated

Was this helpful?