Skip to content
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

Optional query parameters work like required #18

Open
cinarizasyon opened this issue May 11, 2021 · 6 comments
Open

Optional query parameters work like required #18

cinarizasyon opened this issue May 11, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@cinarizasyon
Copy link

cinarizasyon commented May 11, 2021

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
Copy link

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

@pcko1 pcko1 added the bug Something isn't working label May 14, 2021
@wasauce
Copy link

wasauce commented Sep 5, 2021

Probably aware but I am seeing this as well

@jayz1up
Copy link

jayz1up commented Sep 5, 2021 via email

@wasauce
Copy link

wasauce commented Sep 5, 2021

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
Copy link

jayz1up commented Sep 5, 2021 via email

@jayz1up
Copy link

jayz1up commented Sep 5, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants