feat(wallet)!: add new_or_load methods

These methods try to load wallet from persistence and initializes the
wallet instead if non-existant.

An internal helper method `create_signers` is added to reuse code.
Documentation is also improved.
This commit is contained in:
志宇 committed 2023-11-16 07:07:48 +08:00
1 parent 7c6cbc4d9f
commit d294e2e318
3 files changed
+190 -51

No files matched your search

@@ -2,6 +2,7 @@ use std::{io::Write, str::FromStr};
use bdk::{
bitcoin::{Address, Network},
chain::PersistBackend,
wallet::{AddressIndex, Update},
SignOptions, Wallet,
};