diff --git a/src/functions/generateRoute.ts b/src/functions/generateRoute.ts index 1c971b36..80adbb15 100644 --- a/src/functions/generateRoute.ts +++ b/src/functions/generateRoute.ts @@ -2,8 +2,8 @@ import { useSorobanReact } from '@soroban-react/core'; import { AppContext } from 'contexts'; import { useFactory } from 'hooks'; import { useContext, useMemo } from 'react'; -import { CurrencyAmount, Networks, Protocols, Router, Token, TradeType } from 'soroswap-router-sdk'; import { fetchAllPhoenixPairs, fetchAllSoroswapPairs } from 'services/pairs'; +import { CurrencyAmount, Networks, Protocols, Router, Token, TradeType } from 'soroswap-router-sdk'; export interface GenerateRouteProps { amountTokenAddress: string; @@ -79,9 +79,12 @@ export const useRouterSDK = () => { const quoteCurrency = fromAddressToToken(quoteTokenAddress); if (isAggregator) { + // console.log('Returning routeSplit'); + // console.log(await router.routeSplit(currencyAmount, quoteCurrency, tradeType)); return router.routeSplit(currencyAmount, quoteCurrency, tradeType); } + // console.log('returning route'); return router.route(currencyAmount, quoteCurrency, tradeType, factory, sorobanContext as any); }; diff --git a/src/state/swap/hooks.tsx b/src/state/swap/hooks.tsx index f13baa25..10077c6f 100644 --- a/src/state/swap/hooks.tsx +++ b/src/state/swap/hooks.tsx @@ -183,8 +183,8 @@ export function useDerivedSwapInfo(state: SwapState) { //if amountin is more than reserves | expectedoutput is infinity if ( - trade.trade?.outputAmount?.value.includes('Infinity') || - trade.trade?.outputAmount?.value.includes('-') + trade.trade?.outputAmount?.value?.includes('Infinity') || + trade.trade?.outputAmount?.value?.includes('-') ) { inputError = 'Insufficient liquidity for this trade.'; }