Commit ecdbb4a4 authored by Justin Domingue's avatar Justin Domingue Committed by GitHub

revert: "fix: handle insufficient input amount error in v2 add liquidity (#1652)" (#1665)

This reverts commit 307a995a.
parent 536a5d99
......@@ -158,16 +158,10 @@ export function useDerivedMintInfo(
const { [Field.CURRENCY_A]: currencyAAmount, [Field.CURRENCY_B]: currencyBAmount } = parsedAmounts
const [tokenAmountA, tokenAmountB] = [currencyAAmount?.wrapped, currencyBAmount?.wrapped]
if (pair && totalSupply && tokenAmountA && tokenAmountB) {
try {
return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB)
} catch (error) {
if (error.isInsufficientInputAmountError) {
return CurrencyAmount.fromRawAmount(pair.liquidityToken, ZERO)
}
return undefined
}
return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB)
} else {
return undefined
}
return undefined
}, [parsedAmounts, pair, totalSupply])
const poolTokenPercentage = useMemo(() => {
......@@ -201,10 +195,6 @@ export function useDerivedMintInfo(
error = 'Insufficient ' + currencies[Field.CURRENCY_B]?.symbol + ' balance'
}
if (!liquidityMinted?.greaterThan(ZERO)) {
error = `Insufficient input amount`
}
return {
dependentField,
currencies,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment