Skip to content

Commit

Permalink
Merge pull request #1189 from MoralisWeb3/feat/polygonAmoy-chain
Browse files Browse the repository at this point in the history
Feat/polygonAmoy chain
  • Loading branch information
Kayconfig authored Apr 11, 2024
2 parents 318a553 + bc528b0 commit cde4e0b
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/polite-snakes-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@moralisweb3/common-evm-utils': patch
'@moralisweb3/evm-api': patch
'moralis': patch
---

Add support for polygonAmoy chain
74 changes: 74 additions & 0 deletions packages/common/evmUtils/src/data/chaindata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,51 @@ export const chainList: EvmChainListDataEntry[] = [
},
],
},
{
name: 'Holesky',
title: 'Ethereum Testnet Holesky',
chain: 'ETH',
rpc: [
'https://rpc.holesky.ethpandaops.io',
'https://ethereum-holesky-rpc.publicnode.com',
'wss://ethereum-holesky-rpc.publicnode.com',
'https://holesky.drpc.org',
'wss://holesky.drpc.org',
],
faucets: ['https://faucet.holesky.ethpandaops.io', 'https://holesky-faucet.pk910.de'],
nativeCurrency: {
name: 'Testnet ETH',
symbol: 'ETH',
decimals: 18,
},
infoURL: 'https://holesky.ethpandaops.io',
shortName: 'holesky',
chainId: 17000,
networkId: 17000,
slip44: 1,
icon: 'ethereum',
status: 'incubating',
explorers: [
{
name: 'Holesky Explorer',
url: 'https://holesky.beaconcha.in',
icon: 'ethereum',
standard: 'EIP3091',
},
{
name: 'otterscan-holesky',
url: 'https://holesky.otterscan.io',
icon: 'ethereum',
standard: 'EIP3091',
},
{
name: 'Holesky Etherscan',
url: 'https://holesky.etherscan.io',
icon: 'ethereum',
standard: 'EIP3091',
},
],
},
{
name: 'Arbitrum One',
chainId: 42161,
Expand Down Expand Up @@ -650,6 +695,35 @@ export const chainList: EvmChainListDataEntry[] = [
},
],
},
{
name: 'Amoy',
title: 'Polygon Amoy Testnet',
chain: 'Polygon',
icon: 'polygon',
rpc: [
'https://https://rpc-amoy.polygon.technology',
'https://polygon-amoy-bor-rpc.publicnode.com',
'wss://polygon-amoy-bor-rpc.publicnode.com',
],
faucets: ['https://faucet.polygon.technology/'],
nativeCurrency: {
name: 'MATIC',
symbol: 'MATIC',
decimals: 18,
},
infoURL: 'https://polygon.technology/',
shortName: 'polygonamoy',
chainId: 80002,
networkId: 80002,
slip44: 1,
explorers: [
{
name: 'polygonamoy',
url: 'https://www.oklink.com/amoy',
standard: 'EIP3091',
},
],
},
{
name: 'Base Goerli Testnet',
chain: 'ETH',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ describe('EvmChain', () => {
expect(EvmChain.BASE.apiHex).toBe('0x2105');
expect(EvmChain.BASE_TESTNET.apiHex).toBe('0x14a33');
expect(EvmChain.HOLESKY.apiHex).toBe('0x4268');
expect(EvmChain.POLYGON_AMOY.apiHex).toBe('0x13882');
});

describe('metadata', () => {
Expand Down
13 changes: 12 additions & 1 deletion packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ export class EvmChain implements EvmChainable {
return EvmChain.create(0x4268);
}

/**
* Returns POLYGON_AMOY chain
*
* @example EvmChain.POLYGON_AMOY
*/
public static get POLYGON_AMOY() {
return EvmChain.create(80002);
}

/**
* Create a new instance of EvmChain from any valid address input.
*
Expand Down Expand Up @@ -324,6 +333,7 @@ export class EvmChain implements EvmChainable {
EvmChain.BASE_TESTNET,
EvmChain.BASE_SEPOLIA,
EvmChain.HOLESKY,
EvmChain.POLYGON_AMOY,
];
}

Expand Down Expand Up @@ -434,7 +444,8 @@ export class EvmChain implements EvmChainable {
| '0x27d8'
| '0x2105'
| '0x14a33'
| '0x4268';
| '0x4268'
| '0x13882';
}

/**
Expand Down

1 comment on commit cde4e0b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Test coverage

Title Lines Statements Branches Functions
api-utils Coverage: 20%
20.6% (61/296) 20.48% (17/83) 19.04% (12/63)
auth Coverage: 89%
92.45% (98/106) 83.33% (20/24) 86.66% (26/30)
evm-api Coverage: 84%
85.71% (90/105) 66.66% (6/9) 78.87% (56/71)
common-aptos-utils Coverage: 4%
4.56% (151/3306) 4.49% (25/556) 5.53% (45/813)
common-evm-utils Coverage: 61%
61.92% (1805/2915) 23.04% (194/842) 41.7% (440/1055)
sol-api Coverage: 97%
97.56% (40/41) 66.66% (6/9) 93.75% (15/16)
common-sol-utils Coverage: 64%
65.42% (229/350) 41.86% (18/43) 50.89% (57/112)
common-streams-utils Coverage: 90%
90.73% (1204/1327) 73.63% (363/493) 82.07% (444/541)
streams Coverage: 91%
90.54% (603/666) 72.34% (68/94) 90.97% (131/144)

Please sign in to comment.