Skip to content

Commit 650124c

Browse files
committed
Add erc1155 transactions
1 parent e059d7c commit 650124c

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

etherscan/enums/actions_enum.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ class ActionsEnum:
6060
TOKENNFTTX: str = "tokennfttx"
6161
TOKENTX: str = "tokentx"
6262
TXLIST_INTERNAL: str = "txlistinternal"
63+
TXLIST_ERC1155: str = "token1155tx"
6364
TXLIST: str = "txlist"

etherscan/modules/accounts.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,27 @@ def get_internal_txs_by_address(
108108
)
109109
return url
110110

111+
@staticmethod
112+
def get_erc1155_txs_by_address(
113+
address: str, startblock: int, endblock: int, sort: str,
114+
) -> str:
115+
# NOTE: Returns the last 10k events
116+
url = (
117+
f"{fields.MODULE}"
118+
f"{modules.ACCOUNT}"
119+
f"{fields.ACTION}"
120+
f"{actions.TXLIST_ERC1155}"
121+
f"{fields.ADDRESS}"
122+
f"{address}"
123+
f"{fields.START_BLOCK}"
124+
f"{str(startblock)}"
125+
f"{fields.END_BLOCK}"
126+
f"{str(endblock)}"
127+
f"{fields.SORT}"
128+
f"{sort}"
129+
)
130+
return url
131+
111132
@staticmethod
112133
def get_internal_txs_by_address_paginated(
113134
address: str, page: int, offset: int, startblock: int, endblock: int, sort: str,

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from setuptools import setup
22

33
setup(
4-
name="etherscan-python",
5-
version="2.1.0",
4+
name="etherscan-python-api",
5+
version="2.2.0",
66
description="A minimal, yet complete, python API for etherscan.io.",
77
url="https://github.com/pcko1/etherscan-python",
88
author="Panagiotis-Christos Kotsias",

0 commit comments

Comments
 (0)