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

Commit7030596

Browse files
committed
convert to pyproject.toml
1 parent16bb505 commit7030596

File tree

88 files changed

+6796
-6466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6796
-6466
lines changed

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ docs
1515

1616
# eggs
1717
*egg*
18+
19+
.black
20+
.flake8
21+
.errors

‎Makefile‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
install:
22
pip install -e.
33

4+
uninstall:
5+
pip uninstall -y rstms-etherscan-python
6+
47
.PHONY: test
5-
test:
8+
unitest:
69
bash ./run_tests.sh$(API_KEY)
710

811
clean:
912
find. -type d -name __pycache__ -exec rm -rf"{}" +
1013
rm -rf build*.egg-info
1114
rm -f .black .flake8 .errors .coverage
1215

13-
fmt:
14-
black -l 135 etherscan
15-
flake8 --max-line-len 135 etherscan
16+
include$(wildcard make/*.mk)

‎VERSION‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.1.0

‎etherscan/__init__.py‎

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
from .etherscanimportEtherscan
2-
from .modules.accountsimportAccountsasaccounts
3-
from .modules.blocksimportBlocksasblocks
4-
from .modules.contractsimportContractsascontracts
5-
from .modules.gastrackerimportGasTrackerasgastracker
6-
from .modules.proimportProaspro
7-
from .modules.proxyimportProxyasproxy
8-
from .modules.statsimportStatsasstats
9-
from .modules.tokensimportTokensastokens
10-
from .modules.transactionsimportTransactionsastransactions
1+
"""
2+
etherscan-python
113
12-
__all__= [
13-
"Etherscan",
14-
"accounts",
15-
"blocks",
16-
"contracts",
17-
"gastracker",
18-
"pro",
19-
"proxy",
20-
"stats",
21-
"tokens",
22-
"transactions",
23-
]
4+
A minimal, yet complete, python API for etherscan.io.
5+
6+
forked from: https://github.com/pcko1/etherscan-python
7+
8+
"""
9+
10+
from .modules.accountsimportAccountsasaccounts# noqa: F401
11+
from .modules.blocksimportBlocksasblocks# noqa: F401
12+
from .modules.contractsimportContractsascontracts# noqa: F401
13+
from .modules.gastrackerimportGasTrackerasgastracker# noqa: F401
14+
from .modules.proimportProaspro# noqa: F401
15+
from .modules.proxyimportProxyasproxy# noqa: F401
16+
from .modules.statsimportStatsasstats# noqa: F401
17+
from .modules.tokensimportTokensastokens# noqa: F401
18+
from .modules.transactionsimportTransactionsastransactions# noqa: F401

‎etherscan/etherscan.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ def __load_config(config_path: str) -> dict:
2424
def__run(func,api_key:str,net:str):
2525
defwrapper(*args,**kwargs):
2626
url= (
27-
f"{fields.PREFIX.format(net.lower()).replace('-main','')}"f"{func(*args,**kwargs)}"f"{fields.API_KEY}"f"{api_key}"
27+
f"{fields.PREFIX.format(net.lower()).replace('-main','')}"
28+
f"{func(*args,**kwargs)}"
29+
f"{fields.API_KEY}"
30+
f"{api_key}"
2831
)
2932
r=requests.get(url,headers={"User-Agent":""})
3033
returnparser.parse(r)

‎etherscan/modules/accounts.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,14 @@ def get_internal_txs_by_address_paginated(
151151
@staticmethod
152152
defget_internal_txs_by_txhash(txhash:str)->str:
153153
# NOTE: Returns the last 10k events
154-
url=f"{fields.MODULE}"f"{modules.ACCOUNT}"f"{fields.ACTION}"f"{actions.TXLIST_INTERNAL}"f"{fields.TXHASH}"f"{txhash}"
154+
url= (
155+
f"{fields.MODULE}"
156+
f"{modules.ACCOUNT}"
157+
f"{fields.ACTION}"
158+
f"{actions.TXLIST_INTERNAL}"
159+
f"{fields.TXHASH}"
160+
f"{txhash}"
161+
)
155162
returnurl
156163

157164
@staticmethod
@@ -206,7 +213,9 @@ def get_erc20_token_transfer_events_by_address(
206213
returnurl
207214

208215
@staticmethod
209-
defget_erc20_token_transfer_events_by_contract_address_paginated(contract_address:str,page:int,offset:int,sort:str)->str:
216+
defget_erc20_token_transfer_events_by_contract_address_paginated(
217+
contract_address:str,page:int,offset:int,sort:str
218+
)->str:
210219
url= (
211220
f"{fields.MODULE}"
212221
f"{modules.ACCOUNT}"

‎etherscan/modules/blocks.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,25 @@
66
classBlocks:
77
@staticmethod
88
defget_block_reward_by_block_number(block_no:str)->str:
9-
url=f"{fields.MODULE}"f"{modules.BLOCK}"f"{fields.ACTION}"f"{actions.GET_BLOCK_REWARD}"f"{fields.BLOCKNO}"f"{block_no}"
9+
url= (
10+
f"{fields.MODULE}"
11+
f"{modules.BLOCK}"
12+
f"{fields.ACTION}"
13+
f"{actions.GET_BLOCK_REWARD}"
14+
f"{fields.BLOCKNO}"
15+
f"{block_no}"
16+
)
1017
returnurl
1118

1219
@staticmethod
1320
defget_est_block_countdown_time_by_block_number(block_no:str)->str:
1421
url= (
15-
f"{fields.MODULE}"f"{modules.BLOCK}"f"{fields.ACTION}"f"{actions.GET_BLOCK_COUNTDOWN}"f"{fields.BLOCKNO}"f"{block_no}"
22+
f"{fields.MODULE}"
23+
f"{modules.BLOCK}"
24+
f"{fields.ACTION}"
25+
f"{actions.GET_BLOCK_COUNTDOWN}"
26+
f"{fields.BLOCKNO}"
27+
f"{block_no}"
1628
)
1729
returnurl
1830

‎etherscan/modules/contracts.py‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,26 @@
99
classContracts:
1010
@staticmethod
1111
defget_contract_abi(address:str)->str:
12-
url=f"{fields.MODULE}"f"{modules.CONTRACT}"f"{fields.ACTION}"f"{actions.GET_ABI}"f"{fields.ADDRESS}"f"{address}"
12+
url= (
13+
f"{fields.MODULE}"
14+
f"{modules.CONTRACT}"
15+
f"{fields.ACTION}"
16+
f"{actions.GET_ABI}"
17+
f"{fields.ADDRESS}"
18+
f"{address}"
19+
)
1320
returnurl
1421

1522
@staticmethod
1623
defget_contract_source_code(address:str)->str:
17-
url=f"{fields.MODULE}"f"{modules.CONTRACT}"f"{fields.ACTION}"f"{actions.GET_SOURCE_CODE}"f"{fields.ADDRESS}"f"{address}"
24+
url= (
25+
f"{fields.MODULE}"
26+
f"{modules.CONTRACT}"
27+
f"{fields.ACTION}"
28+
f"{actions.GET_SOURCE_CODE}"
29+
f"{fields.ADDRESS}"
30+
f"{address}"
31+
)
1832
returnurl
1933

2034
@staticmethod

‎etherscan/modules/transactions.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
classTransactions:
77
@staticmethod
88
defget_contract_execution_status(txhash:str)->str:
9-
url=f"{fields.MODULE}"f"{modules.TRANSACTION}"f"{fields.ACTION}"f"{actions.GET_STATUS}"f"{fields.TXHASH}"f"{txhash}"
9+
url= (
10+
f"{fields.MODULE}"
11+
f"{modules.TRANSACTION}"
12+
f"{fields.ACTION}"
13+
f"{actions.GET_STATUS}"
14+
f"{fields.TXHASH}"
15+
f"{txhash}"
16+
)
1017
returnurl
1118

1219
@staticmethod

‎etherscan/version.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__="2.1.0"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp