class Block(EtherscanAPI): def __init__(self): super().__init__() self.api = Blocks(api_key=self.key) self._create_data_folder(DATA_DIR) def get_block_reward(self, block): reward = self.api.get_block_reward(block) return reward
def test_get_block_reward(self): api = Blocks(api_key=(API_KEY)) reward_object = api.get_block_reward(BLOCK) self.assertEqual(reward_object['blockReward'], BLOCK_REWARD) self.assertEqual(reward_object['uncleInclusionReward'], UNCLE_INCLUSION_REWARD)
transactions = api.get_all_transactions(offset=10000, sort='asc', internal=False) block = api.get_blocks_mined_page(page=1, offset=1, blocktype='blocks') blocks = api.get_all_blocks_mined(offset=10, blocktype='uncles') # address = ['0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a', # '0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a'] # #api = Account(address=address, api_key=key) #balances = api.get_balance_multiple() # print(balances) # Blocks api = Blocks(api_key=key) reward = api.get_block_reward(2165403) # Contracts address = '0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359' api = Contract(address=address, api_key=key) abi = api.get_abi() sourcecode = api.get_sourcecode() # Proxies number = 10453272 block_numb = '0x9f8118'
from etherscan.blocks import Blocks import json with open('./key.json', mode='r') as key_file: key = json.loads(key_file.read())['key'] api = Blocks(api_key=key) reward = api.get_block_reward(2165403) print(reward)
def __init__(self): super().__init__() self.api = Blocks(api_key=self.key) self._create_data_folder(DATA_DIR)