Expand description
Wallet utilities
Opens a Bark wallet and its on-chain companion from a data directory.
§Behavior
- Reads a BIP-39
mnemonicfile from the provided directory - Parses
config.tomlinto abark::Config - Opens
db.sqliteas abark::persist::sqlite::SqliteClientand loads persisted properties - Loads or creates the
bark::onchain::OnchainWallet, wraps it inArc<RwLock<_>>, and stores it inside thebark::Walletviabark::OpenWalletArgs::onchain— BDK-specific methods are accessed via downcasting throughbark::Wallet::onchain
§Errors
Returns an anyhow::Error with context describing the failing step (I/O, parsing,
database access, or wallet initialization).
§Example
Open a wallet from a data directory:
let datadir = Path::new("./bark_data");
let bark_wallet = open_wallet(datadir, "myapp/1.0").await?.unwrap();
// Use the wallet...
Ok(())Structs§
- Config
Opts - Options to define the initial bark config
- Create
Opts
Constants§
- AUTH_
TOKEN_ FILE - File name used to persist the auth token in the datadir.
Functions§
- create_
wallet - open_
wallet - read_
mnemonic - Read the raw mnemonic phrase from the wallet datadir.