pub struct Wallet<K, D, L2 = Option<ImpossibleLayer2>>where
D: Descriptor<K>,
L2: Layer2,{ /* private fields */ }
Implementations§
Source§impl<K, D> Wallet<K, D>where
D: Descriptor<K>,
impl<K, D> Wallet<K, D>where
D: Descriptor<K>,
Source§impl<K, D, L2> Wallet<K, D, L2>where
D: Descriptor<K>,
L2: Layer2,
impl<K, D, L2> Wallet<K, D, L2>where
D: Descriptor<K>,
L2: Layer2,
pub fn new_layer2( descr: D, l2_descr: <L2 as Layer2>::Descr, layer2: L2, network: Network, ) -> Wallet<K, D, L2>
pub fn with_layer2<I>(
descr: D,
l2_descr: <L2 as Layer2>::Descr,
layer2: L2,
network: Network,
indexer: &I,
) -> MayError<Wallet<K, D, L2>, Vec<<I as Indexer>::Error>>where
I: Indexer,
pub fn restore( descr: WalletDescr<K, D, <L2 as Layer2>::Descr>, data: WalletData<<L2 as Layer2>::Data>, cache: WalletCache<<L2 as Layer2>::Cache>, layer2: L2, ) -> Wallet<K, D, L2>
pub fn set_name(&mut self, name: String)
pub fn update<B>(
&mut self,
indexer: &B,
) -> MayError<usize, Vec<<B as Indexer>::Error>>where
B: Indexer,
pub fn to_deriver(&self) -> D
pub fn last_derivation_index( &self, keychain: impl Into<Keychain>, ) -> NormalIndex
pub fn next_derivation_index( &mut self, keychain: impl Into<Keychain>, shift: bool, ) -> NormalIndex
pub fn next_address( &mut self, keychain: impl Into<Keychain>, shift: bool, ) -> Address
pub fn balance(&self) -> Sats
pub fn transactions(&self) -> &BTreeMap<Txid, WalletTx>
pub fn coins( &self, ) -> impl Iterator<Item = CoinRow<<<L2 as Layer2>::Cache as Layer2Cache>::Coin>>
pub fn address_coins( &self, ) -> HashMap<DerivedAddr, Vec<CoinRow<<<L2 as Layer2>::Cache as Layer2Cache>::Coin>>>
pub fn address_balance(&self) -> impl Iterator<Item = WalletAddr>
pub fn history( &self, ) -> impl Iterator<Item = TxRow<<<L2 as Layer2>::Cache as Layer2Cache>::Tx>>
pub fn utxo(&self, outpoint: Outpoint) -> Result<WalletUtxo, NonWalletItem>
pub fn all_utxos(&self) -> impl Iterator<Item = WalletUtxo>
pub fn coinselect<'a>( &'a self, up_to: Sats, selector: impl Fn(&WalletUtxo) -> bool + 'a, ) -> impl Iterator<Item = Outpoint> + 'a
Source§impl<K, D, L2> Wallet<K, D, L2>where
D: Descriptor<K> + for<'de> Serialize + for<'de> Deserialize<'de>,
L2: Layer2 + for<'de> Serialize + for<'de> Deserialize<'de>,
WalletDescr<K, D>: for<'de> Serialize + for<'de> Deserialize<'de>,
<L2 as Layer2>::Descr: for<'de> Serialize + for<'de> Deserialize<'de>,
<L2 as Layer2>::Data: for<'de> Serialize + for<'de> Deserialize<'de>,
<L2 as Layer2>::Cache: for<'de> Serialize + for<'de> Deserialize<'de>,
impl<K, D, L2> Wallet<K, D, L2>where
D: Descriptor<K> + for<'de> Serialize + for<'de> Deserialize<'de>,
L2: Layer2 + for<'de> Serialize + for<'de> Deserialize<'de>,
WalletDescr<K, D>: for<'de> Serialize + for<'de> Deserialize<'de>,
<L2 as Layer2>::Descr: for<'de> Serialize + for<'de> Deserialize<'de>,
<L2 as Layer2>::Data: for<'de> Serialize + for<'de> Deserialize<'de>,
<L2 as Layer2>::Cache: for<'de> Serialize + for<'de> Deserialize<'de>,
Source§impl<K, D, L2> Wallet<K, D, L2>where
D: Descriptor<K>,
L2: Layer2,
impl<K, D, L2> Wallet<K, D, L2>where
D: Descriptor<K>,
L2: Layer2,
pub fn construct_psbt<'a, 'b>( &mut self, coins: impl IntoIterator<Item = Outpoint>, beneficiaries: impl IntoIterator<Item = &'b Beneficiary>, params: TxParams, ) -> Result<(Psbt, PsbtMeta), ConstructionError>
Methods from Deref<Target = WalletDescr<K, D, <L2 as Layer2>::Descr>>§
Sourcepub fn generator(&self) -> &D
pub fn generator(&self) -> &D
Method borrowing WalletDescr::generator
field.
Sourcepub fn network(&self) -> Network
pub fn network(&self) -> Network
Method returning copy of WalletDescr::network
field.
Sourcepub fn layer2(&self) -> &L2
pub fn layer2(&self) -> &L2
Method borrowing WalletDescr::layer2
field.
Sourcepub fn _phantom(&self) -> &PhantomData<K>
pub fn _phantom(&self) -> &PhantomData<K>
Method borrowing WalletDescr::_phantom
field.
pub fn addresses(&self, keychain: impl Into<Keychain>) -> AddrIter<'_, K, D>
Trait Implementations§
impl<K, D, L2> Eq for Wallet<K, D, L2>
impl<K, D, L2> StructuralPartialEq for Wallet<K, D, L2>where
D: Descriptor<K>,
L2: Layer2,
Auto Trait Implementations§
impl<K, D, L2> Freeze for Wallet<K, D, L2>
impl<K, D, L2> RefUnwindSafe for Wallet<K, D, L2>where
L2: RefUnwindSafe,
D: RefUnwindSafe,
<L2 as Layer2>::Descr: RefUnwindSafe,
<L2 as Layer2>::Data: RefUnwindSafe,
<L2 as Layer2>::Cache: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, D, L2> Send for Wallet<K, D, L2>
impl<K, D, L2> Sync for Wallet<K, D, L2>
impl<K, D, L2> Unpin for Wallet<K, D, L2>
impl<K, D, L2> UnwindSafe for Wallet<K, D, L2>where
L2: UnwindSafe,
D: UnwindSafe,
<L2 as Layer2>::Descr: UnwindSafe,
<L2 as Layer2>::Data: UnwindSafe,
<L2 as Layer2>::Cache: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.