Skip to content

Commit

Permalink
Merge branch 'develop' into modal-rerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Jul 25, 2023
2 parents c3ceb04 + bb8a45f commit e9d801f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/swapper/swappers/LifiSwapper/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
Swapper2Api,
TradeQuote2,
} from 'lib/swapper/api'
import { makeSwapErrorRight, SwapErrorType } from 'lib/swapper/api'
import { getLifi } from 'lib/swapper/swappers/LifiSwapper/utils/getLifi'

import { getTradeQuote } from './getTradeQuote/getTradeQuote'
Expand All @@ -29,6 +30,14 @@ export const lifiApi: Swapper2Api = {
assets: Partial<Record<AssetId, Asset>>,
sellAssetPriceUsdPrecision: string,
): Promise<Result<TradeQuote2, SwapErrorRight>> => {
if (input.sellAmountBeforeFeesCryptoBaseUnit === '0') {
return Err(
makeSwapErrorRight({
message: 'sell amount too low',
code: SwapErrorType.TRADE_QUOTE_AMOUNT_TOO_SMALL,
}),
)
}
if (lifiChainMapPromise === undefined) lifiChainMapPromise = getLifiChainMap()

const maybeLifiChainMap = await lifiChainMapPromise
Expand Down

0 comments on commit e9d801f

Please sign in to comment.