diff --git a/.changeset/purple-rocks-punch.md b/.changeset/purple-rocks-punch.md new file mode 100644 index 0000000000..3e5b86fea6 --- /dev/null +++ b/.changeset/purple-rocks-punch.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Add support for moonbeam chain diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index 143bd2914a..e8864cbb63 100644 --- a/packages/common/evmUtils/src/data/chaindata.ts +++ b/packages/common/evmUtils/src/data/chaindata.ts @@ -397,6 +397,35 @@ export const chainList: EvmChainListDataEntry[] = [ }, ], }, + { + name: 'Moonbeam', + chain: 'MOON', + rpc: [ + 'https://rpc.api.moonbeam.network', + 'wss://wss.api.moonbeam.network', + 'https://moonbeam-rpc.publicnode.com', + 'wss://moonbeam-rpc.publicnode.com', + 'https://moonbeam.drpc.org', + 'wss://moonbeam.drpc.org', + ], + faucets: [], + nativeCurrency: { + name: 'Glimmer', + symbol: 'GLMR', + decimals: 18, + }, + infoURL: 'https://moonbeam.network/networks/moonbeam/', + shortName: 'mbeam', + chainId: 1284, + networkId: 1284, + explorers: [ + { + name: 'moonscan', + url: 'https://moonbeam.moonscan.io', + standard: 'none', + }, + ], + }, { name: 'Fantom Testnet', chain: 'FTM', @@ -753,7 +782,7 @@ export const chainList: EvmChainListDataEntry[] = [ chain: 'Polygon', icon: 'polygon', rpc: [ - 'https://https://rpc-amoy.polygon.technology', + 'https://rpc-amoy.polygon.technology', 'https://polygon-amoy-bor-rpc.publicnode.com', 'wss://polygon-amoy-bor-rpc.publicnode.com', ], diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts index 97b433e8d4..bbfa0e0a1a 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts @@ -124,6 +124,7 @@ describe('EvmChain', () => { expect(EvmChain.HOLESKY.apiHex).toBe('0x4268'); expect(EvmChain.POLYGON_AMOY.apiHex).toBe('0x13882'); expect(EvmChain.LINEA.apiHex).toBe('0xe708'); + expect(EvmChain.MOONBEAM.apiHex).toBe('0x504'); }); describe('metadata', () => { diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index 6e10b52767..e73bb2c0db 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -262,6 +262,15 @@ export class EvmChain implements EvmChainable { return EvmChain.create(59144); } + /** + * Returns MOONBEAM chain + * + * @example EvmChain.MOONBEAM + */ + public static get MOONBEAM() { + return EvmChain.create(1284); + } + /** * Create a new instance of EvmChain from any valid address input. * @@ -344,6 +353,7 @@ export class EvmChain implements EvmChainable { EvmChain.HOLESKY, EvmChain.POLYGON_AMOY, EvmChain.LINEA, + EvmChain.MOONBEAM, ]; } @@ -456,7 +466,8 @@ export class EvmChain implements EvmChainable { | '0x14a33' | '0x4268' | '0x13882' - | '0xe708'; + | '0xe708' + | '0x504'; } /**