Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82f30d4

Browse files
author
Kotsias, Panagiotis-Christos
committed
Added build and dist
1 parentfea7b0d commit82f30d4

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

‎build/lib/etherscan/__init__.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from .modules.accountsimportAccountsasaccounts
2+
from .modules.blocksimportBlocksasblocks
3+
from .modules.contractsimportContractsascontracts
4+
from .modules.gastrackerimportGasTrackerasgastracker
5+
from .modules.proxyimportProxyasproxy
6+
from .modules.statsimportStatsasstats
7+
from .modules.tokensimportTokensastokens
8+
from .modules.transactionsimportTransactionsastransactions
9+
from .etherscanimportEtherscan

‎build/lib/etherscan/etherscan.py‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
importjson
2+
3+
importrequests
4+
5+
importetherscan
6+
frometherscan.enums.fields_enumimportFieldsEnumasfields
7+
frometherscan.utils.parsingimportResponseParserasparser
8+
9+
10+
classEtherscan:
11+
@staticmethod
12+
def__load_config(config_path:str)->dict:
13+
withopen(config_path,"r")asf:
14+
returnjson.load(f)
15+
16+
@staticmethod
17+
def__run(func,api_key):
18+
defwrapper(*args,**kwargs):
19+
url= (
20+
f"{fields.PREFIX}"
21+
f"{func(*args,**kwargs)}"
22+
f"{fields.API_KEY}"
23+
f"{api_key}"
24+
)
25+
r=requests.get(url)
26+
returnparser.parse(r)
27+
28+
returnwrapper
29+
30+
@classmethod
31+
deffrom_config(cls,config_path:str,api_key:str):
32+
config=cls.__load_config(config_path)
33+
forfunc,vinconfig.items():
34+
ifnotfunc.startswith("_"):# disabled if _
35+
attr=getattr(getattr(etherscan,v["module"]),func)
36+
setattr(cls,func,cls.__run(attr,api_key))
37+
returncls

‎dist/etherscan-python-1.0.2.tar.gz‎

4.32 KB
Binary file not shown.
2.89 KB
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp