Skip to content

Commit

Permalink
Add send utxo methods to AbstractKit
Browse files Browse the repository at this point in the history
  • Loading branch information
abdrasulov committed Dec 21, 2023
1 parent c0a58fb commit 921e9d6
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<List<TransactionInfo>> {
return bitcoinCore.transactions(fromUid, type, limit)
}
Expand All @@ -55,10 +62,29 @@ abstract class AbstractKit {
return bitcoinCore.getTransaction(hash)
}

fun fee(
unspentOutputs: List<UnspentOutput>,
address: String? = null,
feeRate: Int,
pluginData: Map<Byte, IPluginData>
): Long {
return bitcoinCore.fee(unspentOutputs, address, feeRate, pluginData)
}

fun fee(value: Long, address: String? = null, senderPay: Boolean = true, feeRate: Int, pluginData: Map<Byte, IPluginData> = mapOf()): Long {
return bitcoinCore.fee(value, address, senderPay, feeRate, pluginData)
}

fun send(
address: String,
unspentOutputs: List<UnspentOutput>,
feeRate: Int,
sortType: TransactionDataSortType,
pluginData: Map<Byte, IPluginData>
): FullTransaction {
return bitcoinCore.send(address, unspentOutputs, feeRate, sortType, pluginData)
}

fun send(
address: String,
value: Long,
Expand Down

0 comments on commit 921e9d6

Please sign in to comment.