mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
feat: Migrate to EtherScan v2 API for supported EVM chains (#2264)
This commit is contained in:
@@ -297,13 +297,14 @@ abstract class HomeSettingsViewModelBase with Store {
|
||||
required bool isEthereum,
|
||||
}) async {
|
||||
final uri = Uri.https(
|
||||
isEthereum ? "api.etherscan.io" : "api.polygonscan.com",
|
||||
"/api",
|
||||
"api.etherscan.io",
|
||||
"/v2/api",
|
||||
{
|
||||
"chainid": isEthereum ? "1" : "137",
|
||||
"module": "token",
|
||||
"action": "tokeninfo",
|
||||
"contractaddress": contractAddress,
|
||||
"apikey": isEthereum ? secrets.etherScanApiKey : secrets.polygonScanApiKey,
|
||||
"apikey": secrets.etherScanApiKey,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -338,13 +339,14 @@ abstract class HomeSettingsViewModelBase with Store {
|
||||
required bool isEthereum,
|
||||
}) async {
|
||||
final uri = Uri.https(
|
||||
isEthereum ? "api.etherscan.io" : "api.polygonscan.com",
|
||||
"/api",
|
||||
"api.etherscan.io",
|
||||
"/v2/api",
|
||||
{
|
||||
"chainid": isEthereum ? "1" : "137",
|
||||
"module": "contract",
|
||||
"action": "getsourcecode",
|
||||
"address": contractAddress,
|
||||
"apikey": isEthereum ? secrets.etherScanApiKey : secrets.polygonScanApiKey,
|
||||
"apikey": secrets.etherScanApiKey,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user