juliankoh / etherscan_py

Powerful wrapper over Etherscan API
MIT License
7 stars 5 forks source link

Unclear output #1

Open snub-fighter opened 3 years ago

snub-fighter commented 3 years ago

Im not sure what I am supposed to do with this output in order to see the actual TX information.

from pprint import pprint
from etherscan_py import etherscan_py
client = etherscan_py.Client('KEY')

transactions = client.get_all_transactions(from_address='ADDRESS',status=1, to_block='latest')
pprint(transactions)

OUTPUT
=======
[<etherscan_py.etherscan_py.EtherscanTransaction object at 0x00000254B06D8AC8>,
wirelessfuture commented 3 years ago

Sorry I know this is old but its returning class objects:

class EtherscanTransaction:
    txhash: string
    block_height: int
    timestamp: int
    nonce: int
    from_address: string
    to_address: string
    value: int
    gas_price: int
    tx_input: string
    position_in_block: int
    is_error: bool

Just iterate and reference these fields and it will work

Tip: You can also use the vars() keyword to output a Python dict.