From a6d40294647ce14ba2df30159d85673673b8e739 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Mon, 25 Mar 2024 08:34:12 +0000 Subject: [PATCH] feat: added new AVAX network --- src/config/chains.json | 13 +++++++++ src/config/envs.json | 36 +++++++++++++++++++++++++ src/constants/chains.ts | 1 + src/constants/networkCodes.ts | 2 +- src/constants/uppercasedNetworkCodes.ts | 2 +- src/types.ts | 1 + 6 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/config/chains.json b/src/config/chains.json index bed5a5d..9d21aae 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -219,5 +219,18 @@ "WETH": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", "curveRegistry": "" } + }, + "43114": { + "chainId": "43114", + "label": "Avalanche Network", + "shortName": "Avax", + "code": "avax", + "baseCurrencyName": "AVAX", + "rpc": "https://api.avax.network/ext/bc/C/rpc/", + "explorer": "https://snowtrace.io/", + "contracts": { + "WETH": "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7", + "curveRegistry": "" + } } } diff --git a/src/config/envs.json b/src/config/envs.json index 6628b38..0dddc93 100644 --- a/src/config/envs.json +++ b/src/config/envs.json @@ -164,6 +164,24 @@ "http": "/orion-indexer/" } } + }, + "43114": { + "api": "https://trade.orion.xyz/avax-mainnet", + "services": { + "aggregator": { + "http": "/backend", + "ws": "/v1" + }, + "blockchain": { + "http": "" + }, + "priceFeed": { + "all": "/price-feed" + }, + "indexer": { + "http": "/orion-indexer/" + } + } } } }, @@ -445,6 +463,24 @@ "http": "/orion-indexer/" } } + }, + "43114": { + "api": "https://trade.orion.xyz/avax-mainnet", + "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 0e0b025..aac8213 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -19,4 +19,5 @@ export const productionChains = [ SupportedChainId.OPBNB, SupportedChainId.INEVM, SupportedChainId.LINEA, + SupportedChainId.AVAX, ]; diff --git a/src/constants/networkCodes.ts b/src/constants/networkCodes.ts index 74b0d0f..c3a5dad 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'] as const; +export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb', 'inevm', 'linea', 'avax'] as const; diff --git a/src/constants/uppercasedNetworkCodes.ts b/src/constants/uppercasedNetworkCodes.ts index f3c9515..6b8e312 100644 --- a/src/constants/uppercasedNetworkCodes.ts +++ b/src/constants/uppercasedNetworkCodes.ts @@ -1 +1 @@ -export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'OPBNB', 'INEVM', 'LINEA'] as const; +export default ['FTM', 'BSC', 'ETH', 'POLYGON', 'OKC', 'ARB', 'OPBNB', 'INEVM', 'LINEA', 'AVAX'] as const; diff --git a/src/types.ts b/src/types.ts index 0f1bbb3..5828296 100644 --- a/src/types.ts +++ b/src/types.ts @@ -90,6 +90,7 @@ export enum SupportedChainId { OPBNB = '204', INEVM = '2525', LINEA = '59144', + AVAX = '43114', POLYGON_TESTNET = '80001', FANTOM_TESTNET = '4002',