Trait lightning_signer::wallet::Wallet

source ·
pub trait Wallet {
    // Required methods
    fn can_spend(
        &self,
        child_path: &[u32],
        script_pubkey: &Script
    ) -> Result<bool, Status>;
    fn allowlist_contains_payee(&self, payee: PublicKey) -> bool;
    fn allowlist_contains(&self, script_pubkey: &Script, path: &[u32]) -> bool;
    fn network(&self) -> Network;
    fn get_native_address(&self, child_path: &[u32]) -> Result<Address, Status>;
    fn get_taproot_address(&self, child_path: &[u32]) -> Result<Address, Status>;
    fn get_wrapped_address(&self, child_path: &[u32]) -> Result<Address, Status>;
}
Expand description

A layer-1 wallet used by Validator

Required Methods§

source

fn can_spend( &self, child_path: &[u32], script_pubkey: &Script ) -> Result<bool, Status>

True if the wallet can spend the given output with a derived key

source

fn allowlist_contains_payee(&self, payee: PublicKey) -> bool

Returns true if the given destination Lightning payee is in the node’s allowlist

source

fn allowlist_contains(&self, script_pubkey: &Script, path: &[u32]) -> bool

True if the script_pubkey is in the node’s allowlist

source

fn network(&self) -> Network

Returns the network

source

fn get_native_address(&self, child_path: &[u32]) -> Result<Address, Status>

Returns the native segwit address at path

source

fn get_taproot_address(&self, child_path: &[u32]) -> Result<Address, Status>

Returns the p2tr address at path

source

fn get_wrapped_address(&self, child_path: &[u32]) -> Result<Address, Status>

👎Deprecated since 0.9.0: Use native addresses instead

Returns the wrapped segwit address at path

Implementors§