Skip to content

Commit

Permalink
Merge branch 'main' into feat/intergrate_common
Browse files Browse the repository at this point in the history
  • Loading branch information
trungbach committed Dec 5, 2024
2 parents b2fc745 + 9c43bb4 commit 260f9e7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
21 changes: 21 additions & 0 deletions packages/oraidex-common/src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export const ETHEREUM_SCAN = "https://etherscan.io";
export const BSC_SCAN = "https://bscscan.com";
export const TRON_SCAN = "https://tronscan.org";
export const KWT_SCAN = "https://scan.kawaii.global";
export const SOL_SCAN = "https://solscan.io";

// sol information
export const commitmentLevel = "confirmed";
export const TOKEN_RESERVES = 1_000_000_000_000_000;
export const LAMPORT_RESERVES = 1_000_000_000;
export const INIT_BONDING_CURVE = 95;

export const ORAI_BRIDGE_UDENOM = "uoraib";
export const ORAI_BRIDGE_EVM_DENOM_PREFIX = "oraib";
Expand All @@ -56,6 +63,7 @@ export const MILKY_BSC_CONTRACT = "0x6fE3d0F096FC932A905accd1EB1783F6e4cEc717";
export const PEPE_BSC_CONTRACT = "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00";
export const CAT_BSC_CONTRACT = "0x6894CDe390a3f51155ea41Ed24a33A4827d3063D";
export const DOGE_BSC_CONTRACT = "0xbA2aE424d960c26247Dd6c32edC70B295c744C43";
export const WSOL_WORMHOLE_BSC_CONTRACT = "0xfA54fF1a158B5189Ebba6ae130CEd6bbd3aEA76e";
// tron contracts
export const USDT_TRON_CONTRACT = "0xa614f803B6FD780986A42c78Ec9c7f77e6DeD13C";
export const WRAP_TRON_TRX_CONTRACT = "0x891cdb91d149f23B1a45D9c5Ca78a88d0cB44C18";
Expand Down Expand Up @@ -105,6 +113,18 @@ export const HMSTR_ORAICHAIN_DENOM = "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj
export const OBTC_ORAICHAIN_EXT_DENOM = "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/obtc";
export const DOGE_BNB_ORAICHAIN_DENOM =
"factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/DogeBNB";
export const WSOL_WORMHOLE_BNB_ORAICHAIN_DENOM =
"factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/oraib0x4VH72cCsNwZwLtHtBnXuCxHWf4mB";
export const MAX_ORAICHAIN_DENOM =
"factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/oraim8c9d1nkfuQk9EzGYEUGxqL3MHQYndRw1huVo5h";

// config solana
export const MAX_SOL_CONTRACT_ADDRESS = "oraim8c9d1nkfuQk9EzGYEUGxqL3MHQYndRw1huVo5h";
export const ORAI_SOL_CONTRACT_ADDRESS = "2hZWncnmsSMdbkdwzSHJfrnDVkL66g63gncdRWqjTbBB";
export const SOLANA_RPC = "https://swr.xnftdata.com/rpc-proxy/";
export const SOLANA_WEBSOCKET = "wss://go.getblock.io/52d75331a9b74f9fa4a0056f15a1c022";
export const MEMO_PROGRAM_ID = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
export const MEMO_PROGRAM_ID_AMOUNT = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";

// config for oraichain token
export const AIRI_CONTRACT = "orai10ldgzued6zjp0mkqwsv2mux3ml50l97c74x8sg";
Expand Down Expand Up @@ -250,3 +270,4 @@ export const minAmountSwapMap = {

export type EvmDenom = "bep20_orai" | "bep20_airi" | "erc20_orai" | "kawaii_orai";

export const solChainId = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
5 changes: 4 additions & 1 deletion packages/oraidex-common/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export type CoinGeckoId =
| "simon-s-cat"
| "hamster-kombat"
| "dogecoin"
| string;
| string
| "solana"
| "max-2";

export type NetworkType = "cosmos" | "evm" | "svm";
export interface NetworkConfig {
coinType?: CoinType;
explorer: string;
Expand Down
13 changes: 10 additions & 3 deletions packages/oraidex-common/src/pairs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
USDT_CONTRACT,
WETH_CONTRACT,
NEUTARO_ORAICHAIN_DENOM as NEUTARO_ADDRESS,
OCH_CONTRACT
OCH_CONTRACT,
MAX_ORAICHAIN_DENOM
} from "./constant";
import { parseAssetInfo } from "./helper";
import uniq from "lodash/uniq";
Expand Down Expand Up @@ -105,6 +106,10 @@ export const PAIRS: PairMapping[] = [
{
asset_infos: [{ token: { contract_addr: OCH_CONTRACT } }, { native_token: { denom: ORAI } }],
symbols: ["OCH", "ORAI"]
},
{
asset_infos: [{ native_token: { denom: MAX_ORAICHAIN_DENOM } }, { token: { contract_addr: ORAIX_CONTRACT } }],
symbols: ["MAX", "ORAIX"]
}
];

Expand All @@ -126,7 +131,8 @@ export enum pairLpTokens {
ORAI_WETH = "orai1rvr9wk6mdlfysvgp72ltthqvkkd5677mp892efq86yyr9alt0tms2a6lcs",
ORAI_BTC = "orai1jd9lc2qt0ltjsatgnu38xsz8ngp89clp0dpeh8geyjj70yvkn4kqmrmh3m",
NTMPI_USDC = "orai1rmvjmwd940ztafxue7630g75px8tqma4jskjuu57fkj0eqahqfgqqwjm00",
OCH_ORAI = "orai1xs5aj90d5m8kwfp9t6ghkcpk8d7sy5jsxdsyejjdxudhhfm7wegsdg929d"
OCH_ORAI = "orai1xs5aj90d5m8kwfp9t6ghkcpk8d7sy5jsxdsyejjdxudhhfm7wegsdg929d",
MAX_ORAIX = "orai1gswmxchtlkav289eq86z4ehaezntctdrptcww4yvpp20d93xza0qsqjxvv"
}

// token identifier can be denom or contract addr
Expand Down Expand Up @@ -188,5 +194,6 @@ export enum PairAddress {
ORAI_WETH = "orai10jgd0l4l0p2h7ugpk2lz64wpefjxc0h7evnlxf76a3fspdplarnsl9ma4j",
ORAI_BTC = "orai1fv5kwdv4z0gvp75ht378x8cg2j7prlywa0g35qmctez9q8u4xryspn6lrd",
NTMPI_USDC = "orai1yemx80gvcw05trjehy94rl4jz5dqjf2qxhks6258uvxd5s0m7h2quavx0g",
OCH_ORAI = "orai1d3f3e3j400hxse5z8vxxnxdwmvljs7mh8xa3wp3spe8g4ngnc3cqx8scs3"
OCH_ORAI = "orai1d3f3e3j400hxse5z8vxxnxdwmvljs7mh8xa3wp3spe8g4ngnc3cqx8scs3",
MAX_ORAIX = "orai1s3746evfgwm7dtl3x4s7fmd37c4s8t566z0xvflr4shdculkxw5qa3pusc"
}
2 changes: 1 addition & 1 deletion packages/universal-swap/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class UniversalSwapHandler {
if (tronWeb && tronWeb.defaultAddress?.base58) return tronToEthAddress(tronWeb.defaultAddress.base58);
throw generateError("Cannot find tron web to nor tron address to send to Tron network");
}
return this.config.cosmosWallet.getKeplrAddr(toChainId as any);
return this.config.cosmosWallet.getKeplrAddr(toChainId as CosmosChainId);
}

/**
Expand Down

0 comments on commit 260f9e7

Please sign in to comment.