I am trying to test their code in order to detect the Ponzi smart contracts. When I run their code following error occurred to get the external transactions. Here is their code ;

for addr in ponzi:
    if (verbose): print("Retrieving transactions of contract ",addr,"... ",end=" ")
    print("Address: ", addr)
    api = Account(address=addr, api_key=key)
    print("api: ", api)
    text = api.get_ext_transactions()
    tint = api.get_int_transactions() 

The value of addr = "0xf45717552f12ef7cb65e95476f217ea008167ae3"

The value api = "<etherscan.accounts.Account object at 0x00000075B4C67388>"

but when execution reaches at api.get_ext_transactions() it gives following error

Traceback (most recent call last): File "ponzi-stats.py", line 133, in text = api.get_ext_transactions() AttributeError: 'Account' object has no attribute 'get_ext_transactions'

And I think this error will also be appeared in next to get internal transactions.

Now my question is how to get external/internal transactions using web2.py. What I have to import, install, etc...

EDIT: In their code they have used from etherscan.accounts import Account. That's why I have installed py-etherscan-api by using this command python -m pip install py-etherscan-api . I am not sure this is right or wrong ...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.