Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

feat: add tx links for add/remove liquidity #338

Merged
merged 4 commits into from
Jun 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: e2e tests
  • Loading branch information
pedronauck committed Jun 24, 2022
commit b470f5056c4fdcca656ee31d47fb75183e3841c5
6 changes: 4 additions & 2 deletions packages/app/src/systems/Pool/pages/RemoveLiquidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
import { CoinBalance } from "~/systems/Core/components/CoinBalance";
import { useTransactionCost } from "~/systems/Core/hooks/useTransactionCost";
import { txFeedback } from "~/systems/Core/utils/feedback";
import { getTransactionCost } from "~/systems/Core/utils/gas";
import { Button, Card } from "~/systems/UI";

export function RemoveLiquidityPage() {
Expand All @@ -46,10 +47,11 @@ export function RemoveLiquidityPage() {
if (!amount) {
throw new Error('"amount" is required');
}
if (!txCost.total) return;
const contractCall = await prepareRemoveLiquidity(contract);
const nextTxCost = await getTransactionCost(contractCall);
// TODO: Add way to set min_eth and min_tokens
// https://github.com/FuelLabs/swayswap/issues/55
return submitRemoveLiquidity(contract, amount, txCost);
return submitRemoveLiquidity(contract, amount, nextTxCost);
},
{ onSuccess: txFeedback("Liquidity removed successfully!", handleSuccess) }
);
Expand Down