createTransaction use BigInt instead of double (#3608)

This commit is contained in:
cyan
2026-09-09 12:02:19 +02:00
committed by GitHub
parent 9d6adcfe68
commit 0b3ac17660
+5 -3
View File
@@ -907,9 +907,11 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
final isSendAll = outputs.any((output) => output.sendAll);
if (!isSendAll) {
final estimateTxAmountDouble = outputs.fold<double>(
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>(
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));