Skip to content

Commit

Permalink
Merge pull request #57 from oraichain/feat/constant-chain
Browse files Browse the repository at this point in the history
add constant list chain id
  • Loading branch information
haunv3 authored Nov 27, 2023
2 parents 6827045 + c9c58ed commit 5f97862
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/oraidex-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraidex-common",
"version": "1.0.39",
"version": "1.0.40",
"main": "build/index.js",
"files": [
"build/"
Expand Down
29 changes: 18 additions & 11 deletions packages/oraidex-common/src/constant.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -132,16 +132,23 @@ 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 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 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 = {
Expand Down
1 change: 1 addition & 0 deletions packages/oraidex-common/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5f97862

Please sign in to comment.