Struct lwk_wollet::Wollet

source ·
pub struct Wollet { /* private fields */ }
Expand description

A watch-only wallet defined by a CT descriptor.

Implementations§

source§

impl Wollet

source

pub fn apply_update(&mut self, update: Update) -> Result<(), Error>

source

pub fn apply_update_no_persist(&mut self, update: Update) -> Result<(), Error>

source§

impl Wollet

source

pub fn new( network: ElementsNetwork, persister: Arc<dyn Persister + Send + Sync>, descriptor: WolletDescriptor ) -> Result<Self, Error>

Create a new wallet

source

pub fn with_fs_persist<P: AsRef<Path>>( network: ElementsNetwork, descriptor: WolletDescriptor, datadir: P ) -> Result<Self, Error>

Create a new wallet persisting on file system

source

pub fn without_persist( network: ElementsNetwork, descriptor: WolletDescriptor ) -> Result<Self, Error>

Create a new wallet which not persist anything

source

pub fn policy_asset(&self) -> AssetId

Get the network policy asset

source

pub fn tx_builder(&self) -> WolletTxBuilder<'_>

Creates a transaction builder with a reference to this wallet

source

pub fn network(&self) -> ElementsNetwork

Get the network

source

pub fn descriptor(&self) -> &ConfidentialDescriptor<DescriptorPublicKey>

Get a reference of the wallet descriptor

source

pub fn wollet_descriptor(&self) -> WolletDescriptor

Get a copy of the wallet descriptor

source

pub fn tip(&self) -> Result<(u32, BlockHash), Error>

Get the blockchain tip

source

pub fn address(&self, index: Option<u32>) -> Result<AddressResult, Error>

Get a wallet address

If Some return the address at the given index, otherwise the last unused address.

source

pub fn change(&self, index: Option<u32>) -> Result<AddressResult, Error>

Get a wallet change address

If a specific descriptor is given for change addresses it’s used to derive this address Otherwise this is the same as address()

If Some return the address at the given index, otherwise the last unused address.

source

pub fn txos_inner(&self, unspent: bool) -> Result<Vec<WalletTxOut>, Error>

source

pub fn utxos(&self) -> Result<Vec<WalletTxOut>, Error>

Get the wallet UTXOs

source

pub fn balance(&self) -> Result<HashMap<AssetId, u64>, Error>

Get the wallet balance

source

pub fn transactions(&self) -> Result<Vec<WalletTx>, Error>

Get the wallet transactions with their heights (if confirmed)

source

pub fn transaction(&self, txid: &Txid) -> Result<Option<WalletTx>, Error>

Get a wallet transaction

source

pub fn issuances(&self) -> Result<Vec<IssuanceDetails>, Error>

Get the wallet (re)issuances

source

pub fn issuance(&self, asset: &AssetId) -> Result<IssuanceDetails, Error>

Get the issuance details for a certain asset

This only works if the asset was issued by this wallet

source

pub fn get_details( &self, pset: &PartiallySignedTransaction ) -> Result<PsetDetails, Error>

Get the PSET details with respect to the wallet

source

pub fn add_details( &self, pset: &mut PartiallySignedTransaction ) -> Result<(), Error>

Add the PSET details with respect to the wallet

source

pub fn signers(&self) -> Vec<Fingerprint>

Get the signers’ fingerprints involved in this descriptor

source

pub fn combine( &self, psets: &[PartiallySignedTransaction] ) -> Result<PartiallySignedTransaction, Error>

Combine a vector of PSET

source

pub fn finalize( &self, pset: &mut PartiallySignedTransaction ) -> Result<Transaction, Error>

source

pub fn updates(&self) -> Result<Vec<Update>, PersistError>

Trait Implementations§

source§

impl Debug for Wollet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Wollet

§

impl !RefUnwindSafe for Wollet

§

impl Send for Wollet

§

impl Sync for Wollet

§

impl Unpin for Wollet

§

impl !UnwindSafe for Wollet

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more