Skip to content

Commit

Permalink
feat: support moonriver
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayconfig committed Apr 19, 2024
1 parent 7d08ba5 commit 54bbb31
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/clean-dolphins-peel.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 moonriver
31 changes: 30 additions & 1 deletion packages/common/evmUtils/src/data/chaindata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
12 changes: 11 additions & 1 deletion packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -344,6 +352,7 @@ export class EvmChain implements EvmChainable {
EvmChain.HOLESKY,
EvmChain.POLYGON_AMOY,
EvmChain.LINEA,
EvmChain.MOONRIVER,
];
}

Expand Down Expand Up @@ -456,7 +465,8 @@ export class EvmChain implements EvmChainable {
| '0x14a33'
| '0x4268'
| '0x13882'
| '0xe708';
| '0xe708'
| '0x505';
}

/**
Expand Down

0 comments on commit 54bbb31

Please sign in to comment.