diff --git a/.changeset/shy-cooks-cry.md b/.changeset/shy-cooks-cry.md new file mode 100644 index 0000000000..85224a2983 --- /dev/null +++ b/.changeset/shy-cooks-cry.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Added support for new EVM chains. diff --git a/packages/common/evmUtils/src/data/chaindata.ts b/packages/common/evmUtils/src/data/chaindata.ts index 6e2f49a923..fb6351f337 100644 --- a/packages/common/evmUtils/src/data/chaindata.ts +++ b/packages/common/evmUtils/src/data/chaindata.ts @@ -13,6 +13,16 @@ export const chainList: EvmChainListDataEntry[] = [ 'https://api.mycryptoapi.com/eth', 'https://cloudflare-eth.com', 'https://ethereum.publicnode.com', + 'wss://ethereum.publicnode.com', + 'https://mainnet.gateway.tenderly.co', + 'wss://mainnet.gateway.tenderly.co', + 'https://rpc.blocknative.com/boost', + 'https://rpc.flashbots.net', + 'https://rpc.flashbots.net/fast', + 'https://rpc.mevblocker.io', + 'https://rpc.mevblocker.io/fast', + 'https://rpc.mevblocker.io/noreverts', + 'https://rpc.mevblocker.io/fullprivacy', ], features: [ { @@ -42,6 +52,18 @@ export const chainList: EvmChainListDataEntry[] = [ url: 'https://etherscan.io', standard: 'EIP3091', }, + { + name: 'blockscout', + url: 'https://eth.blockscout.com', + icon: 'blockscout', + standard: 'EIP3091', + }, + { + name: 'dexguru', + url: 'https://ethereum.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, ], }, { @@ -53,6 +75,9 @@ export const chainList: EvmChainListDataEntry[] = [ 'wss://goerli.infura.io/v3/${INFURA_API_KEY}', 'https://rpc.goerli.mudit.blog/', 'https://ethereum-goerli.publicnode.com', + 'wss://ethereum-goerli.publicnode.com', + 'https://goerli.gateway.tenderly.co', + 'wss://goerli.gateway.tenderly.co', ], faucets: [ 'http://fauceth.komputing.org?chain=5&address=${ADDRESS}', @@ -77,12 +102,24 @@ export const chainList: EvmChainListDataEntry[] = [ url: 'https://goerli.etherscan.io', standard: 'EIP3091', }, + { + name: 'blockscout-goerli', + url: 'https://eth-goerli.blockscout.com', + icon: 'blockscout', + standard: 'EIP3091', + }, ], }, { - name: 'Optimism', + name: 'OP Mainnet', chain: 'ETH', - rpc: ['https://mainnet.optimism.io/'], + rpc: [ + 'https://mainnet.optimism.io', + 'https://optimism.publicnode.com', + 'wss://optimism.publicnode.com', + 'https://optimism.gateway.tenderly.co', + 'wss://optimism.gateway.tenderly.co', + ], faucets: [], nativeCurrency: { name: 'Ether', @@ -99,12 +136,24 @@ export const chainList: EvmChainListDataEntry[] = [ url: 'https://optimistic.etherscan.io', standard: 'EIP3091', }, + { + name: 'blockscout', + url: 'https://optimism.blockscout.com', + icon: 'blockscout', + standard: 'EIP3091', + }, + { + name: 'dexguru', + url: 'https://optimism.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, ], }, { - name: 'Cronos Mainnet Beta', + name: 'Cronos Mainnet', chain: 'CRO', - rpc: ['https://evm.cronos.org', 'https://cronos-evm.publicnode.com'], + rpc: ['https://evm.cronos.org', 'https://cronos-evm.publicnode.com', 'wss://cronos-evm.publicnode.com'], features: [ { name: 'EIP1559', @@ -129,13 +178,13 @@ export const chainList: EvmChainListDataEntry[] = [ ], }, { - name: 'Binance Smart Chain Mainnet', + name: 'BNB Smart Chain Mainnet', chain: 'BSC', rpc: [ - 'https://bsc-dataseed1.binance.org', - 'https://bsc-dataseed2.binance.org', - 'https://bsc-dataseed3.binance.org', - 'https://bsc-dataseed4.binance.org', + 'https://bsc-dataseed1.bnbchain.org', + 'https://bsc-dataseed2.bnbchain.org', + 'https://bsc-dataseed3.bnbchain.org', + 'https://bsc-dataseed4.bnbchain.org', 'https://bsc-dataseed1.defibit.io', 'https://bsc-dataseed2.defibit.io', 'https://bsc-dataseed3.defibit.io', @@ -145,15 +194,16 @@ export const chainList: EvmChainListDataEntry[] = [ 'https://bsc-dataseed3.ninicoin.io', 'https://bsc-dataseed4.ninicoin.io', 'https://bsc.publicnode.com', + 'wss://bsc.publicnode.com', 'wss://bsc-ws-node.nariox.org', ], - faucets: ['https://free-online-app.com/faucet-for-eth-evm-chains/'], + faucets: [], nativeCurrency: { - name: 'Binance Chain Native Token', + name: 'BNB Chain Native Token', symbol: 'BNB', decimals: 18, }, - infoURL: 'https://www.binance.org', + infoURL: 'https://www.bnbchain.org/en', shortName: 'bnb', chainId: 56, networkId: 56, @@ -164,27 +214,34 @@ export const chainList: EvmChainListDataEntry[] = [ url: 'https://bscscan.com', standard: 'EIP3091', }, + { + name: 'dexguru', + url: 'https://bnb.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, ], }, { - name: 'Binance Smart Chain Testnet', + name: 'BNB Smart Chain Testnet', chain: 'BSC', rpc: [ - 'https://data-seed-prebsc-1-s1.binance.org:8545', - 'https://data-seed-prebsc-2-s1.binance.org:8545', - 'https://data-seed-prebsc-1-s2.binance.org:8545', - 'https://data-seed-prebsc-2-s2.binance.org:8545', - 'https://data-seed-prebsc-1-s3.binance.org:8545', - 'https://data-seed-prebsc-2-s3.binance.org:8545', + 'https://data-seed-prebsc-1-s1.bnbchain.org:8545', + 'https://data-seed-prebsc-2-s1.bnbchain.org:8545', + 'https://data-seed-prebsc-1-s2.bnbchain.org:8545', + 'https://data-seed-prebsc-2-s2.bnbchain.org:8545', + 'https://data-seed-prebsc-1-s3.bnbchain.org:8545', + 'https://data-seed-prebsc-2-s3.bnbchain.org:8545', 'https://bsc-testnet.publicnode.com', + 'wss://bsc-testnet.publicnode.com', ], - faucets: ['https://testnet.binance.org/faucet-smart'], + faucets: ['https://testnet.bnbchain.org/faucet-smart'], nativeCurrency: { - name: 'Binance Chain Native Token', + name: 'BNB Chain Native Token', symbol: 'tBNB', decimals: 18, }, - infoURL: 'https://testnet.binance.org/', + infoURL: 'https://www.bnbchain.org/en', shortName: 'bnbt', chainId: 97, networkId: 97, @@ -196,6 +253,59 @@ export const chainList: EvmChainListDataEntry[] = [ }, ], }, + { + name: 'Gnosis', + chain: 'GNO', + icon: 'gnosis', + rpc: [ + 'https://rpc.gnosischain.com', + 'https://rpc.gnosis.gateway.fm', + 'https://rpc.ankr.com/gnosis', + 'https://gnosischain-rpc.gateway.pokt.network', + 'https://gnosis-mainnet.public.blastapi.io', + 'https://gnosis.api.onfinality.io/public', + 'https://gnosis.blockpi.network/v1/rpc/public', + 'https://web3endpoints.com/gnosischain-mainnet', + 'https://gnosis.oat.farm', + 'wss://rpc.gnosischain.com/wss', + 'https://gnosis.publicnode.com', + 'wss://gnosis.publicnode.com', + ], + faucets: [ + 'https://gnosisfaucet.com', + 'https://stakely.io/faucet/gnosis-chain-xdai', + 'https://faucet.prussia.dev/xdai', + ], + nativeCurrency: { + name: 'xDAI', + symbol: 'XDAI', + decimals: 18, + }, + infoURL: 'https://docs.gnosischain.com', + shortName: 'gno', + chainId: 100, + networkId: 100, + slip44: 700, + explorers: [ + { + name: 'gnosisscan', + url: 'https://gnosisscan.io', + standard: 'EIP3091', + }, + { + name: 'blockscout', + url: 'https://gnosis.blockscout.com', + icon: 'blockscout', + standard: 'EIP3091', + }, + { + name: 'dexguru', + url: 'https://gnosis.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, + ], + }, { name: 'Polygon Mainnet', chain: 'Polygon', @@ -208,6 +318,9 @@ export const chainList: EvmChainListDataEntry[] = [ 'https://rpc-mainnet.matic.quiknode.pro', 'https://matic-mainnet-full-rpc.bwarelabs.com', 'https://polygon-bor.publicnode.com', + 'wss://polygon-bor.publicnode.com', + 'https://polygon.gateway.tenderly.co', + 'wss://polygon.gateway.tenderly.co', ], faucets: [], nativeCurrency: { @@ -226,13 +339,19 @@ export const chainList: EvmChainListDataEntry[] = [ url: 'https://polygonscan.com', standard: 'EIP3091', }, + { + name: 'dexguru', + url: 'https://polygon.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, ], }, { name: 'Fantom Opera', chain: 'FTM', - rpc: ['https://rpc.ftm.tools', 'https://fantom.publicnode.com'], - faucets: ['https://free-online-app.com/faucet-for-eth-evm-chains/'], + rpc: ['https://rpc.ftm.tools', 'https://fantom.publicnode.com', 'wss://fantom.publicnode.com'], + faucets: [], nativeCurrency: { name: 'Fantom', symbol: 'FTM', @@ -250,12 +369,22 @@ export const chainList: EvmChainListDataEntry[] = [ icon: 'ftmscan', standard: 'EIP3091', }, + { + name: 'dexguru', + url: 'https://fantom.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, ], }, { name: 'Fantom Testnet', chain: 'FTM', - rpc: ['https://rpc.testnet.fantom.network', 'https://fantom-testnet.publicnode.com'], + rpc: [ + 'https://rpc.testnet.fantom.network', + 'https://fantom-testnet.publicnode.com', + 'wss://fantom-testnet.publicnode.com', + ], faucets: ['https://faucet.fantom.network'], nativeCurrency: { name: 'Fantom', @@ -276,6 +405,42 @@ export const chainList: EvmChainListDataEntry[] = [ }, ], }, + { + name: 'Gnosis Chiado Testnet', + chain: 'GNO', + icon: 'gnosis', + rpc: [ + 'https://rpc.chiadochain.net', + 'https://rpc.chiado.gnosis.gateway.fm', + 'wss://rpc.chiadochain.net/wss', + 'https://gnosis-chiado.publicnode.com', + 'wss://gnosis-chiado.publicnode.com', + ], + faucets: ['https://gnosisfaucet.com'], + nativeCurrency: { + name: 'Chiado xDAI', + symbol: 'XDAI', + decimals: 18, + }, + infoURL: 'https://docs.gnosischain.com', + shortName: 'chi', + chainId: 10200, + networkId: 10200, + explorers: [ + { + name: 'blockscout-chiadochain', + url: 'https://blockscout.chiadochain.net', + icon: 'blockscout', + standard: 'EIP3091', + }, + { + name: 'blockscout', + url: 'https://gnosis-chiado.blockscout.com', + icon: 'blockscout', + standard: 'EIP3091', + }, + ], + }, { name: 'Arbitrum One', chainId: 42161, @@ -291,6 +456,8 @@ export const chainList: EvmChainListDataEntry[] = [ 'https://arbitrum-mainnet.infura.io/v3/${INFURA_API_KEY}', 'https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}', 'https://arb1.arbitrum.io/rpc', + 'https://arbitrum-one.publicnode.com', + 'wss://arbitrum-one.publicnode.com', ], faucets: [], explorers: [ @@ -304,6 +471,12 @@ export const chainList: EvmChainListDataEntry[] = [ url: 'https://explorer.arbitrum.io', standard: 'EIP3091', }, + { + name: 'dexguru', + url: 'https://arbitrum.dex.guru', + icon: 'dexguru', + standard: 'EIP3091', + }, ], infoURL: 'https://arbitrum.io', parent: { @@ -320,7 +493,11 @@ export const chainList: EvmChainListDataEntry[] = [ name: 'Avalanche Fuji Testnet', chain: 'AVAX', icon: 'avax', - rpc: ['https://api.avax-test.network/ext/bc/C/rpc', 'https://avalanche-fuji-c-chain.publicnode.com'], + rpc: [ + 'https://api.avax-test.network/ext/bc/C/rpc', + 'https://avalanche-fuji-c-chain.publicnode.com', + 'wss://avalanche-fuji-c-chain.publicnode.com', + ], faucets: ['https://faucet.avax-test.network/'], nativeCurrency: { name: 'Avalanche', @@ -343,13 +520,17 @@ export const chainList: EvmChainListDataEntry[] = [ name: 'Avalanche C-Chain', chain: 'AVAX', icon: 'avax', - rpc: ['https://api.avax.network/ext/bc/C/rpc', 'https://avalanche-c-chain.publicnode.com'], + rpc: [ + 'https://api.avax.network/ext/bc/C/rpc', + 'https://avalanche-c-chain.publicnode.com', + 'wss://avalanche-c-chain.publicnode.com', + ], features: [ { name: 'EIP1559', }, ], - faucets: ['https://free-online-app.com/faucet-for-eth-evm-chains/'], + faucets: [], nativeCurrency: { name: 'Avalanche', symbol: 'AVAX', @@ -374,10 +555,11 @@ export const chainList: EvmChainListDataEntry[] = [ chain: 'Polygon', icon: 'polygon', rpc: [ - 'https://matic-mumbai.chainstacklabs.com', 'https://rpc-mumbai.maticvigil.com', - 'https://matic-testnet-archive-rpc.bwarelabs.com', 'https://polygon-mumbai-bor.publicnode.com', + 'wss://polygon-mumbai-bor.publicnode.com', + 'https://polygon-mumbai.gateway.tenderly.co', + 'wss://polygon-mumbai.gateway.tenderly.co', ], faucets: ['https://faucet.polygon.technology/'], nativeCurrency: { @@ -397,6 +579,29 @@ export const chainList: EvmChainListDataEntry[] = [ }, ], }, + { + name: 'IVAR Chain Mainnet', + chain: 'IVAR', + icon: 'ivar', + rpc: ['https://mainnet-rpc.ivarex.com'], + faucets: ['https://faucet.ivarex.com/'], + nativeCurrency: { + name: 'Ivar', + symbol: 'IVAR', + decimals: 18, + }, + infoURL: 'https://ivarex.com', + shortName: 'ivar', + chainId: 88888, + networkId: 88888, + explorers: [ + { + name: 'ivarscan', + url: 'https://ivarscan.com', + standard: 'EIP3091', + }, + ], + }, { name: 'Arbitrum Goerli', title: 'Arbitrum Goerli Rollup Testnet', @@ -409,13 +614,17 @@ export const chainList: EvmChainListDataEntry[] = [ symbol: 'AGOR', decimals: 18, }, - rpc: ['https://goerli-rollup.arbitrum.io/rpc/'], + rpc: [ + 'https://goerli-rollup.arbitrum.io/rpc', + 'https://arbitrum-goerli.publicnode.com', + 'wss://arbitrum-goerli.publicnode.com', + ], faucets: [], infoURL: 'https://arbitrum.io/', explorers: [ { - name: 'Arbitrum Goerli Rollup Explorer', - url: 'https://goerli-rollup-explorer.arbitrum.io', + name: 'Arbitrum Goerli Arbiscan', + url: 'https://goerli.arbiscan.io', standard: 'EIP3091', }, ], @@ -433,7 +642,18 @@ export const chainList: EvmChainListDataEntry[] = [ name: 'Sepolia', title: 'Ethereum Testnet Sepolia', chain: 'ETH', - rpc: ['https://rpc.sepolia.org', 'https://rpc2.sepolia.org', 'https://rpc-sepolia.rockx.com'], + rpc: [ + 'https://rpc.sepolia.org', + 'https://rpc2.sepolia.org', + 'https://rpc-sepolia.rockx.com', + 'https://rpc.sepolia.ethpandaops.io', + 'https://sepolia.infura.io/v3/${INFURA_API_KEY}', + 'wss://sepolia.infura.io/v3/${INFURA_API_KEY}', + 'https://sepolia.gateway.tenderly.co', + 'wss://sepolia.gateway.tenderly.co', + 'https://ethereum-sepolia.publicnode.com', + 'wss://ethereum-sepolia.publicnode.com', + ], faucets: ['http://fauceth.komputing.org?chain=11155111&address=${ADDRESS}'], nativeCurrency: { name: 'Sepolia Ether', diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts index b8c6b63aba..6243758a18 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts @@ -115,11 +115,15 @@ describe('EvmChain', () => { expect(EvmChain.ARBITRUM_TESTNET.apiHex).toBe('0x66eed'); expect(EvmChain.OPTIMISM.apiHex).toBe('0xa'); expect(EvmChain.PALM.apiHex).toBe('0x2a15c308d'); + expect(EvmChain.CHILIZ.apiHex).toBe('0x15b38'); + expect(EvmChain.CHILIZ_TESTNET.apiHex).toBe('0x15b32'); + expect(EvmChain.GNOSIS.apiHex).toBe('0x64'); + expect(EvmChain.GNOSIS_TESTNET.apiHex).toBe('0x27d8'); }); describe('metadata', () => { - // We skip RONIN because the source dataset doesn't have it. - const supportedChains = EvmChain.values().filter((chain) => chain.apiHex !== '0x7e4'); + const notSupportedChains = ['0x7e4', '0x15b32']; + const supportedChains = EvmChain.values().filter((chain) => !notSupportedChains.includes(chain.apiHex)); for (const chain of supportedChains) { it(`returns metadata for ${chain.apiHex}`, () => { @@ -138,13 +142,8 @@ describe('EvmChain', () => { const chain = EvmChain.create('0x1'); expect(chain.name).toBe('Ethereum Mainnet'); - expect(chain.rpcUrls).toStrictEqual([ - 'https://mainnet.infura.io/v3/${INFURA_API_KEY}', - 'wss://mainnet.infura.io/ws/v3/${INFURA_API_KEY}', - 'https://api.mycryptoapi.com/eth', - 'https://cloudflare-eth.com', - 'https://ethereum.publicnode.com', - ]); + expect(chain.rpcUrls).toContain('https://ethereum.publicnode.com'); + expect(chain.rpcUrls).toContain('https://api.mycryptoapi.com/eth'); expect(chain.currency).toStrictEqual({ decimals: 18, name: 'Ether', diff --git a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts index 961283b06e..9f7d2d2ddc 100644 --- a/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts +++ b/packages/common/evmUtils/src/dataTypes/EvmChain/EvmChain.ts @@ -172,6 +172,42 @@ export class EvmChain implements EvmChainable { return EvmChain.create(10); } + /** + * Returns CHILIZ chain + * + * @example EvmChain.CHILIZ + */ + public static get CHILIZ() { + return EvmChain.create(88888); + } + + /** + * Returns CHILIZ_TESTNET chain + * + * @example EvmChain.CHILIZ_TESTNET + */ + public static get CHILIZ_TESTNET() { + return EvmChain.create(88882); + } + + /** + * Returns GNOSIS chain + * + * @example EvmChain.GNOSIS + */ + public static get GNOSIS() { + return EvmChain.create(100); + } + + /** + * Returns GNOSIS_TESTNET chain + * + * @example EvmChain.GNOSIS_TESTNET + */ + public static get GNOSIS_TESTNET() { + return EvmChain.create(10200); + } + /** * Create a new instance of EvmChain from any valid address input. * @@ -244,6 +280,10 @@ export class EvmChain implements EvmChainable { EvmChain.ARBITRUM_TESTNET, EvmChain.RONIN, EvmChain.OPTIMISM, + EvmChain.CHILIZ, + EvmChain.CHILIZ_TESTNET, + EvmChain.GNOSIS, + EvmChain.GNOSIS_TESTNET, ]; } @@ -347,7 +387,11 @@ export class EvmChain implements EvmChainable { | '0xa4b1' | '0x7e4' | '0x66eed' - | '0xa'; + | '0xa' + | '0x15b38' + | '0x15b32' + | '0x64' + | '0x27d8'; } /**