defuse/
far.rs

1/// Extensions defined in this module should be used only in FAR chain
2/// and are not expected to be supported on the main chain
3use defuse_core::crypto::PublicKey;
4use near_plugins::AccessControllable;
5use near_sdk::{AccountId, ext_contract};
6use std::collections::HashMap;
7use std::collections::HashSet;
8
9#[ext_contract(ext_force_public_key_manager)]
10pub trait ForcePublicKeyManager: AccessControllable {
11    /// Registers or re-activates `public_key` under the user account_id.
12    ///
13    /// NOTE: MUST attach 1 yⓃ for security purposes.
14    fn force_add_public_keys(&mut self, public_keys: HashMap<AccountId, HashSet<PublicKey>>);
15
16    /// Deactivate `public_key` from the user account_id,
17    /// i.e. this key can't be used to make any actions unless it's re-created.
18    ///
19    /// NOTE: MUST attach 1 yⓃ for security purposes.
20    fn force_remove_public_keys(&mut self, public_keys: HashMap<AccountId, HashSet<PublicKey>>);
21}