I would like to know if you know how to listen to a contract or an address, because I tried to have all the pending events but I can't filter my address in it, too many txhash recuperate I can't find my txhash in it.
I ran the python code and then sent bnb to another address via metamask but I didn't get the txhash on the python code.
If anyone can help me here is the code:
from web3 import Web3 import time web3 = Web3(Web3.WebsocketProvider("wss://bsc-ws-node.nariox.org:443")) def main(): filter = web3.eth.filter('pending') while True: try: tx_hashes = web3.eth.getFilterChanges(filter.filter_id) for tx in tx_hashes: tx_receipt = web3.eth.getTransaction(tx) print(tx_receipt) except Exception as exception: continue if __name__ == '__main__': main() I'm using python