Hi guys I am messing around with web3py, come from nodejs
I want to filter for pending transactions and get output in this format.
How can I get it in the usual hexadecimal format like 0x.....
b'\r:\xb8\xb3\x1e\xeb\x0b\x9cs\xf8C\xec\xef\x9d\x9dxX0"\xb1\xb6n\x9d\x18\xcf3\x8a\x95p\xca\x14\xe4'
MyCode:
print(w3.isConnected())
def handle_event(event):
print(event)
# and whatever
async def log_loop(event_filter, poll_interval):
while True:
for event in event_filter.get_new_entries():
handle_event(event)
await asyncio.sleep(poll_interval)
def main():
# block_filter = w3.eth.filter('latest')
tx_filter = w3.eth.filter('pending')
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(
asyncio.gather(
#log_loop(block_filter, 2),
log_loop(tx_filter, 2)))
finally:
loop.close()
main()
Oct 10, 2021, 6:06 PM
This returns something else but certainly no complete transaction hashes
while True:
new_transaction_filter = w3.eth.filter('pending')
new_transaction_filter.get_new_entries()
print(new_transaction_filter)
while True:
new_transaction_filter = w3.eth.filter('pending')
new_transaction_filter.get_new_entries()
print(new_transaction_filter)
my case is closed thanks still
Oct 10, 2021, 6:45 PM