diff --git a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Withdraw.tsx b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Withdraw.tsx index b116bfa7184..0debc0c911e 100644 --- a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Withdraw.tsx +++ b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Withdraw.tsx @@ -210,7 +210,7 @@ export const Withdraw: React.FC = ({ accountId, fromAddress, onNe const { estimatedFeesData, isEstimatedFeesDataLoading, - dustAmountCryptoBaseUnitOrDefault: dustAmountCryptoBaseUnit, + dustAmountCryptoBaseUnit, outboundFeeCryptoBaseUnit, } = useSendThorTx({ assetId, diff --git a/src/lib/utils/thorchain/hooks/useSendThorTx.tsx b/src/lib/utils/thorchain/hooks/useSendThorTx.tsx index 6f8a27394c9..bae84c9ad10 100644 --- a/src/lib/utils/thorchain/hooks/useSendThorTx.tsx +++ b/src/lib/utils/thorchain/hooks/useSendThorTx.tsx @@ -66,7 +66,7 @@ type UseSendThorTxProps = { disableEstimateFeesRefetch?: boolean fromAddress: string | null memo: string | null - dustAmountCryptoBaseUnit?: string | null + dustAmountCryptoBaseUnit?: string } export const useSendThorTx = ({ @@ -104,7 +104,7 @@ export const useSendThorTx = ({ // Either a fall through of the passed dustAmountCryptoBaseUnit, or the default dust amount for that feeAsset // @TODO: test this with RUNEPool, might not work properly due to mapping for LPs - const dustAmountCryptoBaseUnitOrDefault = useMemo(() => { + const dustAmountCryptoBaseUnit = useMemo(() => { return _dustAmountCryptoBaseUnit ? _dustAmountCryptoBaseUnit : THORCHAIN_SAVERS_DUST_THRESHOLDS_CRYPTO_BASE_UNIT[feeAsset?.assetId ?? ''] ?? '0' @@ -112,9 +112,9 @@ export const useSendThorTx = ({ const amountOrDustCryptoBaseUnit = useMemo(() => { return shouldUseDustAmount - ? bnOrZero(dustAmountCryptoBaseUnitOrDefault).toFixed(0) + ? bnOrZero(dustAmountCryptoBaseUnit).toFixed(0) : bnOrZero(amountCryptoBaseUnit).toFixed(0) - }, [shouldUseDustAmount, dustAmountCryptoBaseUnitOrDefault, amountCryptoBaseUnit]) + }, [shouldUseDustAmount, dustAmountCryptoBaseUnit, amountCryptoBaseUnit]) const transactionType = useMemo(() => { return asset ? getThorchainTransactionType(asset.chainId) : undefined @@ -454,7 +454,7 @@ export const useSendThorTx = ({ isEstimatedFeesDataError, txId, serializedTxIndex, - dustAmountCryptoBaseUnitOrDefault, + dustAmountCryptoBaseUnit, outboundFeeCryptoBaseUnit, inboundAddress, } diff --git a/src/pages/ThorChainLP/components/RemoveLiquidity/RemoveLiquidityInput.tsx b/src/pages/ThorChainLP/components/RemoveLiquidity/RemoveLiquidityInput.tsx index 8e4030c0d52..e22c1232665 100644 --- a/src/pages/ThorChainLP/components/RemoveLiquidity/RemoveLiquidityInput.tsx +++ b/src/pages/ThorChainLP/components/RemoveLiquidity/RemoveLiquidityInput.tsx @@ -383,7 +383,7 @@ export const RemoveLiquidityInput: React.FC = ({ estimatedFeesData: estimatedRuneFeesData, isEstimatedFeesDataLoading: isEstimatedRuneFeesDataLoading, isEstimatedFeesDataError: isEstimatedRuneFeesDataError, - dustAmountCryptoBaseUnitOrDefault: runeDustAmountCryptoBaseUnit, + dustAmountCryptoBaseUnit: runeDustAmountCryptoBaseUnit, } = useSendThorTx({ assetId: thorchainAssetId, accountId: positionRuneAccountId ?? null, @@ -416,7 +416,7 @@ export const RemoveLiquidityInput: React.FC = ({ estimatedFeesData: estimatedPoolAssetFeesData, isEstimatedFeesDataLoading: isEstimatedPoolAssetFeesDataLoading, isEstimatedFeesDataError: isEstimatedPoolAssetFeesDataError, - dustAmountCryptoBaseUnitOrDefault: poolAssetFeeAssetDustAmountCryptoBaseUnit, + dustAmountCryptoBaseUnit: poolAssetFeeAssetDustAmountCryptoBaseUnit, outboundFeeCryptoBaseUnit, } = useSendThorTx({ // Asym asset withdraws are the only ones occurring an asset Tx - both sym and asym RUNE side withdraws occur a RUNE Tx instead