-
Notifications
You must be signed in to change notification settings - Fork 101
eth: migrate etherscan API to v2 #3321
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
backend/backend.go
Outdated
@@ -517,19 +517,19 @@ func (backend *Backend) Coin(code coinpkg.Code) (coinpkg.Coin, error) { | |||
coin = btc.NewCoin(coinpkg.CodeLTC, "Litecoin", "LTC", coinpkg.BtcUnitDefault, <c.MainNetParams, dbFolder, servers, | |||
"https://blockchair.com/litecoin/transaction/", backend.socksProxy) | |||
case code == coinpkg.CodeETH: | |||
etherScan := etherscan.NewEtherScan("https://api.etherscan.io/api", backend.etherScanHTTPClient) | |||
etherScan := etherscan.NewEtherScan("https://api.etherscan.io/v2/api?chainid=1", backend.etherScanHTTPClient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more proper to encode the chainID as a param in the call()
function and not pass it as part of the url in here. In fact, you can drop the base url param as it's now the same for all. Rather, pass the chainID as an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahahah, I knew you'd want to do it that way :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 It's not the first time you say this either 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it a few days ago btw
No description provided.