Пример #1
0
TX_HASH = '0xb03d4625fd433ad05f036abdc895a1837a7d838ed39f970db69e7d832e41205d'
index = '0x0'
api = Proxies(api_key=key)

price = api.gas_price()
block = api.get_block_by_number(number)
tx_count = api.get_block_transaction_count_by_number(block_number=block_numb)
code = api.get_code(address)
block0 = api.get_most_recent_block()
value = api.get_storage_at(address, 0x0)
transaction = api.get_transaction_by_blocknumber_index(block_number=block_numb,
                                                       index=index)
transaction = api.get_transaction_by_hash(tx_hash=TX_HASH)
count = api.get_transaction_count(address)
receipt = api.get_transaction_receipt(TX_HASH)
uncles = api.get_uncle_by_blocknumber_index(block_number=block_numb,
                                            index=index)

# Stats

api = Stats(api_key=key)

last_price = api.get_ether_last_price()
supply = api.get_total_ether_supply()

# Tokens

address = '0xe04f27eb70e025b78871a2ad7eabe85e61212761'
contract_address = '0x57d90b64a1a57749b0f932f1a3395792e12e7055'
api = Tokens(contract_address=contract_address, api_key=key)

balance = api.get_token_balance(address=address)
Пример #2
0
### get sourcecode
sourcecode = api.get_sourcecode()
print(sourcecode[0]['SourceCode'])

# Proxies
### get most recent block
api = Proxies(api_key=key)
block = api.get_most_recent_block()
print(int(block, 16))
### get transaction by blocknumber
transaction = api.get_transaction_by_blocknumber_index(block_number='0x57b2cc',
                                                       index='0x2')
formatted_trans = pd.DataFrame([transaction])
print(formatted_trans)
# get uncle by blocknumber
uncles = api.get_uncle_by_blocknumber_index(block_number='0x210A9B',
                                            index='0x0')
formatted_uncle = pd.DataFrame([uncles])
print(formatted_uncle)

# Stats
api = Stats(api_key=key)
### get ether last price
last_price = api.get_ether_last_price()
formatted_lp = pd.DataFrame([last_price])
formatted_lp['ethbtc_timestamp'] = pd.to_datetime(formatted_lp['ethbtc_timestamp'], unit='s')
formatted_lp['ethusd_timestamp'] = pd.to_datetime(formatted_lp['ethusd_timestamp'], unit='s')
print(formatted_lp)
### get total ether supply
tot_ether = api.get_total_ether_supply()
print(tot_ether)