vectis_wallet/types/
authenticator.rs

1use cosmwasm_schema::cw_serde;
2
3/// User can decide if they want a different authenticator instead of the Vectis one
4#[cw_serde]
5pub enum AuthenticatorProvider {
6    /// User would like to use Vectis provided authenticator
7    Vectis,
8    /// User would like to use their own authenticator at this given contract address
9    Custom(String),
10}
11
12/// Authenticator type maps the authentication method for the main Controller messages
13#[cw_serde]
14pub enum AuthenticatorType {
15    Webauthn,
16    /// This is for future extensibility without neccessarily upgrading the enum type
17    /// It should be the name of the authenticator (i.e. AnonCreds)
18    Other(String),
19}
20
21impl std::fmt::Display for AuthenticatorType {
22    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
23        write!(f, "{self:?}")
24    }
25}
26
27/// Authenticator for the controller
28#[cw_serde]
29pub struct Authenticator {
30    pub ty: AuthenticatorType,
31    pub provider: AuthenticatorProvider,
32}
33
34impl Authenticator {
35    pub fn ty(&self) -> &AuthenticatorType {
36        &self.ty
37    }
38
39    pub fn provider(&self) -> &AuthenticatorProvider {
40        &self.provider
41    }
42}
43
44#[cw_serde]
45pub struct EmptyInstantiateMsg {}