From 3415bf5a7f93ee6a686906176a711c26781ee087 Mon Sep 17 00:00:00 2001 From: Bart Tadych Date: Thu, 21 Mar 2024 10:26:20 +0100 Subject: [PATCH] feat: holesky chain. (#1185) * feat: holesky chain. --- .changeset/real-hounds-tickle.md | 7 +++++ .../common/evmUtils/src/data/chaindata.ts | 28 +++++++++++++++++-- .../src/dataTypes/EvmChain/EvmChain.test.ts | 3 +- .../src/dataTypes/EvmChain/EvmChain.ts | 13 ++++++++- 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 .changeset/real-hounds-tickle.md diff --git a/.changeset/real-hounds-tickle.md b/.changeset/real-hounds-tickle.md new file mode 100644 index 0000000000..c7989b4c42 --- /dev/null +++ b/.changeset/real-hounds-tickle.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Added the `HOLESKY` chain support. diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index 53f5415eb6..3457e0385b 100644 --- a/packages/common/evmUtils/src/data/chaindata.ts +++ b/packages/common/evmUtils/src/data/chaindata.ts @@ -23,6 +23,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'https://rpc.mevblocker.io/fast', 'https://rpc.mevblocker.io/noreverts', 'https://rpc.mevblocker.io/fullprivacy', + 'https://eth.drpc.org', + 'wss://eth.drpc.org', ], features: [ { @@ -120,6 +122,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'wss://optimism-rpc.publicnode.com', 'https://optimism.gateway.tenderly.co', 'wss://optimism.gateway.tenderly.co', + 'https://optimism.drpc.org', + 'wss://optimism.drpc.org', ], faucets: [], nativeCurrency: { @@ -154,7 +158,13 @@ export const chainList: EvmChainListDataEntry[] = [ { name: 'Cronos Mainnet', chain: 'CRO', - rpc: ['https://evm.cronos.org', 'https://cronos-evm-rpc.publicnode.com', 'wss://cronos-evm-rpc.publicnode.com'], + rpc: [ + 'https://evm.cronos.org', + 'https://cronos-evm-rpc.publicnode.com', + 'wss://cronos-evm-rpc.publicnode.com', + 'https://cronos.drpc.org', + 'wss://cronos.drpc.org', + ], features: [ { name: 'EIP1559', @@ -323,6 +333,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'wss://polygon-bor-rpc.publicnode.com', 'https://polygon.gateway.tenderly.co', 'wss://polygon.gateway.tenderly.co', + 'https://polygon.drpc.org', + 'wss://polygon.drpc.org', ], faucets: [], nativeCurrency: { @@ -352,7 +364,13 @@ export const chainList: EvmChainListDataEntry[] = [ { name: 'Fantom Opera', chain: 'FTM', - rpc: ['https://rpc.ftm.tools', 'https://fantom-rpc.publicnode.com', 'wss://fantom-rpc.publicnode.com'], + rpc: [ + 'https://rpc.ftm.tools', + 'https://fantom-rpc.publicnode.com', + 'wss://fantom-rpc.publicnode.com', + 'https://fantom.drpc.org', + 'wss://fantom.drpc.org', + ], faucets: [], nativeCurrency: { name: 'Fantom', @@ -386,6 +404,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'https://rpc.testnet.fantom.network', 'https://fantom-testnet-rpc.publicnode.com', 'wss://fantom-testnet-rpc.publicnode.com', + 'https://fantom-testnet.drpc.org', + 'wss://fantom-testnet.drpc.org', ], faucets: ['https://faucet.fantom.network'], nativeCurrency: { @@ -461,6 +481,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'wss://rpc.chiadochain.net/wss', 'https://gnosis-chiado-rpc.publicnode.com', 'wss://gnosis-chiado-rpc.publicnode.com', + 'https://gnosis-chiado.drpc.org', + 'wss://gnosis-chiado.drpc.org', ], faucets: ['https://gnosisfaucet.com'], nativeCurrency: { @@ -774,6 +796,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'wss://sepolia.gateway.tenderly.co', 'https://ethereum-sepolia-rpc.publicnode.com', 'wss://ethereum-sepolia-rpc.publicnode.com', + 'https://sepolia.drpc.org', + 'wss://sepolia.drpc.org', ], faucets: ['http://fauceth.komputing.org?chain=11155111&address=${ADDRESS}'], nativeCurrency: { diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts index d279977f28..fb94129644 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts @@ -121,10 +121,11 @@ describe('EvmChain', () => { expect(EvmChain.GNOSIS_TESTNET.apiHex).toBe('0x27d8'); expect(EvmChain.BASE.apiHex).toBe('0x2105'); expect(EvmChain.BASE_TESTNET.apiHex).toBe('0x14a33'); + expect(EvmChain.HOLESKY.apiHex).toBe('0x4268'); }); describe('metadata', () => { - const notSupportedChains = ['0x7e4', '0x15b32']; + const notSupportedChains = ['0x7e4', '0x15b32', '0x4268']; const supportedChains = EvmChain.values().filter((chain) => !notSupportedChains.includes(chain.apiHex)); for (const chain of supportedChains) { diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index 9a4a263f86..2d22cc50b8 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -235,6 +235,15 @@ export class EvmChain implements EvmChainable { return EvmChain.create(84532); } + /** + * Returns HOLESKY chain + * + * @example EvmChain.HOLESKY + */ + public static get HOLESKY() { + return EvmChain.create(0x4268); + } + /** * Create a new instance of EvmChain from any valid address input. * @@ -314,6 +323,7 @@ export class EvmChain implements EvmChainable { EvmChain.BASE, EvmChain.BASE_TESTNET, EvmChain.BASE_SEPOLIA, + EvmChain.HOLESKY, ]; } @@ -423,7 +433,8 @@ export class EvmChain implements EvmChainable { | '0x64' | '0x27d8' | '0x2105' - | '0x14a33'; + | '0x14a33' + | '0x4268'; } /**