Skip to content
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

Feat/polygon amoy chain #1189

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading