Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tomasvrba
Copy link
Contributor

No description provided.

@thisconnect thisconnect requested a review from shonsirsha May 2, 2025 07:20
Copy link
Collaborator

@shonsirsha shonsirsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@@ -517,19 +517,19 @@ func (backend *Backend) Coin(code coinpkg.Code) (coinpkg.Coin, error) {
coin = btc.NewCoin(coinpkg.CodeLTC, "Litecoin", "LTC", coinpkg.BtcUnitDefault, &ltc.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)
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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 😂

Copy link
Contributor Author

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

@Tomasvrba Tomasvrba requested a review from benma May 6, 2025 09:54
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

Successfully merging this pull request may close these issues.

3 participants