From 11edcf30cf89211d30c85d7ee6e0ec26d4838e62 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 18 Dec 2023 15:12:16 -0600 Subject: [PATCH] format unused wallet coins for spark spend --- .../wallet_mixin_interfaces/spark_interface.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index e2a16fafb..a70245c9a 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -105,9 +105,15 @@ mixin SparkInterface on Bip39HDWallet, ElectrumXInterface { Future prepareSendSpark({ required TxData txData, }) async { - // todo fetch - final List serializedMintMetas = []; - final List myCoins = []; + final coins = await mainDB.isar.sparkCoins + .where() + .walletIdEqualToAnyLTagHash(walletId) + .filter() + .isUsedEqualTo(false) + .findAll(); + + final serializedCoins = + coins.map((e) => (e.serializedCoinB64!, e.contextB64!)).toList(); final currentId = await electrumXClient.getSparkLatestCoinId(); final List> setMaps = [];