Skip to content

Commit ac906fd

Browse files
committed
update bdk to 0.11.0
1 parent cc5e271 commit ac906fd

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ dependencies {
158158
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
159159

160160
// Bitcoindevkit
161-
implementation 'org.bitcoindevkit:bdk-android:0.9.0'
161+
implementation 'org.bitcoindevkit:bdk-android:0.11.0'
162162

163163
// Github
164164
implementation 'com.github.lelloman:android-identicons:v11'

app/src/main/java/com/iriswallet/data/BdkRepository.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object BdkRepository {
1515
private val keys: DescriptorSecretKey by lazy {
1616
DescriptorSecretKey(
1717
AppContainer.bitcoinNetwork.toBdkNetwork(),
18-
AppContainer.bitcoinKeys.mnemonic,
18+
Mnemonic.fromString(AppContainer.bitcoinKeys.mnemonic),
1919
AppContainer.mnemonicPassword,
2020
)
2121
}
@@ -80,7 +80,11 @@ object BdkRepository {
8080

8181
fun sendToAddress(address: String, amount: ULong): String {
8282
try {
83-
val psbt = TxBuilder().addRecipient(address, amount).finish(vanillaWallet)
83+
val psbt =
84+
TxBuilder()
85+
.addRecipient(Address(address).scriptPubkey(), amount)
86+
.finish(vanillaWallet)
87+
.psbt
8488
vanillaWallet.sign(psbt)
8589
blockchain.broadcast(psbt)
8690
return psbt.txid()

0 commit comments

Comments
 (0)