Skip to content

Commit

Permalink
[ENG-4466] Jordankzf/remove rare sats warning (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
teebszet authored Jun 20, 2024
1 parent c0d7477 commit 46faf48
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/app/components/confirmBtcTransaction/transactionSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import useSelectedAccount from '@hooks/useSelectedAccount';
import { btcTransaction, getBtcFiatEquivalent, RuneSummary } from '@secretkeylabs/xverse-core';
import SelectFeeRate from '@ui-components/selectFeeRate';
import Callout from '@ui-library/callout';
import { BLOG_LINK } from '@utils/constants';
import BigNumber from 'bignumber.js';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -69,7 +68,6 @@ function TransactionSummary({
const { btcFiatRate } = useCoinRates();
const { network, fiatCurrency } = useWalletSelector();
const { t } = useTranslation('translation', { keyPrefix: 'CONFIRM_TRANSACTION' });
const { t: rareSatsT } = useTranslation('translation', { keyPrefix: 'RARE_SATS' });
const { t: tUnits } = useTranslation('translation', { keyPrefix: 'UNITS' });

const { btcAddress, ordinalsAddress } = useSelectedAccount();
Expand All @@ -86,22 +84,6 @@ function TransactionSummary({

const isUnConfirmedInput = inputs.some((input) => !input.extendedUtxo.utxo.status.confirmed);

// if transaction is not final, we don't know where the rare sats will go, so check inputs instead of outputs
const paymentHasInscribedRareSats = !transactionIsFinal
? inputs.some(
(input) =>
input.extendedUtxo.address === btcAddress &&
(input.inscriptions.length || input.satributes.length),
)
: outputs.some(
(output) =>
isSpendOutput(output) &&
(output.inscriptions.some((inscription) => inscription.fromAddress === btcAddress) ||
output.satributes.some((satribute) => satribute.fromAddress === btcAddress)),
);
const feesHaveInscribedRareSats = feeOutput?.inscriptions.length || feeOutput?.satributes.length;
const showInscribeRareSatWarning = paymentHasInscribedRareSats || feesHaveInscribedRareSats;

const satsToFiat = (sats: string) =>
getBtcFiatEquivalent(new BigNumber(sats), new BigNumber(btcFiatRate)).toNumber().toFixed(2);

Expand All @@ -121,15 +103,6 @@ function TransactionSummary({
}}
/>
)}

{!!showInscribeRareSatWarning && (
<WarningCallout
variant="warning"
bodyText={t('INSCRIBED_RARE_SATS_WARNING')}
redirectText={rareSatsT('RARITY_DETAIL.LEARN_MORE')}
anchorRedirect={`${BLOG_LINK}/rare-satoshis`}
/>
)}
{isUnConfirmedInput && (
<WarningCallout bodyText={t('UNCONFIRMED_UTXO_WARNING')} variant="warning" />
)}
Expand Down

0 comments on commit 46faf48

Please sign in to comment.