Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e9df5fb
chore: version pin
fkrause98 Nov 28, 2025
c49367e
chore: update deps
fkrause98 Nov 28, 2025
ccdf53c
chore: working build with new types
fkrause98 Dec 3, 2025
143b110
Merge branch 'next' into fkrause98-update-public-account-retrieval
fkrause98 Dec 11, 2025
676488f
feat: use empty word
fkrause98 Dec 11, 2025
417532d
fix: build storage slots properly
fkrause98 Dec 11, 2025
b2d6242
test: add account with big vault fixture
fkrause98 Dec 16, 2025
7dd4d33
feat: migrate to new protocol
igamigo Dec 19, 2025
0d237d3
chore: more lints and typedoc
igamigo Dec 19, 2025
91b2ed6
fix: get storage map in webclient
igamigo Dec 19, 2025
e4fd31e
chore: lints and imports
igamigo Dec 19, 2025
3a12164
chore: more lints
igamigo Dec 19, 2025
2ef7b2c
chore: lints and fix remaining test
igamigo Dec 19, 2025
646332a
fix: test
igamigo Dec 19, 2025
dde3d4a
reviews: imports, remove slotIndex
igamigo Dec 22, 2025
647b198
Merge branch 'igamigo-refresh-dependencies' into fkrause98-update-pub…
fkrause98 Dec 22, 2025
d55f3df
feat: make test pass with test account
fkrause98 Dec 22, 2025
e5a20b2
tests: failing storage tests
fkrause98 Dec 23, 2025
ce1cd40
fix: build-wasm
fkrause98 Jan 5, 2026
858d916
fix: properly set up map
fkrause98 Jan 5, 2026
629a8e0
refactor: request_details_for_account function
fkrause98 Jan 6, 2026
1fb726d
refactor: working refactor
fkrause98 Jan 7, 2026
c885ff5
lint: clippy
fkrause98 Jan 7, 2026
6344d5f
Merge branch 'next' into fkrause98-update-public-account-retrieval
fkrause98 Jan 7, 2026
5f5c151
lint: clippy, format
fkrause98 Jan 7, 2026
ea3be3d
docs: changelog
fkrause98 Jan 7, 2026
dc80281
fix: restore account setup
fkrause98 Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* [BREAKING] Introduced named storage slots, changed `FilesystemKeystore` to not be generic over RNG ([#1626](https://github.com/0xMiden/miden-client/pull/1626)).
* Added `submit_new_transaction_with_prover` to the Rust client and `submitNewTransactionWithProver` to the WebClient([#1622](https://github.com/0xMiden/miden-client/pull/1622)).
* [BREAKING] Modified JS binding for `AccountComponent::compile` which now takes an `AccountComponentCode` built with the newly added binding `CodeBuilder::compile_account_component_code` ([#1627](https://github.com/0xMiden/miden-client/pull/1627)).
* Expanded the `GrpcClient` API with methods to fetch account proofs and rebuild the slots for an account ([#1591](https://github.com/0xMiden/miden-client/pull/1591)).

## 0.12.5 (2025-12-01)

Expand Down
34 changes: 32 additions & 2 deletions crates/rust-client/src/rpc/domain/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ pub struct AccountUpdateSummary {
/// Commitment of the account, that represents a commitment to its updated state.
pub commitment: Word,
/// Block number of last account update.
pub last_block_num: u32,
pub last_block_num: BlockNumber,
}

impl AccountUpdateSummary {
/// Creates a new [`AccountUpdateSummary`].
pub fn new(commitment: Word, last_block_num: u32) -> Self {
pub fn new(commitment: Word, last_block_num: BlockNumber) -> Self {
Self { commitment, last_block_num }
}
}
Expand Down Expand Up @@ -327,6 +327,15 @@ pub struct AccountStorageDetails {
pub map_details: Vec<AccountStorageMapDetails>,
}

impl AccountStorageDetails {
/// Find the matching details for a map, given its storage slot name.
// This linear search should be good enough since there can be
// only up to 256 slots, so locality probably wins here.
pub fn find_map_details(&self, target: &StorageSlotName) -> Option<&AccountStorageMapDetails> {
self.map_details.iter().find(|map_detail| map_detail.slot_name == *target)
}
}

impl TryFrom<proto::rpc::AccountStorageDetails> for AccountStorageDetails {
type Error = RpcError;

Expand Down Expand Up @@ -544,6 +553,27 @@ impl AccountProof {
}
}

#[cfg(feature = "tonic")]
impl TryFrom<proto::rpc::AccountProofResponse> for AccountProof {
type Error = RpcError;
fn try_from(account_proof: proto::rpc::AccountProofResponse) -> Result<Self, Self::Error> {
let Some(witness) = account_proof.witness else {
return Err(RpcError::ExpectedDataMissing(
"GetAccountProof returned an account without witness".to_owned(),
));
};

let details: Option<AccountDetails> = {
match account_proof.details {
None => None,
Some(details) => Some(details.into_domain(&BTreeMap::new())?),
}
};
AccountProof::new(witness.try_into()?, details)
.map_err(|err| RpcError::InvalidResponse(format!("{err}")))
}
}

// ACCOUNT WITNESS
// ================================================================================================

Expand Down
58 changes: 15 additions & 43 deletions crates/rust-client/src/rpc/generated/nostd/rpc_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct StoreStatus {
}
/// Returns the latest state proof of the specified account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountProofRequest {
pub struct AccountRequest {
/// ID of the account for which we want to get data
#[prost(message, optional, tag = "1")]
pub account_id: ::core::option::Option<super::account::AccountId>,
Expand All @@ -25,10 +25,10 @@ pub struct AccountProofRequest {
pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
/// Request for additional account details; valid only for public accounts.
#[prost(message, optional, tag = "3")]
pub details: ::core::option::Option<account_proof_request::AccountDetailRequest>,
pub details: ::core::option::Option<account_request::AccountDetailRequest>,
}
/// Nested message and enum types in `AccountProofRequest`.
pub mod account_proof_request {
/// Nested message and enum types in `AccountRequest`.
pub mod account_request {
/// Request the details for a public account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountDetailRequest {
Expand Down Expand Up @@ -90,7 +90,7 @@ pub mod account_proof_request {
}
/// Represents the result of getting account proof.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountProofResponse {
pub struct AccountResponse {
/// The block number at which the account witness was created and the account details were observed.
#[prost(message, optional, tag = "1")]
pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
Expand All @@ -99,10 +99,10 @@ pub struct AccountProofResponse {
pub witness: ::core::option::Option<super::account::AccountWitness>,
/// Additional details for public accounts.
#[prost(message, optional, tag = "3")]
pub details: ::core::option::Option<account_proof_response::AccountDetails>,
pub details: ::core::option::Option<account_response::AccountDetails>,
}
/// Nested message and enum types in `AccountProofResponse`.
pub mod account_proof_response {
/// Nested message and enum types in `AccountResponse`.
pub mod account_response {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountDetails {
/// Account header.
Expand All @@ -120,7 +120,7 @@ pub mod account_proof_response {
pub vault_details: ::core::option::Option<super::AccountVaultDetails>,
}
}
/// Account vault details for AccountProofResponse
/// Account vault details for AccountResponse
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountVaultDetails {
/// A flag that is set to true if the account contains too many assets. This indicates
Expand All @@ -133,7 +133,7 @@ pub struct AccountVaultDetails {
#[prost(message, repeated, tag = "2")]
pub assets: ::prost::alloc::vec::Vec<super::primitives::Asset>,
}
/// Account storage details for AccountProofResponse
/// Account storage details for AccountResponse
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountStorageDetails {
/// Account storage header (storage slot info for up to 256 slots)
Expand Down Expand Up @@ -587,37 +587,12 @@ pub mod rpc_client {
.insert(GrpcMethod::new("rpc_store.Rpc", "CheckNullifiers"));
self.inner.unary(req, path, codec).await
}
/// Returns the latest state of an account with the specified ID.
pub async fn get_account_details(
&mut self,
request: impl tonic::IntoRequest<super::super::account::AccountId>,
) -> core::result::Result<
tonic::Response<super::super::account::AccountDetails>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rpc_store.Rpc/GetAccountDetails",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rpc_store.Rpc", "GetAccountDetails"));
self.inner.unary(req, path, codec).await
}
/// Returns the latest state proof of the specified account.
pub async fn get_account_proof(
pub async fn get_account(
&mut self,
request: impl tonic::IntoRequest<super::AccountProofRequest>,
request: impl tonic::IntoRequest<super::AccountRequest>,
) -> core::result::Result<
tonic::Response<super::AccountProofResponse>,
tonic::Response<super::AccountResponse>,
tonic::Status,
> {
self.inner
Expand All @@ -629,12 +604,9 @@ pub mod rpc_client {
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rpc_store.Rpc/GetAccountProof",
);
let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/GetAccount");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rpc_store.Rpc", "GetAccountProof"));
req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "GetAccount"));
self.inner.unary(req, path, codec).await
}
/// Returns raw block data for the specified block number.
Expand Down
58 changes: 15 additions & 43 deletions crates/rust-client/src/rpc/generated/std/rpc_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct StoreStatus {
}
/// Returns the latest state proof of the specified account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountProofRequest {
pub struct AccountRequest {
/// ID of the account for which we want to get data
#[prost(message, optional, tag = "1")]
pub account_id: ::core::option::Option<super::account::AccountId>,
Expand All @@ -25,10 +25,10 @@ pub struct AccountProofRequest {
pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
/// Request for additional account details; valid only for public accounts.
#[prost(message, optional, tag = "3")]
pub details: ::core::option::Option<account_proof_request::AccountDetailRequest>,
pub details: ::core::option::Option<account_request::AccountDetailRequest>,
}
/// Nested message and enum types in `AccountProofRequest`.
pub mod account_proof_request {
/// Nested message and enum types in `AccountRequest`.
pub mod account_request {
/// Request the details for a public account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountDetailRequest {
Expand Down Expand Up @@ -90,7 +90,7 @@ pub mod account_proof_request {
}
/// Represents the result of getting account proof.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountProofResponse {
pub struct AccountResponse {
/// The block number at which the account witness was created and the account details were observed.
#[prost(message, optional, tag = "1")]
pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
Expand All @@ -99,10 +99,10 @@ pub struct AccountProofResponse {
pub witness: ::core::option::Option<super::account::AccountWitness>,
/// Additional details for public accounts.
#[prost(message, optional, tag = "3")]
pub details: ::core::option::Option<account_proof_response::AccountDetails>,
pub details: ::core::option::Option<account_response::AccountDetails>,
}
/// Nested message and enum types in `AccountProofResponse`.
pub mod account_proof_response {
/// Nested message and enum types in `AccountResponse`.
pub mod account_response {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountDetails {
/// Account header.
Expand All @@ -120,7 +120,7 @@ pub mod account_proof_response {
pub vault_details: ::core::option::Option<super::AccountVaultDetails>,
}
}
/// Account vault details for AccountProofResponse
/// Account vault details for AccountResponse
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountVaultDetails {
/// A flag that is set to true if the account contains too many assets. This indicates
Expand All @@ -133,7 +133,7 @@ pub struct AccountVaultDetails {
#[prost(message, repeated, tag = "2")]
pub assets: ::prost::alloc::vec::Vec<super::primitives::Asset>,
}
/// Account storage details for AccountProofResponse
/// Account storage details for AccountResponse
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountStorageDetails {
/// Account storage header (storage slot info for up to 256 slots)
Expand Down Expand Up @@ -598,37 +598,12 @@ pub mod rpc_client {
.insert(GrpcMethod::new("rpc_store.Rpc", "CheckNullifiers"));
self.inner.unary(req, path, codec).await
}
/// Returns the latest state of an account with the specified ID.
pub async fn get_account_details(
&mut self,
request: impl tonic::IntoRequest<super::super::account::AccountId>,
) -> std::result::Result<
tonic::Response<super::super::account::AccountDetails>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rpc_store.Rpc/GetAccountDetails",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rpc_store.Rpc", "GetAccountDetails"));
self.inner.unary(req, path, codec).await
}
/// Returns the latest state proof of the specified account.
pub async fn get_account_proof(
pub async fn get_account(
&mut self,
request: impl tonic::IntoRequest<super::AccountProofRequest>,
request: impl tonic::IntoRequest<super::AccountRequest>,
) -> std::result::Result<
tonic::Response<super::AccountProofResponse>,
tonic::Response<super::AccountResponse>,
tonic::Status,
> {
self.inner
Expand All @@ -640,12 +615,9 @@ pub mod rpc_client {
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rpc_store.Rpc/GetAccountProof",
);
let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/GetAccount");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rpc_store.Rpc", "GetAccountProof"));
req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "GetAccount"));
self.inner.unary(req, path, codec).await
}
/// Returns raw block data for the specified block number.
Expand Down
Loading