diff --git a/packages/oraidex-common/package.json b/packages/oraidex-common/package.json index f4f28f28..1906a000 100644 --- a/packages/oraidex-common/package.json +++ b/packages/oraidex-common/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/oraidex-common", - "version": "1.1.19", + "version": "1.1.20", "main": "build/index.js", "files": [ "build/" diff --git a/packages/oraidex-common/src/config/chainInfosWithIcon.ts b/packages/oraidex-common/src/config/chainInfosWithIcon.ts index 61c6ba67..33744158 100644 --- a/packages/oraidex-common/src/config/chainInfosWithIcon.ts +++ b/packages/oraidex-common/src/config/chainInfosWithIcon.ts @@ -20,6 +20,8 @@ const NobleIcon = "https://raw.githubusercontent.com/cosmos/chain-registry/maste const BtcIcon = "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png"; const OCHIcon = "https://assets.coingecko.com/coins/images/34236/standard/orchai_logo_white_copy_4x-8_%281%29.png?1704307670"; +const PepeIcon = "https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776"; +const HamsterIcon = "https://assets.coingecko.com/coins/images/39102/standard/hamster-removebg-preview.png?1720514486"; import { flatten } from "lodash"; import { chainInfos as customChainInfos, CustomChainInfo } from "../network"; @@ -124,6 +126,16 @@ export const tokensIcon: TokenIcon[] = [ coinGeckoId: "och", Icon: OCHIcon, IconLight: OCHIcon + }, + { + coinGeckoId: "pepe", + Icon: PepeIcon, + IconLight: PepeIcon + }, + { + coinGeckoId: "hamster-kombat", + Icon: HamsterIcon, + IconLight: HamsterIcon } ]; diff --git a/packages/oraidex-common/src/constant.ts b/packages/oraidex-common/src/constant.ts index 11bb2cda..2f92b66f 100644 --- a/packages/oraidex-common/src/constant.ts +++ b/packages/oraidex-common/src/constant.ts @@ -100,6 +100,7 @@ export const TON_ORAICHAIN_DENOM = "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3q export const PEPE_ORAICHAIN_EXT_DENOM = "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/extPEPE"; export const CAT_ORAICHAIN_EXT_DENOM = "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/extCAT"; +export const HMSTR_ORAICHAIN_DENOM = "factory/orai17hyr3eg92fv34fdnkend48scu32hn26gqxw3hnwkfy904lk9r09qqzty42/HMSTR"; // config for oraichain token export const AIRI_CONTRACT = "orai10ldgzued6zjp0mkqwsv2mux3ml50l97c74x8sg"; diff --git a/packages/oraidex-common/src/network.ts b/packages/oraidex-common/src/network.ts index 071751d9..97fc0849 100644 --- a/packages/oraidex-common/src/network.ts +++ b/packages/oraidex-common/src/network.ts @@ -59,7 +59,8 @@ import { CAT_ORAICHAIN_EXT_DENOM as CAT_ORAICHAIN_DENOM, PEPE_ETH_CONTRACT, PEPE_BSC_CONTRACT, - CAT_BSC_CONTRACT + CAT_BSC_CONTRACT, + HMSTR_ORAICHAIN_DENOM } from "./constant"; import { listOsmosisToken } from "./alpha-network"; @@ -120,7 +121,8 @@ export type CoinGeckoId = | "celestia" | "the-open-network" | "pepe" - | "simon-s-cat"; + | "simon-s-cat" + | "hamster-kombat"; export type NetworkType = "cosmos" | "evm"; export interface NetworkConfig { @@ -525,6 +527,13 @@ export const oraichainNetwork: CustomChainInfo = { coinDecimals: 9, coinGeckoId: "the-open-network", coinImageUrl: "https://assets.coingecko.com/coins/images/17980/standard/ton_symbol.png?1696517498" + }, + { + coinDenom: "HMSTR", + coinMinimalDenom: HMSTR_ORAICHAIN_DENOM, + coinDecimals: 9, + coinGeckoId: "hamster-kombat", + coinImageUrl: "https://assets.coingecko.com/coins/images/39102/standard/hamster-removebg-preview.png?1720514486" } ] }; diff --git a/packages/universal-swap/src/handler.ts b/packages/universal-swap/src/handler.ts index c860e6bd..5232ecc4 100644 --- a/packages/universal-swap/src/handler.ts +++ b/packages/universal-swap/src/handler.ts @@ -41,7 +41,7 @@ import { OSMOSIS_ROUTER_CONTRACT, cosmosChains, toDisplay, - EVM_CHAIN_ID_COMMON + ChainIdEnum } from "@oraichain/oraidex-common"; import { ethers } from "ethers"; import { UniversalSwapHelper } from "./helper"; @@ -231,7 +231,7 @@ export class UniversalSwapHandler { if (recipientAddress) { const isValidRecipient = checkValidateAddressWithNetwork(this.swapData.recipientAddress, toToken.originalChainId); if (!isValidRecipient.isValid) throw generateError("Recipient address invalid!"); - transferAddress = recipientAddress; + transferAddress = toToken.chainId === ChainIdEnum.TRON ? tronToEthAddress(recipientAddress) : recipientAddress; } else { transferAddress = this.getTranferAddress(metamaskAddress, tronAddress, channel); } @@ -1161,7 +1161,7 @@ export class UniversalSwapHandler { if (!isValidRecipient.isValid) throw generateError("Recipient address invalid!"); toAddress = - originalToToken.chainId === EVM_CHAIN_ID_COMMON.TRON_CHAIN_ID + originalToToken.chainId === ChainIdEnum.TRON ? tronToEthAddress(recipientAddress) : this.swapData.recipientAddress; } else {