Skip to main content

Module identity

Module identity 

Source
Expand description

Pure encoding and decoding for the Identity and Resources pallets on People chains.

No I/O. No network calls. WASM-safe.

Provides username normalization, storage key derivation for Identity::UsernameInfoOf and Resources::Consumers, and SCALE decoding of the resulting storage values.

Re-exports§

pub use crate::hex_decode;
pub use crate::hex_encode;

Structs§

ConsumerInfo
Decoded identity information from Resources::Consumers.

Enums§

Credibility
Credibility level stored in Resources::Consumers.
IdentityError
Errors produced by the identity encoding layer.

Functions§

account_id_to_hex
Format an AccountId32 as a 0x-prefixed lowercase hex string.
consumers_key
Derive the Substrate storage key for Resources::Consumers[account_id].
decode_consumer_info
Decode a SCALE-encoded ConsumerInfo from a state_getStorage response.
decode_option_account_id
Decode the SCALE-encoded Option<AccountId32> returned by a storage query.
decode_username_info_owner
Decode the raw UsernameInformation value from Identity::UsernameInfoOf.
decode_username_owner
Decode the raw AccountId32 returned by Resources::UsernameOwnerOf on the Individuality chain.
normalize_username
Normalise a username and return its UTF-8 bytes.
username_info_of_key
Derive the Substrate storage key for Identity::UsernameInfoOf[username].
username_owner_of_key
Derive the Substrate storage key for Resources::UsernameOwnerOf[username].