Struct mutiny_core::MutinyWallet
source · pub struct MutinyWallet<S: MutinyStorage> {
pub storage: S,
pub node_manager: Arc<NodeManager<S>>,
pub nostr: Arc<NostrManager<S>>,
/* private fields */
}Expand description
MutinyWallet is the main entry point for the library. It contains the NodeManager, which is the main interface to manage the bitcoin and the lightning functionality.
Fields§
§storage: S§node_manager: Arc<NodeManager<S>>§nostr: Arc<NostrManager<S>>Implementations§
source§impl<S: MutinyStorage> MutinyWallet<S>
impl<S: MutinyStorage> MutinyWallet<S>
pub async fn new( storage: S, config: MutinyWalletConfig ) -> Result<MutinyWallet<S>, MutinyError>
sourcepub async fn start(&mut self) -> Result<(), MutinyError>
pub async fn start(&mut self) -> Result<(), MutinyError>
Starts up all the nodes again.
Not needed after NodeManager’s new() function.
sourcepub async fn pay_subscription_invoice(
&self,
inv: &Bolt11Invoice
) -> Result<(), MutinyError>
pub async fn pay_subscription_invoice( &self, inv: &Bolt11Invoice ) -> Result<(), MutinyError>
Pay the subscription invoice. This will post a NWC automatically afterwards.
sourcepub async fn sync_nostr_contacts(
&self,
npub: XOnlyPublicKey,
timeout: Option<Duration>
) -> Result<(), MutinyError>
pub async fn sync_nostr_contacts( &self, npub: XOnlyPublicKey, timeout: Option<Duration> ) -> Result<(), MutinyError>
Get contacts from the given npub and sync them to the wallet
sourcepub async fn stop(&self) -> Result<(), MutinyError>
pub async fn stop(&self) -> Result<(), MutinyError>
Stops all of the nodes and background processes. Returns after node has been stopped.
pub async fn change_password( &mut self, old: Option<String>, new: Option<String> ) -> Result<(), MutinyError>
sourcepub async fn reset_onchain_tracker(&mut self) -> Result<(), MutinyError>
pub async fn reset_onchain_tracker(&mut self) -> Result<(), MutinyError>
Resets BDK’s keychain tracker. This will require a re-sync of the blockchain.
This can be useful if you get stuck in a bad state.
sourcepub async fn restore_mnemonic(
storage: S,
m: Mnemonic
) -> Result<(), MutinyError>
pub async fn restore_mnemonic( storage: S, m: Mnemonic ) -> Result<(), MutinyError>
Restores the mnemonic after deleting the previous state.
Backup the state beforehand. Does not restore lightning data. Should refresh or restart afterwards. Wallet should be stopped.
Trait Implementations§
source§impl<S: Clone + MutinyStorage> Clone for MutinyWallet<S>
impl<S: Clone + MutinyStorage> Clone for MutinyWallet<S>
source§fn clone(&self) -> MutinyWallet<S>
fn clone(&self) -> MutinyWallet<S>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more