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) ```