From 1a71f0f66f1df72c4071edf2cd5c4f2a105b1692 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 14 Oct 2020 10:26:00 +0200 Subject: [PATCH] remove liquidity in OCEAN only --- .../organisms/AssetActions/Pool/Remove.tsx | 15 ++++----------- .../organisms/AssetActions/Pool/index.tsx | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/organisms/AssetActions/Pool/Remove.tsx b/src/components/organisms/AssetActions/Pool/Remove.tsx index e7fa9e355..12f6b095f 100644 --- a/src/components/organisms/AssetActions/Pool/Remove.tsx +++ b/src/components/organisms/AssetActions/Pool/Remove.tsx @@ -10,19 +10,16 @@ import Token from './Token' export default function Remove({ setShowRemove, poolAddress, - poolTokens, - dtSymbol + poolTokens }: { setShowRemove: (show: boolean) => void poolAddress: string poolTokens: string - dtSymbol: string }): ReactElement { const { ocean, accountId } = useOcean() const [amountPercent, setAmountPercent] = useState('0') const [amountPoolShares, setAmountPoolShares] = useState('0') const [amountOcean, setAmountOcean] = useState() - const [amountDatatoken, setAmountDatatoken] = useState() const [isLoading, setIsLoading] = useState() const [txId, setTxId] = useState() @@ -52,6 +49,9 @@ export default function Remove({ useEffect(() => { if (!ocean || !poolTokens) return + // TODO: check max amount to be able to remove + // getOceanMaxRemoveLiquidity() + async function getValues() { const amountPoolShares = (Number(amountPercent) / 100) * Number(poolTokens) @@ -62,12 +62,6 @@ export default function Remove({ `${amountPoolShares}` ) setAmountOcean(amountOcean) - - const amountDatatoken = await ocean.pool.getDTRemovedforPoolShares( - poolAddress, - `${amountPoolShares}` - ) - setAmountDatatoken(amountDatatoken) } getValues() }, [amountPercent, ocean, poolTokens, poolAddress]) @@ -100,7 +94,6 @@ export default function Remove({

You will receive

- ) : ( <>