txpool_status - BSC

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

This method returns the number of pending and queued transactions in the transaction pool on the BNB Smart Chain.

Parameters

  • None

Request Example

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

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "pending": "0x10",
        "queued": "0x5"
    }
}

Response Parameters

Parameter
Type
Description

pending

string

Pending tx count (0x10 = 16)

queued

string

Queued tx count (0x5 = 5)

Use Cases

  • Monitor mempool congestion

  • Estimate transaction confirmation times

  • Track network activity

  • Optimize gas prices

Error Handling

Error Code
Description

-32601

Method not supported

-32603

Internal error

SDK Integration

Last updated

Was this helpful?