diff --git a/MANIFEST.in b/MANIFEST.in index 39d0704..952e599 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,5 @@ -include etherscan/configs/stable.json \ No newline at end of file +include etherscan/configs/MAIN-stable.json +include etherscan/configs/GOERLI-stable.json +include etherscan/configs/KOVAN-stable.json +include etherscan/configs/RINKEBY-stable.json +include etherscan/configs/ROPSTEN-stable.json diff --git a/README.md b/README.md index 5dc6b62..16d5d18 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![DOI](https://zenodo.org/badge/298646404.svg)](https://zenodo.org/badge/latestdoi/298646404) -A minimal, yet complete, Python API for [Etherscan.io](https://etherscan.io/). All standard and pro endpoints are provided. +A minimal, yet complete, Python API for [Etherscan.io](https://etherscan.io/). All standard and pro endpoints are provided. Görli, Kovan, Rinkeby and Ropsten endpoints are supported. Available on [PyPI](https://pypi.org/project/etherscan-python/). Powered by [Etherscan.io APIs](https://etherscan.io/apis#misc). @@ -193,6 +193,10 @@ eth.get_eth_balance(address="0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a") > '40891631566070000000000' ``` +You can also choose one of the other testnets: +``` python +eth = Etherscan(YOUR_API_KEY, net="ropsten") # net name is case-insensitive, default is main +``` ## Examples diff --git a/etherscan/configs/GOERLI-stable.json b/etherscan/configs/GOERLI-stable.json new file mode 100644 index 0000000..ba9da4d --- /dev/null +++ b/etherscan/configs/GOERLI-stable.json @@ -0,0 +1,466 @@ +{ + "get_proxy_block_number": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_block_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10d4f" + } + }, + "_get_proxy_uncle_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x210A9B", + "index": "0x0" + } + }, + "get_proxy_block_transaction_count_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10FB78" + } + }, + "get_proxy_transaction_by_hash": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_transaction_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x210A9B", + "index": "0x0" + } + }, + "get_proxy_transaction_count": { + "module": "proxy", + "kwargs": { + "address": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2" + } + }, + "get_proxy_transaction_receipt": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_call": { + "module": "proxy", + "kwargs": { + "to": "0xAEEF46DB4855E25702F8237E8f403FddcaF931C0", + "data": "0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724" + } + }, + "get_proxy_code_at": { + "module": "proxy", + "kwargs": { + "address": "0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c" + } + }, + "get_proxy_storage_position_at": { + "module": "proxy", + "kwargs": { + "position": "0x0", + "address": "0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd" + } + }, + "get_proxy_gas_price": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_est_gas": { + "module": "proxy", + "kwargs": { + "data": "0x4e71d92d", + "to": "0xf0160428a8552ac9bb7e050d90eeade4ddd52843", + "value": "0xff22", + "gas_price": "0x51da038cc", + "gas": "0x5f5e0ff" + } + }, + "get_est_confirmation_time": { + "module": "gastracker", + "kwargs": { + "gas_price": "2000000000" + } + }, + "get_gas_oracle": { + "module": "gastracker", + "kwargs": {} + }, + "get_block_reward_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "2165403" + } + }, + "get_est_block_countdown_time_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "99999999" + } + }, + "get_block_number_by_timestamp": { + "module": "blocks", + "kwargs": { + "timestamp": "1578638524", + "closest": "before" + } + }, + "get_total_eth_supply": { + "module": "stats", + "kwargs": {} + }, + "get_eth_last_price": { + "module": "stats", + "kwargs": {} + }, + "_get_eth_nodes_size": { + "module": "stats", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "client_type": "geth", + "sync_mode": "default", + "sort": "asc" + } + }, + "get_total_supply_by_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055" + } + }, + "get_acc_balance_by_token_and_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761" + } + }, + "get_contract_abi": { + "module": "contracts", + "kwargs": { + "address": "0x748D03fb181A158bea396489eA6589E7dCfBA495" + } + }, + "get_contract_source_code": { + "module": "contracts", + "kwargs": { + "address": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" + } + }, + "get_contract_execution_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a" + } + }, + "get_tx_receipt_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76" + } + }, + "get_eth_balance": { + "module": "accounts", + "kwargs": { + "address": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a" + } + }, + "get_eth_balance_multiple": { + "module": "accounts", + "kwargs": { + "addresses": [ + "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a", + "0x63a9975ba31b0b9626b34300f7f627147df1f526", + "0x198ef1ec325a96cc354c7266a038be8b5c558f67" + ] + } + }, + "get_normal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xff6872f2c89ac60fbc1fc977a9724555b9796154", + "startblock": 0, + "endblock": 99999999, + "sort": "asc" + } + }, + "get_normal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0xff6872f2c89ac60fbc1fc977a9724555b9796154", + "startblock": 0, + "endblock": 99999999, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x126c5b0b637340569ee98c768e97992ea2fa426d", + "startblock": 4397831, + "endblock": 4397831, + "sort": "asc" + } + }, + "get_internal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0x126c5b0b637340569ee98c768e97992ea2fa426d", + "startblock": 4397831, + "endblock": 4397831, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_txhash": { + "module": "accounts", + "kwargs": { + "txhash": "0x1b71be923f0dcb1f4a196d340d868ff0b35f494e7f3f6575b81812b0824696bb" + } + }, + "get_internal_txs_by_block_range_paginated": { + "module": "accounts", + "kwargs": { + "startblock": 0, + "endblock": 2702578, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x9fc8720759bf397bdc13ae08760a7aea7ebbdf56", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x2ac3c1d3e24b45c6c310534bc2dd84b5ed576335", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x2ac3c1d3e24b45c6c310534bc2dd84b5ed576335", + "address": "0x9fc8720759bf397bdc13ae08760a7aea7ebbdf56", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x3b2f32d32faabd8d94df36afb956bd4d34bf905c", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0xe5975e7dc3dfbb4cbede646b8af7cf292b46693e", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0xe5975e7dc3dfbb4cbede646b8af7cf292b46693e", + "address": "0x3b2f32d32faabd8d94df36afb956bd4d34bf905c", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_mined_blocks_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x0000000000000000000000000000000000000000" + } + }, + "get_mined_blocks_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0x0000000000000000000000000000000000000000", + "page": 1, + "offset": 100 + } + }, + "get_hist_eth_balance_for_address_by_block_no": { + "module": "pro", + "kwargs": { + "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", + "block_no": "8000000" + } + }, + "get_daily_average_block_size": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_block_time": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_uncle_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_hist_erc20_token_total_supply_by_contract_address_and_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "block_no": "8000000" + } + }, + "get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761", + "block_no": "8000000" + } + }, + "get_token_info_by_contract_address": { + "module": "pro", + "kwargs": { + "contract_address": "0x0e3a2a1f2146d86a604adc220b4967a898d7fe07" + } + }, + "get_daily_average_gas_limit": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_total_gas_used": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_average_gas_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_network_tx_fee": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_new_address_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_network_utilization": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_hash_rate": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_tx_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_difficulty": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_daily_market_cap": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + } +} diff --git a/etherscan/configs/KOVAN-stable.json b/etherscan/configs/KOVAN-stable.json new file mode 100644 index 0000000..dff391d --- /dev/null +++ b/etherscan/configs/KOVAN-stable.json @@ -0,0 +1,466 @@ +{ + "get_proxy_block_number": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_block_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10d4f" + } + }, + "get_proxy_uncle_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x4d50e2", + "index": "0x0" + } + }, + "get_proxy_block_transaction_count_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10FB78" + } + }, + "get_proxy_transaction_by_hash": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_transaction_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x43195c", + "index": "0x0" + } + }, + "get_proxy_transaction_count": { + "module": "proxy", + "kwargs": { + "address": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2" + } + }, + "get_proxy_transaction_receipt": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_call": { + "module": "proxy", + "kwargs": { + "to": "0xAEEF46DB4855E25702F8237E8f403FddcaF931C0", + "data": "0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724" + } + }, + "get_proxy_code_at": { + "module": "proxy", + "kwargs": { + "address": "0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c" + } + }, + "get_proxy_storage_position_at": { + "module": "proxy", + "kwargs": { + "position": "0x0", + "address": "0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd" + } + }, + "get_proxy_gas_price": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_est_gas": { + "module": "proxy", + "kwargs": { + "data": "0x4e71d92d", + "to": "0xf0160428a8552ac9bb7e050d90eeade4ddd52843", + "value": "0xff22", + "gas_price": "0x51da038cc", + "gas": "0x5f5e0ff" + } + }, + "get_est_confirmation_time": { + "module": "gastracker", + "kwargs": { + "gas_price": "2000000000" + } + }, + "get_gas_oracle": { + "module": "gastracker", + "kwargs": {} + }, + "get_block_reward_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "2165403" + } + }, + "get_est_block_countdown_time_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "99999999" + } + }, + "get_block_number_by_timestamp": { + "module": "blocks", + "kwargs": { + "timestamp": "1578638524", + "closest": "before" + } + }, + "get_total_eth_supply": { + "module": "stats", + "kwargs": {} + }, + "get_eth_last_price": { + "module": "stats", + "kwargs": {} + }, + "_get_eth_nodes_size": { + "module": "stats", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "client_type": "geth", + "sync_mode": "default", + "sort": "asc" + } + }, + "get_total_supply_by_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055" + } + }, + "get_acc_balance_by_token_and_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761" + } + }, + "get_contract_abi": { + "module": "contracts", + "kwargs": { + "address": "0xe309239955502Bb812807e8C29B98C3441775d35" + } + }, + "get_contract_source_code": { + "module": "contracts", + "kwargs": { + "address": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" + } + }, + "get_contract_execution_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a" + } + }, + "get_tx_receipt_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76" + } + }, + "get_eth_balance": { + "module": "accounts", + "kwargs": { + "address": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a" + } + }, + "get_eth_balance_multiple": { + "module": "accounts", + "kwargs": { + "addresses": [ + "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a", + "0x63a9975ba31b0b9626b34300f7f627147df1f526", + "0x198ef1ec325a96cc354c7266a038be8b5c558f67" + ] + } + }, + "get_normal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xc1918c20650920aa664235bc6cbd8b8728fbe931", + "startblock": 0, + "endblock": 99999999, + "sort": "asc" + } + }, + "get_normal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0xc1918c20650920aa664235bc6cbd8b8728fbe931", + "startblock": 0, + "endblock": 99999999, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xaaad7966ebe0663b8c9c6f683fb9c3e66e03467f", + "startblock": 23799593, + "endblock": 23799593, + "sort": "asc" + } + }, + "get_internal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0xaaad7966ebe0663b8c9c6f683fb9c3e66e03467f", + "startblock": 23799593, + "endblock": 23799593, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_txhash": { + "module": "accounts", + "kwargs": { + "txhash": "0xad550ebc0f2473e3b5af8d1d30b093749cb2835bf21ed340e976b1ec25276b04" + } + }, + "get_internal_txs_by_block_range_paginated": { + "module": "accounts", + "kwargs": { + "startblock": 0, + "endblock": 2702578, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xa991b15e414ddfa78b0df1f7af6b3cf2023c738d", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x8fe80f7ca77daa68b059f8b3e29e1c5d962f01e7", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x8fe80f7ca77daa68b059f8b3e29e1c5d962f01e7", + "address": "0xa991b15e414ddfa78b0df1f7af6b3cf2023c738d", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x57e05dba059a8ff2777408e9e1f3c517c20fc719", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x953067757ec1b3a859f80ae15269f95430e72e69", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x953067757ec1b3a859f80ae15269f95430e72e69", + "address": "0x57e05dba059a8ff2777408e9e1f3c517c20fc719", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_mined_blocks_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x0000000000000000000000000000000000000000" + } + }, + "get_mined_blocks_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0x0000000000000000000000000000000000000000", + "page": 1, + "offset": 100 + } + }, + "get_hist_eth_balance_for_address_by_block_no": { + "module": "pro", + "kwargs": { + "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", + "block_no": "8000000" + } + }, + "get_daily_average_block_size": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_block_time": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_uncle_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_hist_erc20_token_total_supply_by_contract_address_and_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "block_no": "8000000" + } + }, + "get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761", + "block_no": "8000000" + } + }, + "get_token_info_by_contract_address": { + "module": "pro", + "kwargs": { + "contract_address": "0x0e3a2a1f2146d86a604adc220b4967a898d7fe07" + } + }, + "get_daily_average_gas_limit": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_total_gas_used": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_average_gas_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_network_tx_fee": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_new_address_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_network_utilization": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_hash_rate": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_tx_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_difficulty": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_daily_market_cap": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + } +} diff --git a/etherscan/configs/stable.json b/etherscan/configs/MAIN-stable.json similarity index 100% rename from etherscan/configs/stable.json rename to etherscan/configs/MAIN-stable.json diff --git a/etherscan/configs/RINKEBY-stable.json b/etherscan/configs/RINKEBY-stable.json new file mode 100644 index 0000000..f288c3b --- /dev/null +++ b/etherscan/configs/RINKEBY-stable.json @@ -0,0 +1,466 @@ +{ + "get_proxy_block_number": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_block_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10d4f" + } + }, + "_get_proxy_uncle_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x210A9B", + "index": "0x0" + } + }, + "get_proxy_block_transaction_count_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10FB78" + } + }, + "get_proxy_transaction_by_hash": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_transaction_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x43195c", + "index": "0x0" + } + }, + "get_proxy_transaction_count": { + "module": "proxy", + "kwargs": { + "address": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2" + } + }, + "get_proxy_transaction_receipt": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_call": { + "module": "proxy", + "kwargs": { + "to": "0xAEEF46DB4855E25702F8237E8f403FddcaF931C0", + "data": "0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724" + } + }, + "get_proxy_code_at": { + "module": "proxy", + "kwargs": { + "address": "0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c" + } + }, + "get_proxy_storage_position_at": { + "module": "proxy", + "kwargs": { + "position": "0x0", + "address": "0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd" + } + }, + "get_proxy_gas_price": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_est_gas": { + "module": "proxy", + "kwargs": { + "data": "0x4e71d92d", + "to": "0xf0160428a8552ac9bb7e050d90eeade4ddd52843", + "value": "0xff22", + "gas_price": "0x51da038cc", + "gas": "0x5f5e0ff" + } + }, + "get_est_confirmation_time": { + "module": "gastracker", + "kwargs": { + "gas_price": "2000000000" + } + }, + "get_gas_oracle": { + "module": "gastracker", + "kwargs": {} + }, + "get_block_reward_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "2165403" + } + }, + "get_est_block_countdown_time_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "99999999" + } + }, + "get_block_number_by_timestamp": { + "module": "blocks", + "kwargs": { + "timestamp": "1578638524", + "closest": "before" + } + }, + "get_total_eth_supply": { + "module": "stats", + "kwargs": {} + }, + "get_eth_last_price": { + "module": "stats", + "kwargs": {} + }, + "_get_eth_nodes_size": { + "module": "stats", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "client_type": "geth", + "sync_mode": "default", + "sort": "asc" + } + }, + "get_total_supply_by_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055" + } + }, + "get_acc_balance_by_token_and_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761" + } + }, + "get_contract_abi": { + "module": "contracts", + "kwargs": { + "address": "0x79a856049A390336E221d54e2bAB9e629989187f" + } + }, + "get_contract_source_code": { + "module": "contracts", + "kwargs": { + "address": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" + } + }, + "get_contract_execution_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a" + } + }, + "get_tx_receipt_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76" + } + }, + "get_eth_balance": { + "module": "accounts", + "kwargs": { + "address": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a" + } + }, + "get_eth_balance_multiple": { + "module": "accounts", + "kwargs": { + "addresses": [ + "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a", + "0x63a9975ba31b0b9626b34300f7f627147df1f526", + "0x198ef1ec325a96cc354c7266a038be8b5c558f67" + ] + } + }, + "get_normal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x0cb510e2f16c36ce039ee3164330d5f00ecf9eac", + "startblock": 0, + "endblock": 99999999, + "sort": "asc" + } + }, + "get_normal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0x0cb510e2f16c36ce039ee3164330d5f00ecf9eac", + "startblock": 0, + "endblock": 99999999, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xd16a6772163463c731e37ef42c98eee95f15a496", + "startblock": 8191436, + "endblock": 8191436, + "sort": "asc" + } + }, + "get_internal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0xd16a6772163463c731e37ef42c98eee95f15a496", + "startblock": 8191436, + "endblock": 8191436, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_txhash": { + "module": "accounts", + "kwargs": { + "txhash": "0x55f288d70fbdcb4506a792d7cb3f5085132c5480fd06492e39a67bcb12119fe1" + } + }, + "get_internal_txs_by_block_range_paginated": { + "module": "accounts", + "kwargs": { + "startblock": 0, + "endblock": 2702578, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x18045cdf3f619e32ff4b11df689059b4d0358d11", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0xdf82c9014f127243ce1305dfe54151647d74b27a", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0xdf82c9014f127243ce1305dfe54151647d74b27a", + "address": "0x18045cdf3f619e32ff4b11df689059b4d0358d11", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x0d4444a2473b2832700c693b81bc551e10e5c913", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0xd2ae28b5cb629d9018b91acb855e35cd75f5be80", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0xd2ae28b5cb629d9018b91acb855e35cd75f5be80", + "address": "0x0d4444a2473b2832700c693b81bc551e10e5c913", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_mined_blocks_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xd6ae8250b8348c94847280928c79fb3b63ca453e" + } + }, + "get_mined_blocks_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0xd6ae8250b8348c94847280928c79fb3b63ca453e", + "page": 1, + "offset": 100 + } + }, + "get_hist_eth_balance_for_address_by_block_no": { + "module": "pro", + "kwargs": { + "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", + "block_no": "8000000" + } + }, + "get_daily_average_block_size": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_block_time": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_uncle_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_hist_erc20_token_total_supply_by_contract_address_and_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "block_no": "8000000" + } + }, + "get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761", + "block_no": "8000000" + } + }, + "get_token_info_by_contract_address": { + "module": "pro", + "kwargs": { + "contract_address": "0x0e3a2a1f2146d86a604adc220b4967a898d7fe07" + } + }, + "get_daily_average_gas_limit": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_total_gas_used": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_average_gas_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_network_tx_fee": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_new_address_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_network_utilization": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_hash_rate": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_tx_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_difficulty": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_daily_market_cap": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + } +} diff --git a/etherscan/configs/ROPSTEN-stable.json b/etherscan/configs/ROPSTEN-stable.json new file mode 100644 index 0000000..84448f2 --- /dev/null +++ b/etherscan/configs/ROPSTEN-stable.json @@ -0,0 +1,466 @@ +{ + "get_proxy_block_number": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_block_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10d4f" + } + }, + "get_proxy_uncle_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x956df5", + "index": "0x0" + } + }, + "get_proxy_block_transaction_count_by_number": { + "module": "proxy", + "kwargs": { + "tag": "0x10FB78" + } + }, + "get_proxy_transaction_by_hash": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_transaction_by_block_number_and_index": { + "module": "proxy", + "kwargs": { + "tag": "0x43195c", + "index": "0x0" + } + }, + "get_proxy_transaction_count": { + "module": "proxy", + "kwargs": { + "address": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2" + } + }, + "get_proxy_transaction_receipt": { + "module": "proxy", + "kwargs": { + "txhash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1" + } + }, + "get_proxy_call": { + "module": "proxy", + "kwargs": { + "to": "0xAEEF46DB4855E25702F8237E8f403FddcaF931C0", + "data": "0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724" + } + }, + "get_proxy_code_at": { + "module": "proxy", + "kwargs": { + "address": "0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c" + } + }, + "get_proxy_storage_position_at": { + "module": "proxy", + "kwargs": { + "position": "0x0", + "address": "0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd" + } + }, + "get_proxy_gas_price": { + "module": "proxy", + "kwargs": {} + }, + "get_proxy_est_gas": { + "module": "proxy", + "kwargs": { + "data": "0x4e71d92d", + "to": "0xf0160428a8552ac9bb7e050d90eeade4ddd52843", + "value": "0xff22", + "gas_price": "0x51da038cc", + "gas": "0x5f5e0ff" + } + }, + "get_est_confirmation_time": { + "module": "gastracker", + "kwargs": { + "gas_price": "2000000000" + } + }, + "get_gas_oracle": { + "module": "gastracker", + "kwargs": {} + }, + "get_block_reward_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "2165403" + } + }, + "get_est_block_countdown_time_by_block_number": { + "module": "blocks", + "kwargs": { + "block_no": "99999999" + } + }, + "get_block_number_by_timestamp": { + "module": "blocks", + "kwargs": { + "timestamp": "1578638524", + "closest": "before" + } + }, + "get_total_eth_supply": { + "module": "stats", + "kwargs": {} + }, + "get_eth_last_price": { + "module": "stats", + "kwargs": {} + }, + "_get_eth_nodes_size": { + "module": "stats", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "client_type": "geth", + "sync_mode": "default", + "sort": "asc" + } + }, + "get_total_supply_by_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055" + } + }, + "get_acc_balance_by_token_and_contract_address": { + "module": "tokens", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761" + } + }, + "get_contract_abi": { + "module": "contracts", + "kwargs": { + "address": "0x036af46B35c5Fe11c1C48bC0301e325738F44c4a" + } + }, + "get_contract_source_code": { + "module": "contracts", + "kwargs": { + "address": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" + } + }, + "get_contract_execution_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a" + } + }, + "get_tx_receipt_status": { + "module": "transactions", + "kwargs": { + "txhash": "0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76" + } + }, + "get_eth_balance": { + "module": "accounts", + "kwargs": { + "address": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a" + } + }, + "get_eth_balance_multiple": { + "module": "accounts", + "kwargs": { + "addresses": [ + "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a", + "0x63a9975ba31b0b9626b34300f7f627147df1f526", + "0x198ef1ec325a96cc354c7266a038be8b5c558f67" + ] + } + }, + "get_normal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x687422eea2cb73b5d3e242ba5456b782919afc85", + "startblock": 0, + "endblock": 99999999, + "sort": "asc" + } + }, + "get_normal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0x687422eea2cb73b5d3e242ba5456b782919afc85", + "startblock": 0, + "endblock": 99999999, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_address": { + "module": "accounts", + "kwargs": { + "address": "0xf2b4e81ba39f5215db2e05b2f66f482bb8e87fd2", + "startblock": 9793067, + "endblock": 9793067, + "sort": "asc" + } + }, + "get_internal_txs_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0xf2b4e81ba39f5215db2e05b2f66f482bb8e87fd2", + "startblock": 9793067, + "endblock": 9793067, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_internal_txs_by_txhash": { + "module": "accounts", + "kwargs": { + "txhash": "0xbfb7fd401294dd5bfbcc88842670892182bf119069ad866ac2c5e4d8511cd032" + } + }, + "get_internal_txs_by_block_range_paginated": { + "module": "accounts", + "kwargs": { + "startblock": 0, + "endblock": 2702578, + "page": 1, + "offset": 10, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x3ebe6781be6d436cb7999cfce8b52e40819721cb", + "startblock": 0, + "endblock": 999999999, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x8707a5bf4c2842d46b31a405ba41b858c0f876c4", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc20_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x8707a5bf4c2842d46b31a405ba41b858c0f876c4", + "address": "0x3ebe6781be6d436cb7999cfce8b52e40819721cb", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x07d48bdba7975f0daf73bd5b85a2e3ff87ffb24e", + "startblock": 9792696, + "endblock": 9792696, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_contract_address_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x130116e22f3e42ab82abde6d940ef4ef14b77c86", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_erc721_token_transfer_events_by_address_and_contract_paginated": { + "module": "accounts", + "kwargs": { + "contract_address": "0x130116e22f3e42ab82abde6d940ef4ef14b77c86", + "address": "0x07d48bdba7975f0daf73bd5b85a2e3ff87ffb24e", + "page": 1, + "offset": 100, + "sort": "asc" + } + }, + "get_mined_blocks_by_address": { + "module": "accounts", + "kwargs": { + "address": "0x635b4764d1939dfacd3a8014726159abc277becc" + } + }, + "get_mined_blocks_by_address_paginated": { + "module": "accounts", + "kwargs": { + "address": "0x635b4764d1939dfacd3a8014726159abc277becc", + "page": 1, + "offset": 100 + } + }, + "get_hist_eth_balance_for_address_by_block_no": { + "module": "pro", + "kwargs": { + "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", + "block_no": "8000000" + } + }, + "get_daily_average_block_size": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_block_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_block_time": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_uncle_block_count_and_rewards": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_hist_erc20_token_total_supply_by_contract_address_and_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "block_no": "8000000" + } + }, + "get_hist_erc20_token_account_balance_for_token_contract_address_by_block_no": { + "module": "pro", + "kwargs": { + "contract_address": "0x57d90b64a1a57749b0f932f1a3395792e12e7055", + "address": "0xe04f27eb70e025b78871a2ad7eabe85e61212761", + "block_no": "8000000" + } + }, + "get_token_info_by_contract_address": { + "module": "pro", + "kwargs": { + "contract_address": "0x0e3a2a1f2146d86a604adc220b4967a898d7fe07" + } + }, + "get_daily_average_gas_limit": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_total_gas_used": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_average_gas_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_daily_network_tx_fee": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_new_address_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_network_utilization": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_hash_rate": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_tx_count": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_daily_average_network_difficulty": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_daily_market_cap": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + }, + "get_eth_hist_price": { + "module": "pro", + "kwargs": { + "start_date": "2019-02-01", + "end_date": "2019-02-28", + "sort": "asc" + } + } +} diff --git a/etherscan/enums/fields_enum.py b/etherscan/enums/fields_enum.py index a85fb77..b0bcc4d 100644 --- a/etherscan/enums/fields_enum.py +++ b/etherscan/enums/fields_enum.py @@ -23,7 +23,7 @@ class FieldsEnum: OFFSET: str = "&offset=" PAGE: str = "&page=" POSITION: str = "&position=" - PREFIX: str = "https://api.etherscan.io/api?" + PREFIX: str = "https://api-{}.etherscan.io/api?" SORT: str = "&sort=" START_BLOCK: str = "&startblock=" START_DATE: str = "&startdate=" diff --git a/etherscan/etherscan.py b/etherscan/etherscan.py index 34d9d5b..a8e9b50 100644 --- a/etherscan/etherscan.py +++ b/etherscan/etherscan.py @@ -10,10 +10,10 @@ class Etherscan: - def __new__(cls, api_key: str): - with resources.path(configs, "stable.json") as path: + def __new__(cls, api_key: str, net: str = "MAIN"): + with resources.path(configs, f"{net.upper()}-stable.json") as path: config_path = str(path) - return cls.from_config(api_key=api_key, config_path=config_path) + return cls.from_config(api_key=api_key, config_path=config_path, net=net) @staticmethod def __load_config(config_path: str) -> dict: @@ -21,24 +21,24 @@ def __load_config(config_path: str) -> dict: return json.load(f) @staticmethod - def __run(func, api_key: str): + def __run(func, api_key: str, net: str): def wrapper(*args, **kwargs): url = ( - f"{fields.PREFIX}" + f"{fields.PREFIX.format(net.lower()).replace('-main','')}" f"{func(*args, **kwargs)}" f"{fields.API_KEY}" f"{api_key}" ) - r = requests.get(url) + r = requests.get(url, headers={'User-Agent':''}) return parser.parse(r) return wrapper @classmethod - def from_config(cls, api_key: str, config_path: str): + def from_config(cls, api_key: str, config_path: str, net: str): config = cls.__load_config(config_path) for func, v in config.items(): if not func.startswith("_"): # disabled if _ attr = getattr(getattr(etherscan, v["module"]), func) - setattr(cls, func, cls.__run(attr, api_key)) + setattr(cls, func, cls.__run(attr, api_key, net)) return cls diff --git a/test/test_modules.py b/test/test_modules.py index 7ec2004..65e669b 100644 --- a/test/test_modules.py +++ b/test/test_modules.py @@ -6,7 +6,7 @@ from etherscan.etherscan import Etherscan -CONFIG_PATH = "etherscan/configs/stable.json" +CONFIG_PATH = "etherscan/configs/{}-stable.json" API_KEY = os.environ["API_KEY"] # Encrypted env var by Travis @@ -22,18 +22,20 @@ def dump(data, fname): class Case(TestCase): _MODULE = "" + _NETS = ["MAIN", "GOERLI", "KOVAN", "RINKEBY", "ROPSTEN"] - def test_methods(self): - print(f"\nMODULE: {self._MODULE}") - config = load(CONFIG_PATH) - etherscan = Etherscan(API_KEY) + def methods(self, net): + print(f"\nNET: {net}") + print(f"MODULE: {self._MODULE}") + config = load(CONFIG_PATH.format(net)) + etherscan = Etherscan(API_KEY, net) for fun, v in config.items(): if not fun.startswith("_"): # disabled if _ if v["module"] == self._MODULE: res = getattr(etherscan, fun)(**v["kwargs"]) print(f"METHOD: {fun}, RTYPE: {type(res)}") # Create log files (will update existing ones) - fname = f"logs/standard/{fun}.json" + fname = f"logs/standard/{net}-{fun}.json" log = { "method": fun, "module": v["module"], @@ -43,6 +45,10 @@ def test_methods(self): } dump(log, fname) + def test_net_methods(self): + for net in self._NETS: + self.methods(net) + class TestAccounts(Case): _MODULE = "accounts"