chore(wallet)!: Remove enum AddressIndex

This commit is contained in:
valued mammal authored and 志宇 committed 2024-04-20 15:12:39 +08:00
1 parent d87874780b
commit a266b4718f
5 files changed
+8 -129

No files matched your search

@@ -7,8 +7,8 @@ use std::{io::Write, str::FromStr};
use bdk::{
bitcoin::{Address, Network},
wallet::{AddressIndex, Update},
SignOptions, Wallet,
wallet::Update,
KeychainKind, SignOptions, Wallet,
};
use bdk_esplora::{esplora_client, EsploraExt};
use bdk_file_store::Store;
@@ -26,7 +26,7 @@ fn main() -> Result<(), anyhow::Error> {
Network::Testnet,
)?;
let address = wallet.try_get_address(AddressIndex::New)?;
let address = wallet.next_unused_address(KeychainKind::External)?;
println!("Generated Address: {}", address);
let balance = wallet.get_balance();