diff --git a/package.json b/package.json index b001ef1..1886eb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trustvc/trustvc", - "version": "2.14.0", + "version": "2.14.1", "description": "TrustVC library", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/utils/supportedChains/index.ts b/src/utils/supportedChains/index.ts index d8f6c26..e0e9fca 100644 --- a/src/utils/supportedChains/index.ts +++ b/src/utils/supportedChains/index.ts @@ -84,7 +84,7 @@ export const SUPPORTED_CHAINS: supportedChains = { currency: 'POL', iconImage: iconPolygon, explorerUrl: 'https://amoy.polygonscan.com', - explorerApiUrl: `https://api-amoy.polygonscan.com/api?apikey=${process.env.POLYGONSCAN_API_KEY}`, + explorerApiUrl: `https://api.etherscan.io/v2/api?apikey=${process.env.POLYGONSCAN_API_KEY}&chainid=80002`, rpcUrl: `https://polygon-amoy.infura.io/v3/${process.env.INFURA_API_KEY}`, gasStation: gasStation('https://gasstation.polygon.technology/amoy'), nativeCurrency: { diff --git a/src/utils/supportedChains/supportedChains.test.ts b/src/utils/supportedChains/supportedChains.test.ts index c4c10a6..bc0b2ec 100644 --- a/src/utils/supportedChains/supportedChains.test.ts +++ b/src/utils/supportedChains/supportedChains.test.ts @@ -57,11 +57,12 @@ describe('supportedChains', () => { expect(rpcUrl).toContain('https://polygon-amoy.infura.io/v3/'); }); - it('should use PolygonScan as the explorer API for amoy', () => { + it('should use Etherscan v2 as the explorer API for amoy', () => { const { explorerApiUrl } = SUPPORTED_CHAINS[CHAIN_ID.amoy]; - expect(explorerApiUrl).toContain('https://api-amoy.polygonscan.com/api'); + expect(explorerApiUrl).toContain('https://api.etherscan.io/v2/api'); expect(explorerApiUrl).toContain('apikey='); + expect(explorerApiUrl).toContain('chainid=80002'); }); it('should sepolia chain info correctly', () => {