From 205bc47144f13782557fbf185f509f06d10a4e05 Mon Sep 17 00:00:00 2001 From: sadiabbasi Date: Wed, 8 Jan 2025 22:37:54 +0300 Subject: [PATCH] fix: :art: fixed typeCheck --- src/components/Transaction.tsx | 3 ++- src/utils/chain/etherum.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Transaction.tsx b/src/components/Transaction.tsx index ebda455f9..13c7e2b26 100644 --- a/src/components/Transaction.tsx +++ b/src/components/Transaction.tsx @@ -8,6 +8,7 @@ import { QuestionMark, WarningCircle } from 'iconoir-react-native'; import NegligibleTransactionFees from './NegligibleTransactionFees'; import { KeyValue } from '../utils/strings'; import { formatCurrencyValue } from '../utils/numbers'; +import Decimal from 'decimal.js'; export type TransactionFeeData = { fee: string; @@ -203,7 +204,7 @@ export function ContractOperationDetails({ operation, date }: { operation: Opera } export function isFree(asset: IAsset, usdFee: number): boolean { - return asset.getAmount() === BigInt(0) && usdFee === 0; + return asset.getAmount() === new Decimal(0) && usdFee === 0; } // shows the fee only if the transaction does not contain asset transfers, or is not free diff --git a/src/utils/chain/etherum.ts b/src/utils/chain/etherum.ts index 996611c89..3edae1010 100644 --- a/src/utils/chain/etherum.ts +++ b/src/utils/chain/etherum.ts @@ -556,7 +556,7 @@ export class WalletConnectSession implements IChainSession { const transactionRequest: TransactionRequest = { to: (await transaction.getTo()).getName(), from: (await transaction.getFrom()).getName(), - value: (await transaction.getValue()).getAmount(), + value: (await transaction.getValue()).getAmount().toString(), data: (await transaction.getData()).data, };