Skip to main content

Module account

Module account 

Source
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§

component
standards

Structs§

Account
An account which can store assets and define rules for manipulating them.
AccountBuilder
A convenient builder for an Account allowing for safe construction of an account by combining multiple AccountComponents.
AccountCode
The public interface of an account.
AccountComponent
An AccountComponent defines a Library of code and the initial value and types of the StorageSlots it accesses.
AccountComponentCode
A Library that has been assembled for use as component code.
AccountDelta
The AccountDelta stores the differences between two account states, which can result from one or more transaction.
AccountFile
Account file contains a complete description of an account, including the Account struct as well as account seed and account authentication info.
AccountHeader
A header of an account which contains information that succinctly describes the state of the components of the account.
AccountIdPrefixV1
The prefix of an AccountIdV1, i.e. its first field element.
AccountIdV1
Version 1 of the Account identifier.
AccountInterface
An AccountInterface describes the exported, callable procedures of an account.
AccountProcedureRoot
The MAST root of a public procedure in an account’s interface.
AccountReader
Provides lazy access to account data.
AccountSchemaCommitment
An AccountComponent exposing the account storage schema commitment.
AccountStorage
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.
FaucetMetadata
Display-only metadata for a faucet account, persisted in the client’s settings store.
PartialAccount
A partial representation of an account.
PartialStorage
A partial representation of an account storage, containing only a subset of the storage data.
PartialStorageMap
A partial representation of a StorageMap, containing only proofs for a subset of the key-value pairs.
RoleSymbol
Represents a role symbol for role-based access control.
StorageMap
An account storage map is a sparse merkle tree of depth Self::DEPTH.
StorageMapDelta
StorageMapDelta stores the differences between two states of account storage maps.
StorageMapKey
A raw, user-chosen key for a StorageMap.
StorageMapKeyHash
A hashed key for a StorageMap.
StorageMapWitness
A witness of an asset in a StorageMap.
StorageSlot
An individual storage slot in AccountStorage.
StorageSlotId
The partial hash of a StorageSlotName.
StorageSlotName
The name of an account storage slot.

Enums§

AccountComponentInterface
The enum holding all possible account interfaces which could be loaded to some account.
AccountId
The identifier of an Account.
AccountIdError
AccountIdPrefix
The prefix of an AccountId, i.e. its first field element.
AccountIdVersion
The version of an AccountId.
AccountType
The type of an account, which determines where the account state is stored.
AccountUpdateDetails
AccountUpdateDetails describes the details of one or more transactions executed against an account.
AddressError
AddressInterface
The account interface of an Address.
AddressType
The type of an Address in Miden.
NetworkId
The identifier of a Miden network.
NetworkIdError
StorageSlotContent
Represents the contents of a StorageSlot.
StorageSlotDelta
The delta of a single storage slot.
StorageSlotType
The type of a storage slot.

Traits§

AccountBuilderSchemaCommitmentExt
An extension trait for AccountBuilder that provides a convenience method for building an account with an AccountSchemaCommitment component.
AccountComponentInterfaceExt
An extension for AccountComponentInterface that allows instantiation from a set of procedure roots.
AccountInterfaceExt
An extension for AccountInterface that 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_id to import a public account from the network (provided that the used seed is known).