I am trying to get pending transactions from the mempool on BSC using a websocket - the same way I was getting pending transactions on the Ethereum network:
web3Ws = new Web3(new Web3.providers.WebsocketProvider(WEBSOCKET_PROVIDER_LINK));
web3Ws.eth.subscribe('pendingTransactions', function (error, result)
When working with Ethereum, I set WEBSOCKET_PROVIDER_LINK
to be wss://${NETWORK}.infura.io/ws/v3/${PROJECT_ID}
, but I don't know how to create WebSocket to get pending transactions on BSC.
What provider link can I use to get pending transactions on BSC?
If you'd like to view a pending transaction, click on “Blockchain” and then “View Pending Tnxs”.
Navigate to the Open Orders tab. 4. Click the Cancel orders icon at the top right of the screen above your listed orders, and confirm the pop-up message (at this time, individual orders must be cancelled from a web browser).
Canceling a pending transaction usually requires contacting the merchant who made the charge. Once a pending transaction has posted, contact your bank or card issuer to dispute it.
I think you're looking for https://getblock.io/nodes/bsc
Once you get an API key, you can use this websocket address:
wss://bsc.getblock.io/mainnet/?api_key=API_KEY
I just implemented it, and it seems to be working for me!
UPDATE:
I have had better success with this service: https://www.quicknode.com
GetBlock worked for me, but would sometimes get a little out of sync with the network.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With