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 - Opens the
bark::Walletbound to the on-chain wallet - Returns
(bark::Wallet, bark::onchain::OnchainWallet)
§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, onchain_wallet) = open_wallet(datadir).await?.unwrap();
// Use the wallets...
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.