Enum hersir::config::WalletTemplate
source · pub enum WalletTemplate {
Generated {
alias: WalletAlias,
value: Value,
wallet_type: WalletType,
delegate: Option<NodeAlias>,
discrimination: Discrimination,
tokens: HashMap<TokenIdentifier, u64>,
},
External {
address: String,
value: Value,
tokens: HashMap<TokenIdentifier, u64>,
},
}
Variants§
Generated
Fields
§
alias: WalletAlias
§
wallet_type: WalletType
§
discrimination: Discrimination
§
tokens: HashMap<TokenIdentifier, u64>
Generated wallet when we want let hersir generate new wallet from scratch
External
Wallet which was given in configuration by address, thus hersir does not control it, which implies that some operations like delegation in block0 are not available
Implementations§
source§impl WalletTemplate
impl WalletTemplate
pub fn is_generated(&self) -> bool
pub fn has_alias(&self, other_alias: &WalletAlias) -> bool
source§impl WalletTemplate
impl WalletTemplate
pub fn new_account<S: Into<WalletAlias>>( alias: S, value: Value, discrimination: Discrimination, tokens: HashMap<TokenIdentifier, u64> ) -> Self
pub fn new_utxo<S: Into<WalletAlias>>( alias: S, value: Value, discrimination: Discrimination, tokens: HashMap<TokenIdentifier, u64> ) -> Self
pub fn new_external<S: Into<String>>( address: S, value: Value, tokens: HashMap<TokenIdentifier, u64> ) -> Self
pub fn id(&self) -> String
pub fn alias(&self) -> Option<WalletAlias>
pub fn address(&self) -> Option<String>
pub fn discrimination(&self) -> Discrimination
pub fn wallet_type(&self) -> Option<WalletType>
pub fn value(&self) -> &Value
pub fn delegate(&self) -> &Option<NodeAlias>
pub fn delegate_mut(&mut self) -> &mut Option<NodeAlias>
pub fn tokens(&self) -> &HashMap<TokenIdentifier, u64>
Trait Implementations§
source§impl Clone for WalletTemplate
impl Clone for WalletTemplate
source§fn clone(&self) -> WalletTemplate
fn clone(&self) -> WalletTemplate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for WalletTemplate
impl Debug for WalletTemplate
source§impl<'de> Deserialize<'de> for WalletTemplate
impl<'de> Deserialize<'de> for WalletTemplate
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 From<WalletTemplate> for Wallet
impl From<WalletTemplate> for Wallet
source§fn from(template: WalletTemplate) -> Self
fn from(template: WalletTemplate) -> Self
Converts to this type from the input type.
source§impl Hash for WalletTemplate
impl Hash for WalletTemplate
source§impl PartialEq<WalletTemplate> for WalletTemplate
impl PartialEq<WalletTemplate> for WalletTemplate
source§fn eq(&self, other: &WalletTemplate) -> bool
fn eq(&self, other: &WalletTemplate) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for WalletTemplate
impl StructuralEq for WalletTemplate
impl StructuralPartialEq for WalletTemplate
Auto Trait Implementations§
impl RefUnwindSafe for WalletTemplate
impl Send for WalletTemplate
impl Sync for WalletTemplate
impl Unpin for WalletTemplate
impl UnwindSafe for WalletTemplate
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request