From 0b3ac17660d45414f4802d478e29d58252e2a56b Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 9 Sep 2026 18:02:19 +0800 Subject: [PATCH] createTransaction use BigInt instead of double (#3608) --- lib/view_model/send/send_view_model.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index 9e3fa7f55..48ba722a9 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -907,9 +907,11 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor final isSendAll = outputs.any((output) => output.sendAll); if (!isSendAll) { - final estimateTxAmountDouble = outputs.fold( - 0, (acc, output) => acc + (double.tryParse(output.cryptoAmount) ?? 0)); - if (estimateTxAmountDouble <= 0) throw Exception('Amount must be greater than 0'); + final estimateTxAmount = outputs.fold( + BigInt.zero, (acc, output) => acc + output.cryptoAmountMoney.amount); + if (estimateTxAmount <= BigInt.zero) { + throw Exception('Amount must be greater than 0'); + } } pendingTransaction = await wallet.createTransaction(_credentials(provider));