From 8daf3472762a76d383ec8408e00c2fcae5a9bdd1 Mon Sep 17 00:00:00 2001 From: abdrasulov Date: Thu, 21 Dec 2023 15:36:24 +0600 Subject: [PATCH] Add send utxo methods to AbstractKit --- .../bitcoincore/AbstractKit.kt | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/bitcoincore/src/main/kotlin/io/horizontalsystems/bitcoincore/AbstractKit.kt b/bitcoincore/src/main/kotlin/io/horizontalsystems/bitcoincore/AbstractKit.kt index e585e046..e605ba21 100644 --- a/bitcoincore/src/main/kotlin/io/horizontalsystems/bitcoincore/AbstractKit.kt +++ b/bitcoincore/src/main/kotlin/io/horizontalsystems/bitcoincore/AbstractKit.kt @@ -1,7 +1,12 @@ package io.horizontalsystems.bitcoincore import io.horizontalsystems.bitcoincore.core.IPluginData -import io.horizontalsystems.bitcoincore.models.* +import io.horizontalsystems.bitcoincore.models.BitcoinPaymentData +import io.horizontalsystems.bitcoincore.models.PublicKey +import io.horizontalsystems.bitcoincore.models.TransactionDataSortType +import io.horizontalsystems.bitcoincore.models.TransactionFilterType +import io.horizontalsystems.bitcoincore.models.TransactionInfo +import io.horizontalsystems.bitcoincore.models.UsedAddress import io.horizontalsystems.bitcoincore.network.Network import io.horizontalsystems.bitcoincore.storage.FullTransaction import io.horizontalsystems.bitcoincore.storage.UnspentOutput @@ -47,6 +52,8 @@ abstract class AbstractKit { bitcoinCore.onEnterBackground() } + fun getSpendableUtxo() = bitcoinCore.getSpendableUtxo() + fun transactions(fromUid: String? = null, type: TransactionFilterType? = null, limit: Int? = null): Single> { return bitcoinCore.transactions(fromUid, type, limit) } @@ -55,10 +62,29 @@ abstract class AbstractKit { return bitcoinCore.getTransaction(hash) } + fun fee( + unspentOutputs: List, + address: String? = null, + feeRate: Int, + pluginData: Map + ): Long { + return bitcoinCore.fee(unspentOutputs, address, feeRate, pluginData) + } + fun fee(value: Long, address: String? = null, senderPay: Boolean = true, feeRate: Int, pluginData: Map = mapOf()): Long { return bitcoinCore.fee(value, address, senderPay, feeRate, pluginData) } + fun send( + address: String, + unspentOutputs: List, + feeRate: Int, + sortType: TransactionDataSortType, + pluginData: Map + ): FullTransaction { + return bitcoinCore.send(address, unspentOutputs, feeRate, sortType, pluginData) + } + fun send( address: String, value: Long,