from etherscan.transactions import Transactions
import json

with open('../../api_key.json', mode='r') as key_file:
    key = json.loads(key_file.read())['key']

TX_HASH = '0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76'
api = Transactions(api_key=key)
receipt_status = api.get_tx_receipt_status(tx_hash=TX_HASH)
print(receipt_status)
Beispiel #2
0
                                                       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)
supply = api.get_total_supply()

# Transactions

TX_HASH = '0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a'
api = Transactions(api_key=key)

status = api.get_status(tx_hash=TX_HASH)
receipt_status = api.get_tx_receipt_status(tx_hash=TX_HASH)
from etherscan.transactions import Transactions
import json

with open('../../api_key.json', mode='r') as key_file:
    key = json.loads(key_file.read())['key']

TX_HASH = '0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a'
api = Transactions(api_key=key)
status = api.get_status(tx_hash=TX_HASH)
print(status)
 def test_get_tx_receipt_status(self):
     api = Transactions(api_key=(API_KEY))
     receipt_status = api.get_tx_receipt_status(TX_2)
     self.assertEqual(receipt_status['status'], '1')
Beispiel #5
0
from etherscan.transactions import Transactions
from EtherscanAPI import EtherscanAPI

import os
import json

DATA_DIR = './TransactionsData'
api = EtherscanAPI()
API_KEY = api.key
api._create_data_folder(DATA_DIR)

if __name__ == '__main__':
    test_hash = '0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a'
    api = Transactions(api_key=API_KEY)
    status = api.get_status(tx_hash=test_hash)
    print(status)

    receipt_status = api.get_tx_receipt_status(tx_hash=test_hash)
    print(receipt_status)
 def test_get_status(self):
     api = Transactions(api_key=(API_KEY))
     status = api.get_status(TX_1)
     self.assertEqual(status['isError'], '1')
     self.assertEqual(status['errDescription'], ERROR_STRING)
def get_status(tx_hash):
    api = Transactions(api_key=key)
    status = api.get_status(tx_hash=tx_hash)
    print(status)
def get_tx_receipt_status(tx_hash):
    api = Transactions(api_key=key)
    receipt_status = api.get_tx_receipt_status(tx_hash=tx_hash)
    print(receipt_status)
 def test_get_tx_receipt_status(self):
     api = Transactions(api_key=(API_KEY))
     receipt_status = api.get_tx_receipt_status(TX_2)
     self.assertEqual(receipt_status['status'], '1')
 def test_get_status(self):
     api = Transactions(api_key=(API_KEY))
     status = api.get_status(TX_1)
     self.assertEqual(status['isError'], '1')
     self.assertEqual(status['errDescription'], ERROR_STRING)