pub struct Wallet { /* private fields */ }Implementations§
Source§impl Wallet
impl Wallet
Sourcepub fn last_indexes(&self) -> &BTreeMap<UnhardenedIndex, UnhardenedIndex>
pub fn last_indexes(&self) -> &BTreeMap<UnhardenedIndex, UnhardenedIndex>
Method borrowing Wallet::last_indexes field.
Sourcepub fn last_block(&self) -> BlockHash
pub fn last_block(&self) -> BlockHash
Method returning copy of Wallet::last_block field.
Sourcepub fn height(&self) -> u32
pub fn height(&self) -> u32
Method returning copy of Wallet::height field.
Sourcepub fn state(&self) -> WalletState
pub fn state(&self) -> WalletState
Method returning copy of Wallet::state field.
Sourcepub fn ephemerals(&self) -> &WalletEphemerals
pub fn ephemerals(&self) -> &WalletEphemerals
Method borrowing Wallet::ephemerals field.
Sourcepub fn utxos(&self) -> &BTreeSet<UtxoTxid>
pub fn utxos(&self) -> &BTreeSet<UtxoTxid>
Method borrowing Wallet::utxos field.
Sourcepub fn history(&self) -> &BTreeSet<HistoryEntry>
pub fn history(&self) -> &BTreeSet<HistoryEntry>
Method borrowing Wallet::history field.
Source§impl Wallet
impl Wallet
pub fn as_settings(&self) -> &WalletSettings
pub fn to_settings(&self) -> WalletSettings
pub fn into_settings(self) -> WalletSettings
pub fn tx_count(&self) -> usize
pub fn next_default_index(&self) -> UnhardenedIndex
pub fn next_change_index(&self) -> UnhardenedIndex
pub fn update_next_change_index(&mut self, new_index: UnhardenedIndex) -> bool
pub fn indexed_address(&self, index: UnhardenedIndex) -> Address
pub fn next_address(&self) -> Address
pub fn coinselect(&self, value: u64) -> Option<(BTreeSet<Prevout>, u64)>
pub fn address_info(&self, include_empty: bool) -> Vec<AddressSummary>
pub fn update_signers( &mut self, signers: impl IntoIterator<Item = Signer>, ) -> Result<u16, DescriptorError>
pub fn add_descriptor_class( &mut self, descriptor_class: DescriptorClass, ) -> bool
pub fn update_fees(&mut self, f0: f64, f1: f64, f2: f64)
pub fn clear_utxos(&mut self)
pub fn update_utxos(&mut self, batch: BTreeSet<UtxoTxid>)
pub fn update_complete( &mut self, addr_buffer: &BTreeMap<AddressSource, BTreeSet<TxidMeta>>, tx_buffer: &[Transaction], )
pub fn update_electrum(&mut self, electrum: ElectrumServer) -> bool
pub fn set_comment( &mut self, txid: Txid, label: String, ) -> Result<Option<Comment>, ()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Wallet
impl<'de> Deserialize<'de> for Wallet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FileDocument for Wallet
impl FileDocument for Wallet
const DOC_MAGIC: [u8; 4] = WALLET_DOC_MAGIC
const FILE_EXT: &'static str = "mcw"
type FallbackDocType = WalletSettings
fn magic_u32() -> u32
fn file_name(base: &str, order_no: usize) -> String
fn read_file(path: impl AsRef<Path>) -> Result<Self, Error>where
Self: StrictDecode,
fn write_file(&self, path: impl AsRef<Path>) -> Result<usize, Error>where
Self: Sized + StrictEncode,
Source§impl From<WalletSettings> for Wallet
impl From<WalletSettings> for Wallet
Source§fn from(settings: WalletSettings) -> Self
fn from(settings: WalletSettings) -> Self
Converts to this type from the input type.
Source§impl ResolveTx for Wallet
impl ResolveTx for Wallet
Source§fn resolve_tx(&self, txid: Txid) -> Result<Transaction, TxResolverError>
fn resolve_tx(&self, txid: Txid) -> Result<Transaction, TxResolverError>
Tries to find a transaction by transaction id (
Txid)Source§impl StrictDecode for Wallet
impl StrictDecode for Wallet
Source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
Decode with the given
std::io::Read instance; must either
construct an instance or return implementation-specific error type.Source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
Tries to deserialize byte array into the current type using
StrictDecode::strict_decode. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and
StrictDecode::strict_decode to avoid such failures.Source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
Reads data from file at
path and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed if file contains remaining
data after the object reconstruction.Source§impl StrictEncode for Wallet
impl StrictEncode for Wallet
Source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
Encode with the given
std::io::Write instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.Source§fn strict_serialize(&self) -> Result<Vec<u8>, Error>
fn strict_serialize(&self) -> Result<Vec<u8>, Error>
Serializes data as a byte array using
StrictEncode::strict_encode
functionAuto Trait Implementations§
impl Freeze for Wallet
impl RefUnwindSafe for Wallet
impl Send for Wallet
impl Sync for Wallet
impl Unpin for Wallet
impl UnwindSafe for Wallet
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