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§
- Consumer
Info - Decoded identity information from
Resources::Consumers.
Enums§
- Credibility
- Credibility level stored in
Resources::Consumers. - Identity
Error - 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
ConsumerInfofrom astate_getStorageresponse. - decode_
option_ account_ id - Decode the SCALE-encoded
Option<AccountId32>returned by a storage query. - decode_
username_ info_ owner - Decode the raw
UsernameInformationvalue fromIdentity::UsernameInfoOf. - decode_
username_ owner - Decode the raw
AccountId32returned byResources::UsernameOwnerOfon 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].