From 89f36a6c88adb45dae528ee890fa20e372d0e174 Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Tue, 26 Mar 2024 11:36:20 -0400 Subject: [PATCH] docs: update bdk-jvm readme --- bdk-jvm/README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bdk-jvm/README.md b/bdk-jvm/README.md index 3b60b992..a67b2aeb 100644 --- a/bdk-jvm/README.md +++ b/bdk-jvm/README.md @@ -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) ```