eth_sendRawTransaction - BSC

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

This method submits a pre-signed transaction to the BNB Smart Chain network for execution. This is the primary method for broadcasting transactions and is essential for any application that needs to send BNB or interact with smart contracts.

Parameters

Parameter
Type
Required
Description

signedTxData

string

Yes

The signed transaction data (hex)

Request Example

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

Response Example

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

Response Parameters

Parameter
Type
Description

result

string

Transaction hash for tracking

Use Cases

  • Send BNB transfers

  • Execute BEP-20 token transfers

  • Interact with DeFi protocols

  • Deploy smart contracts

  • Execute PancakeSwap trades

Error Handling

Error Code
Description

-32602

Invalid params - malformed transaction

-32000

Insufficient funds for gas

-32000

Nonce too low

-32000

Replacement transaction underpriced

SDK Integration

Last updated

Was this helpful?