From 54bbb312fee9a323472672cce1560001eb6bf57f Mon Sep 17 00:00:00 2001 From: Kayode Odole <31928403+Kayconfig@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:50:04 +0100 Subject: [PATCH 1/2] feat: support moonriver --- .changeset/clean-dolphins-peel.md | 7 +++++ .../common/evmUtils/src/data/chaindata.ts | 31 ++++++++++++++++++- .../src/dataTypes/EvmChain/EvmChain.test.ts | 1 + .../src/dataTypes/EvmChain/EvmChain.ts | 12 ++++++- 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .changeset/clean-dolphins-peel.md diff --git a/.changeset/clean-dolphins-peel.md b/.changeset/clean-dolphins-peel.md new file mode 100644 index 0000000000..084cfb0d28 --- /dev/null +++ b/.changeset/clean-dolphins-peel.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Add support for moonriver diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index 143bd2914a..2b931be147 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: 'Moonriver', + chain: 'MOON', + rpc: [ + 'https://rpc.api.moonriver.moonbeam.network', + 'wss://wss.api.moonriver.moonbeam.network', + 'https://moonriver-rpc.publicnode.com', + 'wss://moonriver-rpc.publicnode.com', + 'https://moonriver.drpc.org', + 'wss://moonriver.drpc.org', + ], + faucets: [], + nativeCurrency: { + name: 'Moonriver', + symbol: 'MOVR', + decimals: 18, + }, + infoURL: 'https://moonbeam.network/networks/moonriver/', + shortName: 'mriver', + chainId: 1285, + networkId: 1285, + explorers: [ + { + name: 'moonscan', + url: 'https://moonriver.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..f067ac8f82 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.MOONRIVER.apiHex).toBe('0x505'); }); describe('metadata', () => { diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index 6e10b52767..f4dd709143 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -261,6 +261,14 @@ export class EvmChain implements EvmChainable { public static get LINEA() { return EvmChain.create(59144); } + /** + * Returns MOONRIVER chain + * + * @example EvmChain.MOONRIVER + */ + public static get MOONRIVER() { + return EvmChain.create(1285); + } /** * Create a new instance of EvmChain from any valid address input. @@ -344,6 +352,7 @@ export class EvmChain implements EvmChainable { EvmChain.HOLESKY, EvmChain.POLYGON_AMOY, EvmChain.LINEA, + EvmChain.MOONRIVER, ]; } @@ -456,7 +465,8 @@ export class EvmChain implements EvmChainable { | '0x14a33' | '0x4268' | '0x13882' - | '0xe708'; + | '0xe708' + | '0x505'; } /** From b73971c33e16106c45bea99c5d7c5347001d7347 Mon Sep 17 00:00:00 2001 From: Kayode Odole <31928403+Kayconfig@users.noreply.github.com> Date: Fri, 19 Apr 2024 17:20:10 +0100 Subject: [PATCH 2/2] chore: update chaindata --- .../common/evmUtils/src/data/chaindata.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index 2b931be147..d6d1e9f168 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: 'Moonriver', chain: 'MOON',