pub struct Account<K: AsymmetricKey> {
secret: SecretKey<K>,
counter: u32,
}
Fields§
§secret: SecretKey<K>
§counter: u32
Implementations§
source§impl Account<Ed25519Extended>
impl Account<Ed25519Extended>
pub fn from_secret_key(key: SecretKey<Ed25519Extended>) -> Self
source§impl<K: AsymmetricKey> Account<K>
impl<K: AsymmetricKey> Account<K>
pub fn account_id(&self) -> AccountId
pub fn public(&self) -> [u8; 32]
sourcepub fn counter(&self) -> u32
pub fn counter(&self) -> u32
get the transaction counter
this is the counter for the number of times a transaction has been successfully sent to the network with this account. It is used to sign transactions so it is important to keep it up to date as much as possible.
pub fn set_counter(&mut self, counter: u32)
sourcepub fn increase_counter(&mut self, atm: u32)
pub fn increase_counter(&mut self, atm: u32)
increase the counter with the given amount
pub fn secret(&self) -> &SecretKey<K>
Auto Trait Implementations§
impl<K> RefUnwindSafe for Account<K>where <K as AsymmetricKey>::Secret: RefUnwindSafe,
impl<K> Send for Account<K>where <K as AsymmetricKey>::Secret: Send,
impl<K> Sync for Account<K>where <K as AsymmetricKey>::Secret: Sync,
impl<K> Unpin for Account<K>where <K as AsymmetricKey>::Secret: Unpin,
impl<K> UnwindSafe for Account<K>where <K as AsymmetricKey>::Secret: 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