Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove bignumber from the redux store #610

Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 3 additions & 4 deletions src/app/components/confirmBtcTransactionComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import useSeedVault from '@hooks/useSeedVault';
import useWalletSelector from '@hooks/useWalletSelector';
import {
BtcUtxoDataResponse,
ErrorCodes,
getBtcFiatEquivalent,
ResponseError,
Expand All @@ -18,7 +17,7 @@
signBtcTransaction,
UTXO,
} from '@secretkeylabs/xverse-core';
import {

Check warning on line 20 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

'@secretkeylabs/xverse-core/transactions/btc' import is restricted from being used by a pattern
Recipient,
SignedBtcTx,
signNonOrdinalBtcSendTransaction,
Expand Down Expand Up @@ -130,7 +129,7 @@
assetDetail?: string;
assetDetailValue?: string;
isRestoreFundFlow?: boolean;
nonOrdinalUtxos?: BtcUtxoDataResponse[];
nonOrdinalUtxos?: UTXO[];
isBtcSendBrowserTx?: boolean;
currencyType?: CurrencyTypes;
isPartOfBundle?: boolean;
Expand Down Expand Up @@ -259,7 +258,7 @@
setSignedTx(data.signedTx);
setShowFeeSettings(false);
}
}, [data]);

Check warning on line 261 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
if (ordinalData) {
Expand All @@ -267,7 +266,7 @@
setSignedTx(ordinalData.signedTx);
setShowFeeSettings(false);
}
}, [ordinalData]);

Check warning on line 269 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
let sum: BigNumber = new BigNumber(0);
Expand All @@ -286,7 +285,7 @@
setSignedTx(signedNonOrdinalBtcSend.signedTx);
setShowFeeSettings(false);
}
}, [signedNonOrdinalBtcSend]);

Check warning on line 288 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
if (
Expand All @@ -297,7 +296,7 @@
} else if (showFeeWarning) {
setShowFeeWarning(false);
}
}, [currentFee, feeMultipliers]);

Check warning on line 299 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'showFeeWarning'. Either include it or remove the dependency array

const onAdvancedSettingClick = () => {
setShowFeeSettings(true);
Expand All @@ -318,7 +317,7 @@
const newFee = new BigNumber(modifiedFee);
setCurrentFee(newFee);
const seed = await getSeed();
setCurrentFeeRate(new BigNumber(feeRate ?? ''));
setCurrentFeeRate(new BigNumber(feeRate!));
if (ordinalTxUtxo) ordinalMutate({ txFee: modifiedFee, seedPhrase: seed });
else if (isRestoreFundFlow) {
mutateSignNonOrdinalBtcTransaction({ txFee: modifiedFee, seedPhrase: seed });
Expand Down Expand Up @@ -350,7 +349,7 @@
setError(t('TX_ERRORS.INSUFFICIENT_BALANCE_FEES'));
} else setError(txError.toString());
}
}, [txError]);

Check warning on line 352 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients' and 't'. Either include them or remove the dependency array

useEffect(() => {
if (recipients && ordinalError) {
Expand All @@ -361,7 +360,7 @@
setError(t('TX_ERRORS.INSUFFICIENT_BALANCE_FEES'));
} else setError(ordinalError.toString());
}
}, [ordinalError]);

Check warning on line 363 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

useEffect(() => {
if (recipients && errorSigningNonOrdial) {
Expand All @@ -372,7 +371,7 @@
setError(t('TX_ERRORS.INSUFFICIENT_BALANCE_FEES'));
} else setError(errorSigningNonOrdial.toString());
}
}, [errorSigningNonOrdial]);

Check warning on line 374 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

return (
<>
Expand Down Expand Up @@ -439,7 +438,7 @@
<TransactionDetailComponent
title={t('CONFIRM_TRANSACTION.TOTAL')}
value={getAmountString(satsToBtc(total), t('BTC'))}
subValue={getBtcFiatEquivalent(total, btcFiatRate)}
subValue={getBtcFiatEquivalent(total, BigNumber(btcFiatRate))}
subTitle={t('CONFIRM_TRANSACTION.AMOUNT_PLUS_FEES')}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

interface Props {
address: string[];
parsedPsbt: ParsedPSBT;
parsedPsbt: ParsedPSBT | undefined;
isExpanded: boolean;
onArrowClick: () => void;
}
Expand Down Expand Up @@ -189,7 +189,7 @@
{isExpanded && (
<ExpandedContainer style={slideInStyles}>
{parsedPsbt?.inputs.map((input, index) => (
<TransferDetailContainer>

Check warning on line 192 in src/app/components/confirmBtcTransactionComponent/inputOutputComponent.tsx

View workflow job for this annotation

GitHub Actions / build

Missing "key" prop for element in iterator
<TransferDetailView
icon={IconBitcoin}
hideAddress
Expand All @@ -204,7 +204,7 @@

<OutputTitleText>{t('OUTPUT')}</OutputTitleText>
{parsedPsbt?.outputs.map((output) => (
<TransferDetailContainer>{showPsbtOutput(output)}</TransferDetailContainer>

Check warning on line 207 in src/app/components/confirmBtcTransactionComponent/inputOutputComponent.tsx

View workflow job for this annotation

GitHub Actions / build

Missing "key" prop for element in iterator
))}
</ExpandedContainer>
)}
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/confirmStxTransactionComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ import useNetworkSelector from '@hooks/useNetwork';
import useSeedVault from '@hooks/useSeedVault';
import useWalletSelector from '@hooks/useWalletSelector';
import Transport from '@ledgerhq/hw-transport-webusb';
import type { StacksTransaction } from '@secretkeylabs/xverse-core';
import {
getNonce,
microstacksToStx,
setFee,
setNonce,
signLedgerStxTransaction,
signMultiStxTransactions,
signTransaction,
stxToMicrostacks,
} from '@secretkeylabs/xverse-core';
import { microstacksToStx, stxToMicrostacks } from '@secretkeylabs/xverse-core/currency';
import { StacksTransaction } from '@secretkeylabs/xverse-core/types';
import { isHardwareAccount } from '@utils/helper';
import BigNumber from 'bignumber.js';
import { ReactNode, useEffect, useState } from 'react';
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/recipientComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ function RecipientComponent({
amountInCurrency = getFiatEquivalent(
Number(value),
currencyType,
stxBtcRate,
btcFiatRate,
BigNumber(stxBtcRate),
BigNumber(btcFiatRate),
fungibleToken,
);
}
Expand Down
27 changes: 18 additions & 9 deletions src/app/components/sendForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import { useBnsName, useBNSResolver } from '@hooks/queries/useBnsName';
import useDebounce from '@hooks/useDebounce';
import useNetworkSelector from '@hooks/useNetwork';
import useWalletSelector from '@hooks/useWalletSelector';
import { getBtcEquivalent, getStxTokenEquivalent } from '@secretkeylabs/xverse-core';
import { getFiatEquivalent } from '@secretkeylabs/xverse-core/transactions';
import { FungibleToken } from '@secretkeylabs/xverse-core/types';
import type { FungibleToken } from '@secretkeylabs/xverse-core';
import {
getBtcEquivalent,
getFiatEquivalent,
getStxTokenEquivalent,
} from '@secretkeylabs/xverse-core';
import InputFeedback from '@ui-library/inputFeedback';
import { CurrencyTypes } from '@utils/constants';
import { getCurrencyFlag } from '@utils/currency';
Expand Down Expand Up @@ -257,8 +260,8 @@ function SendForm({
const amountInCurrency = getFiatEquivalent(
Number(amountToSend),
currencyType,
stxBtcRate,
btcFiatRate,
BigNumber(stxBtcRate),
BigNumber(btcFiatRate),
fungibleToken,
);
setFiatAmount(amountInCurrency);
Expand Down Expand Up @@ -293,8 +296,8 @@ function SendForm({
const amountInCurrency = getFiatEquivalent(
Number(newValue),
currencyType,
stxBtcRate,
btcFiatRate,
BigNumber(stxBtcRate),
BigNumber(btcFiatRate),
fungibleToken,
);
setFiatAmount(amountInCurrency);
Expand All @@ -307,11 +310,17 @@ function SendForm({
if (!tokenAmount) return '0';
switch (currencyType) {
case 'STX':
return getStxTokenEquivalent(new BigNumber(tokenAmount), stxBtcRate, btcFiatRate)
return getStxTokenEquivalent(
new BigNumber(tokenAmount),
BigNumber(stxBtcRate),
BigNumber(btcFiatRate),
)
.toFixed(6)
.toString();
case 'BTC':
return getBtcEquivalent(new BigNumber(tokenAmount), btcFiatRate).toFixed(8).toString();
return getBtcEquivalent(new BigNumber(tokenAmount), BigNumber(btcFiatRate))
.toFixed(8)
.toString();
case 'FT':
if (fungibleToken?.tokenFiatRate) {
return new BigNumber(tokenAmount)
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/tokenTile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BetterBarLoader } from '@components/barLoader';
import { microstacksToStx, satsToBtc } from '@secretkeylabs/xverse-core/currency';
import { FungibleToken } from '@secretkeylabs/xverse-core/types';
import type { FungibleToken } from '@secretkeylabs/xverse-core';
import { microstacksToStx, satsToBtc } from '@secretkeylabs/xverse-core';
import { currencySymbolMap } from '@secretkeylabs/xverse-core/types/currency';
import { StoreState } from '@stores/index';
import { CurrencyTypes } from '@utils/constants';
Expand Down Expand Up @@ -347,7 +347,7 @@ function TokenTile({
onPress({
coin: currency as CurrencyTypes,
ft: fungibleToken && fungibleToken.principal,
brc20Ft: !fungibleToken?.principal && fungibleToken?.name,
brc20Ft: !fungibleToken?.principal ? fungibleToken?.name : undefined,
});
};

Expand Down
23 changes: 14 additions & 9 deletions src/app/components/transactionSetting/editFee.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import useDebounce from '@hooks/useDebounce';
import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress';
import useWalletSelector from '@hooks/useWalletSelector';
import { BtcUtxoDataResponse, ErrorCodes, UTXO } from '@secretkeylabs/xverse-core';
import {
ErrorCodes,
getBtcFiatEquivalent,
getStxFiatEquivalent,
stxToMicrostacks,
} from '@secretkeylabs/xverse-core/currency';
UTXO,
} from '@secretkeylabs/xverse-core';
import {
getBtcFees,
getBtcFeesForNonOrdinalBtcSend,
Expand Down Expand Up @@ -146,7 +147,7 @@ interface Props {
btcRecipients?: Recipient[];
ordinalTxUtxo?: UTXO;
isRestoreFlow?: boolean;
nonOrdinalUtxos?: BtcUtxoDataResponse[];
nonOrdinalUtxos?: UTXO[];
feeMode: string;
error: string;
setIsLoading: () => void;
Expand Down Expand Up @@ -185,7 +186,7 @@ function EditFee({
} = useWalletSelector();
const [totalFee, setTotalFee] = useState(fee);
const [feeRateInput, setFeeRateInput] = useState(feeRate?.toString() ?? '');
const inputRef = useRef(null);
const inputRef = useRef<HTMLInputElement>(null);
const debouncedFeeRateInput = useDebounce(feeRateInput, 500);
const isBtcOrOrdinals = type === 'BTC' || type === 'Ordinals';
const isStx = type === 'STX';
Expand Down Expand Up @@ -292,7 +293,7 @@ function EditFee({
feeMode,
feeRateInput,
);
setFeeRateInput(selectedFeeRate?.toString());
setFeeRateInput(selectedFeeRate!.toString());
setTotalFee(modifiedFee.toString());
} else if (btcRecipients && selectedAccount) {
const { fee: modifiedFee, selectedFeeRate } = await getBtcFees(
Expand All @@ -302,7 +303,7 @@ function EditFee({
feeMode,
feeRateInput,
);
setFeeRateInput(selectedFeeRate?.toString());
setFeeRateInput(selectedFeeRate!.toString());
setTotalFee(modifiedFee.toString());
}
} catch (err: any) {
Expand All @@ -328,7 +329,7 @@ function EditFee({
feeMode,
feeRateInput,
);
setFeeRateInput(selectedFeeRate?.toString());
setFeeRateInput(selectedFeeRate!.toString());
setTotalFee(modifiedFee.toString());
} catch (err: any) {
if (Number(err) === ErrorCodes.InSufficientBalance) {
Expand Down Expand Up @@ -356,8 +357,12 @@ function EditFee({

function getFiatEquivalent() {
return isStx
? getStxFiatEquivalent(stxToMicrostacks(new BigNumber(totalFee)), stxBtcRate, btcFiatRate)
: getBtcFiatEquivalent(new BigNumber(totalFee), btcFiatRate);
? getStxFiatEquivalent(
stxToMicrostacks(new BigNumber(totalFee)),
BigNumber(stxBtcRate),
BigNumber(btcFiatRate),
)
: getBtcFiatEquivalent(new BigNumber(totalFee), BigNumber(btcFiatRate));
}

const getFiatAmountString = (fiatAmount: BigNumber) => {
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/transactionSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ArrowIcon from '@assets/img/settings/arrow.svg';
import BottomModal from '@components/bottomModal';
import ActionButton from '@components/button';
import useWalletSelector from '@hooks/useWalletSelector';
import { BtcUtxoDataResponse, UTXO } from '@secretkeylabs/xverse-core';
import { UTXO } from '@secretkeylabs/xverse-core';
import { stxToMicrostacks } from '@secretkeylabs/xverse-core/currency';
import { isCustomFeesAllowed, Recipient } from '@secretkeylabs/xverse-core/transactions/btc';
import BigNumber from 'bignumber.js';
Expand Down Expand Up @@ -64,7 +64,7 @@ interface Props {
btcRecipients?: Recipient[];
ordinalTxUtxo?: UTXO;
isRestoreFlow?: boolean;
nonOrdinalUtxos?: BtcUtxoDataResponse[];
nonOrdinalUtxos?: UTXO[];
showFeeSettings: boolean;
setShowFeeSettings: (value: boolean) => void;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ function TransactionSettingAlert({

const applyClickForBtc = async () => {
const currentFee = new BigNumber(feeInput);
if (btcBalance && currentFee.gt(btcBalance)) {
if (currentFee.gt(btcBalance)) {
// show fee exceeds total balance error
setError(t('TRANSACTION_SETTING.GREATER_FEE_ERROR'));
return;
Expand Down
25 changes: 12 additions & 13 deletions src/app/components/transactionsRequests/ContractCallRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ export default function ContractCallRequest(props: ContractCallRequestProps) {

const functionArgsView = () => {
const args = getFunctionArgs();
return args.map((arg, index) => (
return args.map((arg) => (
<TransactionDetailComponent
key={arg.name}
title={arg.name}
value={arg.value.length > 20 ? truncateFunctionArgsView(arg.value) : arg.value}
description={arg.type}
Expand Down Expand Up @@ -224,20 +225,18 @@ export default function ContractCallRequest(props: ContractCallRequestProps) {
switch (postCondition.conditionType) {
case PostConditionType.STX:
return <StxPostConditionCard key={key} postCondition={postCondition} />;
case PostConditionType.Fungible:
case PostConditionType.Fungible: {
const coinInfo = coinsMetaData?.find(
(coin: Coin) =>
coin.contract ===
`${addressToString(postCondition.assetInfo.address)}.${
postCondition.assetInfo.contractName.content
}`,
);
return (
<FtPostConditionCard
key={key}
postCondition={postCondition}
ftMetaData={coinsMetaData?.find(
(coin: Coin) =>
coin.contract ===
`${addressToString(postCondition.assetInfo.address)}.${
postCondition.assetInfo.contractName.content
}`,
)}
/>
<FtPostConditionCard key={key} postCondition={postCondition} ftMetaData={coinInfo} />
);
}
case PostConditionType.NonFungible:
return <NftPostConditionCard key={key} postCondition={postCondition} />;
default:
Expand Down
9 changes: 7 additions & 2 deletions src/app/components/transferFeeView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ function TransferFeeView({ feePerVByte, fee, currency, title }: Props) {
const { btcFiatRate, stxBtcRate, fiatCurrency } = useSelector(
(state: StoreState) => state.walletState,
);
const fiatRate = getFiatEquivalent(Number(fee), currency, stxBtcRate, btcFiatRate);
const fiatRate = getFiatEquivalent(
Number(fee),
currency,
BigNumber(stxBtcRate),
BigNumber(btcFiatRate),
);
const getFiatAmountString = (fiatAmount: BigNumber) => {
if (!fiatAmount) {
return '';
Expand Down Expand Up @@ -103,7 +108,7 @@ function TransferFeeView({ feePerVByte, fee, currency, title }: Props) {
<FiatAmountText>
{getFiatAmountString(
currency === 'sats'
? getBtcFiatEquivalent(new BigNumber(fee), btcFiatRate)
? getBtcFiatEquivalent(new BigNumber(fee), BigNumber(btcFiatRate))
: new BigNumber(fiatRate!),
)}
</FiatAmountText>
Expand Down
4 changes: 1 addition & 3 deletions src/app/hooks/queries/useBtcWalletData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import useBtcClient from '@hooks/useBtcClient';
import type { BtcAddressData } from '@secretkeylabs/xverse-core';
import { SetBtcWalletDataAction } from '@stores/wallet/actions/actionCreators';
import { useQuery } from '@tanstack/react-query';
import BigNumber from 'bignumber.js';
import { useDispatch } from 'react-redux';
import useWalletSelector from '../useWalletSelector';

Expand All @@ -13,8 +12,7 @@ export const useBtcWalletData = () => {

const fetchBtcWalletData = async () => {
const btcData: BtcAddressData = await btcClient.getBalance(btcAddress);
const btcBalance = new BigNumber(btcData.finalBalance);
dispatch(SetBtcWalletDataAction(btcBalance));
dispatch(SetBtcWalletDataAction(btcData.finalBalance));
return btcData;
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks/useDetectOrdinalInSignPsbt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isAxiosError } from 'axios';
import { useEffect, useState } from 'react';
import useWalletSelector from './useWalletSelector';

const useDetectOrdinalInSignPsbt = (parsedPsbt: '' | ParsedPSBT) => {
const useDetectOrdinalInSignPsbt = (parsedPsbt?: ParsedPSBT) => {
const [loading, setLoading] = useState(false);
const [userReceivesOrdinal, setUserReceivesOrdinal] = useState(false);
const [bundleItemsData, setBundleItemsData] = useState<BundleItem[]>([]);
Expand Down
5 changes: 0 additions & 5 deletions src/app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import RareSatsBundle from '@screens/rareSatsBundle';
import RareSatsDetailScreen from '@screens/rareSatsDetail/rareSatsDetail';
import Receive from '@screens/receive';
import RestoreFunds from '@screens/restoreFunds';
import RestoreBtc from '@screens/restoreFunds/restoreBtc';
import RestoreOrdinals from '@screens/restoreFunds/restoreOrdinals';
import RestoreWallet from '@screens/restoreWallet';
import SendBrc20Screen from '@screens/sendBrc20';
Expand Down Expand Up @@ -301,10 +300,6 @@ const router = createHashRouter([
path: 'restore-funds',
element: <RestoreFunds />,
},
{
path: 'recover-btc',
element: <RestoreBtc />,
},
{
path: 'recover-ordinals',
element: <RestoreOrdinals />,
Expand Down
4 changes: 2 additions & 2 deletions src/app/screens/btcSendScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ function BtcSendScreen() {
recipient,
fee: signedTx.fee,
feePerVByte: signedTx.feePerVByte,
fiatFee: getBtcFiatEquivalent(signedTx.fee, btcFiatRate),
fiatFee: getBtcFiatEquivalent(signedTx.fee, BigNumber(btcFiatRate)),
total: signedTx.total,
fiatTotal: getBtcFiatEquivalent(signedTx.total, btcFiatRate),
fiatTotal: getBtcFiatEquivalent(signedTx.total, BigNumber(btcFiatRate)),
btcSendBrowserTx: true,
requestToken,
tabId,
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/coinDashboard/coinHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default function CoinHeader(props: CoinBalanceProps) {
}

const renderStackingBalances = () => {
if (stxLockedBalance && !new BigNumber(stxLockedBalance).eq(0, 10) && coin === 'STX') {
if (!new BigNumber(stxLockedBalance).eq(0) && coin === 'STX') {
return (
<>
<HeaderSeparator />
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/confirmBrc20Transaction/editFees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export function EditFees({
onClose();
};

const fiatFee = getBtcFiatEquivalent(new BigNumber(fee), btcFiatRate);
const fiatFee = getBtcFiatEquivalent(new BigNumber(fee), BigNumber(btcFiatRate));

return (
<BottomModal
Expand Down
Loading