Exemple #1
0
# Proxies

number = 10453272
block_numb = '0x9f8118'
address = '0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c'
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
Exemple #2
0
address = '0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359'
### get abi
api = Contract(address=address, api_key=key)
abi = api.get_abi()
print(abi)
### 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')