From 96d7216939c814bcabac02793adc61e62c074af9 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Fri, 19 Apr 2024 10:15:15 +0100 Subject: [PATCH] feat: added new base chain --- src/config/chains.json | 13 ++++++++ src/config/envs.json | 42 +++++++++++++++++++++++-- src/constants/chains.ts | 1 + src/constants/networkCodes.ts | 2 +- src/constants/uppercasedNetworkCodes.ts | 2 +- src/types.ts | 3 +- 6 files changed, 57 insertions(+), 6 deletions(-) diff --git a/src/config/chains.json b/src/config/chains.json index 9d21aae..3fecfd8 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -232,5 +232,18 @@ "WETH": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", "curveRegistry": "" } + }, + "8453": { + "chainId": "8453", + "label": "Base", + "shortName": "BASE", + "code": "base", + "baseCurrencyName": "ETH", + "rpc": "https://mainnet.base.org/", + "explorer": "https://basescan.org/", + "contracts": { + "WETH": "0x4200000000000000000000000000000000000006", + "curveRegistry": "" + } } } diff --git a/src/config/envs.json b/src/config/envs.json index a6c3988..12e87f9 100644 --- a/src/config/envs.json +++ b/src/config/envs.json @@ -182,6 +182,24 @@ "http": "/orion-indexer/" } } + }, + "8453": { + "api": "https://trade.orion.xyz/base-mainnet", + "services": { + "aggregator": { + "http": "/backend", + "ws": "/v1" + }, + "blockchain": { + "http": "" + }, + "priceFeed": { + "all": "/price-feed" + }, + "indexer": { + "http": "/orion-indexer/" + } + } } } }, @@ -429,7 +447,7 @@ } }, "2525": { - "api": "https://trade.orion.xyz/inevm-mainnet", + "api": "https://staging.orion.xyz/inevm-mainnet", "services": { "aggregator": { "http": "/backend", @@ -447,7 +465,7 @@ } }, "59144": { - "api": "https://trade.orion.xyz/linea-mainnet", + "api": "https://staging.orion.xyz/linea-mainnet", "services": { "aggregator": { "http": "/backend", @@ -465,7 +483,25 @@ } }, "43114": { - "api": "https://trade.orion.xyz/avalanche-c-chain", + "api": "https://staging.orion.xyz/avalanche-c-chain", + "services": { + "aggregator": { + "http": "/backend", + "ws": "/v1" + }, + "blockchain": { + "http": "" + }, + "priceFeed": { + "all": "/price-feed" + }, + "indexer": { + "http": "/orion-indexer/" + } + } + }, + "8453": { + "api": "https://staging.orion.xyz/base-mainnet", "services": { "aggregator": { "http": "/backend", diff --git a/src/constants/chains.ts b/src/constants/chains.ts index aac8213..1fb8ff3 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -20,4 +20,5 @@ export const productionChains = [ SupportedChainId.INEVM, SupportedChainId.LINEA, SupportedChainId.AVAX, + SupportedChainId.BASE, ]; diff --git a/src/constants/networkCodes.ts b/src/constants/networkCodes.ts index c3a5dad..498e149 100644 --- a/src/constants/networkCodes.ts +++ b/src/constants/networkCodes.ts @@ -1 +1 @@ -export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb', 'inevm', 'linea', 'avax'] as const; +export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb', 'inevm', 'linea', 'avax', 'base'] as const; diff --git a/src/constants/uppercasedNetworkCodes.ts b/src/constants/uppercasedNetworkCodes.ts index 6b8e312..e69605f 100644 --- a/src/constants/uppercasedNetworkCodes.ts +++ b/src/constants/uppercasedNetworkCodes.ts @@ -1 +1 @@ -export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'OPBNB', 'INEVM', 'LINEA', 'AVAX'] as const; +export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'OPBNB', 'INEVM', 'LINEA', 'AVAX', 'BASE'] as const; diff --git a/src/types.ts b/src/types.ts index 5828296..eacf494 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,7 +3,7 @@ import type factories from './constants/factories.js'; import type { BigNumber } from 'bignumber.js'; import type subOrderStatuses from './constants/subOrderStatuses.js'; import type positionStatuses from './constants/positionStatuses.js'; -import type { knownEnvs } from './config/schemas/index.js'; +import type { knownEnvs } from './config/schemas'; import type getHistory from './Orion/bridge/getHistory.js'; export type DeepPartial = T extends object ? { @@ -91,6 +91,7 @@ export enum SupportedChainId { INEVM = '2525', LINEA = '59144', AVAX = '43114', + BASE = '8453', POLYGON_TESTNET = '80001', FANTOM_TESTNET = '4002',