pcko1 / etherscan-python

A minimal, yet complete, python API for Etherscan.io.
MIT License
408 stars 111 forks source link

Optional query parameters work like required #18

Closed cinarizasyon closed 2 months ago

cinarizasyon commented 3 years ago

When I am using the rest api, i can send request without using endblock parameter: https://api.etherscan.io/api?module=account&action=tokentx&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&startblock=12328953&sort=asc&apikey=YourApiKeyToken

But the library doesn't allow to do this:

In [5]: eth.get_erc20_token_transfer_events_by_address(address='0x4e83362442b8d1bec281594cea3050c8eb01311c', startblock=12328953)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-e4416848c949> in <module>
----> 1 eth.get_erc20_token_transfer_events_by_address(address='0x4e83362442b8d1bec281594cea3050c8eb01311c', startblock=12328953)

/usr/local/lib/python3.8/dist-packages/etherscan/etherscan.py in wrapper(*args, **kwargs)
     25         def wrapper(*args, **kwargs):
     26             url = (
---> 27                 f"{fields.PREFIX.format(net.lower()).replace('-main','')}"
     28                 f"{func(*args, **kwargs)}"
     29                 f"{fields.API_KEY}"

TypeError: get_erc20_token_transfer_events_by_address() missing 2 required positional arguments: 'endblock' and 'sort'
github-actions[bot] commented 3 years ago

Thanks for reporting this issue, we are on it :)

wasauce commented 3 years ago

Probably aware but I am seeing this as well

jayz1up commented 3 years ago

?

On Sat, Sep 4, 2021 at 11:57 PM William Ferrell @.***> wrote:

Probably aware but I am seeing this as well

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pcko1/etherscan-python/issues/18#issuecomment-913086666, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARZK7UAM26A4KR7PWWFWG2TUAL2DDANCNFSM44XIZPHA .

wasauce commented 3 years ago

Sorry. Was attempting to be helpful in saying that I can reproduce this issue with etherscan-python==2.1.0

If I get around to it over the next couple of weeks, I may make a fix and submit a PR.

jayz1up commented 3 years ago

Wait you so you can get my hex back!?

On Sun, Sep 5, 2021 at 9:42 AM William Ferrell @.***> wrote:

Sorry. Was attempting to be helpful in saying that I can reproduce this issue with etherscan-python==2.1.0

If I get around to it over the next couple of weeks, I may make a fix and submit a PR.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pcko1/etherscan-python/issues/18#issuecomment-913167223, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARZK7UEDQI6ZDCIUE2PTCHLUAN6VBANCNFSM44XIZPHA .

jayz1up commented 3 years ago

I’ll pay you

On Sun, Sep 5, 2021 at 9:42 AM William Ferrell @.***> wrote:

Sorry. Was attempting to be helpful in saying that I can reproduce this issue with etherscan-python==2.1.0

If I get around to it over the next couple of weeks, I may make a fix and submit a PR.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pcko1/etherscan-python/issues/18#issuecomment-913167223, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARZK7UEDQI6ZDCIUE2PTCHLUAN6VBANCNFSM44XIZPHA .