From e738126bedff23e8a7f094b28927fb2a9c390fe4 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Fri, 5 Nov 2021 00:45:50 +0530 Subject: [PATCH] Fix demo --- bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt b/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt index a02f843..45cd0a8 100644 --- a/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt +++ b/bindings/bdk-kotlin/demo/src/main/kotlin/Main.kt @@ -72,12 +72,12 @@ fun main(args: Array) { println("Press Enter to return funds") readLine() println("Creating a PSBT with recipient $recipient and amount $amount satoshis...") - val transaction = PartiallySignedBitcoinTransaction(wallet, recipient, amount) + val psbt = PartiallySignedBitcoinTransaction(wallet, recipient, amount, null) println("Signing the transaction...") - wallet.sign(transaction) + wallet.sign(psbt) println("Broadcasting the signed transaction...") - val transactionId = wallet.broadcast(transaction) - println("Broadcasted transaction with id $transactionId") + val transaction = wallet.broadcast(psbt) + println("Broadcasted transaction $transaction") val take = 5 println("Listing latest $take transactions...") wallet @@ -87,3 +87,4 @@ fun main(args: Array) { .forEach { println(it) } println("Final wallet balance: ${wallet.getBalance()}") } +