Skip to content

Commit

Permalink
Merge pull request #1089 from oraidex/fix/swap-inj
Browse files Browse the repository at this point in the history
fix swap inj
  • Loading branch information
haunv3 authored Dec 23, 2024
2 parents 3c93c3e + c201117 commit 09f6607
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions src/pages/UniversalSwap/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,27 +383,15 @@ export const getProtocolsSmartRoute = (
};

export const isAllowAlphaIbcWasm = (fromToken: TokenItemType, toToken: TokenItemType) => {
return true;
};

const toCoinGeckoIds = ['osmosis', 'cosmos', 'oraichain-token', 'usd-coin'];
const listAllowSmartRoute = {
'osmosis-1-Oraichain': {
fromCoinGeckoIds: ['osmosis'],
toCoinGeckoIds
},
'injective-1-Oraichain': {
fromCoinGeckoIds: ['injective-protocol'],
toCoinGeckoIds
},
'noble-1-Oraichain': {
fromCoinGeckoIds: ['usd-coin'],
toCoinGeckoIds: [...toCoinGeckoIds, 'injective-protocol']
},
'cosmoshub-4-Oraichain': {
fromCoinGeckoIds: ['cosmos'],
toCoinGeckoIds: [...toCoinGeckoIds]
// FIXME: fix case inj oraichain -> x oraichain
if (
fromToken.coinGeckoId === 'injective-protocol' &&
fromToken.chainId === toToken.chainId &&
fromToken.chainId === 'Oraichain'
) {
return false;
}
return true;
};

/**
Expand All @@ -414,6 +402,14 @@ const listAllowSmartRoute = {
* @returns boolean
*/
export const isAllowIBCWasm = (fromToken: TokenItemType, toToken: TokenItemType) => {
// FIXME: fix case inj oraichain -> x oraichain
if (
fromToken.coinGeckoId === 'injective-protocol' &&
fromToken.chainId === toToken.chainId &&
fromToken.chainId === 'Oraichain'
) {
return true;
}
return false;
};

Expand Down

0 comments on commit 09f6607

Please sign in to comment.