TxBuilderResult

data class TxBuilderResult(var psbt: PartiallySignedBitcoinTransaction, var transactionDetails: TransactionDetails)

The value returned from calling the .finish() method on the TxBuilder or BumpFeeTxBuilder.

Samples


fun main() { 
   //sampleStart 
   val faucetAddress = Address("tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt")
// TxBuilderResult is a data class, which means you can use destructuring declarations on it to
// open it up in its component parts
val (psbt, txDetails) = TxBuilder()
    .addRecipient(faucetAddress.scriptPubkey(), 1000u)
    .feeRate(1.2f)
    .finish(wallet)

println("Txid is ${txDetails.txid}")
wallet.sign(psbt) 
   //sampleEnd
}

fun main() { 
   //sampleStart 
   val faucetAddress = Address("tb1ql7w62elx9ucw4pj5lgw4l028hmuw80sndtntxt")
val txBuilderResult: TxBuilderResult = TxBuilder()
    .addRecipient(faucetAddress.scriptPubkey(), 1000u)
    .feeRate(1.2f)
    .finish(wallet)

val psbt = txBuilderResult.psbt
val txDetails = txBuilderResult.transactionDetails

println("Txid is ${txDetails.txid}")
wallet.sign(psbt) 
   //sampleEnd
}

Constructors

Link copied to clipboard
fun TxBuilderResult(psbt: PartiallySignedBitcoinTransaction, transactionDetails: TransactionDetails)

Properties

Link copied to clipboard
var psbt: PartiallySignedBitcoinTransaction

The PSBT

Link copied to clipboard
var transactionDetails: TransactionDetails

The transaction details.