iota_types/account_abstraction/
account.rs

1// Copyright (c) 2026 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use move_core_types::{ident_str, identifier::IdentStr, language_storage::StructTag};
5use serde::{Deserialize, Serialize};
6
7use crate::IOTA_FRAMEWORK_ADDRESS;
8
9pub const ACCOUNT_MODULE_NAME: &IdentStr = ident_str!("account");
10pub const AUTHENTICATOR_FUNCTION_REF_V1_KEY_STRUCT_NAME: &IdentStr =
11    ident_str!("AuthenticatorFunctionRefV1Key");
12
13#[derive(Debug, Default, Serialize, Deserialize, Clone, Eq, PartialEq)]
14pub struct AuthenticatorFunctionRefV1Key {
15    // This field is required to make a Rust struct compatible with an empty Move one.
16    // An empty Move struct contains a 1-byte dummy bool field because empty fields are not
17    // allowed in the bytecode.
18    dummy_field: bool,
19}
20
21impl AuthenticatorFunctionRefV1Key {
22    pub fn tag() -> StructTag {
23        StructTag {
24            address: IOTA_FRAMEWORK_ADDRESS,
25            module: ACCOUNT_MODULE_NAME.to_owned(),
26            name: AUTHENTICATOR_FUNCTION_REF_V1_KEY_STRUCT_NAME.to_owned(),
27            type_params: Vec::new(),
28        }
29    }
30
31    pub fn to_bcs_bytes(&self) -> Vec<u8> {
32        bcs::to_bytes(&self).unwrap()
33    }
34}