Skip to content
  • Sponsor pcko1/etherscan-python

  • Notifications You must be signed in to change notification settings
  • Fork 114

paginated erc20 by address with specifiable start and end blocks #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion etherscan/configs/GOERLI-stable.json
Original file line number Diff line number Diff line change
@@ -246,6 +246,15 @@
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_address_paginated": {
"module": "accounts",
"kwargs": {
"address": "0x9fc8720759bf397bdc13ae08760a7aea7ebbdf56",
"page": 1,
"offset": 100,
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_contract_address_paginated": {
"module": "accounts",
"kwargs": {
@@ -307,4 +316,4 @@
"offset": 100
}
}
}
}
11 changes: 10 additions & 1 deletion etherscan/configs/KOVAN-stable.json
Original file line number Diff line number Diff line change
@@ -246,6 +246,15 @@
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_address_paginated": {
"module": "accounts",
"kwargs": {
"address": "0xa991b15e414ddfa78b0df1f7af6b3cf2023c738d",
"page": 1,
"offset": 100,
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_contract_address_paginated": {
"module": "accounts",
"kwargs": {
@@ -307,4 +316,4 @@
"offset": 100
}
}
}
}
11 changes: 10 additions & 1 deletion etherscan/configs/MAIN-stable.json
Original file line number Diff line number Diff line change
@@ -246,6 +246,15 @@
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_address_paginated": {
"module": "accounts",
"kwargs": {
"address": "0x4e83362442b8d1bec281594cea3050c8eb01311c",
"page": 1,
"offset": 100,
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_contract_address_paginated": {
"module": "accounts",
"kwargs": {
@@ -463,4 +472,4 @@
"sort": "asc"
}
}
}
}
11 changes: 10 additions & 1 deletion etherscan/configs/RINKEBY-stable.json
Original file line number Diff line number Diff line change
@@ -246,6 +246,15 @@
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_address_paginated": {
"module": "accounts",
"kwargs": {
"address": "0x18045cdf3f619e32ff4b11df689059b4d0358d11",
"page": 1,
"offset": 100,
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_contract_address_paginated": {
"module": "accounts",
"kwargs": {
@@ -307,4 +316,4 @@
"offset": 100
}
}
}
}
11 changes: 10 additions & 1 deletion etherscan/configs/ROPSTEN-stable.json
Original file line number Diff line number Diff line change
@@ -246,6 +246,15 @@
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_address_paginated": {
"module": "accounts",
"kwargs": {
"address": "0x3ebe6781be6d436cb7999cfce8b52e40819721cb",
"page": 1,
"offset": 100,
"sort": "asc"
}
},
"get_erc20_token_transfer_events_by_contract_address_paginated": {
"module": "accounts",
"kwargs": {
@@ -307,4 +316,4 @@
"offset": 100
}
}
}
}
37 changes: 35 additions & 2 deletions etherscan/modules/accounts.py
Original file line number Diff line number Diff line change
@@ -188,10 +188,35 @@ def get_erc20_token_transfer_events_by_address(
f"{sort}"
)
return url

@staticmethod
def get_erc20_token_transfer_events_by_address_paginated(
address: str, page: int, offset: int, startblock: int, endblock: int, sort: str
) -> str:

url = (
f"{fields.MODULE}"
f"{modules.ACCOUNT}"
f"{fields.ACTION}"
f"{actions.TOKENTX}"
f"{fields.ADDRESS}"
f"{address}"
f"{fields.START_BLOCK}"
f"{str(startblock)}"
f"{fields.END_BLOCK}"
f"{str(endblock)}"
f"{fields.SORT}"
f"{sort}"
f"{fields.PAGE}"
f"{str(page)}"
f"{fields.OFFSET}"
f"{str(offset)}"
)
return url

@staticmethod
def get_erc20_token_transfer_events_by_contract_address_paginated(
contract_address: str, page: int, offset: int, sort: str
contract_address: str, page: int, offset: int, startblock: int, endblock: int, sort: str
) -> str:

url = (
@@ -201,6 +226,10 @@ def get_erc20_token_transfer_events_by_contract_address_paginated(
f"{actions.TOKENTX}"
f"{fields.CONTRACT_ADDRESS}"
f"{contract_address}"
f"{fields.START_BLOCK}"
f"{str(startblock)}"
f"{fields.END_BLOCK}"
f"{str(endblock)}"
f"{fields.SORT}"
f"{sort}"
f"{fields.PAGE}"
@@ -212,7 +241,7 @@ def get_erc20_token_transfer_events_by_contract_address_paginated(

@staticmethod
def get_erc20_token_transfer_events_by_address_and_contract_paginated(
contract_address: str, address: str, page: int, offset: int, sort: str
contract_address: str, address: str, page: int, offset: int, startblock: int, endblock: int, sort: str
) -> str:

url = (
@@ -224,6 +253,10 @@ def get_erc20_token_transfer_events_by_address_and_contract_paginated(
f"{contract_address}"
f"{fields.ADDRESS}"
f"{address}"
f"{fields.START_BLOCK}"
f"{str(startblock)}"
f"{fields.END_BLOCK}"
f"{str(endblock)}"
f"{fields.SORT}"
f"{sort}"
f"{fields.PAGE}"