From bc82b6ecd70fa9d403a0c178af37f5cb53e4f645 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Wed, 22 Nov 2023 11:23:29 +0700 Subject: [PATCH 1/3] add constant list chain id --- packages/oraidex-common/package.json | 2 +- packages/oraidex-common/src/constant.ts | 26 ++++++++++++++----------- packages/oraidex-common/src/network.ts | 1 + 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/oraidex-common/package.json b/packages/oraidex-common/package.json index 304baec0..bf95fbd4 100644 --- a/packages/oraidex-common/package.json +++ b/packages/oraidex-common/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/oraidex-common", - "version": "1.0.37", + "version": "1.0.38", "main": "build/index.js", "files": [ "build/" diff --git a/packages/oraidex-common/src/constant.ts b/packages/oraidex-common/src/constant.ts index 54698270..aec62b47 100644 --- a/packages/oraidex-common/src/constant.ts +++ b/packages/oraidex-common/src/constant.ts @@ -1,4 +1,4 @@ -import { CosmosChainId, EvmChainId } from "./network"; +import { CosmosChainId, EvmChainId, chainInfos, cosmosChains, evmChains } from "./network"; export const truncDecimals = 6; export const atomic = 10 ** truncDecimals; @@ -132,16 +132,20 @@ export const WEBSOCKET_RECONNECT_INTERVAL = 20000; export const UNISWAP_ROUTER_DEADLINE = 15000; // swap deadline in ms export const EVM_BALANCE_RETRY_COUNT = 5; -export const EVM_CHAIN_ID: EvmChainId[] = ["0x38", "0x01", "0x1ae6", "0x2b6653dc"]; -export const COSMOS_CHAIN_ID: CosmosChainId[] = [ - "Oraichain", - "oraibridge-subnet-2", - "osmosis-1", - "cosmoshub-4", - "injective-1", - "kawaii_6886-1", - "noble-1" -]; +// evm chainID +export const ETH_CHAIN_ID = "0x01"; +export const BSC_CHAIN_ID = "0x38"; +export const KAWAII_EVM_CHAIN_ID = "0x1ae6"; +export const TRON_CHAIN_ID = "0x2b6653dc"; + +// cosmos chainId +export const ORAICHAIN_CHAIN_ID = "Oraichain"; +export const ORAIBRIDGE_CHAIN_ID = "oraibridge-subnet-2"; +export const OSMOSIS_CHAIN_ID = "osmosis-1"; +export const COSMOSHUB_CHAIN_ID = "cosmoshub-4"; +export const INJECTVE_CHAIN_ID = "injective-1"; +export const KAWAII_COSMOS_CHAIN_ID = "kawaii_6886-1"; +export const NOBLE_CHAIN_ID = "noble-1"; // asset info token export const ORAI_INFO = { diff --git a/packages/oraidex-common/src/network.ts b/packages/oraidex-common/src/network.ts index 8e5b16b0..15323d72 100644 --- a/packages/oraidex-common/src/network.ts +++ b/packages/oraidex-common/src/network.ts @@ -940,6 +940,7 @@ export const network: CustomChainInfo & NetworkConfig = { // exclude kawaiverse subnet and other special evm that has different cointype export const evmChains = chainInfos.filter((c) => c.networkType === "evm"); +export const cosmosChains = chainInfos.filter((c) => c.networkType === "cosmos"); // evm network export enum Networks { From 98d48ba165465b6311dad814f3a7ff69811a7397 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Mon, 27 Nov 2023 13:44:47 +0700 Subject: [PATCH 2/3] update enum common chain evm and cosmos --- packages/oraidex-common/src/constant.ts | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/oraidex-common/src/constant.ts b/packages/oraidex-common/src/constant.ts index aec62b47..5e6262eb 100644 --- a/packages/oraidex-common/src/constant.ts +++ b/packages/oraidex-common/src/constant.ts @@ -133,19 +133,22 @@ export const UNISWAP_ROUTER_DEADLINE = 15000; // swap deadline in ms export const EVM_BALANCE_RETRY_COUNT = 5; // evm chainID -export const ETH_CHAIN_ID = "0x01"; -export const BSC_CHAIN_ID = "0x38"; -export const KAWAII_EVM_CHAIN_ID = "0x1ae6"; -export const TRON_CHAIN_ID = "0x2b6653dc"; - +export enum EVM_CHAIN_ID_COMMON { + ETH_CHAIN_ID = "0x01", + BSC_CHAIN_ID = "0x38", + KAWAII_EVM_CHAIN_ID = "0x1ae6", + TRON_CHAIN_ID = "0x2b6653dc" +} // cosmos chainId -export const ORAICHAIN_CHAIN_ID = "Oraichain"; -export const ORAIBRIDGE_CHAIN_ID = "oraibridge-subnet-2"; -export const OSMOSIS_CHAIN_ID = "osmosis-1"; -export const COSMOSHUB_CHAIN_ID = "cosmoshub-4"; -export const INJECTVE_CHAIN_ID = "injective-1"; -export const KAWAII_COSMOS_CHAIN_ID = "kawaii_6886-1"; -export const NOBLE_CHAIN_ID = "noble-1"; +export enum COSMOS_CHAIN_ID_COMMON { + ORAICHAIN_CHAIN_ID = "Oraichain", + ORAIBRIDGE_CHAIN_ID = "oraibridge-subnet-2", + OSMOSIS_CHAIN_ID = "osmosis-1", + COSMOSHUB_CHAIN_ID = "cosmoshub-4", + INJECTVE_CHAIN_ID = "injective-1", + KAWAII_COSMOS_CHAIN_ID = "kawaii_6886-1", + NOBLE_CHAIN_ID = "noble-1" +} // asset info token export const ORAI_INFO = { From c9c58ed70f20a26046a2622737308747ef48d14e Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Mon, 27 Nov 2023 16:45:19 +0700 Subject: [PATCH 3/3] chore: pumb oraidex-common --- packages/oraidex-common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/oraidex-common/package.json b/packages/oraidex-common/package.json index ab07f5a4..52c3a374 100644 --- a/packages/oraidex-common/package.json +++ b/packages/oraidex-common/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/oraidex-common", - "version": "1.0.39", + "version": "1.0.40", "main": "build/index.js", "files": [ "build/"