diff --git a/.changeset/seven-rockets-crash.md b/.changeset/seven-rockets-crash.md new file mode 100644 index 0000000000..8bdf0846c2 --- /dev/null +++ b/.changeset/seven-rockets-crash.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Add support for Moonbase chain diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index d6d1e9f168..181aa2ca1e 100644 --- a/packages/common/evmUtils/src/data/chaindata.ts +++ b/packages/common/evmUtils/src/data/chaindata.ts @@ -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', diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts index a5fbf5f999..3996d1cfe3 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts @@ -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', () => { diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index d81d40acf1..ca95f56ff3 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -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. @@ -363,6 +371,7 @@ export class EvmChain implements EvmChainable { EvmChain.LINEA, EvmChain.MOONBEAM, EvmChain.MOONRIVER, + EvmChain.MOONBASE, ]; } @@ -477,7 +486,8 @@ export class EvmChain implements EvmChainable { | '0x13882' | '0xe708' | '0x504' - | '0x505'; + | '0x505' + | '0x507'; } /**