From 4c66bbaa413e76a7af1339169ae44fecfc845b17 Mon Sep 17 00:00:00 2001 From: likho Date: Tue, 10 Oct 2023 14:54:23 +0200 Subject: [PATCH] Fix send all error --- lib/wallets/example/libepiccash.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/wallets/example/libepiccash.dart b/lib/wallets/example/libepiccash.dart index 30e0aa087..d51ab78d6 100644 --- a/lib/wallets/example/libepiccash.dart +++ b/lib/wallets/example/libepiccash.dart @@ -255,9 +255,12 @@ abstract class LibEpiccash { final part1 = jsonDecode(slate[0] as String); final part2 = jsonDecode(slate[1] as String); + List? outputs = part2['tx']?['body']?['outputs'] as List; + String? commitId = (outputs.isEmpty) ? '' : outputs[0]['commit'] as String; + ({String slateId, String commitId}) data = ( slateId: part1[0]['tx_slate_id'], - commitId: part2['tx']['body']['outputs'][0]['commit'], + commitId: commitId, ); return data; @@ -463,10 +466,6 @@ abstract class LibEpiccash { .toInt(); var amountSending = amount - largestSatoshiFee; //Get fees for this new amount - ({ - String wallet, - int amount, - }) data = (wallet: wallet, amount: amountSending); fees = await compute(_transactionFeesWrapper, ( wallet: wallet, amount: amountSending,