From feabebcce59756b14dfb2cc2297475c79f64c95b Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 24 May 2023 12:11:33 -0600 Subject: [PATCH] amount fix --- lib/services/coins/nano/nano_wallet.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/services/coins/nano/nano_wallet.dart b/lib/services/coins/nano/nano_wallet.dart index 2b7b67c15..f019cde87 100644 --- a/lib/services/coins/nano/nano_wallet.dart +++ b/lib/services/coins/nano/nano_wallet.dart @@ -333,19 +333,19 @@ class NanoWallet extends CoinServiceAPI with WalletCache, WalletDB, CoinControlI } else if (typeString == "receive") { type = TransactionType.incoming; } - var intAmount = int.parse((BigInt.parse(tx["amount"].toString()) ~/ BigInt.from(10).pow(23)).toString()); - var strAmount = jsonEncode({ - "raw": intAmount.toString(), - "fractionDigits": 7, - }); + final amount = Amount( + rawValue: BigInt.parse(tx["amount"].toString()), + fractionDigits: coin.decimals, + ); + var transaction = Transaction( walletId: walletId, txid: tx["hash"].toString(), timestamp: int.parse(tx["local_timestamp"].toString()), type: type, subType: TransactionSubType.none, - amount: intAmount, - amountString: strAmount, + amount: 0, + amountString: amount.toJsonString(), fee: 0, height: int.parse(tx["height"].toString()), isCancelled: false,