Skip to content

Commit

Permalink
feat: add support for Moonbase chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayconfig committed Apr 23, 2024
1 parent 1294f1d commit 36f3d57
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/seven-rockets-crash.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 Moonbase chain
28 changes: 28 additions & 0 deletions packages/common/evmUtils/src/data/chaindata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,34 @@ export const chainList: EvmChainListDataEntry[] = [
},
],
},
{
name: 'Moonbase Alpha',
chain: 'MOON',
rpc: [
'https://rpc.api.moonbase.moonbeam.network',
'wss://wss.api.moonbase.moonbeam.network',
'https://moonbase-alpha.drpc.org',
'wss://moonbase-alpha.drpc.org',
],
faucets: [],
nativeCurrency: {
name: 'Dev',
symbol: 'DEV',
decimals: 18,
},
infoURL: 'https://docs.moonbeam.network/networks/testnet/',
shortName: 'mbase',
chainId: 1287,
networkId: 1287,
slip44: 1,
explorers: [
{
name: 'moonscan',
url: 'https://moonbase.moonscan.io',
standard: 'none',
},
],
},
{
name: 'Fantom Testnet',
chain: 'FTM',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ describe('EvmChain', () => {
expect(EvmChain.LINEA.apiHex).toBe('0xe708');
expect(EvmChain.MOONBEAM.apiHex).toBe('0x504');
expect(EvmChain.MOONRIVER.apiHex).toBe('0x505');
expect(EvmChain.MOONBASE.apiHex).toBe('0x507');
});

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 @@ -278,6 +278,14 @@ export class EvmChain implements EvmChainable {
public static get MOONBEAM() {
return EvmChain.create(1284);
}
/**
* Returns MOONBASE chain
*
* @example EvmChain.MOONBASE
*/
public static get MOONBASE() {
return EvmChain.create(1287);
}

/**
* Create a new instance of EvmChain from any valid address input.
Expand Down Expand Up @@ -363,6 +371,7 @@ export class EvmChain implements EvmChainable {
EvmChain.LINEA,
EvmChain.MOONBEAM,
EvmChain.MOONRIVER,
EvmChain.MOONBASE,
];
}

Expand Down Expand Up @@ -477,7 +486,8 @@ export class EvmChain implements EvmChainable {
| '0x13882'
| '0xe708'
| '0x504'
| '0x505';
| '0x505'
| '0x507';
}

/**
Expand Down

0 comments on commit 36f3d57

Please sign in to comment.