I want to scan the latest block https://trx.tokenview.com/en/blocklist
of the tron network if there is a new transaction on a specific address.
I managed to get the latest block and the balance of the address but I cannot figure out how to scan the latest block and look for any new transaction of the address. Any idea will be very helpful.
from tronpy import Tron
client = Tron()
#-- Get the latest block
latestBlock = client.get_latest_block_number()
print (latestBlock)
#-- Get the balance
accountBalance = client.get_account_balance('TTzPiwbBedv7E8p4FkyPyeqq4RVoqRL3TW')
print (accountBalance)
#-- if the address has new transaction in the latest block at the time of the scan:
#-- display all the data (receiver, sender and amount, etc)
from How to scan the latest TRX block for transfer events to check if an address has a new transaction
No comments:
Post a Comment