From 93dc28805523d310b46c776dabeb7934f255dcf1 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 11 Jan 2024 12:55:32 +0000 Subject: [PATCH 1/3] feat: added new networks Arbitrum and opBNB --- src/config/chains.json | 25 ++++++++++++++++++++++++ src/config/envs.json | 36 +++++++++++++++++++++++++++++++++++ src/constants/chains.ts | 2 ++ src/constants/networkCodes.ts | 2 +- src/types.ts | 4 +++- 5 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/config/chains.json b/src/config/chains.json index 4fad92a..968c971 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -38,6 +38,18 @@ "curveRegistry": "0x93461072c00b2740c474a3d52c70be6249c802d8" } }, + "204": { + "chainId": "204", + "explorer": "http://opbnbscan.com/", + "label": "opBNB Chain", + "shortName": "opBNB", + "code": "opbnb", + "rpc": "https://opbnb-mainnet-rpc.bnbchain.org", + "baseCurrencyName": "BNB", + "contracts": { + "WETH": "0x4200000000000000000000000000000000000006", + } + }, "3": { "chainId": "3", "explorer": "https://ropsten.etherscan.io/", @@ -77,6 +89,19 @@ "curveRegistry": "" } }, + "42161": { + "chainId": "42161", + "explorer": "https://arbiscan.io/", + "label": "Arbitrum", + "shortName": "Arbitrum", + "code": "arb", + "rpc": "https://arb1.arbitrum.io/rpc", + "baseCurrencyName": "ARB", + "contracts": { + "WETH": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", + "curveRegistiry": "0x445FE580eF8d70FF569aB36e80c647af338db351", + } + }, "4002": { "chainId": "4002", "explorer": "https://testnet.ftmscan.com/", diff --git a/src/config/envs.json b/src/config/envs.json index be254cf..8672516 100644 --- a/src/config/envs.json +++ b/src/config/envs.json @@ -93,6 +93,42 @@ "http": "/orion-indexer/" } } + }, + "42161": { + "api": "https://trade.orion.xyz/arbitrum-mainnet", + "services": { + "aggregator": { + "http": "/backend", + "ws": "/v1" + }, + "blockchain": { + "http": "" + }, + "priceFeed": { + "all": "/price-feed" + }, + "indexer": { + "http": "/orion-indexer/" + } + } + }, + "204": { + "api": "https://trade.orion.xyz/opbnb-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 790a42d..74135ed 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -15,4 +15,6 @@ export const productionChains = [ SupportedChainId.FANTOM_OPERA, SupportedChainId.POLYGON, SupportedChainId.OKC, + SupportedChainId.ARBITRUM, + SupportedChainId.OPBNB, ]; diff --git a/src/constants/networkCodes.ts b/src/constants/networkCodes.ts index 75fe8ee..d04ac04 100644 --- a/src/constants/networkCodes.ts +++ b/src/constants/networkCodes.ts @@ -1 +1 @@ -export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip'] as const; +export default ['ftm', 'bsc', 'eth', 'polygon', 'okc', 'arb', 'drip', 'opbnb'] as const; diff --git a/src/types.ts b/src/types.ts index 7511476..4685276 100644 --- a/src/types.ts +++ b/src/types.ts @@ -83,10 +83,11 @@ export enum SupportedChainId { MAINNET = '1', ROPSTEN = '3', GOERLI = '5', - ARBITRUM_GOERLI = '421613', + ARBITRUM = '42161', FANTOM_OPERA = '250', POLYGON = '137', OKC = '66', + OPBNB = '204', POLYGON_TESTNET = '80001', FANTOM_TESTNET = '4002', @@ -94,6 +95,7 @@ export enum SupportedChainId { BSC_TESTNET = '97', OKC_TESTNET = '65', DRIP_TESTNET = '56303', + ARBITRUM_GOERLI = '421613', // For testing and debug purpose // BROKEN = '0', From 59f8356da11bbd5172484e0d9bea445346ba31a4 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 11 Jan 2024 12:56:11 +0000 Subject: [PATCH 2/3] feat: update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 90d430e..363a5af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.20.42", + "version": "0.20.43-rc0", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", From ad669fd3a608f73cf271090b71af3b560613e688 Mon Sep 17 00:00:00 2001 From: Mikhail Gladchenko Date: Thu, 11 Jan 2024 13:08:55 +0000 Subject: [PATCH 3/3] bug: fixed build fail --- src/config/chains.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/chains.json b/src/config/chains.json index 968c971..ea887a8 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -47,7 +47,7 @@ "rpc": "https://opbnb-mainnet-rpc.bnbchain.org", "baseCurrencyName": "BNB", "contracts": { - "WETH": "0x4200000000000000000000000000000000000006", + "WETH": "0x4200000000000000000000000000000000000006" } }, "3": { @@ -99,7 +99,7 @@ "baseCurrencyName": "ARB", "contracts": { "WETH": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", - "curveRegistiry": "0x445FE580eF8d70FF569aB36e80c647af338db351", + "curveRegistiry": "0x445FE580eF8d70FF569aB36e80c647af338db351" } }, "4002": {