From f8b52aaa02e259c5e83f8e4b6adfa2bed1dbd25d Mon Sep 17 00:00:00 2001 From: Dmitry <35160421+TheJuze@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:14:52 +0300 Subject: [PATCH] actualize testnet chains (#260) --- src/__tests__/basic.test.ts | 22 ++------- src/config/chains.json | 91 ------------------------------------- src/config/envs.json | 90 ------------------------------------ src/constants/chains.ts | 6 --- src/types.ts | 57 ++++++++++------------- 5 files changed, 30 insertions(+), 236 deletions(-) diff --git a/src/__tests__/basic.test.ts b/src/__tests__/basic.test.ts index d4de381..76fb063 100644 --- a/src/__tests__/basic.test.ts +++ b/src/__tests__/basic.test.ts @@ -81,7 +81,7 @@ describe('Orion', () => { test('Init Orion testing', () => { const orion = new Orion('testing'); expect(orion.referralSystem).toBeInstanceOf(ReferralSystem); - expect(orion.unitsArray.length).toBe(4); // eth, bsc, polygon, fantom + expect(orion.unitsArray.length).toBe(2); // eth, bsc const unitBSC = orion.units[SupportedChainId.BSC_TESTNET]; expect(unitBSC?.chainId).toBe(SupportedChainId.BSC_TESTNET); @@ -89,23 +89,11 @@ describe('Orion', () => { expect(orion.getSiblingsOf(SupportedChainId.BSC_TESTNET)).toHaveLength(3); expect(unitBSC?.networkCode).toBe('bsc'); - const unitRopsten = orion.units[SupportedChainId.ROPSTEN] - expect(unitRopsten?.chainId).toBe(SupportedChainId.ROPSTEN); + const unitSepolia = orion.units[SupportedChainId.SEPOLIA] + expect(unitSepolia?.chainId).toBe(SupportedChainId.SEPOLIA); // expect(unitRopsten?.env).toBe('testing'); - expect(orion.getSiblingsOf(SupportedChainId.ROPSTEN)).toHaveLength(3); - expect(unitRopsten?.networkCode).toBe('eth'); - - const unitPolygon = orion.units[SupportedChainId.POLYGON_TESTNET]; - expect(unitPolygon?.chainId).toBe(SupportedChainId.POLYGON_TESTNET); - // expect(unitPolygon?.env).toBe('testing'); - expect(orion.getSiblingsOf(SupportedChainId.POLYGON_TESTNET)).toHaveLength(3); - expect(unitPolygon?.networkCode).toBe('polygon'); - - const unitFantom = orion.units[SupportedChainId.FANTOM_TESTNET]; - expect(unitFantom?.chainId).toBe(SupportedChainId.FANTOM_TESTNET); - // expect(unitFantom?.env).toBe('testing'); - expect(orion.getSiblingsOf(SupportedChainId.FANTOM_TESTNET)).toHaveLength(3); - expect(unitFantom?.networkCode).toBe('ftm'); + expect(orion.getSiblingsOf(SupportedChainId.SEPOLIA)).toHaveLength(3); + expect(unitSepolia?.networkCode).toBe('eth'); }); test('Init Orion production', () => { diff --git a/src/config/chains.json b/src/config/chains.json index 3607a21..4afb939 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -51,32 +51,6 @@ "curveRegistry": "" } }, - "3": { - "chainId": "3", - "explorer": "https://ropsten.etherscan.io/", - "label": "Ropsten", - "shortName": "ETH-Ropsten", - "code": "eth", - "rpc": "https://testing.orion.xyz/eth-ropsten/rpc", - "baseCurrencyName": "ETH", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, - "5": { - "chainId": "5", - "explorer": "https://goerli.etherscan.io/", - "label": "Goerli", - "shortName": "ETH-Goerli", - "code": "eth", - "rpc": "https://testing.orion.xyz/eth-goerli/rpc", - "baseCurrencyName": "ETH", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "11155111": { "chainId": "11155111", "explorer": "https://sepolia.etherscan.io/", @@ -90,19 +64,6 @@ "curveRegistry": "" } }, - "421613": { - "chainId": "421613", - "explorer": "https://goerli.arbiscan.io/", - "label": "Arbitrum Goerli", - "shortName": "Arbitrum Goerli", - "code": "arb", - "rpc": "https://goerli-rollup.arbitrum.io/rpc", - "baseCurrencyName": "ETH", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "42161": { "chainId": "42161", "explorer": "https://arbiscan.io/", @@ -116,19 +77,6 @@ "curveRegistry": "0x445FE580eF8d70FF569aB36e80c647af338db351" } }, - "4002": { - "chainId": "4002", - "explorer": "https://testnet.ftmscan.com/", - "label": "Fantom Testnet", - "shortName": "FTM-Testnet", - "code": "ftm", - "rpc": "https://rpc.testnet.fantom.network/", - "baseCurrencyName": "FTM", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "250": { "chainId": "250", "explorer": "https://ftmscan.com/", @@ -155,19 +103,6 @@ "curveRegistry": "0x094d12e5b541784701FD8d65F11fc0598FBC6332" } }, - "80001": { - "chainId": "80001", - "label": "Polygon Mumbai", - "shortName": "Polygon Mumbai", - "code": "polygon", - "baseCurrencyName": "MATIC", - "rpc": "https://rpc.ankr.com/polygon_mumbai", - "explorer": "https://mumbai.polygonscan.com/", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "66": { "chainId": "66", "explorer": "https://www.oklink.com/okc/", @@ -181,32 +116,6 @@ "curveRegistry": "" } }, - "65": { - "chainId": "65", - "explorer": "https://www.oklink.com/okc-test/", - "label": "OKC Testnet", - "shortName": "OKC-Testnet", - "code": "okc", - "rpc": "https://exchaintestrpc.okex.org/", - "baseCurrencyName": "OKT", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, - "56303": { - "chainId": "56303", - "label": "DRIP Chain", - "shortName": "DRIP Chain", - "code": "drip", - "baseCurrencyName": "DRIP", - "rpc": "https://testnet.1d.rip/", - "explorer": "https://explorer-testnet.1d.rip/", - "contracts": { - "WETH": "", - "curveRegistry": "" - } - }, "2525": { "chainId": "2525", "label": "inEVM", diff --git a/src/config/envs.json b/src/config/envs.json index adaf1ce..445649e 100644 --- a/src/config/envs.json +++ b/src/config/envs.json @@ -244,78 +244,6 @@ "http": "/orion-indexer/" } } - }, - "421613": { - "api": "https://testing.orion.xyz/arbitrum-goerli", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } - }, - "4002": { - "api": "https://testing.orion.xyz/ftm-testnet", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } - }, - "80001": { - "api": "https://testing.orion.xyz/polygon-mumbai", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } - }, - "56303": { - "api": "https://testing.orion.xyz/drip-testnet", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } } } }, @@ -544,24 +472,6 @@ "http": "/orion-indexer/" } } - }, - "3": { - "api": "https://dn-dev.orion.xyz/eth-ropsten", - "services": { - "aggregator": { - "http": "/backend", - "ws": "/v1" - }, - "blockchain": { - "http": "" - }, - "priceFeed": { - "all": "/price-feed" - }, - "indexer": { - "http": "/orion-indexer/" - } - } } } }, diff --git a/src/constants/chains.ts b/src/constants/chains.ts index df0bd2f..621b947 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -2,13 +2,7 @@ import { SupportedChainId } from '../types.js'; export const developmentChains = [ SupportedChainId.BSC_TESTNET, - SupportedChainId.ROPSTEN, - SupportedChainId.GOERLI, SupportedChainId.SEPOLIA, - SupportedChainId.ARBITRUM_GOERLI, - SupportedChainId.FANTOM_TESTNET, - SupportedChainId.POLYGON_TESTNET, - SupportedChainId.OKC_TESTNET, ]; export const productionChains = [ SupportedChainId.MAINNET, diff --git a/src/types.ts b/src/types.ts index c02bc8f..72ec8dc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -82,26 +82,19 @@ export type Pair = { export enum SupportedChainId { MAINNET = '1', - ARBITRUM = '42161', - FANTOM_OPERA = '250', - POLYGON = '137', - OKC = '66', - OPBNB = '204', - INEVM = '2525', - LINEA = '59144', - AVAX = '43114', - BASE = '8453', - - ROPSTEN = '3', - GOERLI = '5', - SEPOLIA = '11155111', - POLYGON_TESTNET = '80001', - FANTOM_TESTNET = '4002', BSC = '56', + OKC = '66', + POLYGON = '137', + OPBNB = '204', + FANTOM_OPERA = '250', + INEVM = '2525', + BASE = '8453', + ARBITRUM = '42161', + AVAX = '43114', + LINEA = '59144', + BSC_TESTNET = '97', - OKC_TESTNET = '65', - DRIP_TESTNET = '56303', - ARBITRUM_GOERLI = '421613', + SEPOLIA = '11155111', // For testing and debug purpose // BROKEN = '0', @@ -291,22 +284,22 @@ export type EnvConfig = { referralAPI: string frontageAPI: string networks: Partial< - Record< - SupportedChainId, - VerboseUnitConfig + Record< + SupportedChainId, + VerboseUnitConfig + > > - > } export type AggregatedAssets = Partial< - Record< - string, - Partial< - Record + Record< + string, + Partial< + Record + > > - > - >; +>; export type RedeemOrder = { sender: string @@ -446,9 +439,9 @@ type BridgeHistory = Awaited>; type BridgeHistoryItem = NonNullable; export type AtomicSwap = Partial< - Omit + Omit > & Partial< - Omit + Omit > & { sourceChainId: SupportedChainId targetChainId: SupportedChainId