Skip to content

Commit

Permalink
feat: holesky chain. (#1185)
Browse files Browse the repository at this point in the history
* feat: holesky chain.
  • Loading branch information
b4rtaz authored Mar 21, 2024
1 parent b027413 commit 3415bf5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/real-hounds-tickle.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
---

Added the `HOLESKY` chain support.
28 changes: 26 additions & 2 deletions packages/common/evmUtils/src/data/chaindata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 12 additions & 1 deletion packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -314,6 +323,7 @@ export class EvmChain implements EvmChainable {
EvmChain.BASE,
EvmChain.BASE_TESTNET,
EvmChain.BASE_SEPOLIA,
EvmChain.HOLESKY,
];
}

Expand Down Expand Up @@ -423,7 +433,8 @@ export class EvmChain implements EvmChainable {
| '0x64'
| '0x27d8'
| '0x2105'
| '0x14a33';
| '0x14a33'
| '0x4268';
}

/**
Expand Down

1 comment on commit 3415bf5

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage

Title Lines Statements Branches Functions
api-utils Coverage: 20%
20.6% (61/296) 20.48% (17/83) 19.04% (12/63)
auth Coverage: 89%
92.45% (98/106) 83.33% (20/24) 86.66% (26/30)
evm-api Coverage: 84%
85.71% (90/105) 66.66% (6/9) 78.87% (56/71)
common-aptos-utils Coverage: 4%
4.56% (151/3306) 4.49% (25/556) 5.53% (45/813)
common-evm-utils Coverage: 61%
61.89% (1803/2913) 23.04% (194/842) 41.65% (439/1054)
sol-api Coverage: 97%
97.56% (40/41) 66.66% (6/9) 93.75% (15/16)
common-sol-utils Coverage: 64%
65.42% (229/350) 41.86% (18/43) 50.89% (57/112)
common-streams-utils Coverage: 90%
90.73% (1204/1327) 73.63% (363/493) 82.07% (444/541)
streams Coverage: 91%
90.54% (603/666) 72.34% (68/94) 90.97% (131/144)

Please sign in to comment.