mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
actualize testnet chains (#260)
This commit is contained in:
@@ -81,7 +81,7 @@ describe('Orion', () => {
|
|||||||
test('Init Orion testing', () => {
|
test('Init Orion testing', () => {
|
||||||
const orion = new Orion('testing');
|
const orion = new Orion('testing');
|
||||||
expect(orion.referralSystem).toBeInstanceOf(ReferralSystem);
|
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];
|
const unitBSC = orion.units[SupportedChainId.BSC_TESTNET];
|
||||||
expect(unitBSC?.chainId).toBe(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(orion.getSiblingsOf(SupportedChainId.BSC_TESTNET)).toHaveLength(3);
|
||||||
expect(unitBSC?.networkCode).toBe('bsc');
|
expect(unitBSC?.networkCode).toBe('bsc');
|
||||||
|
|
||||||
const unitRopsten = orion.units[SupportedChainId.ROPSTEN]
|
const unitSepolia = orion.units[SupportedChainId.SEPOLIA]
|
||||||
expect(unitRopsten?.chainId).toBe(SupportedChainId.ROPSTEN);
|
expect(unitSepolia?.chainId).toBe(SupportedChainId.SEPOLIA);
|
||||||
// expect(unitRopsten?.env).toBe('testing');
|
// expect(unitRopsten?.env).toBe('testing');
|
||||||
expect(orion.getSiblingsOf(SupportedChainId.ROPSTEN)).toHaveLength(3);
|
expect(orion.getSiblingsOf(SupportedChainId.SEPOLIA)).toHaveLength(3);
|
||||||
expect(unitRopsten?.networkCode).toBe('eth');
|
expect(unitSepolia?.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');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Init Orion production', () => {
|
test('Init Orion production', () => {
|
||||||
|
|||||||
@@ -51,32 +51,6 @@
|
|||||||
"curveRegistry": ""
|
"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": {
|
"11155111": {
|
||||||
"chainId": "11155111",
|
"chainId": "11155111",
|
||||||
"explorer": "https://sepolia.etherscan.io/",
|
"explorer": "https://sepolia.etherscan.io/",
|
||||||
@@ -90,19 +64,6 @@
|
|||||||
"curveRegistry": ""
|
"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": {
|
"42161": {
|
||||||
"chainId": "42161",
|
"chainId": "42161",
|
||||||
"explorer": "https://arbiscan.io/",
|
"explorer": "https://arbiscan.io/",
|
||||||
@@ -116,19 +77,6 @@
|
|||||||
"curveRegistry": "0x445FE580eF8d70FF569aB36e80c647af338db351"
|
"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": {
|
"250": {
|
||||||
"chainId": "250",
|
"chainId": "250",
|
||||||
"explorer": "https://ftmscan.com/",
|
"explorer": "https://ftmscan.com/",
|
||||||
@@ -155,19 +103,6 @@
|
|||||||
"curveRegistry": "0x094d12e5b541784701FD8d65F11fc0598FBC6332"
|
"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": {
|
"66": {
|
||||||
"chainId": "66",
|
"chainId": "66",
|
||||||
"explorer": "https://www.oklink.com/okc/",
|
"explorer": "https://www.oklink.com/okc/",
|
||||||
@@ -181,32 +116,6 @@
|
|||||||
"curveRegistry": ""
|
"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": {
|
"2525": {
|
||||||
"chainId": "2525",
|
"chainId": "2525",
|
||||||
"label": "inEVM",
|
"label": "inEVM",
|
||||||
|
|||||||
@@ -244,78 +244,6 @@
|
|||||||
"http": "/orion-indexer/"
|
"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/"
|
"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/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,13 +2,7 @@ import { SupportedChainId } from '../types.js';
|
|||||||
|
|
||||||
export const developmentChains = [
|
export const developmentChains = [
|
||||||
SupportedChainId.BSC_TESTNET,
|
SupportedChainId.BSC_TESTNET,
|
||||||
SupportedChainId.ROPSTEN,
|
|
||||||
SupportedChainId.GOERLI,
|
|
||||||
SupportedChainId.SEPOLIA,
|
SupportedChainId.SEPOLIA,
|
||||||
SupportedChainId.ARBITRUM_GOERLI,
|
|
||||||
SupportedChainId.FANTOM_TESTNET,
|
|
||||||
SupportedChainId.POLYGON_TESTNET,
|
|
||||||
SupportedChainId.OKC_TESTNET,
|
|
||||||
];
|
];
|
||||||
export const productionChains = [
|
export const productionChains = [
|
||||||
SupportedChainId.MAINNET,
|
SupportedChainId.MAINNET,
|
||||||
|
|||||||
57
src/types.ts
57
src/types.ts
@@ -82,26 +82,19 @@ export type Pair = {
|
|||||||
|
|
||||||
export enum SupportedChainId {
|
export enum SupportedChainId {
|
||||||
MAINNET = '1',
|
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',
|
BSC = '56',
|
||||||
|
OKC = '66',
|
||||||
|
POLYGON = '137',
|
||||||
|
OPBNB = '204',
|
||||||
|
FANTOM_OPERA = '250',
|
||||||
|
INEVM = '2525',
|
||||||
|
BASE = '8453',
|
||||||
|
ARBITRUM = '42161',
|
||||||
|
AVAX = '43114',
|
||||||
|
LINEA = '59144',
|
||||||
|
|
||||||
BSC_TESTNET = '97',
|
BSC_TESTNET = '97',
|
||||||
OKC_TESTNET = '65',
|
SEPOLIA = '11155111',
|
||||||
DRIP_TESTNET = '56303',
|
|
||||||
ARBITRUM_GOERLI = '421613',
|
|
||||||
|
|
||||||
// For testing and debug purpose
|
// For testing and debug purpose
|
||||||
// BROKEN = '0',
|
// BROKEN = '0',
|
||||||
@@ -291,22 +284,22 @@ export type EnvConfig = {
|
|||||||
referralAPI: string
|
referralAPI: string
|
||||||
frontageAPI: string
|
frontageAPI: string
|
||||||
networks: Partial<
|
networks: Partial<
|
||||||
Record<
|
Record<
|
||||||
SupportedChainId,
|
SupportedChainId,
|
||||||
VerboseUnitConfig
|
VerboseUnitConfig
|
||||||
|
>
|
||||||
>
|
>
|
||||||
>
|
|
||||||
}
|
}
|
||||||
export type AggregatedAssets = Partial<
|
export type AggregatedAssets = Partial<
|
||||||
Record<
|
Record<
|
||||||
string,
|
string,
|
||||||
Partial<
|
Partial<
|
||||||
Record<SupportedChainId, {
|
Record<SupportedChainId, {
|
||||||
address: string
|
address: string
|
||||||
}>
|
}>
|
||||||
|
>
|
||||||
>
|
>
|
||||||
>
|
>;
|
||||||
>;
|
|
||||||
|
|
||||||
export type RedeemOrder = {
|
export type RedeemOrder = {
|
||||||
sender: string
|
sender: string
|
||||||
@@ -446,9 +439,9 @@ type BridgeHistory = Awaited<ReturnType<typeof getHistory>>;
|
|||||||
type BridgeHistoryItem = NonNullable<BridgeHistory[string]>;
|
type BridgeHistoryItem = NonNullable<BridgeHistory[string]>;
|
||||||
|
|
||||||
export type AtomicSwap = Partial<
|
export type AtomicSwap = Partial<
|
||||||
Omit<BridgeHistoryItem, 'creationDate' | 'expiration' | 'secret'>
|
Omit<BridgeHistoryItem, 'creationDate' | 'expiration' | 'secret'>
|
||||||
> & Partial<
|
> & Partial<
|
||||||
Omit<AtomicSwapLocal, 'creationDate' | 'expiration' | 'secret'>
|
Omit<AtomicSwapLocal, 'creationDate' | 'expiration' | 'secret'>
|
||||||
> & {
|
> & {
|
||||||
sourceChainId: SupportedChainId
|
sourceChainId: SupportedChainId
|
||||||
targetChainId: SupportedChainId
|
targetChainId: SupportedChainId
|
||||||
|
|||||||
Reference in New Issue
Block a user