From e4d9d7c1a45804995748b102b1304c869cca400f Mon Sep 17 00:00:00 2001 From: Sviatoslav <20727358+svetkrasin@users.noreply.github.com> Date: Sun, 16 Jan 2022 14:01:08 -0800 Subject: [PATCH] added get_total_nodes_count() --- etherscan/configs/GOERLI-stable.json | 4 ++++ etherscan/configs/KOVAN-stable.json | 4 ++++ etherscan/configs/MAIN-stable.json | 4 ++++ etherscan/configs/RINKEBY-stable.json | 4 ++++ etherscan/configs/ROPSTEN-stable.json | 4 ++++ etherscan/enums/actions_enum.py | 1 + etherscan/modules/stats.py | 10 ++++++++++ 7 files changed, 31 insertions(+) diff --git a/etherscan/configs/GOERLI-stable.json b/etherscan/configs/GOERLI-stable.json index 4dbe408..23d6eaf 100644 --- a/etherscan/configs/GOERLI-stable.json +++ b/etherscan/configs/GOERLI-stable.json @@ -114,6 +114,10 @@ "module": "stats", "kwargs": {} }, + "get_total_nodes_count": { + "module": "stats", + "kwargs": {} + }, "get_eth_last_price": { "module": "stats", "kwargs": {} diff --git a/etherscan/configs/KOVAN-stable.json b/etherscan/configs/KOVAN-stable.json index a8ac91f..92b6466 100644 --- a/etherscan/configs/KOVAN-stable.json +++ b/etherscan/configs/KOVAN-stable.json @@ -114,6 +114,10 @@ "module": "stats", "kwargs": {} }, + "get_total_nodes_count": { + "module": "stats", + "kwargs": {} + }, "get_eth_last_price": { "module": "stats", "kwargs": {} diff --git a/etherscan/configs/MAIN-stable.json b/etherscan/configs/MAIN-stable.json index 272ed0b..049fe3e 100644 --- a/etherscan/configs/MAIN-stable.json +++ b/etherscan/configs/MAIN-stable.json @@ -114,6 +114,10 @@ "module": "stats", "kwargs": {} }, + "get_total_nodes_count": { + "module": "stats", + "kwargs": {} + }, "get_eth_last_price": { "module": "stats", "kwargs": {} diff --git a/etherscan/configs/RINKEBY-stable.json b/etherscan/configs/RINKEBY-stable.json index 3ca8296..f982764 100644 --- a/etherscan/configs/RINKEBY-stable.json +++ b/etherscan/configs/RINKEBY-stable.json @@ -114,6 +114,10 @@ "module": "stats", "kwargs": {} }, + "get_total_nodes_count": { + "module": "stats", + "kwargs": {} + }, "get_eth_last_price": { "module": "stats", "kwargs": {} diff --git a/etherscan/configs/ROPSTEN-stable.json b/etherscan/configs/ROPSTEN-stable.json index 012856e..096fa4d 100644 --- a/etherscan/configs/ROPSTEN-stable.json +++ b/etherscan/configs/ROPSTEN-stable.json @@ -114,6 +114,10 @@ "module": "stats", "kwargs": {} }, + "get_total_nodes_count": { + "module": "stats", + "kwargs": {} + }, "get_eth_last_price": { "module": "stats", "kwargs": {} diff --git a/etherscan/enums/actions_enum.py b/etherscan/enums/actions_enum.py index 20c81cb..c530434 100644 --- a/etherscan/enums/actions_enum.py +++ b/etherscan/enums/actions_enum.py @@ -52,6 +52,7 @@ class ActionsEnum: GET_SOURCE_CODE: str = "getsourcecode" GET_STATUS: str = "getstatus" GET_TX_RECEIPT_STATUS: str = "gettxreceiptstatus" + NODE_COUNT: str = "nodecount" TOKEN_BALANCE_HISTORY: str = "tokenbalancehistory" TOKEN_BALANCE: str = "tokenbalance" TOKEN_INFO: str = "tokeninfo" diff --git a/etherscan/modules/stats.py b/etherscan/modules/stats.py index 816f46c..afa14a1 100644 --- a/etherscan/modules/stats.py +++ b/etherscan/modules/stats.py @@ -45,3 +45,13 @@ def get_eth_nodes_size( f"{sort}" ) return url + + @staticmethod + def get_total_nodes_count() -> str: + url = ( + f"{fields.MODULE}" + f"{modules.STATS}" + f"{fields.ACTION}" + f"{actions.NODE_COUNT}" + ) + return url \ No newline at end of file