diff --git a/crates/rust-client/src/mock.rs b/crates/rust-client/src/mock.rs index 1b1a345bc..08d87cc2d 100644 --- a/crates/rust-client/src/mock.rs +++ b/crates/rust-client/src/mock.rs @@ -262,7 +262,7 @@ impl NodeRpcClient for MockRpcApi { } async fn get_notes_by_id(&mut self, note_ids: &[NoteId]) -> Result, RpcError> { - // assume all off-chain notes for now + // assume all private notes for now let hit_notes = note_ids.iter().filter_map(|id| self.notes.get(id)); let mut return_notes = vec![]; for note in hit_notes { diff --git a/crates/rust-client/src/rpc/tonic_client/mod.rs b/crates/rust-client/src/rpc/tonic_client/mod.rs index deef5181a..212200357 100644 --- a/crates/rust-client/src/rpc/tonic_client/mod.rs +++ b/crates/rust-client/src/rpc/tonic_client/mod.rs @@ -173,13 +173,13 @@ impl NodeRpcClient for TonicRpcClient { }; let note = match note.details { - // On-chain notes include details + // Public notes include details Some(details) => { let note = Note::read_from_bytes(&details)?; NetworkNote::Public(note, inclusion_details) }, - // Off-chain notes do not have details + // Private notes do not have details None => { let note_metadata = note .metadata diff --git a/crates/rust-client/src/rpc/web_tonic_client/mod.rs b/crates/rust-client/src/rpc/web_tonic_client/mod.rs index 51425aa51..1d5166863 100644 --- a/crates/rust-client/src/rpc/web_tonic_client/mod.rs +++ b/crates/rust-client/src/rpc/web_tonic_client/mod.rs @@ -150,13 +150,13 @@ impl NodeRpcClient for WebTonicRpcClient { }; let note = match note.details { - // On-chain notes include details + // Public notes include details Some(details) => { let note = Note::read_from_bytes(&details)?; NetworkNote::Public(note, inclusion_details) }, - // Off-chain notes do not have details + // Private notes do not have details None => { let note_metadata = note .metadata diff --git a/crates/rust-client/src/store/web_store/mod.rs b/crates/rust-client/src/store/web_store/mod.rs index 13a5578c7..e244dc898 100644 --- a/crates/rust-client/src/store/web_store/mod.rs +++ b/crates/rust-client/src/store/web_store/mod.rs @@ -20,6 +20,9 @@ use crate::{ transactions::{TransactionRecord, TransactionStoreUpdate}, }; +#[cfg(not(target_arch = "wasm32"))] +compile_error!("The `idxdb` feature is only supported when targeting wasm32.") + pub mod accounts; pub mod chain_data; pub mod notes; diff --git a/crates/rust-client/src/sync/mod.rs b/crates/rust-client/src/sync/mod.rs index 3a126353e..b01b5b5c5 100644 --- a/crates/rust-client/src/sync/mod.rs +++ b/crates/rust-client/src/sync/mod.rs @@ -596,7 +596,7 @@ impl Client { .iter() .find(|acc| *remote_account_id == acc.id() && *remote_account_hash != acc.hash()); - // OffChain accounts should always have the latest known state. If we receive a stale + // Private accounts should always have the latest known state. If we receive a stale // update we ignore it. if mismatched_account.is_some() { let account_by_hash = diff --git a/crates/web-client/README.md b/crates/web-client/README.md index 634329623..e810a7148 100644 --- a/crates/web-client/README.md +++ b/crates/web-client/README.md @@ -22,8 +22,8 @@ const webClient = new WebClient(); await webClient.create_client(); // Use WebClient to create accounts, notes, transactions, etc. -// This will create a mutable, off-chain account and store it in IndexedDB -const accountId = await webClient.new_wallet("OffChain", true); +// This will create a mutable, private account and store it in IndexedDB +const accountId = await webClient.new_wallet("Private", true); ``` ## Examples @@ -56,23 +56,23 @@ await webClient.create_client(); /** * Creates a new wallet account. * - * @param storage_mode String. Either "OffChain" or "OnChain". + * @param storage_mode String. Either "Private" or "Public". * @param mutable Boolean. Whether the wallet code is mutable or not * * Returns: Wallet Id */ -const walletId = await webClient.new_wallet("OffChain", true); +const walletId = await webClient.new_wallet("Private", true); /** * Creates a new faucet account. * - * @param storage_mode String. Either "OffChain" or "OnChain". + * @param storage_mode String. Either "Private" or "Public". * @param non_fungible Boolean. Whether the faucet is non_fungible or not. NOTE: Non-fungible faucets are not supported yet * @param token_symbol String. Token symbol of the token the faucet creates * @param decimals String. Decimal precision of token. * @param max_supply String. Maximum token supply */ -const faucetId = await webClient.new_faucet("OffChain", true, "TOK", 6, 1_000_000) +const faucetId = await webClient.new_faucet("Private", true, "TOK", 6, 1_000_000) /** * Returns all accounts. Both wallets and faucets. Returns the following object per account @@ -119,8 +119,8 @@ Let's mint some tokens for our wallet from our faucet: ```typescript const webClient = new WebClient(); await webClient.create_client(); -const walletId = await webClient.new_wallet("OffChain", true); -const faucetId = await webClient.new_faucet("OffChain", true, "TOK", 6, 1_000_000); +const walletId = await webClient.new_wallet("Private", true); +const faucetId = await webClient.new_faucet("Private", true, "TOK", 6, 1_000_000); // Syncs web client with node state. await webClient.sync_state(); @@ -153,8 +153,8 @@ You can use the WebClient to query for existing notes, export notes, and import Here is an example of how to import a note from a file (generated, say, from the faucet at https://testnet.miden.io/ for a given account). This code exposes a simple button on an HTML page for a user to select a file. A listener is setup to capture this event, serialize the note file, and import it. ```typescript let webClient = await createMidenWebClient(); -let walletAccount = await webClient.new_wallet("OffChain", true); -console.log(walletAccount); // Prints the id that can be used to plug in to the deployed Miden faucet +let walletAccount = await webClient.new_wallet("Private", true); // The second argument defines that the wallet has mutable code. +console.log(walletAccount); // Prints the id that can be used to plug in to the deployed Miden faucet.