TxBuilderResult

data class TxBuilderResult(var psbt: PartiallySignedTransaction, 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 into its component parts
val (psbt, txDetails) = TxBuilder()
    .addRecipient(faucetAddress.scriptPubkey(), 1000uL)
    .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(), 1000uL)
    .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: PartiallySignedTransaction, transactionDetails: TransactionDetails)

Properties

Link copied to clipboard
var psbt: PartiallySignedTransaction

The PSBT

Link copied to clipboard
var transactionDetails: TransactionDetails

The transaction details.