use super::auth_method::AuthMethod;
pub mod access;
pub mod auth;
pub mod components;
pub mod faucets;
pub mod interface;
pub mod metadata;
pub mod policies;
pub mod wallets;
pub use metadata::AccountBuilderSchemaCommitmentExt;
#[macro_export]
macro_rules! procedure_root {
($name:ident, $component_name:expr, $proc_name:expr, $component_code:expr) => {
static $name: miden_protocol::utils::sync::LazyLock<
miden_protocol::account::AccountProcedureRoot,
> = miden_protocol::utils::sync::LazyLock::new(|| {
let full_path = ::alloc::format!("{}::{}", $component_name, $proc_name);
let code: &miden_protocol::account::AccountComponentCode = $component_code;
code.get_procedure_root_by_path(full_path.as_str())
.unwrap_or_else(|| panic!("component should contain procedure '{}'", full_path))
});
};
}
macro_rules! account_component_code {
($name:ident, $relative_path:expr) => {
static $name: miden_protocol::utils::sync::LazyLock<
miden_protocol::account::component::AccountComponentCode,
> = miden_protocol::utils::sync::LazyLock::new(|| {
let bytes = include_bytes!(concat!(
env!("OUT_DIR"),
"/assets/account_components/",
$relative_path
));
let library = <miden_protocol::assembly::Library as miden_protocol::utils::serde::Deserializable>::read_from_bytes(bytes)
.expect("Shipped library failed to deserialize: {err}");
miden_protocol::account::component::AccountComponentCode::from(library)
});
};
}
pub(crate) use account_component_code;