From acb05178713e2d4b0bad2ac84f410fb69e2e5f67 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Wed, 11 Oct 2023 20:32:11 -0400 Subject: [PATCH] fix , bug and swapping for nano (#1123) --- cw_nano/lib/nano_wallet.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cw_nano/lib/nano_wallet.dart b/cw_nano/lib/nano_wallet.dart index da50f4ebb..bf7cc6bca 100644 --- a/cw_nano/lib/nano_wallet.dart +++ b/cw_nano/lib/nano_wallet.dart @@ -169,8 +169,8 @@ abstract class NanoWalletBase if (txOut.sendAll) { amt = balance[currency]?.currentBalance ?? BigInt.zero; } else { - amt = BigInt.tryParse( - NanoUtil.getAmountAsRaw(txOut.cryptoAmount ?? "0", NanoUtil.rawPerNano)) ?? + amt = BigInt.tryParse(NanoUtil.getAmountAsRaw( + txOut.cryptoAmount?.replaceAll(',', '.') ?? "0", NanoUtil.rawPerNano)) ?? BigInt.zero; } @@ -182,7 +182,9 @@ abstract class NanoWalletBase final block = await _client.constructSendBlock( amountRaw: amt.toString(), - destinationAddress: txOut.extractedAddress ?? txOut.address, + destinationAddress: credentials.outputs.first.isParsedAddress + ? credentials.outputs.first.extractedAddress! + : credentials.outputs.first.address, privateKey: _privateKey!, balanceAfterTx: runningBalance, previousHash: previousHash,