Skip to content

Commit 0e12725

Browse files
paginated erc20 by address
1 parent e059d7c commit 0e12725

File tree

6 files changed

+85
-7
lines changed

6 files changed

+85
-7
lines changed

etherscan/configs/GOERLI-stable.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@
246246
"sort": "asc"
247247
}
248248
},
249+
"get_erc20_token_transfer_events_by_address_paginated": {
250+
"module": "accounts",
251+
"kwargs": {
252+
"address": "0x9fc8720759bf397bdc13ae08760a7aea7ebbdf56",
253+
"page": 1,
254+
"offset": 100,
255+
"sort": "asc"
256+
}
257+
},
249258
"get_erc20_token_transfer_events_by_contract_address_paginated": {
250259
"module": "accounts",
251260
"kwargs": {
@@ -307,4 +316,4 @@
307316
"offset": 100
308317
}
309318
}
310-
}
319+
}

etherscan/configs/KOVAN-stable.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@
246246
"sort": "asc"
247247
}
248248
},
249+
"get_erc20_token_transfer_events_by_address_paginated": {
250+
"module": "accounts",
251+
"kwargs": {
252+
"address": "0xa991b15e414ddfa78b0df1f7af6b3cf2023c738d",
253+
"page": 1,
254+
"offset": 100,
255+
"sort": "asc"
256+
}
257+
},
249258
"get_erc20_token_transfer_events_by_contract_address_paginated": {
250259
"module": "accounts",
251260
"kwargs": {
@@ -307,4 +316,4 @@
307316
"offset": 100
308317
}
309318
}
310-
}
319+
}

etherscan/configs/MAIN-stable.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@
246246
"sort": "asc"
247247
}
248248
},
249+
"get_erc20_token_transfer_events_by_address_paginated": {
250+
"module": "accounts",
251+
"kwargs": {
252+
"address": "0x4e83362442b8d1bec281594cea3050c8eb01311c",
253+
"page": 1,
254+
"offset": 100,
255+
"sort": "asc"
256+
}
257+
},
249258
"get_erc20_token_transfer_events_by_contract_address_paginated": {
250259
"module": "accounts",
251260
"kwargs": {
@@ -463,4 +472,4 @@
463472
"sort": "asc"
464473
}
465474
}
466-
}
475+
}

etherscan/configs/RINKEBY-stable.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@
246246
"sort": "asc"
247247
}
248248
},
249+
"get_erc20_token_transfer_events_by_address_paginated": {
250+
"module": "accounts",
251+
"kwargs": {
252+
"address": "0x18045cdf3f619e32ff4b11df689059b4d0358d11",
253+
"page": 1,
254+
"offset": 100,
255+
"sort": "asc"
256+
}
257+
},
249258
"get_erc20_token_transfer_events_by_contract_address_paginated": {
250259
"module": "accounts",
251260
"kwargs": {
@@ -307,4 +316,4 @@
307316
"offset": 100
308317
}
309318
}
310-
}
319+
}

etherscan/configs/ROPSTEN-stable.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@
246246
"sort": "asc"
247247
}
248248
},
249+
"get_erc20_token_transfer_events_by_address_paginated": {
250+
"module": "accounts",
251+
"kwargs": {
252+
"address": "0x3ebe6781be6d436cb7999cfce8b52e40819721cb",
253+
"page": 1,
254+
"offset": 100,
255+
"sort": "asc"
256+
}
257+
},
249258
"get_erc20_token_transfer_events_by_contract_address_paginated": {
250259
"module": "accounts",
251260
"kwargs": {
@@ -307,4 +316,4 @@
307316
"offset": 100
308317
}
309318
}
310-
}
319+
}

etherscan/modules/accounts.py

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,35 @@ def get_erc20_token_transfer_events_by_address(
188188
f"{sort}"
189189
)
190190
return url
191+
192+
@staticmethod
193+
def get_erc20_token_transfer_events_by_address_paginated(
194+
address: str, page: int, offset: int, startblock: int, endblock: int, sort: str
195+
) -> str:
196+
197+
url = (
198+
f"{fields.MODULE}"
199+
f"{modules.ACCOUNT}"
200+
f"{fields.ACTION}"
201+
f"{actions.TOKENTX}"
202+
f"{fields.ADDRESS}"
203+
f"{address}"
204+
f"{fields.START_BLOCK}"
205+
f"{str(startblock)}"
206+
f"{fields.END_BLOCK}"
207+
f"{str(endblock)}"
208+
f"{fields.SORT}"
209+
f"{sort}"
210+
f"{fields.PAGE}"
211+
f"{str(page)}"
212+
f"{fields.OFFSET}"
213+
f"{str(offset)}"
214+
)
215+
return url
191216

192217
@staticmethod
193218
def get_erc20_token_transfer_events_by_contract_address_paginated(
194-
contract_address: str, page: int, offset: int, sort: str
219+
contract_address: str, page: int, offset: int, startblock: int, endblock: int, sort: str
195220
) -> str:
196221

197222
url = (
@@ -201,6 +226,10 @@ def get_erc20_token_transfer_events_by_contract_address_paginated(
201226
f"{actions.TOKENTX}"
202227
f"{fields.CONTRACT_ADDRESS}"
203228
f"{contract_address}"
229+
f"{fields.START_BLOCK}"
230+
f"{str(startblock)}"
231+
f"{fields.END_BLOCK}"
232+
f"{str(endblock)}"
204233
f"{fields.SORT}"
205234
f"{sort}"
206235
f"{fields.PAGE}"
@@ -212,7 +241,7 @@ def get_erc20_token_transfer_events_by_contract_address_paginated(
212241

213242
@staticmethod
214243
def get_erc20_token_transfer_events_by_address_and_contract_paginated(
215-
contract_address: str, address: str, page: int, offset: int, sort: str
244+
contract_address: str, address: str, page: int, offset: int, startblock: int, endblock: int, sort: str
216245
) -> str:
217246

218247
url = (
@@ -224,6 +253,10 @@ def get_erc20_token_transfer_events_by_address_and_contract_paginated(
224253
f"{contract_address}"
225254
f"{fields.ADDRESS}"
226255
f"{address}"
256+
f"{fields.START_BLOCK}"
257+
f"{str(startblock)}"
258+
f"{fields.END_BLOCK}"
259+
f"{str(endblock)}"
227260
f"{fields.SORT}"
228261
f"{sort}"
229262
f"{fields.PAGE}"

0 commit comments

Comments
 (0)