pub trait Account {
type AccountId: Copy;
// Required methods
fn id(&self) -> Self::AccountId;
fn name(&self) -> Option<&str>;
fn source(&self) -> &AccountSource;
fn ufvk(&self) -> Option<&UnifiedFullViewingKey>;
fn uivk(&self) -> UnifiedIncomingViewingKey;
// Provided method
fn purpose(&self) -> AccountPurpose { ... }
}
Expand description
A set of capabilities that a client account must provide.
Required Associated Types§
Required Methods§
Sourcefn name(&self) -> Option<&str>
fn name(&self) -> Option<&str>
Returns the human-readable name for the account, if any has been configured.
Sourcefn source(&self) -> &AccountSource
fn source(&self) -> &AccountSource
Returns whether this account is derived or imported, and the derivation parameters if applicable.
Sourcefn ufvk(&self) -> Option<&UnifiedFullViewingKey>
fn ufvk(&self) -> Option<&UnifiedFullViewingKey>
Returns the UFVK that the wallet backend has stored for the account, if any.
Accounts for which this returns None
cannot be used in wallet contexts, because
they are unable to maintain an accurate balance.
Sourcefn uivk(&self) -> UnifiedIncomingViewingKey
fn uivk(&self) -> UnifiedIncomingViewingKey
Returns the UIVK that the wallet backend has stored for the account.
All accounts are required to have at least an incoming viewing key. This gives no
indication about whether an account can be used in a wallet context; for that, use
Account::ufvk
.
Provided Methods§
Sourcefn purpose(&self) -> AccountPurpose
fn purpose(&self) -> AccountPurpose
Returns whether the account is a spending account or a view-only account.
Implementations on Foreign Types§
Source§impl<A: Copy> Account for (A, UnifiedFullViewingKey)
Available on crate feature test-dependencies
only.
impl<A: Copy> Account for (A, UnifiedFullViewingKey)
test-dependencies
only.Source§impl<A: Copy> Account for (A, UnifiedIncomingViewingKey)
Available on crate feature test-dependencies
only.
impl<A: Copy> Account for (A, UnifiedIncomingViewingKey)
test-dependencies
only.