BNB Smart Chain

BNB Smart Chain

eth_newPendingTransactionFilter

BNB Smart Chain operates as chain ID 56 and meters gas in BNB, and eth_newPendingTransactionFilter lets you observe its mempool as transactions queue up ahead of the next ~3-second PoSA block. Directed at https://bsc.therpc.io/YOUR_API_KEY, it creates a server-side filter for incoming pending transactions and returns a hex filter ID. Poll that ID with eth_getFilterChanges and the node hands back the hashes of pending transactions it has seen since your last poll, giving polling clients a mempool feed without keeping a WebSocket open to BNB Smart Chain.

Use cases

  • Watch the BNB Smart Chain mempool for pending transactions originating from a particular sender so you can react before they are mined.
  • Build a live gas-price gauge by sampling the fees attached to pending transactions and charting BNB tip levels over time.

Parameters

This method takes no parameters. Pass an empty array [].

Response

TypeDescription
stringHex filter ID. When polled with eth_getFilterChanges, yields an array of new pending transaction hashes since the last poll.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newPendingTransactionFilter",
"params": [],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32000filter not foundProvider rejected filter creation or the filter limit was reached.

Common pitfalls

  • Each poll delivers nothing but transaction hashes; resolve the full body with eth_getTransactionByHash when you need sender, value, or calldata.
  • A pending transaction may never make it into a block or may be replaced by a higher-fee one with the same nonce, so never count it as confirmed.
  • When BNB Smart Chain is congested the mempool can balloon and flood each poll with thousands of hashes; for sustained real-time use prefer an eth_subscribe newPendingTransactions stream over WebSocket.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_newPendingTransactionFilter","params":[]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.