Skip to content

Commit

Permalink
docs: update bdk-jvm readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Mar 26, 2024
1 parent 6ea0518 commit 89f36a6
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions bdk-jvm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@ import org.bitcoindevkit.*
val externalDescriptor = Descriptor("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)", Network.TESTNET)
val internalDescriptor = Descriptor("wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)", Network.TESTNET)

val databaseConfig = DatabaseConfig.Memory

val blockchainConfig = BlockchainConfig.Electrum(
ElectrumConfig("ssl://electrum.blockstream.info:60002", null, 5u, null, 10u, true)
val esploraClient: EsploraClient = EsploraClient("https://esplora.testnet.kuutamo.cloud/")
val wallet: Wallet = Wallet(
descriptor = externalDescriptor,
changeDescriptor = internalDescriptor,
persistenceBackendPath = "./bdkwallet.db",
network = Network.TESTNET
)
val update = esploraClient.fullScan(
wallet = wallet,
stopGap = 10uL,
parallelRequests = 1uL
)
val wallet = Wallet(externalDescriptor, internalDescriptor, Network.TESTNET, databaseConfig, blockchainConfig)

wallet.applyUpdate(update)

val newAddress = wallet.getAddress(AddressIndex.LastUnused)
```

Expand Down

0 comments on commit 89f36a6

Please sign in to comment.