newton-core 0.4.16

newton protocol core sdk
//! Identity-namespace key builders.
//!
//! Re-exports typed constructors from [`newton_state_tree::NamespaceKey`].
//! See `docs/PRIVATE_DATA_STORAGE.md` ยง 5.1 for the encoding schema.

use alloy::primitives::{Address, B256};
pub use newton_state_tree::NamespaceKey;

/// Build an identity-namespace leaf key for one `(user, domain_id, field_tag)` tuple.
#[inline]
pub fn identity_leaf(user: Address, domain_id: B256, field_tag: u32) -> NamespaceKey {
    NamespaceKey::identity_leaf(user, domain_id, field_tag)
}

/// Build an identity-namespace linkage key for one `(user, policy_client)` pair.
#[inline]
pub fn identity_linkage(user: Address, policy_client: Address) -> NamespaceKey {
    NamespaceKey::identity_linkage(user, policy_client)
}