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

Error handling ERC-1155 #76

Open
rpcerror opened this issue Feb 10, 2023 · 8 comments
Open

Error handling ERC-1155 #76

rpcerror opened this issue Feb 10, 2023 · 8 comments

Comments

@rpcerror
Copy link

There is an issue with error handling while using the ERC-1155 function. With err, result or any other error type the code only logs: etherscan server: NOTOK instead of providing an actual error message.

@nanmu42
Copy link
Owner

nanmu42 commented Feb 11, 2023

Yes, collecting the result field into error messages would be an improvement.

As a quick walkaround, try enabling verbose mode to see the full response.

if c.Verbose {

@rpcerror
Copy link
Author

This worked, thank you. However looking at the API response and reading current etherscan docs It seems like they have removed the erc-1155 token check functrion completely, or I must be blind as I cant find it: https://docs.etherscan.io/api-endpoints/tokens

Or maybe I am doing something wrong in my code? The error I get:
{"status":"0","message":"NOTOK","result":"Error! Missing Or invalid Action name"}

@nanmu42
Copy link
Owner

nanmu42 commented Feb 11, 2023

@rpcerror
Copy link
Author

Yes, this is right. Something must be not right though, the request I am sending should be 100% good according to their API docs, here it is:

GET /api?action=token1155tx&address=

&apikey=&contractaddress=&module=account&offset=10000&page=1&sort=asc

but I get this error:

{"status":"0","message":"NOTOK","result":"Error! Missing Or invalid Action name"}

Do you know what might be the issue?

@nanmu42
Copy link
Owner

nanmu42 commented Feb 11, 2023

This is odd.

Does this endpoint need a paid plan or something?

@rpcerror
Copy link
Author

No, it does not. 1155 transfers function is included in the free plan based on etherscan API docs. What the issue might be related to then?

@rpcerror
Copy link
Author

I have just messaged etherscan on email, and they claim everything is fine on their end. Here's the reply: image

Could you please run the request too and check if it returns an error on your side?

@rpcerror
Copy link
Author

And let me tell you, it works fine for me via browser. image

Looking forward to you reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants