iota_types/account_abstraction/
account.rs

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