Expand description
Re-export the entire miden_client crate so external projects can use a single dependency.
The account module provides types and client APIs for managing accounts within the Miden
network.
Accounts are foundational entities of the Miden protocol. They store assets and define rules for manipulating them. Once an account is registered with the client, its state will be updated accordingly, and validated against the network state on every sync.
§Example
To add a new account to the client’s store, you might use the Client::add_account method as
follows:
let account = AccountBuilder::new(random_seed)
.account_type(AccountType::Private)
.with_component(BasicWallet)
.build_with_schema_commitment()?;
// Add the account to the client. The account already embeds its seed information.
client.add_account(&account, false).await?;For more details on accounts, refer to the Account documentation.
Modules§
Structs§
- Account
- An account which can store assets and define rules for manipulating them.
- Account
Builder - A convenient builder for an
Accountallowing for safe construction of an account by combining multipleAccountComponents. - Account
Code - The public interface of an account.
- Account
Component - An
AccountComponentdefines aLibraryof code and the initial value and types of theStorageSlots it accesses. - Account
Component Code - A
Librarythat has been assembled for use as component code. - Account
Delta - The
AccountDeltastores the differences between two account states, which can result from one or more transaction. - Account
File - Account file contains a complete description of an account, including the
Accountstruct as well as account seed and account authentication info. - Account
Header - A header of an account which contains information that succinctly describes the state of the components of the account.
- Account
IdPrefix V1 - The prefix of an
AccountIdV1, i.e. its first field element. - Account
IdV1 - Version 1 of the
Accountidentifier. - Account
Interface - An
AccountInterfacedescribes the exported, callable procedures of an account. - Account
Procedure Root - The MAST root of a public procedure in an account’s interface.
- Account
Reader - Provides lazy access to account data.
- Account
Schema Commitment - An
AccountComponentexposing the account storage schema commitment. - Account
Storage - Account storage is composed of a variable number of name-addressable
StorageSlots up to 255 slots in total. - Address
- A user-facing address in Miden.
- Faucet
Metadata - Display-only metadata for a faucet account, persisted in the client’s settings store.
- Partial
Account - A partial representation of an account.
- Partial
Storage - A partial representation of an account storage, containing only a subset of the storage data.
- Partial
Storage Map - A partial representation of a
StorageMap, containing only proofs for a subset of the key-value pairs. - Role
Symbol - Represents a role symbol for role-based access control.
- Storage
Map - An account storage map is a sparse merkle tree of depth
Self::DEPTH. - Storage
MapDelta - StorageMapDelta stores the differences between two states of account storage maps.
- Storage
MapKey - A raw, user-chosen key for a
StorageMap. - Storage
MapKey Hash - A hashed key for a
StorageMap. - Storage
MapWitness - A witness of an asset in a
StorageMap. - Storage
Slot - An individual storage slot in
AccountStorage. - Storage
Slot Id - The partial hash of a
StorageSlotName. - Storage
Slot Name - The name of an account storage slot.
Enums§
- Account
Component Interface - The enum holding all possible account interfaces which could be loaded to some account.
- Account
Id - The identifier of an
Account. - Account
IdError - Account
IdPrefix - The prefix of an
AccountId, i.e. its first field element. - Account
IdVersion - The version of an
AccountId. - Account
Type - The type of an account, which determines where the account state is stored.
- Account
Update Details AccountUpdateDetailsdescribes the details of one or more transactions executed against an account.- Address
Error - Address
Interface - The account interface of an
Address. - Address
Type - The type of an
Addressin Miden. - Network
Id - The identifier of a Miden network.
- Network
IdError - Storage
Slot Content - Represents the contents of a
StorageSlot. - Storage
Slot Delta - The delta of a single storage slot.
- Storage
Slot Type - The type of a storage slot.
Traits§
- Account
Builder Schema Commitment Ext - An extension trait for
AccountBuilderthat provides a convenience method for building an account with anAccountSchemaCommitmentcomponent. - Account
Component Interface Ext - An extension for
AccountComponentInterfacethat allows instantiation from a set of procedure roots. - Account
Interface Ext - An extension for
AccountInterfacethat allows instantiation from higher-level types.
Functions§
- build_
wallet_ id - Builds an regular account ID from the provided parameters. The ID may be used along
Client::import_account_by_idto import a public account from the network (provided that the used seed is known).