A quick guide on how to use the BDK-Kotlin 0.7.0 library to create a send transaction with multiple recipients.
You can use the Padawan Wallet and dev-kit open-source projects as reference.
TxBuilder
With the TxBuilder() you can create the transaciton as per usual.
var txBuilder = TxBuilder() for (recipient in recipientList) { txBuilder = txBuilder.addRecipient(address = recipient.first, amount = recipient.second) } txBuilder = txBuilder.feeRate(satPerVbyte = feeRate) return txBuilder.finish(wallet)
You can write this piece of logic however you want, but to give an example of using scopes to read the recipientList data :
val psbt = recipientList.fold(TxBuilder()) { builder, recipient -> builder.addRecipient(recipient.address, recipient.amount) }.finish(wallet)
Sign & Broadcast
After you have the PSBT object you can do whatever you want with it! Sign and broadcast with the Wallet and Blockchain object to send out the transaction.

