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::RegularAccountImmutableCode)
.storage_mode(AccountStorageMode::Private)
.with_component(BasicWallet)
.build()?;
// 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
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.
- 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. - Storage
Map - An account storage map is a sparse merkle tree of depth
Self::DEPTH. - 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
Id - The identifier of an
Account. - Account
IdError - Account
IdPrefix - The prefix of an
AccountId, i.e. its first field element. - Account
Storage Mode - Describes where the state of the account is stored.
- Account
Type - Represents the different account types recognized by the protocol.
- 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 Type - The type of a storage slot.
Traits§
- 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).