pub trait AccountManager {
// Required methods
fn has_public_key(
&self,
account_id: &AccountId,
public_key: &PublicKey,
) -> bool;
fn public_keys_of(&self, account_id: &AccountId) -> HashSet<PublicKey>;
fn add_public_key(&mut self, public_key: PublicKey);
fn remove_public_key(&mut self, public_key: &PublicKey);
fn is_nonce_used(
&self,
account_id: &AccountId,
nonce: AsBase64<Nonce>,
) -> bool;
fn invalidate_nonces(&mut self, nonces: Vec<AsBase64<Nonce>>);
}
Required Methods§
Sourcefn has_public_key(&self, account_id: &AccountId, public_key: &PublicKey) -> bool
fn has_public_key(&self, account_id: &AccountId, public_key: &PublicKey) -> bool
Check if account has given public key
Sourcefn public_keys_of(&self, account_id: &AccountId) -> HashSet<PublicKey>
fn public_keys_of(&self, account_id: &AccountId) -> HashSet<PublicKey>
Returns set of public keys registered for given account
Sourcefn add_public_key(&mut self, public_key: PublicKey)
fn add_public_key(&mut self, public_key: PublicKey)
Registers or re-activates public_key
under the caller account_id.
NOTE: MUST attach 1 yⓃ for security purposes.
Sourcefn remove_public_key(&mut self, public_key: &PublicKey)
fn remove_public_key(&mut self, public_key: &PublicKey)
Deactivate public_key
from the caller account_id,
i.e. this key can’t be used to make any actions unless it’s re-created.
NOTE: MUST attach 1 yⓃ for security purposes.
Sourcefn is_nonce_used(&self, account_id: &AccountId, nonce: AsBase64<Nonce>) -> bool
fn is_nonce_used(&self, account_id: &AccountId, nonce: AsBase64<Nonce>) -> bool
Returns whether given nonce was already used by the account NOTE: nonces are non-sequential and follow permit2 nonce schema.
Sourcefn invalidate_nonces(&mut self, nonces: Vec<AsBase64<Nonce>>)
fn invalidate_nonces(&mut self, nonces: Vec<AsBase64<Nonce>>)
NOTE: MUST attach 1 yⓃ for security purposes.