@miden-sdk/miden-sdk 0.14.0-alpha.2 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6644,55 +6644,47 @@ var cmp_1 = cmp;
6644
6644
 
6645
6645
  const { safeRe: re, t } = reExports;
6646
6646
 
6647
- var lrucache;
6648
- var hasRequiredLrucache;
6649
-
6650
- function requireLrucache () {
6651
- if (hasRequiredLrucache) return lrucache;
6652
- hasRequiredLrucache = 1;
6653
- class LRUCache {
6654
- constructor () {
6655
- this.max = 1000;
6656
- this.map = new Map();
6657
- }
6658
-
6659
- get (key) {
6660
- const value = this.map.get(key);
6661
- if (value === undefined) {
6662
- return undefined
6663
- } else {
6664
- // Remove the key from the map and add it to the end
6665
- this.map.delete(key);
6666
- this.map.set(key, value);
6667
- return value
6668
- }
6669
- }
6647
+ class LRUCache {
6648
+ constructor () {
6649
+ this.max = 1000;
6650
+ this.map = new Map();
6651
+ }
6670
6652
 
6671
- delete (key) {
6672
- return this.map.delete(key)
6673
- }
6653
+ get (key) {
6654
+ const value = this.map.get(key);
6655
+ if (value === undefined) {
6656
+ return undefined
6657
+ } else {
6658
+ // Remove the key from the map and add it to the end
6659
+ this.map.delete(key);
6660
+ this.map.set(key, value);
6661
+ return value
6662
+ }
6663
+ }
6674
6664
 
6675
- set (key, value) {
6676
- const deleted = this.delete(key);
6665
+ delete (key) {
6666
+ return this.map.delete(key)
6667
+ }
6677
6668
 
6678
- if (!deleted && value !== undefined) {
6679
- // If cache is full, delete the least recently used item
6680
- if (this.map.size >= this.max) {
6681
- const firstKey = this.map.keys().next().value;
6682
- this.delete(firstKey);
6683
- }
6669
+ set (key, value) {
6670
+ const deleted = this.delete(key);
6684
6671
 
6685
- this.map.set(key, value);
6686
- }
6672
+ if (!deleted && value !== undefined) {
6673
+ // If cache is full, delete the least recently used item
6674
+ if (this.map.size >= this.max) {
6675
+ const firstKey = this.map.keys().next().value;
6676
+ this.delete(firstKey);
6677
+ }
6687
6678
 
6688
- return this
6689
- }
6690
- }
6679
+ this.map.set(key, value);
6680
+ }
6691
6681
 
6692
- lrucache = LRUCache;
6693
- return lrucache;
6682
+ return this
6683
+ }
6694
6684
  }
6695
6685
 
6686
+ var lrucache = LRUCache;
6687
+
6696
6688
  var range;
6697
6689
  var hasRequiredRange;
6698
6690
 
@@ -6913,7 +6905,7 @@ function requireRange () {
6913
6905
 
6914
6906
  range = Range;
6915
6907
 
6916
- const LRU = requireLrucache();
6908
+ const LRU = lrucache;
6917
6909
  const cache = new LRU();
6918
6910
 
6919
6911
  const parseOptions = parseOptions_1;
@@ -7515,7 +7507,10 @@ function getDatabase(dbId) {
7515
7507
  */
7516
7508
  async function openDatabase(network, clientVersion) {
7517
7509
  const db = new MidenDatabase(network);
7518
- await db.open(clientVersion);
7510
+ const success = await db.open(clientVersion);
7511
+ if (!success) {
7512
+ throw new Error(`Failed to open IndexedDB database: ${network}`);
7513
+ }
7519
7514
  databaseRegistry.set(network, db);
7520
7515
  return network;
7521
7516
  }
@@ -7553,19 +7548,19 @@ function indexes(...items) {
7553
7548
  const V1_STORES = {
7554
7549
  [Table.AccountCode]: indexes("root"),
7555
7550
  [Table.LatestAccountStorage]: indexes("[accountId+slotName]", "accountId"),
7556
- [Table.HistoricalAccountStorage]: indexes("[accountId+nonce+slotName]", "accountId", "[accountId+nonce]"),
7551
+ [Table.HistoricalAccountStorage]: indexes("[accountId+replacedAtNonce+slotName]", "accountId", "[accountId+replacedAtNonce]"),
7557
7552
  [Table.LatestStorageMapEntries]: indexes("[accountId+slotName+key]", "accountId", "[accountId+slotName]"),
7558
- [Table.HistoricalStorageMapEntries]: indexes("[accountId+nonce+slotName+key]", "accountId", "[accountId+nonce]"),
7559
- [Table.LatestAccountAssets]: indexes("[accountId+vaultKey]", "accountId", "faucetIdPrefix"),
7560
- [Table.HistoricalAccountAssets]: indexes("[accountId+nonce+vaultKey]", "accountId", "[accountId+nonce]"),
7553
+ [Table.HistoricalStorageMapEntries]: indexes("[accountId+replacedAtNonce+slotName+key]", "accountId", "[accountId+replacedAtNonce]"),
7554
+ [Table.LatestAccountAssets]: indexes("[accountId+vaultKey]", "accountId"),
7555
+ [Table.HistoricalAccountAssets]: indexes("[accountId+replacedAtNonce+vaultKey]", "accountId", "[accountId+replacedAtNonce]"),
7561
7556
  [Table.AccountAuth]: indexes("pubKeyCommitmentHex"),
7562
7557
  [Table.AccountKeyMapping]: indexes("[accountIdHex+pubKeyCommitmentHex]", "accountIdHex", "pubKeyCommitmentHex"),
7563
7558
  [Table.LatestAccountHeaders]: indexes("&id", "accountCommitment"),
7564
- [Table.HistoricalAccountHeaders]: indexes("&accountCommitment", "id", "[id+nonce]"),
7559
+ [Table.HistoricalAccountHeaders]: indexes("&accountCommitment", "id", "[id+replacedAtNonce]"),
7565
7560
  [Table.Addresses]: indexes("address", "id"),
7566
7561
  [Table.Transactions]: indexes("id", "statusVariant"),
7567
7562
  [Table.TransactionScripts]: indexes("scriptRoot"),
7568
- [Table.InputNotes]: indexes("noteId", "nullifier", "stateDiscriminant"),
7563
+ [Table.InputNotes]: indexes("noteId", "nullifier", "stateDiscriminant", "[consumedBlockHeight+consumedTxOrder+noteId]"),
7569
7564
  [Table.OutputNotes]: indexes("noteId", "recipientDigest", "stateDiscriminant", "nullifier"),
7570
7565
  [Table.NotesScripts]: indexes("scriptRoot"),
7571
7566
  [Table.StateSync]: indexes("id"),
@@ -7843,21 +7838,25 @@ async function getAccountCode(dbId, codeRoot) {
7843
7838
  logWebStoreError(error, `Error fetching account code for root ${codeRoot}`);
7844
7839
  }
7845
7840
  }
7846
- async function getAccountStorage(dbId, accountId) {
7841
+ async function getAccountStorage(dbId, accountId, slotNames) {
7847
7842
  try {
7848
7843
  const db = getDatabase(dbId);
7849
- const allMatchingRecords = await db.latestAccountStorages
7850
- .where("accountId")
7851
- .equals(accountId)
7852
- .toArray();
7853
- const slots = allMatchingRecords.map((record) => {
7854
- return {
7855
- slotName: record.slotName,
7856
- slotValue: record.slotValue,
7857
- slotType: record.slotType,
7858
- };
7859
- });
7860
- return slots;
7844
+ let query = db.latestAccountStorages.where("accountId").equals(accountId);
7845
+ let allMatchingRecords;
7846
+ if (slotNames.length) {
7847
+ const nameSet = new Set(slotNames);
7848
+ allMatchingRecords = await query
7849
+ .and((record) => nameSet.has(record.slotName))
7850
+ .toArray();
7851
+ }
7852
+ else {
7853
+ allMatchingRecords = await query.toArray();
7854
+ }
7855
+ return allMatchingRecords.map((record) => ({
7856
+ slotName: record.slotName,
7857
+ slotValue: record.slotValue,
7858
+ slotType: record.slotType,
7859
+ }));
7861
7860
  }
7862
7861
  catch (error) {
7863
7862
  logWebStoreError(error, `Error fetching account storage for account ${accountId}`);
@@ -7876,38 +7875,29 @@ async function getAccountStorageMaps(dbId, accountId) {
7876
7875
  logWebStoreError(error, `Error fetching account storage maps for account ${accountId}`);
7877
7876
  }
7878
7877
  }
7879
- async function getAccountVaultAssets(dbId, accountId) {
7878
+ async function getAccountVaultAssets(dbId, accountId, vaultKeys) {
7880
7879
  try {
7881
7880
  const db = getDatabase(dbId);
7882
- const allMatchingRecords = await db.latestAccountAssets
7883
- .where("accountId")
7884
- .equals(accountId)
7885
- .toArray();
7886
- const assets = allMatchingRecords.map((record) => {
7887
- return {
7888
- asset: record.asset,
7889
- };
7890
- });
7891
- return assets;
7881
+ let query = db.latestAccountAssets.where("accountId").equals(accountId);
7882
+ let records;
7883
+ if (vaultKeys.length) {
7884
+ const keySet = new Set(vaultKeys);
7885
+ records = await query
7886
+ .and((record) => keySet.has(record.vaultKey))
7887
+ .toArray();
7888
+ }
7889
+ else {
7890
+ records = await query.toArray();
7891
+ }
7892
+ return records.map((record) => ({
7893
+ vaultKey: record.vaultKey,
7894
+ asset: record.asset,
7895
+ }));
7892
7896
  }
7893
7897
  catch (error) {
7894
7898
  logWebStoreError(error, `Error fetching account vault for account ${accountId}`);
7895
7899
  }
7896
7900
  }
7897
- async function getAccountAuthByPubKeyCommitment(dbId, pubKeyCommitmentHex) {
7898
- const db = getDatabase(dbId);
7899
- const accountSecretKey = await db.accountAuths
7900
- .where("pubKeyCommitmentHex")
7901
- .equals(pubKeyCommitmentHex)
7902
- .first();
7903
- if (!accountSecretKey) {
7904
- throw new Error("Account auth not found in cache.");
7905
- }
7906
- const data = {
7907
- secretKey: accountSecretKey.secretKeyHex,
7908
- };
7909
- return data;
7910
- }
7911
7901
  async function getAccountAddresses(dbId, accountId) {
7912
7902
  try {
7913
7903
  const db = getDatabase(dbId);
@@ -7938,7 +7928,7 @@ async function upsertAccountCode(dbId, codeRoot, code) {
7938
7928
  logWebStoreError(error, `Error inserting code with root: ${codeRoot}`);
7939
7929
  }
7940
7930
  }
7941
- async function upsertAccountStorage(dbId, accountId, nonce, storageSlots) {
7931
+ async function upsertAccountStorage(dbId, accountId, storageSlots) {
7942
7932
  try {
7943
7933
  const db = getDatabase(dbId);
7944
7934
  await db.latestAccountStorages
@@ -7953,43 +7943,19 @@ async function upsertAccountStorage(dbId, accountId, nonce, storageSlots) {
7953
7943
  slotValue: slot.slotValue,
7954
7944
  slotType: slot.slotType,
7955
7945
  }));
7956
- const historicalEntries = latestEntries.map((entry) => ({
7957
- ...entry,
7958
- nonce,
7959
- }));
7960
7946
  await db.latestAccountStorages.bulkPut(latestEntries);
7961
- await db.historicalAccountStorages.bulkPut(historicalEntries);
7962
7947
  }
7963
7948
  catch (error) {
7964
7949
  logWebStoreError(error, `Error inserting storage slots`);
7965
7950
  }
7966
7951
  }
7967
- async function upsertStorageMapEntries(dbId, accountId, nonce, entries) {
7952
+ async function upsertStorageMapEntries(dbId, accountId, entries) {
7968
7953
  try {
7969
7954
  const db = getDatabase(dbId);
7970
- // Read old latest entries before clearing, to detect removals
7971
- const oldEntries = await db.latestStorageMapEntries
7972
- .where("accountId")
7973
- .equals(accountId)
7974
- .toArray();
7975
7955
  await db.latestStorageMapEntries
7976
7956
  .where("accountId")
7977
7957
  .equals(accountId)
7978
7958
  .delete();
7979
- // Build a set of new keys for fast lookup
7980
- const newKeySet = new Set(entries.map((e) => `${e.slotName}\0${e.key}`));
7981
- // Write tombstones to historical for entries that existed but are now absent
7982
- for (const old of oldEntries) {
7983
- if (!newKeySet.has(`${old.slotName}\0${old.key}`)) {
7984
- await db.historicalStorageMapEntries.put({
7985
- accountId,
7986
- nonce,
7987
- slotName: old.slotName,
7988
- key: old.key,
7989
- value: null,
7990
- });
7991
- }
7992
- }
7993
7959
  if (entries.length === 0)
7994
7960
  return;
7995
7961
  const latestEntries = entries.map((entry) => ({
@@ -7998,60 +7964,30 @@ async function upsertStorageMapEntries(dbId, accountId, nonce, entries) {
7998
7964
  key: entry.key,
7999
7965
  value: entry.value,
8000
7966
  }));
8001
- const historicalEntries = latestEntries.map((entry) => ({
8002
- ...entry,
8003
- nonce,
8004
- }));
8005
7967
  await db.latestStorageMapEntries.bulkPut(latestEntries);
8006
- await db.historicalStorageMapEntries.bulkPut(historicalEntries);
8007
7968
  }
8008
7969
  catch (error) {
8009
7970
  logWebStoreError(error, `Error inserting storage map entries`);
8010
7971
  }
8011
7972
  }
8012
- async function upsertVaultAssets(dbId, accountId, nonce, assets) {
7973
+ async function upsertVaultAssets(dbId, accountId, assets) {
8013
7974
  try {
8014
7975
  const db = getDatabase(dbId);
8015
- // Read old latest entries before clearing, to detect removals
8016
- const oldAssets = await db.latestAccountAssets
8017
- .where("accountId")
8018
- .equals(accountId)
8019
- .toArray();
8020
7976
  await db.latestAccountAssets.where("accountId").equals(accountId).delete();
8021
- // Build a set of new vault keys for fast lookup
8022
- const newKeySet = new Set(assets.map((a) => a.vaultKey));
8023
- // Write tombstones to historical for assets that existed but are now absent
8024
- for (const old of oldAssets) {
8025
- if (!newKeySet.has(old.vaultKey)) {
8026
- await db.historicalAccountAssets.put({
8027
- accountId,
8028
- nonce,
8029
- vaultKey: old.vaultKey,
8030
- faucetIdPrefix: old.faucetIdPrefix,
8031
- asset: null,
8032
- });
8033
- }
8034
- }
8035
7977
  if (assets.length === 0)
8036
7978
  return;
8037
7979
  const latestEntries = assets.map((asset) => ({
8038
7980
  accountId,
8039
7981
  vaultKey: asset.vaultKey,
8040
- faucetIdPrefix: asset.faucetIdPrefix,
8041
7982
  asset: asset.asset,
8042
7983
  }));
8043
- const historicalEntries = latestEntries.map((entry) => ({
8044
- ...entry,
8045
- nonce,
8046
- }));
8047
7984
  await db.latestAccountAssets.bulkPut(latestEntries);
8048
- await db.historicalAccountAssets.bulkPut(historicalEntries);
8049
7985
  }
8050
7986
  catch (error) {
8051
7987
  logWebStoreError(error, `Error inserting assets`);
8052
7988
  }
8053
7989
  }
8054
- async function applyTransactionDelta(dbId, accountId, nonce, updatedSlots, changedMapEntries, changedAssets, codeRoot, storageRoot, vaultRoot, committed, commitment, accountSeed) {
7990
+ async function applyTransactionDelta(dbId, accountId, nonce, updatedSlots, changedMapEntries, changedAssets, codeRoot, storageRoot, vaultRoot, committed, commitment) {
8055
7991
  try {
8056
7992
  const db = getDatabase(dbId);
8057
7993
  await db.dexie.transaction("rw", [
@@ -8064,108 +8000,299 @@ async function applyTransactionDelta(dbId, accountId, nonce, updatedSlots, chang
8064
8000
  db.latestAccountHeaders,
8065
8001
  db.historicalAccountHeaders,
8066
8002
  ], async () => {
8067
- // Apply storage delta
8003
+ // Apply storage delta: read old → archive → write new
8068
8004
  for (const slot of updatedSlots) {
8069
- await db.latestAccountStorages.put({
8005
+ const oldSlot = await db.latestAccountStorages
8006
+ .where("[accountId+slotName]")
8007
+ .equals([accountId, slot.slotName])
8008
+ .first();
8009
+ await db.historicalAccountStorages.put({
8070
8010
  accountId,
8011
+ replacedAtNonce: nonce,
8071
8012
  slotName: slot.slotName,
8072
- slotValue: slot.slotValue,
8013
+ oldSlotValue: oldSlot?.slotValue ?? null,
8073
8014
  slotType: slot.slotType,
8074
8015
  });
8075
- await db.historicalAccountStorages.put({
8016
+ await db.latestAccountStorages.put({
8076
8017
  accountId,
8077
- nonce,
8078
8018
  slotName: slot.slotName,
8079
8019
  slotValue: slot.slotValue,
8080
8020
  slotType: slot.slotType,
8081
8021
  });
8082
8022
  }
8083
- // Process map entries: value="" means removal
8023
+ // Process map entries: read old → archive → update latest
8084
8024
  for (const entry of changedMapEntries) {
8025
+ const oldEntry = await db.latestStorageMapEntries
8026
+ .where("[accountId+slotName+key]")
8027
+ .equals([accountId, entry.slotName, entry.key])
8028
+ .first();
8029
+ await db.historicalStorageMapEntries.put({
8030
+ accountId,
8031
+ replacedAtNonce: nonce,
8032
+ slotName: entry.slotName,
8033
+ key: entry.key,
8034
+ oldValue: oldEntry?.value ?? null,
8035
+ });
8036
+ // "" means removal
8085
8037
  if (entry.value === "") {
8086
- // Removal: delete from latest, write tombstone to historical
8087
8038
  await db.latestStorageMapEntries
8088
8039
  .where("[accountId+slotName+key]")
8089
8040
  .equals([accountId, entry.slotName, entry.key])
8090
8041
  .delete();
8091
- await db.historicalStorageMapEntries.put({
8092
- accountId,
8093
- nonce,
8094
- slotName: entry.slotName,
8095
- key: entry.key,
8096
- value: null,
8097
- });
8098
8042
  }
8099
8043
  else {
8100
- // Update: put to both latest and historical
8101
8044
  await db.latestStorageMapEntries.put({
8102
8045
  accountId,
8103
8046
  slotName: entry.slotName,
8104
8047
  key: entry.key,
8105
8048
  value: entry.value,
8106
8049
  });
8107
- await db.historicalStorageMapEntries.put({
8108
- accountId,
8109
- nonce,
8110
- slotName: entry.slotName,
8111
- key: entry.key,
8112
- value: entry.value,
8113
- });
8114
8050
  }
8115
8051
  }
8116
- // Apply vault delta
8052
+ // Apply vault delta: read old → archive → update latest
8117
8053
  for (const entry of changedAssets) {
8054
+ const oldAsset = await db.latestAccountAssets
8055
+ .where("[accountId+vaultKey]")
8056
+ .equals([accountId, entry.vaultKey])
8057
+ .first();
8058
+ await db.historicalAccountAssets.put({
8059
+ accountId,
8060
+ replacedAtNonce: nonce,
8061
+ vaultKey: entry.vaultKey,
8062
+ oldAsset: oldAsset?.asset ?? null,
8063
+ });
8064
+ // "" means removal
8118
8065
  if (entry.asset === "") {
8119
- // Removal: delete from latest, write tombstone to historical
8120
8066
  await db.latestAccountAssets
8121
8067
  .where("[accountId+vaultKey]")
8122
8068
  .equals([accountId, entry.vaultKey])
8123
8069
  .delete();
8124
- await db.historicalAccountAssets.put({
8125
- accountId,
8126
- nonce,
8127
- vaultKey: entry.vaultKey,
8128
- faucetIdPrefix: entry.faucetIdPrefix,
8129
- asset: null,
8130
- });
8131
8070
  }
8132
8071
  else {
8133
- // Update: put to both latest and historical
8134
8072
  await db.latestAccountAssets.put({
8135
8073
  accountId,
8136
8074
  vaultKey: entry.vaultKey,
8137
- faucetIdPrefix: entry.faucetIdPrefix,
8138
- asset: entry.asset,
8139
- });
8140
- await db.historicalAccountAssets.put({
8141
- accountId,
8142
- nonce,
8143
- vaultKey: entry.vaultKey,
8144
- faucetIdPrefix: entry.faucetIdPrefix,
8145
8075
  asset: entry.asset,
8146
8076
  });
8147
8077
  }
8148
8078
  }
8149
- // Upsert account record
8150
- const data = {
8079
+ // Archive old header and write new header
8080
+ const oldHeader = await db.latestAccountHeaders
8081
+ .where("id")
8082
+ .equals(accountId)
8083
+ .first();
8084
+ if (oldHeader) {
8085
+ await db.historicalAccountHeaders.put({
8086
+ id: accountId,
8087
+ replacedAtNonce: nonce,
8088
+ codeRoot: oldHeader.codeRoot,
8089
+ storageRoot: oldHeader.storageRoot,
8090
+ vaultRoot: oldHeader.vaultRoot,
8091
+ nonce: oldHeader.nonce,
8092
+ committed: oldHeader.committed,
8093
+ accountSeed: oldHeader.accountSeed,
8094
+ accountCommitment: oldHeader.accountCommitment,
8095
+ locked: oldHeader.locked,
8096
+ });
8097
+ }
8098
+ await db.latestAccountHeaders.put({
8151
8099
  id: accountId,
8152
8100
  codeRoot,
8153
8101
  storageRoot,
8154
8102
  vaultRoot,
8155
8103
  nonce,
8156
8104
  committed,
8157
- accountSeed,
8105
+ accountSeed: undefined,
8158
8106
  accountCommitment: commitment,
8159
8107
  locked: false,
8160
- };
8161
- await db.historicalAccountHeaders.put(data);
8162
- await db.latestAccountHeaders.put(data);
8108
+ });
8163
8109
  });
8164
8110
  }
8165
8111
  catch (error) {
8166
8112
  logWebStoreError(error, `Error applying transaction delta`);
8167
8113
  }
8168
8114
  }
8115
+ async function archiveAndReplaceStorageSlots(db, accountId, nonce, newSlots) {
8116
+ const oldSlots = await db.latestAccountStorages
8117
+ .where("accountId")
8118
+ .equals(accountId)
8119
+ .toArray();
8120
+ // Archive every old slot
8121
+ for (const slot of oldSlots) {
8122
+ await db.historicalAccountStorages.put({
8123
+ accountId,
8124
+ replacedAtNonce: nonce,
8125
+ slotName: slot.slotName,
8126
+ oldSlotValue: slot.slotValue,
8127
+ slotType: slot.slotType,
8128
+ });
8129
+ }
8130
+ // Write NULL markers for genuinely new slots (no old value to archive)
8131
+ const oldSlotNames = new Set(oldSlots.map((s) => s.slotName));
8132
+ for (const slot of newSlots) {
8133
+ if (!oldSlotNames.has(slot.slotName)) {
8134
+ await db.historicalAccountStorages.put({
8135
+ accountId,
8136
+ replacedAtNonce: nonce,
8137
+ slotName: slot.slotName,
8138
+ oldSlotValue: null,
8139
+ slotType: slot.slotType,
8140
+ });
8141
+ }
8142
+ }
8143
+ // Replace latest
8144
+ await db.latestAccountStorages.where("accountId").equals(accountId).delete();
8145
+ if (newSlots.length > 0) {
8146
+ await db.latestAccountStorages.bulkPut(newSlots.map((slot) => ({
8147
+ accountId,
8148
+ slotName: slot.slotName,
8149
+ slotValue: slot.slotValue,
8150
+ slotType: slot.slotType,
8151
+ })));
8152
+ }
8153
+ }
8154
+ async function archiveAndReplaceMapEntries(db, accountId, nonce, newEntries) {
8155
+ const oldEntries = await db.latestStorageMapEntries
8156
+ .where("accountId")
8157
+ .equals(accountId)
8158
+ .toArray();
8159
+ for (const entry of oldEntries) {
8160
+ await db.historicalStorageMapEntries.put({
8161
+ accountId,
8162
+ replacedAtNonce: nonce,
8163
+ slotName: entry.slotName,
8164
+ key: entry.key,
8165
+ oldValue: entry.value,
8166
+ });
8167
+ }
8168
+ const oldKeys = new Set(oldEntries.map((e) => `${e.slotName}\0${e.key}`));
8169
+ for (const entry of newEntries) {
8170
+ if (!oldKeys.has(`${entry.slotName}\0${entry.key}`)) {
8171
+ await db.historicalStorageMapEntries.put({
8172
+ accountId,
8173
+ replacedAtNonce: nonce,
8174
+ slotName: entry.slotName,
8175
+ key: entry.key,
8176
+ oldValue: null,
8177
+ });
8178
+ }
8179
+ }
8180
+ await db.latestStorageMapEntries
8181
+ .where("accountId")
8182
+ .equals(accountId)
8183
+ .delete();
8184
+ if (newEntries.length > 0) {
8185
+ await db.latestStorageMapEntries.bulkPut(newEntries.map((entry) => ({
8186
+ accountId,
8187
+ slotName: entry.slotName,
8188
+ key: entry.key,
8189
+ value: entry.value,
8190
+ })));
8191
+ }
8192
+ }
8193
+ async function archiveAndReplaceVaultAssets(db, accountId, nonce, newAssets) {
8194
+ const oldAssets = await db.latestAccountAssets
8195
+ .where("accountId")
8196
+ .equals(accountId)
8197
+ .toArray();
8198
+ for (const asset of oldAssets) {
8199
+ await db.historicalAccountAssets.put({
8200
+ accountId,
8201
+ replacedAtNonce: nonce,
8202
+ vaultKey: asset.vaultKey,
8203
+ oldAsset: asset.asset,
8204
+ });
8205
+ }
8206
+ const oldKeys = new Set(oldAssets.map((a) => a.vaultKey));
8207
+ for (const asset of newAssets) {
8208
+ if (!oldKeys.has(asset.vaultKey)) {
8209
+ await db.historicalAccountAssets.put({
8210
+ accountId,
8211
+ replacedAtNonce: nonce,
8212
+ vaultKey: asset.vaultKey,
8213
+ oldAsset: null,
8214
+ });
8215
+ }
8216
+ }
8217
+ await db.latestAccountAssets.where("accountId").equals(accountId).delete();
8218
+ if (newAssets.length > 0) {
8219
+ await db.latestAccountAssets.bulkPut(newAssets.map((asset) => ({
8220
+ accountId,
8221
+ vaultKey: asset.vaultKey,
8222
+ asset: asset.asset,
8223
+ })));
8224
+ }
8225
+ }
8226
+ async function restoreSlotsFromHistorical(db, accountId, nonce) {
8227
+ const oldSlots = await db.historicalAccountStorages
8228
+ .where("[accountId+replacedAtNonce]")
8229
+ .equals([accountId, nonce])
8230
+ .toArray();
8231
+ for (const slot of oldSlots) {
8232
+ if (slot.oldSlotValue !== null) {
8233
+ await db.latestAccountStorages.put({
8234
+ accountId: slot.accountId,
8235
+ slotName: slot.slotName,
8236
+ slotValue: slot.oldSlotValue,
8237
+ slotType: slot.slotType,
8238
+ });
8239
+ }
8240
+ else {
8241
+ await db.latestAccountStorages
8242
+ .where("[accountId+slotName]")
8243
+ .equals([accountId, slot.slotName])
8244
+ .delete();
8245
+ }
8246
+ }
8247
+ }
8248
+ async function restoreMapEntriesFromHistorical(db, accountId, nonce) {
8249
+ const oldEntries = await db.historicalStorageMapEntries
8250
+ .where("[accountId+replacedAtNonce]")
8251
+ .equals([accountId, nonce])
8252
+ .toArray();
8253
+ for (const entry of oldEntries) {
8254
+ if (entry.oldValue !== null) {
8255
+ await db.latestStorageMapEntries.put({
8256
+ accountId: entry.accountId,
8257
+ slotName: entry.slotName,
8258
+ key: entry.key,
8259
+ value: entry.oldValue,
8260
+ });
8261
+ }
8262
+ else {
8263
+ await db.latestStorageMapEntries
8264
+ .where("[accountId+slotName+key]")
8265
+ .equals([accountId, entry.slotName, entry.key])
8266
+ .delete();
8267
+ }
8268
+ }
8269
+ }
8270
+ async function restoreAssetsFromHistorical(db, accountId, nonce) {
8271
+ const oldAssets = await db.historicalAccountAssets
8272
+ .where("[accountId+replacedAtNonce]")
8273
+ .equals([accountId, nonce])
8274
+ .toArray();
8275
+ for (const asset of oldAssets) {
8276
+ if (asset.oldAsset !== null) {
8277
+ await db.latestAccountAssets.put({
8278
+ accountId: asset.accountId,
8279
+ vaultKey: asset.vaultKey,
8280
+ asset: asset.oldAsset,
8281
+ });
8282
+ }
8283
+ else {
8284
+ await db.latestAccountAssets
8285
+ .where("[accountId+vaultKey]")
8286
+ .equals([accountId, asset.vaultKey])
8287
+ .delete();
8288
+ }
8289
+ }
8290
+ }
8291
+ /**
8292
+ * Replaces an account's full state (storage, map entries, vault assets, header)
8293
+ * with a new snapshot. Before overwriting, all current latest values are archived
8294
+ * to historical.
8295
+ */
8169
8296
  async function applyFullAccountState(dbId, accountState) {
8170
8297
  try {
8171
8298
  const db = getDatabase(dbId);
@@ -8180,13 +8307,31 @@ async function applyFullAccountState(dbId, accountState) {
8180
8307
  db.latestAccountHeaders,
8181
8308
  db.historicalAccountHeaders,
8182
8309
  ], async () => {
8183
- // Upsert account storage (calls existing helpers Dexie nesting
8184
- // joins them to this outer transaction)
8185
- await upsertAccountStorage(dbId, accountId, nonce, storageSlots);
8186
- await upsertStorageMapEntries(dbId, accountId, nonce, storageMapEntries);
8187
- await upsertVaultAssets(dbId, accountId, nonce, assets);
8188
- // Upsert account record
8189
- const data = {
8310
+ // Archive: save current latest values to historical (so they can be
8311
+ // restored on undo), then replace latest with the new state.
8312
+ await archiveAndReplaceStorageSlots(db, accountId, nonce, storageSlots);
8313
+ await archiveAndReplaceMapEntries(db, accountId, nonce, storageMapEntries);
8314
+ await archiveAndReplaceVaultAssets(db, accountId, nonce, assets);
8315
+ // Archive old header and write new header
8316
+ const oldHeader = await db.latestAccountHeaders
8317
+ .where("id")
8318
+ .equals(accountId)
8319
+ .first();
8320
+ if (oldHeader) {
8321
+ await db.historicalAccountHeaders.put({
8322
+ id: accountId,
8323
+ replacedAtNonce: nonce,
8324
+ codeRoot: oldHeader.codeRoot,
8325
+ storageRoot: oldHeader.storageRoot,
8326
+ vaultRoot: oldHeader.vaultRoot,
8327
+ nonce: oldHeader.nonce,
8328
+ committed: oldHeader.committed,
8329
+ accountSeed: oldHeader.accountSeed,
8330
+ accountCommitment: oldHeader.accountCommitment,
8331
+ locked: oldHeader.locked,
8332
+ });
8333
+ }
8334
+ await db.latestAccountHeaders.put({
8190
8335
  id: accountId,
8191
8336
  codeRoot,
8192
8337
  storageRoot,
@@ -8196,9 +8341,7 @@ async function applyFullAccountState(dbId, accountState) {
8196
8341
  accountSeed,
8197
8342
  accountCommitment,
8198
8343
  locked: false,
8199
- };
8200
- await db.historicalAccountHeaders.put(data);
8201
- await db.latestAccountHeaders.put(data);
8344
+ });
8202
8345
  });
8203
8346
  }
8204
8347
  catch (error) {
@@ -8219,26 +8362,12 @@ async function upsertAccountRecord(dbId, accountId, codeRoot, storageRoot, vault
8219
8362
  accountCommitment: commitment,
8220
8363
  locked: false,
8221
8364
  };
8222
- await db.historicalAccountHeaders.put(data);
8223
8365
  await db.latestAccountHeaders.put(data);
8224
8366
  }
8225
8367
  catch (error) {
8226
8368
  logWebStoreError(error, `Error inserting account: ${accountId}`);
8227
8369
  }
8228
8370
  }
8229
- async function insertAccountAuth(dbId, pubKeyCommitmentHex, secretKey) {
8230
- try {
8231
- const db = getDatabase(dbId);
8232
- const data = {
8233
- pubKeyCommitmentHex,
8234
- secretKeyHex: secretKey,
8235
- };
8236
- await db.accountAuths.add(data);
8237
- }
8238
- catch (error) {
8239
- logWebStoreError(error, `Error inserting account auth for pubKey: ${pubKeyCommitmentHex}`);
8240
- }
8241
- }
8242
8371
  async function insertAccountAddress(dbId, accountId, address) {
8243
8372
  try {
8244
8373
  const db = getDatabase(dbId);
@@ -8328,96 +8457,87 @@ async function lockAccount(dbId, accountId) {
8328
8457
  }
8329
8458
  }
8330
8459
  /**
8331
- * Rebuilds latest storage slots from historical data.
8332
- * Groups by slotName, takes the entry with MAX(nonce) per slot.
8333
- * Slots cannot be removed, so no tombstone filtering needed.
8460
+ * Prunes historical account states for a single account up to the given nonce.
8461
+ *
8462
+ * Deletes all historical entries with `replacedAtNonce <= upToNonce` and any
8463
+ * orphaned account code. Mirrors the SQLite implementation.
8334
8464
  */
8335
- async function rebuildLatestStorageSlots(db, accountId) {
8336
- await db.latestAccountStorages.where("accountId").equals(accountId).delete();
8337
- const allHist = await db.historicalAccountStorages
8338
- .where("accountId")
8339
- .equals(accountId)
8340
- .toArray();
8341
- // Group by slotName, take MAX(nonce) per slot
8342
- const bySlot = new Map();
8343
- for (const entry of allHist) {
8344
- const existing = bySlot.get(entry.slotName);
8345
- if (!existing || BigInt(entry.nonce) > BigInt(existing.nonce)) {
8346
- bySlot.set(entry.slotName, entry);
8347
- }
8348
- }
8349
- if (bySlot.size > 0) {
8350
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8351
- const entries = [...bySlot.values()].map(({ nonce, ...rest }) => rest);
8352
- await db.latestAccountStorages.bulkPut(entries);
8465
+ async function pruneAccountHistory(dbId, accountId, upToNonce) {
8466
+ try {
8467
+ const db = getDatabase(dbId);
8468
+ let totalDeleted = 0;
8469
+ const boundaryNonce = BigInt(upToNonce);
8470
+ await db.dexie.transaction("rw", [
8471
+ db.historicalAccountHeaders,
8472
+ db.historicalAccountStorages,
8473
+ db.historicalStorageMapEntries,
8474
+ db.historicalAccountAssets,
8475
+ db.accountCodes,
8476
+ db.latestAccountHeaders,
8477
+ db.foreignAccountCode,
8478
+ ], async () => {
8479
+ // Nonces are stored as strings so we cannot use index range queries
8480
+ // (lexicographic ordering would be wrong). Filter in JS instead.
8481
+ const headers = await db.historicalAccountHeaders
8482
+ .where("id")
8483
+ .equals(accountId)
8484
+ .toArray();
8485
+ const toPrune = headers.filter((h) => BigInt(h.replacedAtNonce) <= boundaryNonce);
8486
+ // Collect code roots from headers we are about to delete.
8487
+ const candidateCodeRoots = new Set(toPrune.map((h) => h.codeRoot));
8488
+ for (const h of toPrune) {
8489
+ await db.historicalAccountHeaders
8490
+ .where("accountCommitment")
8491
+ .equals(h.accountCommitment)
8492
+ .delete();
8493
+ const rat = h.replacedAtNonce;
8494
+ totalDeleted += 1;
8495
+ totalDeleted += await db.historicalAccountStorages
8496
+ .where("[accountId+replacedAtNonce]")
8497
+ .equals([accountId, rat])
8498
+ .delete();
8499
+ totalDeleted += await db.historicalStorageMapEntries
8500
+ .where("[accountId+replacedAtNonce]")
8501
+ .equals([accountId, rat])
8502
+ .delete();
8503
+ totalDeleted += await db.historicalAccountAssets
8504
+ .where("[accountId+replacedAtNonce]")
8505
+ .equals([accountId, rat])
8506
+ .delete();
8507
+ }
8508
+ // Delete orphaned code: only check roots from the deleted headers,
8509
+ // and only if they are not referenced by any remaining header or foreign code.
8510
+ if (candidateCodeRoots.size > 0) {
8511
+ const latestHeaders = await db.latestAccountHeaders.toArray();
8512
+ const remainingHistorical = await db.historicalAccountHeaders.toArray();
8513
+ const foreignCodes = await db.foreignAccountCode.toArray();
8514
+ const referencedCodeRoots = new Set();
8515
+ for (const h of latestHeaders)
8516
+ referencedCodeRoots.add(h.codeRoot);
8517
+ for (const h of remainingHistorical)
8518
+ referencedCodeRoots.add(h.codeRoot);
8519
+ for (const f of foreignCodes)
8520
+ referencedCodeRoots.add(f.codeRoot);
8521
+ for (const root of candidateCodeRoots) {
8522
+ if (!referencedCodeRoots.has(root)) {
8523
+ await db.accountCodes.where("root").equals(root).delete();
8524
+ totalDeleted += 1;
8525
+ }
8526
+ }
8527
+ }
8528
+ });
8529
+ return totalDeleted;
8353
8530
  }
8354
- }
8355
- /**
8356
- * Rebuilds latest storage map entries from historical data.
8357
- * Groups by (slotName, key), takes the entry with MAX(nonce) per key.
8358
- * Filters out tombstones (value === null).
8359
- */
8360
- async function rebuildLatestStorageMapEntries(db, accountId) {
8361
- await db.latestStorageMapEntries
8362
- .where("accountId")
8363
- .equals(accountId)
8364
- .delete();
8365
- const allHist = await db.historicalStorageMapEntries
8366
- .where("accountId")
8367
- .equals(accountId)
8368
- .toArray();
8369
- // Group by (slotName, key), take MAX(nonce) per key
8370
- const byKey = new Map();
8371
- for (const entry of allHist) {
8372
- const compositeKey = `${entry.slotName}\0${entry.key}`;
8373
- const existing = byKey.get(compositeKey);
8374
- if (!existing || BigInt(entry.nonce) > BigInt(existing.nonce)) {
8375
- byKey.set(compositeKey, entry);
8376
- }
8377
- }
8378
- // Filter out tombstones and strip nonce
8379
- const entries = [...byKey.values()]
8380
- .filter((e) => e.value !== null)
8381
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8382
- .map(({ nonce, value, ...rest }) => ({
8383
- ...rest,
8384
- value: value,
8385
- }));
8386
- if (entries.length > 0) {
8387
- await db.latestStorageMapEntries.bulkPut(entries);
8531
+ catch (error) {
8532
+ logWebStoreError(error, `Error pruning account history for ${accountId}`);
8533
+ throw error;
8388
8534
  }
8389
8535
  }
8390
8536
  /**
8391
- * Rebuilds latest vault assets from historical data.
8392
- * Groups by vaultKey, takes the entry with MAX(nonce) per key.
8393
- * Filters out tombstones (asset === null).
8537
+ * Undoes discarded account states by restoring old values from historical
8538
+ * back to latest. Non-null old values overwrite latest; null old values
8539
+ * (entries that didn't exist before that nonce) cause deletion from latest.
8394
8540
  */
8395
- async function rebuildLatestVaultAssets(db, accountId) {
8396
- await db.latestAccountAssets.where("accountId").equals(accountId).delete();
8397
- const allHist = await db.historicalAccountAssets
8398
- .where("accountId")
8399
- .equals(accountId)
8400
- .toArray();
8401
- // Group by vaultKey, take MAX(nonce) per key
8402
- const byKey = new Map();
8403
- for (const entry of allHist) {
8404
- const existing = byKey.get(entry.vaultKey);
8405
- if (!existing || BigInt(entry.nonce) > BigInt(existing.nonce)) {
8406
- byKey.set(entry.vaultKey, entry);
8407
- }
8408
- }
8409
- // Filter out tombstones and strip nonce
8410
- const entries = [...byKey.values()]
8411
- .filter((e) => e.asset !== null)
8412
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
8413
- .map(({ nonce, asset, ...rest }) => ({
8414
- ...rest,
8415
- asset: asset,
8416
- }));
8417
- if (entries.length > 0) {
8418
- await db.latestAccountAssets.bulkPut(entries);
8419
- }
8420
- }
8421
8541
  async function undoAccountStates(dbId, accountCommitments) {
8422
8542
  try {
8423
8543
  const db = getDatabase(dbId);
@@ -8431,49 +8551,66 @@ async function undoAccountStates(dbId, accountCommitments) {
8431
8551
  db.latestAccountHeaders,
8432
8552
  db.historicalAccountHeaders,
8433
8553
  ], async () => {
8434
- // Find affected records to get their account IDs and nonces before deleting
8435
- const affectedRecords = await db.historicalAccountHeaders
8436
- .where("accountCommitment")
8437
- .anyOf(accountCommitments)
8438
- .toArray();
8439
- // Collect affected (accountId, nonce) pairs
8554
+ // Step 1: Resolve nonces from both latest and historical headers
8440
8555
  const accountNonces = new Map();
8441
- for (const record of affectedRecords) {
8442
- if (!accountNonces.has(record.id)) {
8443
- accountNonces.set(record.id, new Set());
8556
+ for (const commitment of accountCommitments) {
8557
+ const latestRecord = await db.latestAccountHeaders
8558
+ .where("accountCommitment")
8559
+ .equals(commitment)
8560
+ .first();
8561
+ if (latestRecord) {
8562
+ if (!accountNonces.has(latestRecord.id)) {
8563
+ accountNonces.set(latestRecord.id, new Set());
8564
+ }
8565
+ accountNonces.get(latestRecord.id).add(latestRecord.nonce);
8566
+ continue;
8567
+ }
8568
+ const histRecord = await db.historicalAccountHeaders
8569
+ .where("accountCommitment")
8570
+ .equals(commitment)
8571
+ .first();
8572
+ if (histRecord) {
8573
+ if (!accountNonces.has(histRecord.id)) {
8574
+ accountNonces.set(histRecord.id, new Set());
8575
+ }
8576
+ accountNonces.get(histRecord.id).add(histRecord.nonce);
8444
8577
  }
8445
- accountNonces.get(record.id).add(record.nonce);
8446
8578
  }
8447
- // Delete matching records from historical account headers
8448
- await db.historicalAccountHeaders
8449
- .where("accountCommitment")
8450
- .anyOf(accountCommitments)
8451
- .delete();
8452
- // Delete historical storage/map/assets for affected (accountId, nonce) pairs
8579
+ // Step 2: Group nonces by account, sort descending (undo most recent first).
8580
+ // Descending order is needed because each nonce's old value is the state before
8581
+ // that nonce — processing most recent first lets earlier nonces overwrite with
8582
+ // the correct final value.
8453
8583
  for (const [accountId, nonces] of accountNonces) {
8454
- for (const nonce of nonces) {
8455
- await db.historicalAccountStorages
8456
- .where("[accountId+nonce]")
8457
- .equals([accountId, nonce])
8458
- .delete();
8459
- await db.historicalStorageMapEntries
8460
- .where("[accountId+nonce]")
8461
- .equals([accountId, nonce])
8462
- .delete();
8463
- await db.historicalAccountAssets
8464
- .where("[accountId+nonce]")
8465
- .equals([accountId, nonce])
8466
- .delete();
8584
+ const sortedNonces = [...nonces].sort((a, b) => Number(BigInt(b) - BigInt(a)));
8585
+ // Step 3: Restore old values from historical back to latest, undoing
8586
+ // each nonce in descending order. Non-null old values overwrite latest;
8587
+ // null old values (entries that didn't exist before) cause deletion.
8588
+ for (const nonce of sortedNonces) {
8589
+ await restoreSlotsFromHistorical(db, accountId, nonce);
8590
+ await restoreMapEntriesFromHistorical(db, accountId, nonce);
8591
+ await restoreAssetsFromHistorical(db, accountId, nonce);
8467
8592
  }
8468
- }
8469
- // Rebuild latest for each affected account
8470
- for (const accountId of accountNonces.keys()) {
8471
- const remaining = await db.historicalAccountHeaders
8472
- .where("id")
8473
- .equals(accountId)
8474
- .toArray();
8475
- if (remaining.length === 0) {
8476
- // Account completely undone — clear all latest tables
8593
+ // Step 4: Restore old header from the earliest discarded nonce
8594
+ const minNonce = sortedNonces[sortedNonces.length - 1];
8595
+ const oldHeader = await db.historicalAccountHeaders
8596
+ .where("[id+replacedAtNonce]")
8597
+ .equals([accountId, minNonce])
8598
+ .first();
8599
+ if (oldHeader) {
8600
+ await db.latestAccountHeaders.put({
8601
+ id: oldHeader.id,
8602
+ codeRoot: oldHeader.codeRoot,
8603
+ storageRoot: oldHeader.storageRoot,
8604
+ vaultRoot: oldHeader.vaultRoot,
8605
+ nonce: oldHeader.nonce,
8606
+ committed: oldHeader.committed,
8607
+ accountSeed: oldHeader.accountSeed,
8608
+ accountCommitment: oldHeader.accountCommitment,
8609
+ locked: oldHeader.locked,
8610
+ });
8611
+ }
8612
+ else {
8613
+ // No previous state — delete the account entirely
8477
8614
  await db.latestAccountHeaders
8478
8615
  .where("id")
8479
8616
  .equals(accountId)
@@ -8491,25 +8628,71 @@ async function undoAccountStates(dbId, accountCommitments) {
8491
8628
  .equals(accountId)
8492
8629
  .delete();
8493
8630
  }
8494
- else {
8495
- // Find the record with the highest nonce
8496
- let maxRecord = remaining[0];
8497
- for (const record of remaining) {
8498
- if (BigInt(record.nonce) > BigInt(maxRecord.nonce)) {
8499
- maxRecord = record;
8500
- }
8501
- }
8502
- // Rebuild latest from historical using MAX(nonce) per key
8503
- await db.latestAccountHeaders.put(maxRecord);
8504
- await rebuildLatestStorageSlots(db, accountId);
8505
- await rebuildLatestStorageMapEntries(db, accountId);
8506
- await rebuildLatestVaultAssets(db, accountId);
8631
+ // Step 5: Delete consumed historical entries at discarded nonces
8632
+ for (const nonce of sortedNonces) {
8633
+ await db.historicalAccountStorages
8634
+ .where("[accountId+replacedAtNonce]")
8635
+ .equals([accountId, nonce])
8636
+ .delete();
8637
+ await db.historicalStorageMapEntries
8638
+ .where("[accountId+replacedAtNonce]")
8639
+ .equals([accountId, nonce])
8640
+ .delete();
8641
+ await db.historicalAccountAssets
8642
+ .where("[accountId+replacedAtNonce]")
8643
+ .equals([accountId, nonce])
8644
+ .delete();
8645
+ await db.historicalAccountHeaders
8646
+ .where("[id+replacedAtNonce]")
8647
+ .equals([accountId, nonce])
8648
+ .delete();
8507
8649
  }
8508
8650
  }
8509
8651
  });
8510
8652
  }
8511
8653
  catch (error) {
8512
8654
  logWebStoreError(error, `Error undoing account states: ${accountCommitments.join(",")}`);
8655
+ throw error;
8656
+ }
8657
+ }
8658
+
8659
+ async function insertAccountAuth(dbId, pubKeyCommitmentHex, secretKey) {
8660
+ try {
8661
+ const db = getDatabase(dbId);
8662
+ const data = {
8663
+ pubKeyCommitmentHex,
8664
+ secretKeyHex: secretKey,
8665
+ };
8666
+ await db.accountAuths.add(data);
8667
+ }
8668
+ catch (error) {
8669
+ logWebStoreError(error, `Error inserting account auth for pubKey: ${pubKeyCommitmentHex}`);
8670
+ }
8671
+ }
8672
+ async function getAccountAuthByPubKeyCommitment(dbId, pubKeyCommitmentHex) {
8673
+ const db = getDatabase(dbId);
8674
+ const accountSecretKey = await db.accountAuths
8675
+ .where("pubKeyCommitmentHex")
8676
+ .equals(pubKeyCommitmentHex)
8677
+ .first();
8678
+ if (!accountSecretKey) {
8679
+ throw new Error("Account auth not found in cache.");
8680
+ }
8681
+ const data = {
8682
+ secretKey: accountSecretKey.secretKeyHex,
8683
+ };
8684
+ return data;
8685
+ }
8686
+ async function removeAccountAuth(dbId, pubKeyCommitmentHex) {
8687
+ try {
8688
+ const db = getDatabase(dbId);
8689
+ await db.accountAuths
8690
+ .where("pubKeyCommitmentHex")
8691
+ .equals(pubKeyCommitmentHex)
8692
+ .delete();
8693
+ }
8694
+ catch (error) {
8695
+ logWebStoreError(error, `Error removing account auth for pubKey: ${pubKeyCommitmentHex}`);
8513
8696
  }
8514
8697
  }
8515
8698
  async function insertAccountKeyMapping(dbId, accountIdHex, pubKeyCommitmentHex) {
@@ -8539,6 +8722,18 @@ async function getKeyCommitmentsByAccountId(dbId, accountIdHex) {
8539
8722
  return [];
8540
8723
  }
8541
8724
  }
8725
+ async function removeAllMappingsForKey(dbId, pubKeyCommitmentHex) {
8726
+ try {
8727
+ const db = getDatabase(dbId);
8728
+ await db.accountKeyMappings
8729
+ .where("pubKeyCommitmentHex")
8730
+ .equals(pubKeyCommitmentHex)
8731
+ .delete();
8732
+ }
8733
+ catch (error) {
8734
+ logWebStoreError(error, `Error removing all mappings for key: ${pubKeyCommitmentHex}`);
8735
+ }
8736
+ }
8542
8737
  async function getAccountIdByKeyCommitment(dbId, pubKeyCommitmentHex) {
8543
8738
  try {
8544
8739
  const db = getDatabase(dbId);
@@ -8636,6 +8831,19 @@ async function getTrackedBlockHeaders(dbId) {
8636
8831
  logWebStoreError(err, "Failed to get tracked block headers");
8637
8832
  }
8638
8833
  }
8834
+ async function getTrackedBlockHeaderNumbers(dbId) {
8835
+ try {
8836
+ const db = getDatabase(dbId);
8837
+ const blockNums = await db.blockHeaders
8838
+ .where("hasClientNotes")
8839
+ .equals("true")
8840
+ .primaryKeys();
8841
+ return blockNums;
8842
+ }
8843
+ catch (err) {
8844
+ logWebStoreError(err, "Failed to get tracked block header numbers");
8845
+ }
8846
+ }
8639
8847
  async function getPartialBlockchainPeaksByBlockNum(dbId, blockNum) {
8640
8848
  try {
8641
8849
  const db = getDatabase(dbId);
@@ -8717,7 +8925,10 @@ async function pruneIrrelevantBlocks(dbId) {
8717
8925
  async function recursivelyTransformForExport(obj) {
8718
8926
  switch (obj.type) {
8719
8927
  case "Uint8Array":
8720
- return Array.from(obj.value);
8928
+ return {
8929
+ __type: "Uint8Array",
8930
+ data: uint8ArrayToBase64(obj.value),
8931
+ };
8721
8932
  case "Blob":
8722
8933
  return {
8723
8934
  __type: "Blob",
@@ -8769,6 +8980,8 @@ async function recursivelyTransformForImport(obj) {
8769
8980
  switch (obj.type) {
8770
8981
  case "Blob":
8771
8982
  return new Blob([base64ToUint8Array(obj.value.data)]);
8983
+ case "Uint8Array":
8984
+ return base64ToUint8Array(obj.value.data);
8772
8985
  case "Array":
8773
8986
  return await Promise.all(obj.value.map((v) => recursivelyTransformForImport({ type: getImportType(v), value: v })));
8774
8987
  case "Object":
@@ -8787,6 +9000,9 @@ function getImportType(value) {
8787
9000
  if (value && typeof value === "object" && value.__type === "Blob") {
8788
9001
  return "Blob";
8789
9002
  }
9003
+ if (value && typeof value === "object" && value.__type === "Uint8Array") {
9004
+ return "Uint8Array";
9005
+ }
8790
9006
  if (Array.isArray(value))
8791
9007
  return "Array";
8792
9008
  if (value && typeof value === "object")
@@ -8946,9 +9162,9 @@ async function getNoteScript(dbId, scriptRoot) {
8946
9162
  logWebStoreError(err, "Failed to get note script from root");
8947
9163
  }
8948
9164
  }
8949
- async function upsertInputNote(dbId, noteId, assets, serialNumber, inputs, scriptRoot, serializedNoteScript, nullifier, serializedCreatedAt, stateDiscriminant, state) {
9165
+ async function upsertInputNote(dbId, noteId, assets, serialNumber, inputs, scriptRoot, serializedNoteScript, nullifier, serializedCreatedAt, stateDiscriminant, state, consumedBlockHeight, consumedTxOrder, consumerAccountId, tx) {
8950
9166
  const db = getDatabase(dbId);
8951
- return db.dexie.transaction("rw", db.inputNotes, db.notesScripts, async (tx) => {
9167
+ const doWork = async (t) => {
8952
9168
  try {
8953
9169
  const data = {
8954
9170
  noteId,
@@ -8960,22 +9176,59 @@ async function upsertInputNote(dbId, noteId, assets, serialNumber, inputs, scrip
8960
9176
  state,
8961
9177
  stateDiscriminant,
8962
9178
  serializedCreatedAt,
9179
+ // These fields are null for non-consumed notes.
9180
+ // Convert null -> undefined so Dexie omits them from compound indexes.
9181
+ consumedBlockHeight: consumedBlockHeight ?? undefined,
9182
+ consumedTxOrder: consumedTxOrder ?? undefined,
9183
+ consumerAccountId: consumerAccountId ?? undefined,
8963
9184
  };
8964
- await tx.inputNotes.put(data);
9185
+ await t.inputNotes.put(data);
8965
9186
  const noteScriptData = {
8966
9187
  scriptRoot,
8967
9188
  serializedNoteScript,
8968
9189
  };
8969
- await tx.notesScripts.put(noteScriptData);
9190
+ await t.notesScripts.put(noteScriptData);
8970
9191
  }
8971
9192
  catch (error) {
8972
9193
  logWebStoreError(error, `Error inserting note: ${noteId}`);
8973
9194
  }
8974
- });
9195
+ };
9196
+ return db.dexie.transaction("rw", db.inputNotes, db.notesScripts, doWork);
8975
9197
  }
8976
- async function upsertOutputNote(dbId, noteId, assets, recipientDigest, metadata, nullifier, expectedHeight, stateDiscriminant, state) {
9198
+ // Uses the [consumedBlockHeight+consumedTxOrder+noteId] compound index for cursor-based
9199
+ // iteration, filtering by consumer account.
9200
+ async function getInputNoteByOffset(dbId, states, consumerAccountId, blockStart, blockEnd, offset) {
9201
+ try {
9202
+ const db = getDatabase(dbId);
9203
+ // The compound index sorts by consumedBlockHeight, consumedTxOrder, noteId.
9204
+ // Rows without these fields are excluded by the index.
9205
+ const results = await db.inputNotes
9206
+ .orderBy("[consumedBlockHeight+consumedTxOrder+noteId]")
9207
+ .filter((n) => {
9208
+ if (states.length > 0 && !states.includes(n.stateDiscriminant))
9209
+ return false;
9210
+ if (n.consumerAccountId !== consumerAccountId)
9211
+ return false;
9212
+ if (blockStart != null && n.consumedBlockHeight < blockStart)
9213
+ return false;
9214
+ if (blockEnd != null && n.consumedBlockHeight > blockEnd)
9215
+ return false;
9216
+ return true;
9217
+ })
9218
+ .offset(offset)
9219
+ .limit(1)
9220
+ .toArray();
9221
+ if (results.length === 0)
9222
+ return [];
9223
+ return await processInputNotes(dbId, results);
9224
+ }
9225
+ catch (err) {
9226
+ logWebStoreError(err, "Failed to get input note by offset");
9227
+ }
9228
+ }
9229
+ async function upsertOutputNote(dbId, noteId, assets, recipientDigest, metadata, nullifier, expectedHeight, stateDiscriminant, state, tx) {
8977
9230
  const db = getDatabase(dbId);
8978
- return db.dexie.transaction("rw", db.outputNotes, db.notesScripts, async (tx) => {
9231
+ const doWork = async (t) => {
8979
9232
  try {
8980
9233
  const data = {
8981
9234
  noteId,
@@ -8987,12 +9240,13 @@ async function upsertOutputNote(dbId, noteId, assets, recipientDigest, metadata,
8987
9240
  stateDiscriminant,
8988
9241
  state,
8989
9242
  };
8990
- await tx.outputNotes.put(data);
9243
+ await t.outputNotes.put(data);
8991
9244
  }
8992
9245
  catch (error) {
8993
9246
  logWebStoreError(error, `Error inserting note: ${noteId}`);
8994
9247
  }
8995
- });
9248
+ };
9249
+ return db.dexie.transaction("rw", db.outputNotes, db.notesScripts, doWork);
8996
9250
  }
8997
9251
  async function processInputNotes(dbId, notes) {
8998
9252
  const db = getDatabase(dbId);
@@ -9190,7 +9444,7 @@ async function getTransactions(dbId, filter) {
9190
9444
  logWebStoreError(err, "Failed to get transactions");
9191
9445
  }
9192
9446
  }
9193
- async function insertTransactionScript(dbId, scriptRoot, txScript) {
9447
+ async function insertTransactionScript(dbId, scriptRoot, txScript, tx) {
9194
9448
  try {
9195
9449
  const db = getDatabase(dbId);
9196
9450
  const scriptRootArray = new Uint8Array(scriptRoot);
@@ -9199,13 +9453,13 @@ async function insertTransactionScript(dbId, scriptRoot, txScript) {
9199
9453
  scriptRoot: scriptRootBase64,
9200
9454
  txScript: mapOption(txScript, (txScript) => new Uint8Array(txScript)),
9201
9455
  };
9202
- await db.transactionScripts.put(data);
9456
+ await (tx || db).transactionScripts.put(data);
9203
9457
  }
9204
9458
  catch (error) {
9205
9459
  logWebStoreError(error, "Failed to insert transaction script");
9206
9460
  }
9207
9461
  }
9208
- async function upsertTransactionRecord(dbId, transactionId, details, blockNum, statusVariant, status, scriptRoot) {
9462
+ async function upsertTransactionRecord(dbId, transactionId, details, blockNum, statusVariant, status, scriptRoot, tx) {
9209
9463
  try {
9210
9464
  const db = getDatabase(dbId);
9211
9465
  const data = {
@@ -9216,7 +9470,7 @@ async function upsertTransactionRecord(dbId, transactionId, details, blockNum, s
9216
9470
  statusVariant,
9217
9471
  status,
9218
9472
  };
9219
- await db.transactions.put(data);
9473
+ await (tx || db).transactions.put(data);
9220
9474
  }
9221
9475
  catch (err) {
9222
9476
  logWebStoreError(err, "Failed to insert proven transaction data");
@@ -9317,7 +9571,7 @@ async function applyStateSync(dbId, stateUpdate) {
9317
9571
  return await db.dexie.transaction("rw", tablesToAccess, async (tx) => {
9318
9572
  await Promise.all([
9319
9573
  Promise.all(serializedInputNotes.map((note) => {
9320
- return upsertInputNote(dbId, note.noteId, note.noteAssets, note.serialNumber, note.inputs, note.noteScriptRoot, note.noteScript, note.nullifier, note.createdAt, note.stateDiscriminant, note.state);
9574
+ return upsertInputNote(dbId, note.noteId, note.noteAssets, note.serialNumber, note.inputs, note.noteScriptRoot, note.noteScript, note.nullifier, note.createdAt, note.stateDiscriminant, note.state, note.consumedBlockHeight, note.consumedTxOrder, note.consumerAccountId);
9321
9575
  })),
9322
9576
  Promise.all(serializedOutputNotes.map((note) => {
9323
9577
  return upsertOutputNote(dbId, note.noteId, note.noteAssets, note.recipientDigest, note.metadata, note.nullifier, note.expectedHeight, note.stateDiscriminant, note.state);
@@ -9331,14 +9585,19 @@ async function applyStateSync(dbId, stateUpdate) {
9331
9585
  }
9332
9586
  return Promise.all(promises);
9333
9587
  })),
9334
- Promise.all(accountUpdates.flatMap((accountUpdate) => {
9335
- return [
9336
- upsertAccountStorage(dbId, accountUpdate.accountId, accountUpdate.nonce, accountUpdate.storageSlots),
9337
- upsertStorageMapEntries(dbId, accountUpdate.accountId, accountUpdate.nonce, accountUpdate.storageMapEntries),
9338
- upsertVaultAssets(dbId, accountUpdate.accountId, accountUpdate.nonce, accountUpdate.assets),
9339
- upsertAccountRecord(dbId, accountUpdate.accountId, accountUpdate.codeRoot, accountUpdate.storageRoot, accountUpdate.vaultRoot, accountUpdate.nonce, accountUpdate.committed, accountUpdate.accountCommitment, accountUpdate.accountSeed),
9340
- ];
9341
- })),
9588
+ Promise.all(accountUpdates.map((accountUpdate) => applyFullAccountState(dbId, {
9589
+ accountId: accountUpdate.accountId,
9590
+ nonce: accountUpdate.nonce,
9591
+ storageSlots: accountUpdate.storageSlots,
9592
+ storageMapEntries: accountUpdate.storageMapEntries,
9593
+ assets: accountUpdate.assets,
9594
+ codeRoot: accountUpdate.codeRoot,
9595
+ storageRoot: accountUpdate.storageRoot,
9596
+ vaultRoot: accountUpdate.vaultRoot,
9597
+ committed: accountUpdate.committed,
9598
+ accountCommitment: accountUpdate.accountCommitment,
9599
+ accountSeed: accountUpdate.accountSeed,
9600
+ }))),
9342
9601
  updateSyncHeight(tx, blockNum),
9343
9602
  updatePartialBlockchainNodes(tx, serializedNodeIds, serializedNodes),
9344
9603
  updateCommittedNoteTags(tx, committedNoteIds),
@@ -9697,13 +9956,20 @@ class AccountBuilder {
9697
9956
  }
9698
9957
  /**
9699
9958
  * Sets the account type (regular, faucet, etc.).
9700
- * @param {AccountType} account_type
9959
+ *
9960
+ * Accepts either a numeric WASM enum value (0–3) or a string name
9961
+ * (`"FungibleFaucet"`, `"NonFungibleFaucet"`,
9962
+ * `"RegularAccountImmutableCode"`, `"RegularAccountUpdatableCode"`).
9963
+ * @param {any} account_type
9701
9964
  * @returns {AccountBuilder}
9702
9965
  */
9703
9966
  accountType(account_type) {
9704
9967
  const ptr = this.__destroy_into_raw();
9705
9968
  const ret = wasm.accountbuilder_accountType(ptr, account_type);
9706
- return AccountBuilder.__wrap(ret);
9969
+ if (ret[2]) {
9970
+ throw takeFromExternrefTable0(ret[1]);
9971
+ }
9972
+ return AccountBuilder.__wrap(ret[0]);
9707
9973
  }
9708
9974
  /**
9709
9975
  * Builds the account and returns it together with the derived seed.
@@ -9965,6 +10231,10 @@ class AccountComponent {
9965
10231
  }
9966
10232
  /**
9967
10233
  * Returns the hex-encoded MAST root for a procedure by name.
10234
+ *
10235
+ * Matches by full path, relative path, or local name (after the last `::`).
10236
+ * When matching by local name, if multiple procedures share the same local
10237
+ * name across modules, the first match is returned.
9968
10238
  * @param {string} procedure_name
9969
10239
  * @returns {string}
9970
10240
  */
@@ -10339,6 +10609,26 @@ class AccountId {
10339
10609
  }
10340
10610
  return AccountId.__wrap(ret[0]);
10341
10611
  }
10612
+ /**
10613
+ * Builds an account ID from its prefix and suffix field elements.
10614
+ *
10615
+ * This is useful when the account ID components are stored separately (e.g., in storage
10616
+ * maps) and need to be recombined into an `AccountId`.
10617
+ *
10618
+ * Returns an error if the provided felts do not form a valid account ID.
10619
+ * @param {Felt} prefix
10620
+ * @param {Felt} suffix
10621
+ * @returns {AccountId}
10622
+ */
10623
+ static fromPrefixSuffix(prefix, suffix) {
10624
+ _assertClass(prefix, Felt);
10625
+ _assertClass(suffix, Felt);
10626
+ const ret = wasm.accountid_fromPrefixSuffix(prefix.__wbg_ptr, suffix.__wbg_ptr);
10627
+ if (ret[2]) {
10628
+ throw takeFromExternrefTable0(ret[1]);
10629
+ }
10630
+ return AccountId.__wrap(ret[0]);
10631
+ }
10342
10632
  /**
10343
10633
  * Returns true if the ID refers to a faucet.
10344
10634
  * @returns {boolean}
@@ -10523,7 +10813,8 @@ const AccountInterface = Object.freeze({
10523
10813
  /**
10524
10814
  * Proof of existence of an account's state at a specific block number, as returned by the node.
10525
10815
  *
10526
- * For public accounts, this includes the account header, storage slot values and account code.
10816
+ * For public accounts, this includes the account header, storage slot values, account code,
10817
+ * and optionally storage map entries for the requested storage maps.
10527
10818
  * For private accounts, only the account commitment and merkle proof are available.
10528
10819
  */
10529
10820
  class AccountProof {
@@ -10584,6 +10875,46 @@ class AccountProof {
10584
10875
  const ret = wasm.accountproof_blockNum(this.__wbg_ptr);
10585
10876
  return ret >>> 0;
10586
10877
  }
10878
+ /**
10879
+ * Returns storage map entries for a given slot name, if available.
10880
+ *
10881
+ * Returns `undefined` if the account is private, the slot was not requested in the
10882
+ * storage requirements, or the slot is not a map.
10883
+ *
10884
+ * Each entry contains a `key` and `value` as `Word` objects.
10885
+ * @param {string} slot_name
10886
+ * @returns {StorageMapEntry[] | undefined}
10887
+ */
10888
+ getStorageMapEntries(slot_name) {
10889
+ const ptr0 = passStringToWasm0(slot_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10890
+ const len0 = WASM_VECTOR_LEN;
10891
+ const ret = wasm.accountproof_getStorageMapEntries(this.__wbg_ptr, ptr0, len0);
10892
+ if (ret[3]) {
10893
+ throw takeFromExternrefTable0(ret[2]);
10894
+ }
10895
+ let v2;
10896
+ if (ret[0] !== 0) {
10897
+ v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
10898
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10899
+ }
10900
+ return v2;
10901
+ }
10902
+ /**
10903
+ * Returns the names of all storage slots that have map details available.
10904
+ *
10905
+ * This can be used to discover which storage maps were included in the proof response.
10906
+ * Returns `undefined` if the account is private.
10907
+ * @returns {string[] | undefined}
10908
+ */
10909
+ getStorageMapSlotNames() {
10910
+ const ret = wasm.accountproof_getStorageMapSlotNames(this.__wbg_ptr);
10911
+ let v1;
10912
+ if (ret[0] !== 0) {
10913
+ v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
10914
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10915
+ }
10916
+ return v1;
10917
+ }
10587
10918
  /**
10588
10919
  * Returns the value of a storage slot by name, if available.
10589
10920
  *
@@ -10603,6 +10934,25 @@ class AccountProof {
10603
10934
  }
10604
10935
  return ret[0] === 0 ? undefined : Word.__wrap(ret[0]);
10605
10936
  }
10937
+ /**
10938
+ * Returns whether a storage map slot had too many entries to return inline.
10939
+ *
10940
+ * When this returns `true`, use `RpcClient.syncStorageMaps()` to fetch the full
10941
+ * storage map data.
10942
+ *
10943
+ * Returns `undefined` if the slot was not found or the account is private.
10944
+ * @param {string} slot_name
10945
+ * @returns {boolean | undefined}
10946
+ */
10947
+ hasStorageMapTooManyEntries(slot_name) {
10948
+ const ptr0 = passStringToWasm0(slot_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10949
+ const len0 = WASM_VECTOR_LEN;
10950
+ const ret = wasm.accountproof_hasStorageMapTooManyEntries(this.__wbg_ptr, ptr0, len0);
10951
+ if (ret[2]) {
10952
+ throw takeFromExternrefTable0(ret[1]);
10953
+ }
10954
+ return ret[0] === 0xFFFFFF ? undefined : ret[0] !== 0;
10955
+ }
10606
10956
  /**
10607
10957
  * Returns the number of storage slots, if available (public accounts only).
10608
10958
  * @returns {number | undefined}
@@ -11366,6 +11716,16 @@ class AdviceInputs {
11366
11716
  }
11367
11717
  return v1;
11368
11718
  }
11719
+ /**
11720
+ * `wasm_bindgen` requires an explicit constructor; `#[derive(Default)]` alone
11721
+ * is not callable from JS.
11722
+ */
11723
+ constructor() {
11724
+ const ret = wasm.adviceinputs_new();
11725
+ this.__wbg_ptr = ret >>> 0;
11726
+ AdviceInputsFinalization.register(this, this.__wbg_ptr, this);
11727
+ return this;
11728
+ }
11369
11729
  /**
11370
11730
  * Returns the stack inputs as a vector of felts.
11371
11731
  * @returns {Felt[]}
@@ -11478,7 +11838,7 @@ class AssetVault {
11478
11838
  * @returns {Word}
11479
11839
  */
11480
11840
  root() {
11481
- const ret = wasm.accountcode_commitment(this.__wbg_ptr);
11841
+ const ret = wasm.accountheader_codeCommitment(this.__wbg_ptr);
11482
11842
  return Word.__wrap(ret);
11483
11843
  }
11484
11844
  }
@@ -11748,7 +12108,7 @@ class BasicFungibleFaucetComponent {
11748
12108
  * @returns {Felt}
11749
12109
  */
11750
12110
  maxSupply() {
11751
- const ret = wasm.accountid_suffix(this.__wbg_ptr);
12111
+ const ret = wasm.accountid_prefix(this.__wbg_ptr);
11752
12112
  return Felt.__wrap(ret);
11753
12113
  }
11754
12114
  /**
@@ -11883,7 +12243,7 @@ class BlockHeader {
11883
12243
  * @returns {Word}
11884
12244
  */
11885
12245
  txKernelCommitment() {
11886
- const ret = wasm.accountbuilderresult_seed(this.__wbg_ptr);
12246
+ const ret = wasm.blockheader_txKernelCommitment(this.__wbg_ptr);
11887
12247
  return Word.__wrap(ret);
11888
12248
  }
11889
12249
  /**
@@ -12042,7 +12402,7 @@ class CodeBuilder {
12042
12402
  if (Symbol.dispose) CodeBuilder.prototype[Symbol.dispose] = CodeBuilder.prototype.free;
12043
12403
 
12044
12404
  /**
12045
- * Represents a note committed on chain, as returned by `syncNotes`.
12405
+ * Represents a note committed on chain.
12046
12406
  */
12047
12407
  class CommittedNote {
12048
12408
  static __wrap(ptr) {
@@ -12063,15 +12423,34 @@ class CommittedNote {
12063
12423
  wasm.__wbg_committednote_free(ptr, 0);
12064
12424
  }
12065
12425
  /**
12066
- * Returns the inclusion path for the note.
12426
+ * Returns the full note metadata when the attachment payload is available.
12427
+ * @returns {NoteMetadata | undefined}
12428
+ */
12429
+ fullMetadata() {
12430
+ const ret = wasm.committednote_fullMetadata(this.__wbg_ptr);
12431
+ return ret === 0 ? undefined : NoteMetadata.__wrap(ret);
12432
+ }
12433
+ /**
12434
+ * Returns the inclusion path for the note in the block's note tree.
12067
12435
  * @returns {SparseMerklePath}
12068
12436
  */
12069
12437
  inclusionPath() {
12070
12438
  const ret = wasm.committednote_inclusionPath(this.__wbg_ptr);
12071
12439
  return SparseMerklePath.__wrap(ret);
12072
12440
  }
12441
+ /**
12442
+ * Returns the inclusion proof for this note.
12443
+ * @returns {NoteInclusionProof}
12444
+ */
12445
+ inclusionProof() {
12446
+ const ret = wasm.committednote_inclusionProof(this.__wbg_ptr);
12447
+ return NoteInclusionProof.__wrap(ret);
12448
+ }
12073
12449
  /**
12074
12450
  * Returns the note metadata.
12451
+ *
12452
+ * If only metadata headers are available, the returned metadata contains
12453
+ * the sender, note type, and tag without attachment payload.
12075
12454
  * @returns {NoteMetadata}
12076
12455
  */
12077
12456
  metadata() {
@@ -12094,6 +12473,30 @@ class CommittedNote {
12094
12473
  const ret = wasm.committednote_noteIndex(this.__wbg_ptr);
12095
12474
  return ret;
12096
12475
  }
12476
+ /**
12477
+ * Returns the note type (public, private, etc.).
12478
+ * @returns {NoteType}
12479
+ */
12480
+ noteType() {
12481
+ const ret = wasm.committednote_noteType(this.__wbg_ptr);
12482
+ return ret;
12483
+ }
12484
+ /**
12485
+ * Returns the note sender, even when only header metadata is available.
12486
+ * @returns {AccountId}
12487
+ */
12488
+ sender() {
12489
+ const ret = wasm.committednote_sender(this.__wbg_ptr);
12490
+ return AccountId.__wrap(ret);
12491
+ }
12492
+ /**
12493
+ * Returns the note tag.
12494
+ * @returns {number}
12495
+ */
12496
+ tag() {
12497
+ const ret = wasm.committednote_tag(this.__wbg_ptr);
12498
+ return ret >>> 0;
12499
+ }
12097
12500
  }
12098
12501
  if (Symbol.dispose) CommittedNote.prototype[Symbol.dispose] = CommittedNote.prototype.free;
12099
12502
 
@@ -12601,7 +13004,7 @@ class FetchedAccount {
12601
13004
  * @returns {number}
12602
13005
  */
12603
13006
  lastBlockNum() {
12604
- const ret = wasm.fetchedaccount_lastBlockNum(this.__wbg_ptr);
13007
+ const ret = wasm.accountproof_blockNum(this.__wbg_ptr);
12605
13008
  return ret >>> 0;
12606
13009
  }
12607
13010
  }
@@ -14360,7 +14763,6 @@ class JsVaultAsset {
14360
14763
  toJSON() {
14361
14764
  return {
14362
14765
  asset: this.asset,
14363
- faucetIdPrefix: this.faucetIdPrefix,
14364
14766
  vaultKey: this.vaultKey,
14365
14767
  };
14366
14768
  }
@@ -14393,22 +14795,6 @@ class JsVaultAsset {
14393
14795
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
14394
14796
  }
14395
14797
  }
14396
- /**
14397
- * Asset's faucet ID prefix.
14398
- * @returns {string}
14399
- */
14400
- get faucetIdPrefix() {
14401
- let deferred1_0;
14402
- let deferred1_1;
14403
- try {
14404
- const ret = wasm.__wbg_get_jsvaultasset_faucetIdPrefix(this.__wbg_ptr);
14405
- deferred1_0 = ret[0];
14406
- deferred1_1 = ret[1];
14407
- return getStringFromWasm0(ret[0], ret[1]);
14408
- } finally {
14409
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
14410
- }
14411
- }
14412
14798
  /**
14413
14799
  * The vault key associated with the asset.
14414
14800
  * @returns {string}
@@ -14430,15 +14816,6 @@ class JsVaultAsset {
14430
14816
  * @param {string} arg0
14431
14817
  */
14432
14818
  set asset(arg0) {
14433
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14434
- const len0 = WASM_VECTOR_LEN;
14435
- wasm.__wbg_set_jsstoragemapentry_value(this.__wbg_ptr, ptr0, len0);
14436
- }
14437
- /**
14438
- * Asset's faucet ID prefix.
14439
- * @param {string} arg0
14440
- */
14441
- set faucetIdPrefix(arg0) {
14442
14819
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14443
14820
  const len0 = WASM_VECTOR_LEN;
14444
14821
  wasm.__wbg_set_jsstoragemapentry_key(this.__wbg_ptr, ptr0, len0);
@@ -14506,7 +14883,10 @@ class MerklePath {
14506
14883
  computeRoot(index, node) {
14507
14884
  _assertClass(node, Word);
14508
14885
  const ret = wasm.merklepath_computeRoot(this.__wbg_ptr, index, node.__wbg_ptr);
14509
- return Word.__wrap(ret);
14886
+ if (ret[2]) {
14887
+ throw takeFromExternrefTable0(ret[1]);
14888
+ }
14889
+ return Word.__wrap(ret[0]);
14510
14890
  }
14511
14891
  /**
14512
14892
  * Returns the depth of the path.
@@ -14763,7 +15143,7 @@ class Note {
14763
15143
  * @returns {Word}
14764
15144
  */
14765
15145
  nullifier() {
14766
- const ret = wasm.accountcode_commitment(this.__wbg_ptr);
15146
+ const ret = wasm.note_nullifier(this.__wbg_ptr);
14767
15147
  return Word.__wrap(ret);
14768
15148
  }
14769
15149
  /**
@@ -14824,13 +15204,12 @@ class NoteAndArgs {
14824
15204
  */
14825
15205
  constructor(note, args) {
14826
15206
  _assertClass(note, Note);
14827
- var ptr0 = note.__destroy_into_raw();
14828
- let ptr1 = 0;
15207
+ let ptr0 = 0;
14829
15208
  if (!isLikeNone(args)) {
14830
15209
  _assertClass(args, Word);
14831
- ptr1 = args.__destroy_into_raw();
15210
+ ptr0 = args.__destroy_into_raw();
14832
15211
  }
14833
- const ret = wasm.noteandargs_new(ptr0, ptr1);
15212
+ const ret = wasm.noteandargs_new(note.__wbg_ptr, ptr0);
14834
15213
  this.__wbg_ptr = ret >>> 0;
14835
15214
  NoteAndArgsFinalization.register(this, this.__wbg_ptr, this);
14836
15215
  return this;
@@ -14908,6 +15287,76 @@ class NoteAndArgsArray {
14908
15287
  }
14909
15288
  if (Symbol.dispose) NoteAndArgsArray.prototype[Symbol.dispose] = NoteAndArgsArray.prototype.free;
14910
15289
 
15290
+ class NoteArray {
15291
+ toJSON() {
15292
+ return {
15293
+ };
15294
+ }
15295
+ toString() {
15296
+ return JSON.stringify(this);
15297
+ }
15298
+ __destroy_into_raw() {
15299
+ const ptr = this.__wbg_ptr;
15300
+ this.__wbg_ptr = 0;
15301
+ NoteArrayFinalization.unregister(this);
15302
+ return ptr;
15303
+ }
15304
+ free() {
15305
+ const ptr = this.__destroy_into_raw();
15306
+ wasm.__wbg_notearray_free(ptr, 0);
15307
+ }
15308
+ /**
15309
+ * Get element at index, will always return a clone to avoid aliasing issues.
15310
+ * @param {number} index
15311
+ * @returns {Note}
15312
+ */
15313
+ get(index) {
15314
+ const ret = wasm.notearray_get(this.__wbg_ptr, index);
15315
+ if (ret[2]) {
15316
+ throw takeFromExternrefTable0(ret[1]);
15317
+ }
15318
+ return Note.__wrap(ret[0]);
15319
+ }
15320
+ /**
15321
+ * @returns {number}
15322
+ */
15323
+ length() {
15324
+ const ret = wasm.notearray_length(this.__wbg_ptr);
15325
+ return ret >>> 0;
15326
+ }
15327
+ /**
15328
+ * @param {Note[] | null} [elements]
15329
+ */
15330
+ constructor(elements) {
15331
+ var ptr0 = isLikeNone(elements) ? 0 : passArrayJsValueToWasm0(elements, wasm.__wbindgen_malloc);
15332
+ var len0 = WASM_VECTOR_LEN;
15333
+ const ret = wasm.notearray_new(ptr0, len0);
15334
+ this.__wbg_ptr = ret >>> 0;
15335
+ NoteArrayFinalization.register(this, this.__wbg_ptr, this);
15336
+ return this;
15337
+ }
15338
+ /**
15339
+ * @param {Note} element
15340
+ */
15341
+ push(element) {
15342
+ _assertClass(element, Note);
15343
+ wasm.notearray_push(this.__wbg_ptr, element.__wbg_ptr);
15344
+ }
15345
+ /**
15346
+ * @param {number} index
15347
+ * @param {Note} elem
15348
+ */
15349
+ replaceAt(index, elem) {
15350
+ _assertClass(elem, Note);
15351
+ var ptr0 = elem.__destroy_into_raw();
15352
+ const ret = wasm.notearray_replaceAt(this.__wbg_ptr, index, ptr0);
15353
+ if (ret[1]) {
15354
+ throw takeFromExternrefTable0(ret[0]);
15355
+ }
15356
+ }
15357
+ }
15358
+ if (Symbol.dispose) NoteArray.prototype[Symbol.dispose] = NoteArray.prototype.free;
15359
+
14911
15360
  /**
14912
15361
  * An asset container for a note.
14913
15362
  *
@@ -15530,7 +15979,10 @@ class NoteExecutionHint {
15530
15979
  */
15531
15980
  canBeConsumed(block_num) {
15532
15981
  const ret = wasm.noteexecutionhint_canBeConsumed(this.__wbg_ptr, block_num);
15533
- return ret !== 0;
15982
+ if (ret[2]) {
15983
+ throw takeFromExternrefTable0(ret[1]);
15984
+ }
15985
+ return ret[0] !== 0;
15534
15986
  }
15535
15987
  /**
15536
15988
  * Reconstructs a hint from its encoded tag and payload.
@@ -15540,7 +15992,10 @@ class NoteExecutionHint {
15540
15992
  */
15541
15993
  static fromParts(tag, payload) {
15542
15994
  const ret = wasm.noteexecutionhint_fromParts(tag, payload);
15543
- return NoteExecutionHint.__wrap(ret);
15995
+ if (ret[2]) {
15996
+ throw takeFromExternrefTable0(ret[1]);
15997
+ }
15998
+ return NoteExecutionHint.__wrap(ret[0]);
15544
15999
  }
15545
16000
  /**
15546
16001
  * Creates a hint that does not specify any execution constraint.
@@ -15814,14 +16269,6 @@ class NoteHeader {
15814
16269
  const ptr = this.__destroy_into_raw();
15815
16270
  wasm.__wbg_noteheader_free(ptr, 0);
15816
16271
  }
15817
- /**
15818
- * Returns a commitment to the note ID and metadata.
15819
- * @returns {Word}
15820
- */
15821
- commitment() {
15822
- const ret = wasm.noteheader_commitment(this.__wbg_ptr);
15823
- return Word.__wrap(ret);
15824
- }
15825
16272
  /**
15826
16273
  * Returns the unique identifier for the note.
15827
16274
  * @returns {NoteId}
@@ -15838,6 +16285,14 @@ class NoteHeader {
15838
16285
  const ret = wasm.noteheader_metadata(this.__wbg_ptr);
15839
16286
  return NoteMetadata.__wrap(ret);
15840
16287
  }
16288
+ /**
16289
+ * Returns a commitment to the note ID and metadata.
16290
+ * @returns {Word}
16291
+ */
16292
+ toCommitment() {
16293
+ const ret = wasm.noteheader_toCommitment(this.__wbg_ptr);
16294
+ return Word.__wrap(ret);
16295
+ }
15841
16296
  }
15842
16297
  if (Symbol.dispose) NoteHeader.prototype[Symbol.dispose] = NoteHeader.prototype.free;
15843
16298
 
@@ -16107,20 +16562,20 @@ class NoteLocation {
16107
16562
  wasm.__wbg_notelocation_free(ptr, 0);
16108
16563
  }
16109
16564
  /**
16110
- * Returns the block height containing the note.
16565
+ * Returns the index of the note leaf within the block's note tree.
16111
16566
  * @returns {number}
16112
16567
  */
16113
- blockNum() {
16114
- const ret = wasm.noteattachmentscheme_asU32(this.__wbg_ptr);
16115
- return ret >>> 0;
16568
+ blockNoteTreeIndex() {
16569
+ const ret = wasm.notelocation_blockNoteTreeIndex(this.__wbg_ptr);
16570
+ return ret;
16116
16571
  }
16117
16572
  /**
16118
- * Returns the index of the note leaf within the block's note tree.
16573
+ * Returns the block height containing the note.
16119
16574
  * @returns {number}
16120
16575
  */
16121
- nodeIndexInBlock() {
16122
- const ret = wasm.notelocation_nodeIndexInBlock(this.__wbg_ptr);
16123
- return ret;
16576
+ blockNum() {
16577
+ const ret = wasm.noteattachmentscheme_asU32(this.__wbg_ptr);
16578
+ return ret >>> 0;
16124
16579
  }
16125
16580
  }
16126
16581
  if (Symbol.dispose) NoteLocation.prototype[Symbol.dispose] = NoteLocation.prototype.free;
@@ -16415,7 +16870,8 @@ class NoteScript {
16415
16870
  }
16416
16871
  /**
16417
16872
  * Creates a `NoteScript` from the given `Package`.
16418
- * Throws if the package is invalid.
16873
+ * The package must contain a library with exactly one procedure annotated with
16874
+ * `@note_script`.
16419
16875
  * @param {Package} _package
16420
16876
  * @returns {NoteScript}
16421
16877
  */
@@ -16530,13 +16986,66 @@ class NoteStorage {
16530
16986
  constructor(felt_array) {
16531
16987
  _assertClass(felt_array, FeltArray);
16532
16988
  const ret = wasm.notestorage_new(felt_array.__wbg_ptr);
16533
- this.__wbg_ptr = ret >>> 0;
16989
+ if (ret[2]) {
16990
+ throw takeFromExternrefTable0(ret[1]);
16991
+ }
16992
+ this.__wbg_ptr = ret[0] >>> 0;
16534
16993
  NoteStorageFinalization.register(this, this.__wbg_ptr, this);
16535
16994
  return this;
16536
16995
  }
16537
16996
  }
16538
16997
  if (Symbol.dispose) NoteStorage.prototype[Symbol.dispose] = NoteStorage.prototype.free;
16539
16998
 
16999
+ /**
17000
+ * Represents a single block's worth of note sync data.
17001
+ */
17002
+ class NoteSyncBlock {
17003
+ static __wrap(ptr) {
17004
+ ptr = ptr >>> 0;
17005
+ const obj = Object.create(NoteSyncBlock.prototype);
17006
+ obj.__wbg_ptr = ptr;
17007
+ NoteSyncBlockFinalization.register(obj, obj.__wbg_ptr, obj);
17008
+ return obj;
17009
+ }
17010
+ __destroy_into_raw() {
17011
+ const ptr = this.__wbg_ptr;
17012
+ this.__wbg_ptr = 0;
17013
+ NoteSyncBlockFinalization.unregister(this);
17014
+ return ptr;
17015
+ }
17016
+ free() {
17017
+ const ptr = this.__destroy_into_raw();
17018
+ wasm.__wbg_notesyncblock_free(ptr, 0);
17019
+ }
17020
+ /**
17021
+ * Returns the block header for this block.
17022
+ * @returns {BlockHeader}
17023
+ */
17024
+ blockHeader() {
17025
+ const ret = wasm.notesyncblock_blockHeader(this.__wbg_ptr);
17026
+ return BlockHeader.__wrap(ret);
17027
+ }
17028
+ /**
17029
+ * Returns the MMR path for the block header.
17030
+ * @returns {MerklePath}
17031
+ */
17032
+ mmrPath() {
17033
+ const ret = wasm.notesyncblock_mmrPath(this.__wbg_ptr);
17034
+ return MerklePath.__wrap(ret);
17035
+ }
17036
+ /**
17037
+ * Returns the committed notes in this block.
17038
+ * @returns {CommittedNote[]}
17039
+ */
17040
+ notes() {
17041
+ const ret = wasm.notesyncblock_notes(this.__wbg_ptr);
17042
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
17043
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17044
+ return v1;
17045
+ }
17046
+ }
17047
+ if (Symbol.dispose) NoteSyncBlock.prototype[Symbol.dispose] = NoteSyncBlock.prototype.free;
17048
+
16540
17049
  /**
16541
17050
  * Represents the response data from `syncNotes`.
16542
17051
  */
@@ -16559,31 +17068,49 @@ class NoteSyncInfo {
16559
17068
  wasm.__wbg_notesyncinfo_free(ptr, 0);
16560
17069
  }
16561
17070
  /**
16562
- * Returns the block header associated with the matching notes.
16563
- * @returns {BlockHeader}
17071
+ * Returns the first block header associated with matching notes, if any.
17072
+ * @returns {BlockHeader | undefined}
16564
17073
  */
16565
17074
  blockHeader() {
16566
17075
  const ret = wasm.notesyncinfo_blockHeader(this.__wbg_ptr);
16567
- return BlockHeader.__wrap(ret);
17076
+ return ret === 0 ? undefined : BlockHeader.__wrap(ret);
17077
+ }
17078
+ /**
17079
+ * Returns the last block checked by the node. Used as a cursor for pagination.
17080
+ * @returns {number}
17081
+ */
17082
+ blockTo() {
17083
+ const ret = wasm.notesyncinfo_blockTo(this.__wbg_ptr);
17084
+ return ret >>> 0;
17085
+ }
17086
+ /**
17087
+ * Returns the blocks containing matching notes.
17088
+ * @returns {NoteSyncBlock[]}
17089
+ */
17090
+ blocks() {
17091
+ const ret = wasm.notesyncinfo_blocks(this.__wbg_ptr);
17092
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
17093
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17094
+ return v1;
16568
17095
  }
16569
17096
  /**
16570
17097
  * Returns the latest block number in the chain.
16571
17098
  * @returns {number}
16572
17099
  */
16573
17100
  chainTip() {
16574
- const ret = wasm.notesyncinfo_chainTip(this.__wbg_ptr);
17101
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
16575
17102
  return ret >>> 0;
16576
17103
  }
16577
17104
  /**
16578
- * Returns the MMR path for the block header.
16579
- * @returns {MerklePath}
17105
+ * Returns the first block MMR path associated with matching notes, if any.
17106
+ * @returns {MerklePath | undefined}
16580
17107
  */
16581
17108
  mmrPath() {
16582
17109
  const ret = wasm.notesyncinfo_mmrPath(this.__wbg_ptr);
16583
- return MerklePath.__wrap(ret);
17110
+ return ret === 0 ? undefined : MerklePath.__wrap(ret);
16584
17111
  }
16585
17112
  /**
16586
- * Returns the committed notes returned by the node.
17113
+ * Returns the committed notes across all matching blocks.
16587
17114
  * @returns {CommittedNote[]}
16588
17115
  */
16589
17116
  notes() {
@@ -16686,7 +17213,7 @@ const NoteType = Object.freeze({
16686
17213
  });
16687
17214
 
16688
17215
  /**
16689
- * Representation of a note produced by a transaction (full, partial, or header-only).
17216
+ * Representation of a note produced by a transaction (full or partial).
16690
17217
  */
16691
17218
  class OutputNote {
16692
17219
  static __wrap(ptr) {
@@ -16730,16 +17257,6 @@ class OutputNote {
16730
17257
  const ret = wasm.outputnote_full(note.__wbg_ptr);
16731
17258
  return OutputNote.__wrap(ret);
16732
17259
  }
16733
- /**
16734
- * Wraps only the header of a note.
16735
- * @param {NoteHeader} note_header
16736
- * @returns {OutputNote}
16737
- */
16738
- static header(note_header) {
16739
- _assertClass(note_header, NoteHeader);
16740
- const ret = wasm.outputnote_header(note_header.__wbg_ptr);
16741
- return OutputNote.__wrap(ret);
16742
- }
16743
17260
  /**
16744
17261
  * Returns the note ID for this output.
16745
17262
  * @returns {NoteId}
@@ -16776,20 +17293,12 @@ class OutputNote {
16776
17293
  return OutputNote.__wrap(ret);
16777
17294
  }
16778
17295
  /**
16779
- * Returns the recipient digest if the recipient is known.
16780
- * @returns {Word | undefined}
17296
+ * Returns the recipient digest.
17297
+ * @returns {Word}
16781
17298
  */
16782
17299
  recipientDigest() {
16783
17300
  const ret = wasm.outputnote_recipientDigest(this.__wbg_ptr);
16784
- return ret === 0 ? undefined : Word.__wrap(ret);
16785
- }
16786
- /**
16787
- * Returns a more compact representation if possible (e.g. dropping details).
16788
- * @returns {OutputNote}
16789
- */
16790
- shrink() {
16791
- const ret = wasm.outputnote_shrink(this.__wbg_ptr);
16792
- return OutputNote.__wrap(ret);
17301
+ return Word.__wrap(ret);
16793
17302
  }
16794
17303
  }
16795
17304
  if (Symbol.dispose) OutputNote.prototype[Symbol.dispose] = OutputNote.prototype.free;
@@ -16828,7 +17337,7 @@ class OutputNoteArray {
16828
17337
  * @returns {number}
16829
17338
  */
16830
17339
  length() {
16831
- const ret = wasm.outputnotearray_length(this.__wbg_ptr);
17340
+ const ret = wasm.notearray_length(this.__wbg_ptr);
16832
17341
  return ret >>> 0;
16833
17342
  }
16834
17343
  /**
@@ -17004,12 +17513,6 @@ class OutputNotes {
17004
17513
  OutputNotesFinalization.register(obj, obj.__wbg_ptr, obj);
17005
17514
  return obj;
17006
17515
  }
17007
- static __unwrap(jsValue) {
17008
- if (!(jsValue instanceof OutputNotes)) {
17009
- return 0;
17010
- }
17011
- return jsValue.__destroy_into_raw();
17012
- }
17013
17516
  __destroy_into_raw() {
17014
17517
  const ptr = this.__wbg_ptr;
17015
17518
  this.__wbg_ptr = 0;
@@ -17052,89 +17555,19 @@ class OutputNotes {
17052
17555
  notes() {
17053
17556
  const ret = wasm.outputnotes_notes(this.__wbg_ptr);
17054
17557
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
17055
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17056
- return v1;
17057
- }
17058
- /**
17059
- * Returns the number of notes emitted.
17060
- * @returns {number}
17061
- */
17062
- numNotes() {
17063
- const ret = wasm.outputnotes_numNotes(this.__wbg_ptr);
17064
- return ret >>> 0;
17065
- }
17066
- }
17067
- if (Symbol.dispose) OutputNotes.prototype[Symbol.dispose] = OutputNotes.prototype.free;
17068
-
17069
- class OutputNotesArray {
17070
- toJSON() {
17071
- return {
17072
- };
17073
- }
17074
- toString() {
17075
- return JSON.stringify(this);
17076
- }
17077
- __destroy_into_raw() {
17078
- const ptr = this.__wbg_ptr;
17079
- this.__wbg_ptr = 0;
17080
- OutputNotesArrayFinalization.unregister(this);
17081
- return ptr;
17082
- }
17083
- free() {
17084
- const ptr = this.__destroy_into_raw();
17085
- wasm.__wbg_outputnotesarray_free(ptr, 0);
17086
- }
17087
- /**
17088
- * Get element at index, will always return a clone to avoid aliasing issues.
17089
- * @param {number} index
17090
- * @returns {OutputNotes}
17091
- */
17092
- get(index) {
17093
- const ret = wasm.outputnotesarray_get(this.__wbg_ptr, index);
17094
- if (ret[2]) {
17095
- throw takeFromExternrefTable0(ret[1]);
17096
- }
17097
- return OutputNotes.__wrap(ret[0]);
17098
- }
17099
- /**
17100
- * @returns {number}
17101
- */
17102
- length() {
17103
- const ret = wasm.outputnotesarray_length(this.__wbg_ptr);
17104
- return ret >>> 0;
17105
- }
17106
- /**
17107
- * @param {OutputNotes[] | null} [elements]
17108
- */
17109
- constructor(elements) {
17110
- var ptr0 = isLikeNone(elements) ? 0 : passArrayJsValueToWasm0(elements, wasm.__wbindgen_malloc);
17111
- var len0 = WASM_VECTOR_LEN;
17112
- const ret = wasm.outputnotesarray_new(ptr0, len0);
17113
- this.__wbg_ptr = ret >>> 0;
17114
- OutputNotesArrayFinalization.register(this, this.__wbg_ptr, this);
17115
- return this;
17116
- }
17117
- /**
17118
- * @param {OutputNotes} element
17119
- */
17120
- push(element) {
17121
- _assertClass(element, OutputNotes);
17122
- wasm.outputnotesarray_push(this.__wbg_ptr, element.__wbg_ptr);
17558
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17559
+ return v1;
17123
17560
  }
17124
17561
  /**
17125
- * @param {number} index
17126
- * @param {OutputNotes} elem
17562
+ * Returns the number of notes emitted.
17563
+ * @returns {number}
17127
17564
  */
17128
- replaceAt(index, elem) {
17129
- _assertClass(elem, OutputNotes);
17130
- var ptr0 = elem.__destroy_into_raw();
17131
- const ret = wasm.outputnotesarray_replaceAt(this.__wbg_ptr, index, ptr0);
17132
- if (ret[1]) {
17133
- throw takeFromExternrefTable0(ret[0]);
17134
- }
17565
+ numNotes() {
17566
+ const ret = wasm.outputnotes_numNotes(this.__wbg_ptr);
17567
+ return ret >>> 0;
17135
17568
  }
17136
17569
  }
17137
- if (Symbol.dispose) OutputNotesArray.prototype[Symbol.dispose] = OutputNotesArray.prototype.free;
17570
+ if (Symbol.dispose) OutputNotes.prototype[Symbol.dispose] = OutputNotes.prototype.free;
17138
17571
 
17139
17572
  /**
17140
17573
  * Compiled VM package containing libraries and metadata.
@@ -17259,6 +17692,33 @@ class PartialNote {
17259
17692
  }
17260
17693
  if (Symbol.dispose) PartialNote.prototype[Symbol.dispose] = PartialNote.prototype.free;
17261
17694
 
17695
+ /**
17696
+ * Poseidon2 hashing helpers exposed to JavaScript.
17697
+ */
17698
+ class Poseidon2 {
17699
+ __destroy_into_raw() {
17700
+ const ptr = this.__wbg_ptr;
17701
+ this.__wbg_ptr = 0;
17702
+ Poseidon2Finalization.unregister(this);
17703
+ return ptr;
17704
+ }
17705
+ free() {
17706
+ const ptr = this.__destroy_into_raw();
17707
+ wasm.__wbg_poseidon2_free(ptr, 0);
17708
+ }
17709
+ /**
17710
+ * Computes a Poseidon2 digest from the provided field elements.
17711
+ * @param {FeltArray} felt_array
17712
+ * @returns {Word}
17713
+ */
17714
+ static hashElements(felt_array) {
17715
+ _assertClass(felt_array, FeltArray);
17716
+ const ret = wasm.poseidon2_hashElements(felt_array.__wbg_ptr);
17717
+ return Word.__wrap(ret);
17718
+ }
17719
+ }
17720
+ if (Symbol.dispose) Poseidon2.prototype[Symbol.dispose] = Poseidon2.prototype.free;
17721
+
17262
17722
  class ProcedureThreshold {
17263
17723
  static __wrap(ptr) {
17264
17724
  ptr = ptr >>> 0;
@@ -17359,7 +17819,7 @@ class ProvenTransaction {
17359
17819
  * @returns {AccountId}
17360
17820
  */
17361
17821
  accountId() {
17362
- const ret = wasm.proventransaction_accountId(this.__wbg_ptr);
17822
+ const ret = wasm.account_id(this.__wbg_ptr);
17363
17823
  return AccountId.__wrap(ret);
17364
17824
  }
17365
17825
  /**
@@ -17387,7 +17847,7 @@ class ProvenTransaction {
17387
17847
  * @returns {TransactionId}
17388
17848
  */
17389
17849
  id() {
17390
- const ret = wasm.proventransaction_id(this.__wbg_ptr);
17850
+ const ret = wasm.accountcode_commitment(this.__wbg_ptr);
17391
17851
  return TransactionId.__wrap(ret);
17392
17852
  }
17393
17853
  /**
@@ -17400,20 +17860,12 @@ class ProvenTransaction {
17400
17860
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17401
17861
  return v1;
17402
17862
  }
17403
- /**
17404
- * Returns notes created by this transaction.
17405
- * @returns {OutputNotes}
17406
- */
17407
- outputNotes() {
17408
- const ret = wasm.proventransaction_outputNotes(this.__wbg_ptr);
17409
- return OutputNotes.__wrap(ret);
17410
- }
17411
17863
  /**
17412
17864
  * Returns the commitment of the reference block.
17413
17865
  * @returns {Word}
17414
17866
  */
17415
17867
  refBlockCommitment() {
17416
- const ret = wasm.proventransaction_refBlockCommitment(this.__wbg_ptr);
17868
+ const ret = wasm.accountheader_storageCommitment(this.__wbg_ptr);
17417
17869
  return Word.__wrap(ret);
17418
17870
  }
17419
17871
  /**
@@ -17551,20 +18003,44 @@ class RpcClient {
17551
18003
  * Fetches an account proof from the node.
17552
18004
  *
17553
18005
  * This is a lighter-weight alternative to `getAccountDetails` that makes a single RPC call
17554
- * and returns the account proof and, for public accounts, the account header, storage slot
17555
- * values, and account code without reconstructing the full account state.
18006
+ * and returns the account proof alongside the account header, storage slot values, and
18007
+ * account code without reconstructing the full account state.
17556
18008
  *
17557
18009
  * For private accounts, the proof is returned but account details will not be available
17558
18010
  * since they are not stored on-chain.
17559
18011
  *
17560
- * Useful for reading storage slot values (e.g., faucet metadata) without the overhead of
17561
- * fetching the complete account with all vault assets and storage map entries.
18012
+ * Useful for reading storage slot values (e.g., faucet metadata) or specific storage map
18013
+ * entries without the overhead of fetching the complete account with all vault assets and
18014
+ * storage map entries.
18015
+ *
18016
+ * @param `account_id` - The account to fetch the proof for.
18017
+ * @param `storage_requirements` - Optional storage requirements specifying which storage
18018
+ * maps and keys to include. When `undefined`, no storage map data is requested.
18019
+ * @param `block_num` - Optional block number to fetch the account state at. When `undefined`,
18020
+ * fetches the latest state (chain tip).
18021
+ * @param `known_vault_commitment` - Optional known vault commitment. When provided,
18022
+ * vault data is returned only if the account's current vault root differs from this
18023
+ * value. Use `Word.new([0, 0, 0, 0])` to always fetch. When `undefined`, vault data
18024
+ * is not requested.
17562
18025
  * @param {AccountId} account_id
18026
+ * @param {AccountStorageRequirements | null} [storage_requirements]
18027
+ * @param {number | null} [block_num]
18028
+ * @param {Word | null} [known_vault_commitment]
17563
18029
  * @returns {Promise<AccountProof>}
17564
18030
  */
17565
- getAccountProof(account_id) {
18031
+ getAccountProof(account_id, storage_requirements, block_num, known_vault_commitment) {
17566
18032
  _assertClass(account_id, AccountId);
17567
- const ret = wasm.rpcclient_getAccountProof(this.__wbg_ptr, account_id.__wbg_ptr);
18033
+ let ptr0 = 0;
18034
+ if (!isLikeNone(storage_requirements)) {
18035
+ _assertClass(storage_requirements, AccountStorageRequirements);
18036
+ ptr0 = storage_requirements.__destroy_into_raw();
18037
+ }
18038
+ let ptr1 = 0;
18039
+ if (!isLikeNone(known_vault_commitment)) {
18040
+ _assertClass(known_vault_commitment, Word);
18041
+ ptr1 = known_vault_commitment.__destroy_into_raw();
18042
+ }
18043
+ const ret = wasm.rpcclient_getAccountProof(this.__wbg_ptr, account_id.__wbg_ptr, ptr0, isLikeNone(block_num) ? 0x100000001 : (block_num) >>> 0, ptr1);
17568
18044
  return ret;
17569
18045
  }
17570
18046
  /**
@@ -17647,6 +18123,26 @@ class RpcClient {
17647
18123
  const ret = wasm.rpcclient_syncNotes(this.__wbg_ptr, block_num, isLikeNone(block_to) ? 0x100000001 : (block_to) >>> 0, ptr0, len0);
17648
18124
  return ret;
17649
18125
  }
18126
+ /**
18127
+ * Syncs storage map updates for an account within a block range.
18128
+ *
18129
+ * This is used when `AccountProof.hasStorageMapTooManyEntries()` returns `true` for a
18130
+ * slot, indicating the storage map was too large to return inline. This endpoint fetches
18131
+ * the full storage map data with pagination support.
18132
+ *
18133
+ * @param `block_from` - The starting block number.
18134
+ * @param `block_to` - Optional ending block number. When `undefined`, syncs to chain tip.
18135
+ * @param `account_id` - The account to sync storage maps for.
18136
+ * @param {number} block_from
18137
+ * @param {number | null | undefined} block_to
18138
+ * @param {AccountId} account_id
18139
+ * @returns {Promise<StorageMapInfo>}
18140
+ */
18141
+ syncStorageMaps(block_from, block_to, account_id) {
18142
+ _assertClass(account_id, AccountId);
18143
+ const ret = wasm.rpcclient_syncStorageMaps(this.__wbg_ptr, block_from, isLikeNone(block_to) ? 0x100000001 : (block_to) >>> 0, account_id.__wbg_ptr);
18144
+ return ret;
18145
+ }
17650
18146
  }
17651
18147
  if (Symbol.dispose) RpcClient.prototype[Symbol.dispose] = RpcClient.prototype.free;
17652
18148
 
@@ -17701,6 +18197,32 @@ class SerializedInputNoteData {
17701
18197
  const ptr = this.__destroy_into_raw();
17702
18198
  wasm.__wbg_serializedinputnotedata_free(ptr, 0);
17703
18199
  }
18200
+ /**
18201
+ * @returns {number | undefined}
18202
+ */
18203
+ get consumedBlockHeight() {
18204
+ const ret = wasm.__wbg_get_serializedinputnotedata_consumedBlockHeight(this.__wbg_ptr);
18205
+ return ret === 0x100000001 ? undefined : ret;
18206
+ }
18207
+ /**
18208
+ * @returns {number | undefined}
18209
+ */
18210
+ get consumedTxOrder() {
18211
+ const ret = wasm.__wbg_get_serializedinputnotedata_consumedTxOrder(this.__wbg_ptr);
18212
+ return ret === 0x100000001 ? undefined : ret;
18213
+ }
18214
+ /**
18215
+ * @returns {string | undefined}
18216
+ */
18217
+ get consumerAccountId() {
18218
+ const ret = wasm.__wbg_get_serializedinputnotedata_consumerAccountId(this.__wbg_ptr);
18219
+ let v1;
18220
+ if (ret[0] !== 0) {
18221
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
18222
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
18223
+ }
18224
+ return v1;
18225
+ }
17704
18226
  /**
17705
18227
  * @returns {string}
17706
18228
  */
@@ -17813,13 +18335,33 @@ class SerializedInputNoteData {
17813
18335
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
17814
18336
  return v1;
17815
18337
  }
18338
+ /**
18339
+ * @param {number | null} [arg0]
18340
+ */
18341
+ set consumedBlockHeight(arg0) {
18342
+ wasm.__wbg_set_serializedinputnotedata_consumedBlockHeight(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0);
18343
+ }
18344
+ /**
18345
+ * @param {number | null} [arg0]
18346
+ */
18347
+ set consumedTxOrder(arg0) {
18348
+ wasm.__wbg_set_serializedinputnotedata_consumedTxOrder(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0);
18349
+ }
18350
+ /**
18351
+ * @param {string | null} [arg0]
18352
+ */
18353
+ set consumerAccountId(arg0) {
18354
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
18355
+ var len0 = WASM_VECTOR_LEN;
18356
+ wasm.__wbg_set_serializedinputnotedata_consumerAccountId(this.__wbg_ptr, ptr0, len0);
18357
+ }
17816
18358
  /**
17817
18359
  * @param {string} arg0
17818
18360
  */
17819
18361
  set createdAt(arg0) {
17820
18362
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17821
18363
  const len0 = WASM_VECTOR_LEN;
17822
- wasm.__wbg_set_jsaccountupdate_accountCommitment(this.__wbg_ptr, ptr0, len0);
18364
+ wasm.__wbg_set_serializedinputnotedata_createdAt(this.__wbg_ptr, ptr0, len0);
17823
18365
  }
17824
18366
  /**
17825
18367
  * @param {Uint8Array} arg0
@@ -17843,7 +18385,7 @@ class SerializedInputNoteData {
17843
18385
  set noteId(arg0) {
17844
18386
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17845
18387
  const len0 = WASM_VECTOR_LEN;
17846
- wasm.__wbg_set_jsaccountupdate_storageRoot(this.__wbg_ptr, ptr0, len0);
18388
+ wasm.__wbg_set_serializedinputnotedata_noteId(this.__wbg_ptr, ptr0, len0);
17847
18389
  }
17848
18390
  /**
17849
18391
  * @param {string} arg0
@@ -17859,7 +18401,7 @@ class SerializedInputNoteData {
17859
18401
  set noteScript(arg0) {
17860
18402
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
17861
18403
  const len0 = WASM_VECTOR_LEN;
17862
- wasm.__wbg_set_jsstatesyncupdate_blockHasRelevantNotes(this.__wbg_ptr, ptr0, len0);
18404
+ wasm.__wbg_set_serializedinputnotedata_noteScript(this.__wbg_ptr, ptr0, len0);
17863
18405
  }
17864
18406
  /**
17865
18407
  * @param {string} arg0
@@ -17867,7 +18409,7 @@ class SerializedInputNoteData {
17867
18409
  set nullifier(arg0) {
17868
18410
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17869
18411
  const len0 = WASM_VECTOR_LEN;
17870
- wasm.__wbg_set_jsaccountupdate_codeRoot(this.__wbg_ptr, ptr0, len0);
18412
+ wasm.__wbg_set_serializedinputnotedata_nullifier(this.__wbg_ptr, ptr0, len0);
17871
18413
  }
17872
18414
  /**
17873
18415
  * @param {Uint8Array} arg0
@@ -18013,7 +18555,7 @@ class SerializedOutputNoteData {
18013
18555
  set metadata(arg0) {
18014
18556
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18015
18557
  const len0 = WASM_VECTOR_LEN;
18016
- wasm.__wbg_set_serializedinputnotedata_inputs(this.__wbg_ptr, ptr0, len0);
18558
+ wasm.__wbg_set_serializedoutputnotedata_metadata(this.__wbg_ptr, ptr0, len0);
18017
18559
  }
18018
18560
  /**
18019
18561
  * @param {Uint8Array} arg0
@@ -18021,7 +18563,7 @@ class SerializedOutputNoteData {
18021
18563
  set noteAssets(arg0) {
18022
18564
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18023
18565
  const len0 = WASM_VECTOR_LEN;
18024
- wasm.__wbg_set_serializedinputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18566
+ wasm.__wbg_set_serializedoutputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18025
18567
  }
18026
18568
  /**
18027
18569
  * @param {string} arg0
@@ -18171,7 +18713,7 @@ class SerializedTransactionData {
18171
18713
  set details(arg0) {
18172
18714
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18173
18715
  const len0 = WASM_VECTOR_LEN;
18174
- wasm.__wbg_set_serializedinputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18716
+ wasm.__wbg_set_serializedoutputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18175
18717
  }
18176
18718
  /**
18177
18719
  * @param {string} arg0
@@ -18201,7 +18743,7 @@ class SerializedTransactionData {
18201
18743
  set status(arg0) {
18202
18744
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18203
18745
  const len0 = WASM_VECTOR_LEN;
18204
- wasm.__wbg_set_serializedinputnotedata_serialNumber(this.__wbg_ptr, ptr0, len0);
18746
+ wasm.__wbg_set_serializedtransactiondata_status(this.__wbg_ptr, ptr0, len0);
18205
18747
  }
18206
18748
  /**
18207
18749
  * @param {Uint8Array | null} [arg0]
@@ -18592,6 +19134,165 @@ class StorageMap {
18592
19134
  }
18593
19135
  if (Symbol.dispose) StorageMap.prototype[Symbol.dispose] = StorageMap.prototype.free;
18594
19136
 
19137
+ /**
19138
+ * A key-value entry from a storage map.
19139
+ */
19140
+ class StorageMapEntry {
19141
+ static __wrap(ptr) {
19142
+ ptr = ptr >>> 0;
19143
+ const obj = Object.create(StorageMapEntry.prototype);
19144
+ obj.__wbg_ptr = ptr;
19145
+ StorageMapEntryFinalization.register(obj, obj.__wbg_ptr, obj);
19146
+ return obj;
19147
+ }
19148
+ __destroy_into_raw() {
19149
+ const ptr = this.__wbg_ptr;
19150
+ this.__wbg_ptr = 0;
19151
+ StorageMapEntryFinalization.unregister(this);
19152
+ return ptr;
19153
+ }
19154
+ free() {
19155
+ const ptr = this.__destroy_into_raw();
19156
+ wasm.__wbg_storagemapentry_free(ptr, 0);
19157
+ }
19158
+ /**
19159
+ * Returns the storage map key.
19160
+ * @returns {Word}
19161
+ */
19162
+ key() {
19163
+ const ret = wasm.accountcode_commitment(this.__wbg_ptr);
19164
+ return Word.__wrap(ret);
19165
+ }
19166
+ /**
19167
+ * Returns the storage map value.
19168
+ * @returns {Word}
19169
+ */
19170
+ value() {
19171
+ const ret = wasm.accountheader_storageCommitment(this.__wbg_ptr);
19172
+ return Word.__wrap(ret);
19173
+ }
19174
+ }
19175
+ if (Symbol.dispose) StorageMapEntry.prototype[Symbol.dispose] = StorageMapEntry.prototype.free;
19176
+
19177
+ /**
19178
+ * Information about storage map updates for an account, as returned by the
19179
+ * `syncStorageMaps` RPC endpoint.
19180
+ *
19181
+ * Contains the list of storage map updates within the requested block range,
19182
+ * along with the chain tip and last processed block number.
19183
+ */
19184
+ class StorageMapInfo {
19185
+ static __wrap(ptr) {
19186
+ ptr = ptr >>> 0;
19187
+ const obj = Object.create(StorageMapInfo.prototype);
19188
+ obj.__wbg_ptr = ptr;
19189
+ StorageMapInfoFinalization.register(obj, obj.__wbg_ptr, obj);
19190
+ return obj;
19191
+ }
19192
+ __destroy_into_raw() {
19193
+ const ptr = this.__wbg_ptr;
19194
+ this.__wbg_ptr = 0;
19195
+ StorageMapInfoFinalization.unregister(this);
19196
+ return ptr;
19197
+ }
19198
+ free() {
19199
+ const ptr = this.__destroy_into_raw();
19200
+ wasm.__wbg_storagemapinfo_free(ptr, 0);
19201
+ }
19202
+ /**
19203
+ * Returns the block number of the last check included in this response.
19204
+ * @returns {number}
19205
+ */
19206
+ blockNumber() {
19207
+ const ret = wasm.notesyncinfo_blockTo(this.__wbg_ptr);
19208
+ return ret >>> 0;
19209
+ }
19210
+ /**
19211
+ * Returns the current chain tip block number.
19212
+ * @returns {number}
19213
+ */
19214
+ chainTip() {
19215
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
19216
+ return ret >>> 0;
19217
+ }
19218
+ /**
19219
+ * Returns the list of storage map updates.
19220
+ * @returns {StorageMapUpdate[]}
19221
+ */
19222
+ updates() {
19223
+ const ret = wasm.storagemapinfo_updates(this.__wbg_ptr);
19224
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
19225
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
19226
+ return v1;
19227
+ }
19228
+ }
19229
+ if (Symbol.dispose) StorageMapInfo.prototype[Symbol.dispose] = StorageMapInfo.prototype.free;
19230
+
19231
+ /**
19232
+ * A single storage map update entry, containing the block number, slot name,
19233
+ * key, and new value.
19234
+ */
19235
+ class StorageMapUpdate {
19236
+ static __wrap(ptr) {
19237
+ ptr = ptr >>> 0;
19238
+ const obj = Object.create(StorageMapUpdate.prototype);
19239
+ obj.__wbg_ptr = ptr;
19240
+ StorageMapUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
19241
+ return obj;
19242
+ }
19243
+ __destroy_into_raw() {
19244
+ const ptr = this.__wbg_ptr;
19245
+ this.__wbg_ptr = 0;
19246
+ StorageMapUpdateFinalization.unregister(this);
19247
+ return ptr;
19248
+ }
19249
+ free() {
19250
+ const ptr = this.__destroy_into_raw();
19251
+ wasm.__wbg_storagemapupdate_free(ptr, 0);
19252
+ }
19253
+ /**
19254
+ * Returns the block number in which this update occurred.
19255
+ * @returns {number}
19256
+ */
19257
+ blockNum() {
19258
+ const ret = wasm.storagemapupdate_blockNum(this.__wbg_ptr);
19259
+ return ret >>> 0;
19260
+ }
19261
+ /**
19262
+ * Returns the storage map key that was updated.
19263
+ * @returns {Word}
19264
+ */
19265
+ key() {
19266
+ const ret = wasm.accountcode_commitment(this.__wbg_ptr);
19267
+ return Word.__wrap(ret);
19268
+ }
19269
+ /**
19270
+ * Returns the name of the storage slot that was updated.
19271
+ * @returns {string}
19272
+ */
19273
+ slotName() {
19274
+ let deferred1_0;
19275
+ let deferred1_1;
19276
+ try {
19277
+ const ret = wasm.storagemapupdate_slotName(this.__wbg_ptr);
19278
+ deferred1_0 = ret[0];
19279
+ deferred1_1 = ret[1];
19280
+ return getStringFromWasm0(ret[0], ret[1]);
19281
+ } finally {
19282
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
19283
+ }
19284
+ }
19285
+ /**
19286
+ * Returns the new value for this storage map key.
19287
+ * @returns {Word}
19288
+ */
19289
+ value() {
19290
+ const ret = wasm.accountheader_storageCommitment(this.__wbg_ptr);
19291
+ return Word.__wrap(ret);
19292
+ }
19293
+ }
19294
+ if (Symbol.dispose) StorageMapUpdate.prototype[Symbol.dispose] = StorageMapUpdate.prototype.free;
19295
+
18595
19296
  /**
18596
19297
  * A single storage slot value or map for an account component.
18597
19298
  */
@@ -18908,21 +19609,15 @@ class TokenSymbol {
18908
19609
  * @returns {string}
18909
19610
  */
18910
19611
  toString() {
18911
- let deferred2_0;
18912
- let deferred2_1;
19612
+ let deferred1_0;
19613
+ let deferred1_1;
18913
19614
  try {
18914
19615
  const ret = wasm.tokensymbol_toString(this.__wbg_ptr);
18915
- var ptr1 = ret[0];
18916
- var len1 = ret[1];
18917
- if (ret[3]) {
18918
- ptr1 = 0; len1 = 0;
18919
- throw takeFromExternrefTable0(ret[2]);
18920
- }
18921
- deferred2_0 = ptr1;
18922
- deferred2_1 = len1;
18923
- return getStringFromWasm0(ptr1, len1);
19616
+ deferred1_0 = ret[0];
19617
+ deferred1_1 = ret[1];
19618
+ return getStringFromWasm0(ret[0], ret[1]);
18924
19619
  } finally {
18925
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
19620
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
18926
19621
  }
18927
19622
  }
18928
19623
  }
@@ -19547,6 +20242,16 @@ class TransactionRequestBuilder {
19547
20242
  const ret = wasm.transactionrequestbuilder_withExpectedOutputRecipients(ptr, recipients.__wbg_ptr);
19548
20243
  return TransactionRequestBuilder.__wrap(ret);
19549
20244
  }
20245
+ /**
20246
+ * Sets the maximum number of blocks until the transaction request expires.
20247
+ * @param {number} expiration_delta
20248
+ * @returns {TransactionRequestBuilder}
20249
+ */
20250
+ withExpirationDelta(expiration_delta) {
20251
+ const ptr = this.__destroy_into_raw();
20252
+ const ret = wasm.transactionrequestbuilder_withExpirationDelta(ptr, expiration_delta);
20253
+ return TransactionRequestBuilder.__wrap(ret);
20254
+ }
19550
20255
  /**
19551
20256
  * Registers foreign accounts referenced by the transaction.
19552
20257
  * @param {ForeignAccountArray} foreign_accounts
@@ -19570,13 +20275,13 @@ class TransactionRequestBuilder {
19570
20275
  return TransactionRequestBuilder.__wrap(ret);
19571
20276
  }
19572
20277
  /**
19573
- * Adds notes created by the sender that should be emitted by the transaction.
19574
- * @param {OutputNoteArray} notes
20278
+ * Adds output notes created by the sender that should be emitted by the transaction.
20279
+ * @param {NoteArray} notes
19575
20280
  * @returns {TransactionRequestBuilder}
19576
20281
  */
19577
20282
  withOwnOutputNotes(notes) {
19578
20283
  const ptr = this.__destroy_into_raw();
19579
- _assertClass(notes, OutputNoteArray);
20284
+ _assertClass(notes, NoteArray);
19580
20285
  const ret = wasm.transactionrequestbuilder_withOwnOutputNotes(ptr, notes.__wbg_ptr);
19581
20286
  return TransactionRequestBuilder.__wrap(ret);
19582
20287
  }
@@ -19813,7 +20518,7 @@ class TransactionScriptInputPairArray {
19813
20518
  * @returns {number}
19814
20519
  */
19815
20520
  length() {
19816
- const ret = wasm.outputnotesarray_length(this.__wbg_ptr);
20521
+ const ret = wasm.transactionscriptinputpairarray_length(this.__wbg_ptr);
19817
20522
  return ret >>> 0;
19818
20523
  }
19819
20524
  /**
@@ -19889,7 +20594,10 @@ class TransactionStatus {
19889
20594
  const ptr0 = passStringToWasm0(cause, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
19890
20595
  const len0 = WASM_VECTOR_LEN;
19891
20596
  const ret = wasm.transactionstatus_discarded(ptr0, len0);
19892
- return TransactionStatus.__wrap(ret);
20597
+ if (ret[2]) {
20598
+ throw takeFromExternrefTable0(ret[1]);
20599
+ }
20600
+ return TransactionStatus.__wrap(ret[0]);
19893
20601
  }
19894
20602
  /**
19895
20603
  * Returns the block number if the transaction was committed.
@@ -19973,7 +20681,7 @@ class TransactionStoreUpdate {
19973
20681
  return AccountDelta.__wrap(ret);
19974
20682
  }
19975
20683
  /**
19976
- * Returns the notes created by the transaction.
20684
+ * Returns the output notes created by the transaction.
19977
20685
  * @returns {OutputNotes}
19978
20686
  */
19979
20687
  createdNotes() {
@@ -20162,17 +20870,6 @@ class WebClient {
20162
20870
  }
20163
20871
  return AccountReader.__wrap(ret[0]);
20164
20872
  }
20165
- /**
20166
- * @param {AccountId} account_id
20167
- * @param {AuthSecretKey} secret_key
20168
- * @returns {Promise<void>}
20169
- */
20170
- addAccountSecretKeyToWebStore(account_id, secret_key) {
20171
- _assertClass(account_id, AccountId);
20172
- _assertClass(secret_key, AuthSecretKey);
20173
- const ret = wasm.webclient_addAccountSecretKeyToWebStore(this.__wbg_ptr, account_id.__wbg_ptr, secret_key.__wbg_ptr);
20174
- return ret;
20175
- }
20176
20873
  /**
20177
20874
  * @param {string} tag
20178
20875
  * @returns {Promise<void>}
@@ -20224,9 +20921,10 @@ class WebClient {
20224
20921
  * @param {string | null} [node_note_transport_url]
20225
20922
  * @param {Uint8Array | null} [seed]
20226
20923
  * @param {string | null} [store_name]
20924
+ * @param {boolean | null} [debug_mode]
20227
20925
  * @returns {Promise<any>}
20228
20926
  */
20229
- createClient(node_url, node_note_transport_url, seed, store_name) {
20927
+ createClient(node_url, node_note_transport_url, seed, store_name, debug_mode) {
20230
20928
  var ptr0 = isLikeNone(node_url) ? 0 : passStringToWasm0(node_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20231
20929
  var len0 = WASM_VECTOR_LEN;
20232
20930
  var ptr1 = isLikeNone(node_note_transport_url) ? 0 : passStringToWasm0(node_note_transport_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -20235,7 +20933,7 @@ class WebClient {
20235
20933
  var len2 = WASM_VECTOR_LEN;
20236
20934
  var ptr3 = isLikeNone(store_name) ? 0 : passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20237
20935
  var len3 = WASM_VECTOR_LEN;
20238
- const ret = wasm.webclient_createClient(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
20936
+ const ret = wasm.webclient_createClient(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(debug_mode) ? 0xFFFFFF : debug_mode ? 1 : 0);
20239
20937
  return ret;
20240
20938
  }
20241
20939
  /**
@@ -20258,9 +20956,10 @@ class WebClient {
20258
20956
  * @param {Function | null} [get_key_cb]
20259
20957
  * @param {Function | null} [insert_key_cb]
20260
20958
  * @param {Function | null} [sign_cb]
20959
+ * @param {boolean | null} [debug_mode]
20261
20960
  * @returns {Promise<any>}
20262
20961
  */
20263
- createClientWithExternalKeystore(node_url, node_note_transport_url, seed, store_name, get_key_cb, insert_key_cb, sign_cb) {
20962
+ createClientWithExternalKeystore(node_url, node_note_transport_url, seed, store_name, get_key_cb, insert_key_cb, sign_cb, debug_mode) {
20264
20963
  var ptr0 = isLikeNone(node_url) ? 0 : passStringToWasm0(node_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20265
20964
  var len0 = WASM_VECTOR_LEN;
20266
20965
  var ptr1 = isLikeNone(node_note_transport_url) ? 0 : passStringToWasm0(node_note_transport_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -20269,7 +20968,7 @@ class WebClient {
20269
20968
  var len2 = WASM_VECTOR_LEN;
20270
20969
  var ptr3 = isLikeNone(store_name) ? 0 : passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20271
20970
  var len3 = WASM_VECTOR_LEN;
20272
- const ret = wasm.webclient_createClientWithExternalKeystore(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(get_key_cb) ? 0 : addToExternrefTable0(get_key_cb), isLikeNone(insert_key_cb) ? 0 : addToExternrefTable0(insert_key_cb), isLikeNone(sign_cb) ? 0 : addToExternrefTable0(sign_cb));
20971
+ const ret = wasm.webclient_createClientWithExternalKeystore(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(get_key_cb) ? 0 : addToExternrefTable0(get_key_cb), isLikeNone(insert_key_cb) ? 0 : addToExternrefTable0(insert_key_cb), isLikeNone(sign_cb) ? 0 : addToExternrefTable0(sign_cb), isLikeNone(debug_mode) ? 0xFFFFFF : debug_mode ? 1 : 0);
20273
20972
  return ret;
20274
20973
  }
20275
20974
  /**
@@ -20314,10 +21013,28 @@ class WebClient {
20314
21013
  * @param {TransactionRequest} transaction_request
20315
21014
  * @returns {Promise<TransactionSummary>}
20316
21015
  */
20317
- executeForSummary(account_id, transaction_request) {
21016
+ executeForSummary(account_id, transaction_request) {
21017
+ _assertClass(account_id, AccountId);
21018
+ _assertClass(transaction_request, TransactionRequest);
21019
+ const ret = wasm.webclient_executeForSummary(this.__wbg_ptr, account_id.__wbg_ptr, transaction_request.__wbg_ptr);
21020
+ return ret;
21021
+ }
21022
+ /**
21023
+ * Executes the provided transaction script against the specified account
21024
+ * and returns the resulting stack output. This is a local-only "view call"
21025
+ * that does not submit anything to the network.
21026
+ * @param {AccountId} account_id
21027
+ * @param {TransactionScript} tx_script
21028
+ * @param {AdviceInputs} advice_inputs
21029
+ * @param {ForeignAccountArray} foreign_accounts
21030
+ * @returns {Promise<FeltArray>}
21031
+ */
21032
+ executeProgram(account_id, tx_script, advice_inputs, foreign_accounts) {
20318
21033
  _assertClass(account_id, AccountId);
20319
- _assertClass(transaction_request, TransactionRequest);
20320
- const ret = wasm.webclient_executeForSummary(this.__wbg_ptr, account_id.__wbg_ptr, transaction_request.__wbg_ptr);
21034
+ _assertClass(tx_script, TransactionScript);
21035
+ _assertClass(advice_inputs, AdviceInputs);
21036
+ _assertClass(foreign_accounts, ForeignAccountArray);
21037
+ const ret = wasm.webclient_executeProgram(this.__wbg_ptr, account_id.__wbg_ptr, tx_script.__wbg_ptr, advice_inputs.__wbg_ptr, foreign_accounts.__wbg_ptr);
20321
21038
  return ret;
20322
21039
  }
20323
21040
  /**
@@ -20358,16 +21075,6 @@ class WebClient {
20358
21075
  const ret = wasm.webclient_exportNoteFile(this.__wbg_ptr, ptr0, len0, export_format);
20359
21076
  return ret;
20360
21077
  }
20361
- /**
20362
- * Retrieves the entire underlying web store and returns it as a `JsValue`
20363
- *
20364
- * Meant to be used in conjunction with the `force_import_store` method
20365
- * @returns {Promise<any>}
20366
- */
20367
- exportStore() {
20368
- const ret = wasm.webclient_exportStore(this.__wbg_ptr);
20369
- return ret;
20370
- }
20371
21078
  /**
20372
21079
  * Fetch all private notes from the note transport layer
20373
21080
  *
@@ -20390,17 +21097,6 @@ class WebClient {
20390
21097
  const ret = wasm.webclient_fetchPrivateNotes(this.__wbg_ptr);
20391
21098
  return ret;
20392
21099
  }
20393
- /**
20394
- * @param {any} store_dump
20395
- * @param {string} _store_name
20396
- * @returns {Promise<any>}
20397
- */
20398
- forceImportStore(store_dump, _store_name) {
20399
- const ptr0 = passStringToWasm0(_store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20400
- const len0 = WASM_VECTOR_LEN;
20401
- const ret = wasm.webclient_forceImportStore(this.__wbg_ptr, store_dump, ptr0, len0);
20402
- return ret;
20403
- }
20404
21100
  /**
20405
21101
  * Retrieves the full account data for the given account ID, returning `null` if not found.
20406
21102
  *
@@ -20413,30 +21109,6 @@ class WebClient {
20413
21109
  const ret = wasm.webclient_getAccount(this.__wbg_ptr, account_id.__wbg_ptr);
20414
21110
  return ret;
20415
21111
  }
20416
- /**
20417
- * Retrieves an authentication secret key from the keystore given a public key commitment.
20418
- *
20419
- * The public key commitment should correspond to one of the keys tracked by the keystore.
20420
- * Returns the associated [`AuthSecretKey`] if found, or an error if not found.
20421
- * @param {Word} pub_key_commitment
20422
- * @returns {Promise<AuthSecretKey>}
20423
- */
20424
- getAccountAuthByPubKeyCommitment(pub_key_commitment) {
20425
- _assertClass(pub_key_commitment, Word);
20426
- const ret = wasm.webclient_getAccountAuthByPubKeyCommitment(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
20427
- return ret;
20428
- }
20429
- /**
20430
- * Retrieves the full account data for the account associated with the given public key
20431
- * commitment, returning `null` if no account is found.
20432
- * @param {Word} pub_key_commitment
20433
- * @returns {Promise<Account | undefined>}
20434
- */
20435
- getAccountByKeyCommitment(pub_key_commitment) {
20436
- _assertClass(pub_key_commitment, Word);
20437
- const ret = wasm.webclient_getAccountByKeyCommitment(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
20438
- return ret;
20439
- }
20440
21112
  /**
20441
21113
  * Retrieves the account code for a specific account.
20442
21114
  *
@@ -20533,19 +21205,6 @@ class WebClient {
20533
21205
  const ret = wasm.webclient_getOutputNotes(this.__wbg_ptr, ptr0);
20534
21206
  return ret;
20535
21207
  }
20536
- /**
20537
- * Returns all public key commitments associated with the given account ID.
20538
- *
20539
- * These commitments can be used with [`getAccountAuthByPubKeyCommitment`]
20540
- * to retrieve the corresponding secret keys from the keystore.
20541
- * @param {AccountId} account_id
20542
- * @returns {Promise<Word[]>}
20543
- */
20544
- getPublicKeyCommitmentsOfAccount(account_id) {
20545
- _assertClass(account_id, AccountId);
20546
- const ret = wasm.webclient_getPublicKeyCommitmentsOfAccount(this.__wbg_ptr, account_id.__wbg_ptr);
20547
- return ret;
20548
- }
20549
21208
  /**
20550
21209
  * Retrieves the setting value for `key`, or `None` if it hasn’t been set.
20551
21210
  * @param {string} key
@@ -20626,6 +21285,19 @@ class WebClient {
20626
21285
  const ret = wasm.webclient_insertAccountAddress(this.__wbg_ptr, account_id.__wbg_ptr, address.__wbg_ptr);
20627
21286
  return ret;
20628
21287
  }
21288
+ /**
21289
+ * Returns a `WebKeystoreApi` handle for managing secret keys.
21290
+ *
21291
+ * The returned object can be used from JavaScript as `client.keystore`.
21292
+ * @returns {WebKeystoreApi}
21293
+ */
21294
+ get keystore() {
21295
+ const ret = wasm.webclient_keystore(this.__wbg_ptr);
21296
+ if (ret[2]) {
21297
+ throw takeFromExternrefTable0(ret[1]);
21298
+ }
21299
+ return WebKeystoreApi.__wrap(ret[0]);
21300
+ }
20629
21301
  /**
20630
21302
  * Returns all the existing setting keys from the store.
20631
21303
  * @returns {Promise<string[]>}
@@ -20657,6 +21329,21 @@ class WebClient {
20657
21329
  const ret = wasm.webclient_newAccount(this.__wbg_ptr, account.__wbg_ptr, overwrite);
20658
21330
  return ret;
20659
21331
  }
21332
+ /**
21333
+ * Inserts an account and its secret key in one call, matching how
21334
+ * `newWallet` / `newFaucet` already work internally. If the key
21335
+ * insertion fails the account is still persisted (same as wallet/faucet),
21336
+ * but callers only need a single await instead of two.
21337
+ * @param {Account} account
21338
+ * @param {AuthSecretKey} secret_key
21339
+ * @returns {Promise<void>}
21340
+ */
21341
+ newAccountWithSecretKey(account, secret_key) {
21342
+ _assertClass(account, Account);
21343
+ _assertClass(secret_key, AuthSecretKey);
21344
+ const ret = wasm.webclient_newAccountWithSecretKey(this.__wbg_ptr, account.__wbg_ptr, secret_key.__wbg_ptr);
21345
+ return ret;
21346
+ }
20660
21347
  /**
20661
21348
  * @param {Note[]} list_of_notes
20662
21349
  * @returns {TransactionRequest}
@@ -20779,6 +21466,24 @@ class WebClient {
20779
21466
  const ret = wasm.webclient_proveTransaction(this.__wbg_ptr, transaction_result.__wbg_ptr, ptr0);
20780
21467
  return ret;
20781
21468
  }
21469
+ /**
21470
+ * Prunes historical account states for the specified account up to the given nonce.
21471
+ *
21472
+ * Deletes all historical entries with `replaced_at_nonce <= up_to_nonce` and any
21473
+ * orphaned account code.
21474
+ *
21475
+ * Returns the total number of rows deleted, including historical entries and orphaned
21476
+ * account code.
21477
+ * @param {AccountId} account_id
21478
+ * @param {Felt} up_to_nonce
21479
+ * @returns {Promise<number>}
21480
+ */
21481
+ pruneAccountHistory(account_id, up_to_nonce) {
21482
+ _assertClass(account_id, AccountId);
21483
+ _assertClass(up_to_nonce, Felt);
21484
+ const ret = wasm.webclient_pruneAccountHistory(this.__wbg_ptr, account_id.__wbg_ptr, up_to_nonce.__wbg_ptr);
21485
+ return ret;
21486
+ }
20782
21487
  /**
20783
21488
  * @param {AccountId} account_id
20784
21489
  * @param {Address} address
@@ -20851,19 +21556,6 @@ class WebClient {
20851
21556
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
20852
21557
  return v1;
20853
21558
  }
20854
- /**
20855
- * Sets the debug mode for transaction execution.
20856
- *
20857
- * When enabled, the transaction executor will record additional information useful for
20858
- * debugging (the values on the VM stack and the state of the advice provider). This is
20859
- * disabled by default since it adds overhead.
20860
- *
20861
- * Must be called before `createClient`.
20862
- * @param {boolean} enabled
20863
- */
20864
- setDebugMode(enabled) {
20865
- wasm.webclient_setDebugMode(this.__wbg_ptr, enabled);
20866
- }
20867
21559
  /**
20868
21560
  * Sets a setting key-value in the store. It can then be retrieved using `get_setting`.
20869
21561
  * @param {string} key
@@ -20876,6 +21568,28 @@ class WebClient {
20876
21568
  const ret = wasm.webclient_setSetting(this.__wbg_ptr, ptr0, len0, value);
20877
21569
  return ret;
20878
21570
  }
21571
+ /**
21572
+ * Returns the identifier of the underlying store (e.g. `IndexedDB` database name, file path).
21573
+ * @returns {string}
21574
+ */
21575
+ storeIdentifier() {
21576
+ let deferred2_0;
21577
+ let deferred2_1;
21578
+ try {
21579
+ const ret = wasm.webclient_storeIdentifier(this.__wbg_ptr);
21580
+ var ptr1 = ret[0];
21581
+ var len1 = ret[1];
21582
+ if (ret[3]) {
21583
+ ptr1 = 0; len1 = 0;
21584
+ throw takeFromExternrefTable0(ret[2]);
21585
+ }
21586
+ deferred2_0 = ptr1;
21587
+ deferred2_1 = len1;
21588
+ return getStringFromWasm0(ptr1, len1);
21589
+ } finally {
21590
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
21591
+ }
21592
+ }
20879
21593
  /**
20880
21594
  * Executes a transaction specified by the request against the specified account,
20881
21595
  * proves it, submits it to the network, and updates the local database.
@@ -20949,6 +21663,88 @@ class WebClient {
20949
21663
  }
20950
21664
  if (Symbol.dispose) WebClient.prototype[Symbol.dispose] = WebClient.prototype.free;
20951
21665
 
21666
+ /**
21667
+ * JavaScript API for the client's keystore.
21668
+ *
21669
+ * Manages the association between accounts and their authentication secret keys,
21670
+ * indexed by public key commitment.
21671
+ */
21672
+ class WebKeystoreApi {
21673
+ static __wrap(ptr) {
21674
+ ptr = ptr >>> 0;
21675
+ const obj = Object.create(WebKeystoreApi.prototype);
21676
+ obj.__wbg_ptr = ptr;
21677
+ WebKeystoreApiFinalization.register(obj, obj.__wbg_ptr, obj);
21678
+ return obj;
21679
+ }
21680
+ __destroy_into_raw() {
21681
+ const ptr = this.__wbg_ptr;
21682
+ this.__wbg_ptr = 0;
21683
+ WebKeystoreApiFinalization.unregister(this);
21684
+ return ptr;
21685
+ }
21686
+ free() {
21687
+ const ptr = this.__destroy_into_raw();
21688
+ wasm.__wbg_webkeystoreapi_free(ptr, 0);
21689
+ }
21690
+ /**
21691
+ * Retrieves a secret key from the keystore given a public key commitment.
21692
+ *
21693
+ * Returns the associated `AuthSecretKey` if found, or `null` if not found.
21694
+ * @param {Word} pub_key_commitment
21695
+ * @returns {Promise<AuthSecretKey | undefined>}
21696
+ */
21697
+ get(pub_key_commitment) {
21698
+ _assertClass(pub_key_commitment, Word);
21699
+ const ret = wasm.webkeystoreapi_get(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
21700
+ return ret;
21701
+ }
21702
+ /**
21703
+ * Returns the account ID associated with a given public key commitment,
21704
+ * or `null` if no account is found.
21705
+ * @param {Word} pub_key_commitment
21706
+ * @returns {Promise<AccountId | undefined>}
21707
+ */
21708
+ getAccountId(pub_key_commitment) {
21709
+ _assertClass(pub_key_commitment, Word);
21710
+ const ret = wasm.webkeystoreapi_getAccountId(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
21711
+ return ret;
21712
+ }
21713
+ /**
21714
+ * Returns all public key commitments associated with the given account ID.
21715
+ * @param {AccountId} account_id
21716
+ * @returns {Promise<Word[]>}
21717
+ */
21718
+ getCommitments(account_id) {
21719
+ _assertClass(account_id, AccountId);
21720
+ const ret = wasm.webkeystoreapi_getCommitments(this.__wbg_ptr, account_id.__wbg_ptr);
21721
+ return ret;
21722
+ }
21723
+ /**
21724
+ * Inserts a secret key into the keystore, associating it with the given account ID.
21725
+ * @param {AccountId} account_id
21726
+ * @param {AuthSecretKey} secret_key
21727
+ * @returns {Promise<void>}
21728
+ */
21729
+ insert(account_id, secret_key) {
21730
+ _assertClass(account_id, AccountId);
21731
+ _assertClass(secret_key, AuthSecretKey);
21732
+ const ret = wasm.webkeystoreapi_insert(this.__wbg_ptr, account_id.__wbg_ptr, secret_key.__wbg_ptr);
21733
+ return ret;
21734
+ }
21735
+ /**
21736
+ * Removes a key from the keystore by its public key commitment.
21737
+ * @param {Word} pub_key_commitment
21738
+ * @returns {Promise<void>}
21739
+ */
21740
+ remove(pub_key_commitment) {
21741
+ _assertClass(pub_key_commitment, Word);
21742
+ const ret = wasm.webkeystoreapi_remove(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
21743
+ return ret;
21744
+ }
21745
+ }
21746
+ if (Symbol.dispose) WebKeystoreApi.prototype[Symbol.dispose] = WebKeystoreApi.prototype.free;
21747
+
20952
21748
  class Word {
20953
21749
  static __wrap(ptr) {
20954
21750
  ptr = ptr >>> 0;
@@ -21085,6 +21881,37 @@ function createAuthFalcon512RpoMultisig(config) {
21085
21881
  return AccountComponent.__wrap(ret[0]);
21086
21882
  }
21087
21883
 
21884
+ /**
21885
+ * Exports the entire contents of an `IndexedDB` store as a JSON string.
21886
+ *
21887
+ * Use together with [`import_store`].
21888
+ * @param {string} store_name
21889
+ * @returns {Promise<any>}
21890
+ */
21891
+ function exportStore2(store_name) {
21892
+ const ptr0 = passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
21893
+ const len0 = WASM_VECTOR_LEN;
21894
+ const ret = wasm.exportStore(ptr0, len0);
21895
+ return ret;
21896
+ }
21897
+
21898
+ /**
21899
+ * Imports store contents from a JSON string, replacing all existing data.
21900
+ *
21901
+ * Use together with [`export_store`].
21902
+ * @param {string} store_name
21903
+ * @param {string} store_dump
21904
+ * @returns {Promise<void>}
21905
+ */
21906
+ function importStore(store_name, store_dump) {
21907
+ const ptr0 = passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
21908
+ const len0 = WASM_VECTOR_LEN;
21909
+ const ptr1 = passStringToWasm0(store_dump, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
21910
+ const len1 = WASM_VECTOR_LEN;
21911
+ const ret = wasm.importStore(ptr0, len0, ptr1, len1);
21912
+ return ret;
21913
+ }
21914
+
21088
21915
  /**
21089
21916
  * Initializes the `tracing` subscriber that routes Rust log output to the
21090
21917
  * browser console via `console.log` / `console.warn` / `console.error`.
@@ -21239,7 +22066,7 @@ function __wbg_get_imports() {
21239
22066
  const ret = AccountStorage.__wrap(arg0);
21240
22067
  return ret;
21241
22068
  },
21242
- __wbg_addNoteTag_129c8d9b232bafa2: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22069
+ __wbg_addNoteTag_63799a9478c87a90: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
21243
22070
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21244
22071
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21245
22072
  let v1;
@@ -21262,15 +22089,15 @@ function __wbg_get_imports() {
21262
22089
  __wbg_append_a992ccc37aa62dc4: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
21263
22090
  arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
21264
22091
  }, arguments); },
21265
- __wbg_applyFullAccountState_5984dfa1f9adbcb1: function(arg0, arg1, arg2) {
22092
+ __wbg_applyFullAccountState_f1ff4a1d13811963: function(arg0, arg1, arg2) {
21266
22093
  const ret = applyFullAccountState(getStringFromWasm0(arg0, arg1), JsAccountUpdate.__wrap(arg2));
21267
22094
  return ret;
21268
22095
  },
21269
- __wbg_applyStateSync_164e7aaf2febbe98: function(arg0, arg1, arg2) {
22096
+ __wbg_applyStateSync_24ad223fd10a4973: function(arg0, arg1, arg2) {
21270
22097
  const ret = applyStateSync(getStringFromWasm0(arg0, arg1), JsStateSyncUpdate.__wrap(arg2));
21271
22098
  return ret;
21272
22099
  },
21273
- __wbg_applyTransactionDelta_59ccc57856c6bd87: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22) {
22100
+ __wbg_applyTransactionDelta_6041c5f076d8405c: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20) {
21274
22101
  let deferred0_0;
21275
22102
  let deferred0_1;
21276
22103
  let deferred1_0;
@@ -21302,12 +22129,7 @@ function __wbg_get_imports() {
21302
22129
  deferred7_1 = arg17;
21303
22130
  deferred8_0 = arg19;
21304
22131
  deferred8_1 = arg20;
21305
- let v9;
21306
- if (arg21 !== 0) {
21307
- v9 = getArrayU8FromWasm0(arg21, arg22).slice();
21308
- wasm.__wbindgen_free(arg21, arg22 * 1, 1);
21309
- }
21310
- const ret = applyTransactionDelta(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), v2, v3, v4, getStringFromWasm0(arg12, arg13), getStringFromWasm0(arg14, arg15), getStringFromWasm0(arg16, arg17), arg18 !== 0, getStringFromWasm0(arg19, arg20), v9);
22132
+ const ret = applyTransactionDelta(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), v2, v3, v4, getStringFromWasm0(arg12, arg13), getStringFromWasm0(arg14, arg15), getStringFromWasm0(arg16, arg17), arg18 !== 0, getStringFromWasm0(arg19, arg20));
21311
22133
  return ret;
21312
22134
  } finally {
21313
22135
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
@@ -21370,6 +22192,10 @@ function __wbg_get_imports() {
21370
22192
  const ret = arg0.catch(arg1);
21371
22193
  return ret;
21372
22194
  },
22195
+ __wbg_clearTimeout_5a54f8841c30079a: function(arg0) {
22196
+ const ret = clearTimeout(arg0);
22197
+ return ret;
22198
+ },
21373
22199
  __wbg_clearTimeout_a7df70ff6fb2f0a7: function(arg0) {
21374
22200
  const ret = clearTimeout(arg0);
21375
22201
  return ret;
@@ -21406,7 +22232,7 @@ function __wbg_get_imports() {
21406
22232
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21407
22233
  }
21408
22234
  },
21409
- __wbg_exportStore_5874ec863915584b: function(arg0, arg1) {
22235
+ __wbg_exportStore_961eb403ce6401e7: function(arg0, arg1) {
21410
22236
  const ret = exportStore(getStringFromWasm0(arg0, arg1));
21411
22237
  return ret;
21412
22238
  },
@@ -21418,6 +22244,10 @@ function __wbg_get_imports() {
21418
22244
  const ret = Felt.__unwrap(arg0);
21419
22245
  return ret;
21420
22246
  },
22247
+ __wbg_feltarray_new: function(arg0) {
22248
+ const ret = FeltArray.__wrap(arg0);
22249
+ return ret;
22250
+ },
21421
22251
  __wbg_fetch_a720bfbbf7f6c776: function(arg0, arg1) {
21422
22252
  const ret = fetch(arg0, arg1);
21423
22253
  return ret;
@@ -21434,7 +22264,7 @@ function __wbg_get_imports() {
21434
22264
  const ret = FetchedNote.__wrap(arg0);
21435
22265
  return ret;
21436
22266
  },
21437
- __wbg_forceImportStore_6c4f01c5c826a84a: function(arg0, arg1, arg2) {
22267
+ __wbg_forceImportStore_7ec9187226bc64a6: function(arg0, arg1, arg2) {
21438
22268
  const ret = forceImportStore(getStringFromWasm0(arg0, arg1), arg2);
21439
22269
  return ret;
21440
22270
  },
@@ -21454,7 +22284,7 @@ function __wbg_get_imports() {
21454
22284
  const ret = FungibleAssetDeltaItem.__wrap(arg0);
21455
22285
  return ret;
21456
22286
  },
21457
- __wbg_getAccountAddresses_82f229693e2ec7ae: function(arg0, arg1, arg2, arg3) {
22287
+ __wbg_getAccountAddresses_ce9cbae0dbe8d488: function(arg0, arg1, arg2, arg3) {
21458
22288
  let deferred0_0;
21459
22289
  let deferred0_1;
21460
22290
  try {
@@ -21466,7 +22296,7 @@ function __wbg_get_imports() {
21466
22296
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21467
22297
  }
21468
22298
  },
21469
- __wbg_getAccountAuthByPubKeyCommitment_6fe602f9dfb51fae: function(arg0, arg1, arg2, arg3) {
22299
+ __wbg_getAccountAuthByPubKeyCommitment_9108bcc540b259f8: function(arg0, arg1, arg2, arg3) {
21470
22300
  let deferred0_0;
21471
22301
  let deferred0_1;
21472
22302
  try {
@@ -21478,7 +22308,7 @@ function __wbg_get_imports() {
21478
22308
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21479
22309
  }
21480
22310
  },
21481
- __wbg_getAccountCode_fff3da1c8f921fb0: function(arg0, arg1, arg2, arg3) {
22311
+ __wbg_getAccountCode_d6a66dc4c8bcd0fb: function(arg0, arg1, arg2, arg3) {
21482
22312
  let deferred0_0;
21483
22313
  let deferred0_1;
21484
22314
  try {
@@ -21490,7 +22320,7 @@ function __wbg_get_imports() {
21490
22320
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21491
22321
  }
21492
22322
  },
21493
- __wbg_getAccountHeaderByCommitment_75f89bbcd8556322: function(arg0, arg1, arg2, arg3) {
22323
+ __wbg_getAccountHeaderByCommitment_5a38a4f46714ab0c: function(arg0, arg1, arg2, arg3) {
21494
22324
  let deferred0_0;
21495
22325
  let deferred0_1;
21496
22326
  try {
@@ -21502,7 +22332,7 @@ function __wbg_get_imports() {
21502
22332
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21503
22333
  }
21504
22334
  },
21505
- __wbg_getAccountHeader_f11be28051c305aa: function(arg0, arg1, arg2, arg3) {
22335
+ __wbg_getAccountHeader_2fc7d24bb322f741: function(arg0, arg1, arg2, arg3) {
21506
22336
  let deferred0_0;
21507
22337
  let deferred0_1;
21508
22338
  try {
@@ -21514,7 +22344,7 @@ function __wbg_get_imports() {
21514
22344
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21515
22345
  }
21516
22346
  },
21517
- __wbg_getAccountIdByKeyCommitment_09d6d47e3075a887: function(arg0, arg1, arg2, arg3) {
22347
+ __wbg_getAccountIdByKeyCommitment_cd45cb20eb4179c6: function(arg0, arg1, arg2, arg3) {
21518
22348
  let deferred0_0;
21519
22349
  let deferred0_1;
21520
22350
  try {
@@ -21526,11 +22356,11 @@ function __wbg_get_imports() {
21526
22356
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21527
22357
  }
21528
22358
  },
21529
- __wbg_getAccountIds_47bd2e2f5585bdd3: function(arg0, arg1) {
22359
+ __wbg_getAccountIds_011f27983158f415: function(arg0, arg1) {
21530
22360
  const ret = getAccountIds(getStringFromWasm0(arg0, arg1));
21531
22361
  return ret;
21532
22362
  },
21533
- __wbg_getAccountStorageMaps_dd2bbc0db626823c: function(arg0, arg1, arg2, arg3) {
22363
+ __wbg_getAccountStorageMaps_e66cd035c5bbb97b: function(arg0, arg1, arg2, arg3) {
21534
22364
  let deferred0_0;
21535
22365
  let deferred0_1;
21536
22366
  try {
@@ -21542,65 +22372,83 @@ function __wbg_get_imports() {
21542
22372
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21543
22373
  }
21544
22374
  },
21545
- __wbg_getAccountStorage_440a6bf20267a6af: function(arg0, arg1, arg2, arg3) {
22375
+ __wbg_getAccountStorage_ec182807a0c17c91: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21546
22376
  let deferred0_0;
21547
22377
  let deferred0_1;
21548
22378
  try {
21549
22379
  deferred0_0 = arg2;
21550
22380
  deferred0_1 = arg3;
21551
- const ret = getAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
22381
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
22382
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
22383
+ const ret = getAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
21552
22384
  return ret;
21553
22385
  } finally {
21554
22386
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21555
22387
  }
21556
22388
  },
21557
- __wbg_getAccountVaultAssets_e97b428441d96ee9: function(arg0, arg1, arg2, arg3) {
22389
+ __wbg_getAccountVaultAssets_bccdee600be89096: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21558
22390
  let deferred0_0;
21559
22391
  let deferred0_1;
21560
22392
  try {
21561
22393
  deferred0_0 = arg2;
21562
22394
  deferred0_1 = arg3;
21563
- const ret = getAccountVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
22395
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
22396
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
22397
+ const ret = getAccountVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
21564
22398
  return ret;
21565
22399
  } finally {
21566
22400
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21567
22401
  }
21568
22402
  },
21569
- __wbg_getAllAccountHeaders_15f6fcfa376fcb5b: function(arg0, arg1) {
22403
+ __wbg_getAllAccountHeaders_74acd216317a5f87: function(arg0, arg1) {
21570
22404
  const ret = getAllAccountHeaders(getStringFromWasm0(arg0, arg1));
21571
22405
  return ret;
21572
22406
  },
21573
- __wbg_getBlockHeaders_c2ae17aac376da9c: function(arg0, arg1, arg2, arg3) {
22407
+ __wbg_getBlockHeaders_05b30aae935a1a7d: function(arg0, arg1, arg2, arg3) {
21574
22408
  var v0 = getArrayU32FromWasm0(arg2, arg3).slice();
21575
22409
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21576
22410
  const ret = getBlockHeaders(getStringFromWasm0(arg0, arg1), v0);
21577
22411
  return ret;
21578
22412
  },
21579
- __wbg_getForeignAccountCode_6c09a7caeb4b9647: function(arg0, arg1, arg2, arg3) {
22413
+ __wbg_getForeignAccountCode_213f3c8e7e729c1a: function(arg0, arg1, arg2, arg3) {
21580
22414
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21581
22415
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21582
22416
  const ret = getForeignAccountCode(getStringFromWasm0(arg0, arg1), v0);
21583
22417
  return ret;
21584
22418
  },
21585
- __wbg_getInputNotesFromIds_83d99c60a0a16932: function(arg0, arg1, arg2, arg3) {
22419
+ __wbg_getInputNoteByOffset_0bee418c75072b27: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
22420
+ let deferred1_0;
22421
+ let deferred1_1;
22422
+ try {
22423
+ var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
22424
+ wasm.__wbindgen_free(arg2, arg3 * 1, 1);
22425
+ deferred1_0 = arg4;
22426
+ deferred1_1 = arg5;
22427
+ const ret = getInputNoteByOffset(getStringFromWasm0(arg0, arg1), v0, getStringFromWasm0(arg4, arg5), arg6 === 0x100000001 ? undefined : arg6, arg7 === 0x100000001 ? undefined : arg7, arg8 >>> 0);
22428
+ return ret;
22429
+ } finally {
22430
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22431
+ }
22432
+ },
22433
+ __wbg_getInputNotesFromIds_721daab430964ba8: function(arg0, arg1, arg2, arg3) {
21586
22434
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21587
22435
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21588
22436
  const ret = getInputNotesFromIds(getStringFromWasm0(arg0, arg1), v0);
21589
22437
  return ret;
21590
22438
  },
21591
- __wbg_getInputNotesFromNullifiers_40921b17ee291c87: function(arg0, arg1, arg2, arg3) {
22439
+ __wbg_getInputNotesFromNullifiers_f3bab786cefda999: function(arg0, arg1, arg2, arg3) {
21592
22440
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21593
22441
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21594
22442
  const ret = getInputNotesFromNullifiers(getStringFromWasm0(arg0, arg1), v0);
21595
22443
  return ret;
21596
22444
  },
21597
- __wbg_getInputNotes_246e203a70392bb8: function(arg0, arg1, arg2, arg3) {
22445
+ __wbg_getInputNotes_eb7302d670b898b8: function(arg0, arg1, arg2, arg3) {
21598
22446
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21599
22447
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21600
22448
  const ret = getInputNotes(getStringFromWasm0(arg0, arg1), v0);
21601
22449
  return ret;
21602
22450
  },
21603
- __wbg_getKeyCommitmentsByAccountId_2c21ea614d0bb0bb: function(arg0, arg1, arg2, arg3) {
22451
+ __wbg_getKeyCommitmentsByAccountId_39dba15570f24593: function(arg0, arg1, arg2, arg3) {
21604
22452
  let deferred0_0;
21605
22453
  let deferred0_1;
21606
22454
  try {
@@ -21612,7 +22460,7 @@ function __wbg_get_imports() {
21612
22460
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21613
22461
  }
21614
22462
  },
21615
- __wbg_getNoteScript_d1134d3cd683d6b2: function(arg0, arg1, arg2, arg3) {
22463
+ __wbg_getNoteScript_efda320e2c0fccf7: function(arg0, arg1, arg2, arg3) {
21616
22464
  let deferred0_0;
21617
22465
  let deferred0_1;
21618
22466
  try {
@@ -21624,33 +22472,33 @@ function __wbg_get_imports() {
21624
22472
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21625
22473
  }
21626
22474
  },
21627
- __wbg_getNoteTags_e4f71e1a8f4feb21: function(arg0, arg1) {
22475
+ __wbg_getNoteTags_d6b8022f9b4859e8: function(arg0, arg1) {
21628
22476
  const ret = getNoteTags(getStringFromWasm0(arg0, arg1));
21629
22477
  return ret;
21630
22478
  },
21631
- __wbg_getOutputNotesFromIds_de8fb6f5fee6c953: function(arg0, arg1, arg2, arg3) {
22479
+ __wbg_getOutputNotesFromIds_fa5c634a82cd6bff: function(arg0, arg1, arg2, arg3) {
21632
22480
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21633
22481
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21634
22482
  const ret = getOutputNotesFromIds(getStringFromWasm0(arg0, arg1), v0);
21635
22483
  return ret;
21636
22484
  },
21637
- __wbg_getOutputNotesFromNullifiers_9f51be76a0f6c916: function(arg0, arg1, arg2, arg3) {
22485
+ __wbg_getOutputNotesFromNullifiers_91fb57f239d4ca70: function(arg0, arg1, arg2, arg3) {
21638
22486
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21639
22487
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21640
22488
  const ret = getOutputNotesFromNullifiers(getStringFromWasm0(arg0, arg1), v0);
21641
22489
  return ret;
21642
22490
  },
21643
- __wbg_getOutputNotes_9cdaa6245bd5714c: function(arg0, arg1, arg2, arg3) {
22491
+ __wbg_getOutputNotes_a1065157d0831b01: function(arg0, arg1, arg2, arg3) {
21644
22492
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21645
22493
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21646
22494
  const ret = getOutputNotes(getStringFromWasm0(arg0, arg1), v0);
21647
22495
  return ret;
21648
22496
  },
21649
- __wbg_getPartialBlockchainNodesAll_82f75763ea15d598: function(arg0, arg1) {
22497
+ __wbg_getPartialBlockchainNodesAll_ddea8ea03a56c531: function(arg0, arg1) {
21650
22498
  const ret = getPartialBlockchainNodesAll(getStringFromWasm0(arg0, arg1));
21651
22499
  return ret;
21652
22500
  },
21653
- __wbg_getPartialBlockchainNodesUpToInOrderIndex_0f129ed50a5e4af5: function(arg0, arg1, arg2, arg3) {
22501
+ __wbg_getPartialBlockchainNodesUpToInOrderIndex_959b31301df8c438: function(arg0, arg1, arg2, arg3) {
21654
22502
  let deferred0_0;
21655
22503
  let deferred0_1;
21656
22504
  try {
@@ -21662,13 +22510,13 @@ function __wbg_get_imports() {
21662
22510
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21663
22511
  }
21664
22512
  },
21665
- __wbg_getPartialBlockchainNodes_42cb8c65e5dc9051: function(arg0, arg1, arg2, arg3) {
22513
+ __wbg_getPartialBlockchainNodes_09bd2967864c4c45: function(arg0, arg1, arg2, arg3) {
21666
22514
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21667
22515
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21668
22516
  const ret = getPartialBlockchainNodes(getStringFromWasm0(arg0, arg1), v0);
21669
22517
  return ret;
21670
22518
  },
21671
- __wbg_getPartialBlockchainPeaksByBlockNum_22a173865b3df735: function(arg0, arg1, arg2) {
22519
+ __wbg_getPartialBlockchainPeaksByBlockNum_b5b9e95f32003e32: function(arg0, arg1, arg2) {
21672
22520
  const ret = getPartialBlockchainPeaksByBlockNum(getStringFromWasm0(arg0, arg1), arg2 >>> 0);
21673
22521
  return ret;
21674
22522
  },
@@ -21679,7 +22527,7 @@ function __wbg_get_imports() {
21679
22527
  const ret = arg0.getReader();
21680
22528
  return ret;
21681
22529
  }, arguments); },
21682
- __wbg_getSetting_f7be8e05ab8bad69: function(arg0, arg1, arg2, arg3) {
22530
+ __wbg_getSetting_ba46bcae2e2b7d6c: function(arg0, arg1, arg2, arg3) {
21683
22531
  let deferred0_0;
21684
22532
  let deferred0_1;
21685
22533
  try {
@@ -21691,7 +22539,7 @@ function __wbg_get_imports() {
21691
22539
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21692
22540
  }
21693
22541
  },
21694
- __wbg_getSyncHeight_30373234e1db7d59: function(arg0, arg1) {
22542
+ __wbg_getSyncHeight_b986a41f20a4c60f: function(arg0, arg1) {
21695
22543
  const ret = getSyncHeight(getStringFromWasm0(arg0, arg1));
21696
22544
  return ret;
21697
22545
  },
@@ -21699,11 +22547,15 @@ function __wbg_get_imports() {
21699
22547
  const ret = arg0.getTime();
21700
22548
  return ret;
21701
22549
  },
21702
- __wbg_getTrackedBlockHeaders_a2ff7ced468be82b: function(arg0, arg1) {
22550
+ __wbg_getTrackedBlockHeaderNumbers_13758201e4acf879: function(arg0, arg1) {
22551
+ const ret = getTrackedBlockHeaderNumbers(getStringFromWasm0(arg0, arg1));
22552
+ return ret;
22553
+ },
22554
+ __wbg_getTrackedBlockHeaders_e01f9f3411d5db34: function(arg0, arg1) {
21703
22555
  const ret = getTrackedBlockHeaders(getStringFromWasm0(arg0, arg1));
21704
22556
  return ret;
21705
22557
  },
21706
- __wbg_getTransactions_fba251dc1ae7c5be: function(arg0, arg1, arg2, arg3) {
22558
+ __wbg_getTransactions_39cdbadf132e2cbd: function(arg0, arg1, arg2, arg3) {
21707
22559
  let deferred0_0;
21708
22560
  let deferred0_1;
21709
22561
  try {
@@ -21715,7 +22567,7 @@ function __wbg_get_imports() {
21715
22567
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21716
22568
  }
21717
22569
  },
21718
- __wbg_getUnspentInputNoteNullifiers_b282e57f53cd12ee: function(arg0, arg1) {
22570
+ __wbg_getUnspentInputNoteNullifiers_454a694b1712e5cb: function(arg0, arg1) {
21719
22571
  const ret = getUnspentInputNoteNullifiers(getStringFromWasm0(arg0, arg1));
21720
22572
  return ret;
21721
22573
  },
@@ -21759,7 +22611,7 @@ function __wbg_get_imports() {
21759
22611
  const ret = InputNoteRecord.__wrap(arg0);
21760
22612
  return ret;
21761
22613
  },
21762
- __wbg_insertAccountAddress_6231e3afe2424f42: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22614
+ __wbg_insertAccountAddress_964930c0efd3f292: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21763
22615
  let deferred0_0;
21764
22616
  let deferred0_1;
21765
22617
  try {
@@ -21773,7 +22625,7 @@ function __wbg_get_imports() {
21773
22625
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21774
22626
  }
21775
22627
  },
21776
- __wbg_insertAccountAuth_a99c26f21d124b5c: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22628
+ __wbg_insertAccountAuth_15db742f3171bda3: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21777
22629
  let deferred0_0;
21778
22630
  let deferred0_1;
21779
22631
  let deferred1_0;
@@ -21790,7 +22642,7 @@ function __wbg_get_imports() {
21790
22642
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
21791
22643
  }
21792
22644
  },
21793
- __wbg_insertAccountKeyMapping_4039662d288a5400: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22645
+ __wbg_insertAccountKeyMapping_9c49660f1ec7399f: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21794
22646
  let deferred0_0;
21795
22647
  let deferred0_1;
21796
22648
  let deferred1_0;
@@ -21807,7 +22659,7 @@ function __wbg_get_imports() {
21807
22659
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
21808
22660
  }
21809
22661
  },
21810
- __wbg_insertBlockHeader_e30051a2b8f281b7: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22662
+ __wbg_insertBlockHeader_060e7f46d4ec35e7: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
21811
22663
  var v0 = getArrayU8FromWasm0(arg3, arg4).slice();
21812
22664
  wasm.__wbindgen_free(arg3, arg4 * 1, 1);
21813
22665
  var v1 = getArrayU8FromWasm0(arg5, arg6).slice();
@@ -21815,7 +22667,7 @@ function __wbg_get_imports() {
21815
22667
  const ret = insertBlockHeader(getStringFromWasm0(arg0, arg1), arg2 >>> 0, v0, v1, arg7 !== 0);
21816
22668
  return ret;
21817
22669
  },
21818
- __wbg_insertPartialBlockchainNodes_f03e6846e58f99f7: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22670
+ __wbg_insertPartialBlockchainNodes_04f374dbb1ca7e77: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21819
22671
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21820
22672
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21821
22673
  var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
@@ -21823,7 +22675,7 @@ function __wbg_get_imports() {
21823
22675
  const ret = insertPartialBlockchainNodes(getStringFromWasm0(arg0, arg1), v0, v1);
21824
22676
  return ret;
21825
22677
  },
21826
- __wbg_insertSetting_7f257c949e4ba7f9: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22678
+ __wbg_insertSetting_e8fb47c1a72a54c4: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21827
22679
  let deferred0_0;
21828
22680
  let deferred0_1;
21829
22681
  try {
@@ -21837,7 +22689,7 @@ function __wbg_get_imports() {
21837
22689
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21838
22690
  }
21839
22691
  },
21840
- __wbg_insertTransactionScript_c9c414607bf00695: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22692
+ __wbg_insertTransactionScript_ba6a81a76d47a2d3: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21841
22693
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21842
22694
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21843
22695
  let v1;
@@ -21930,11 +22782,11 @@ function __wbg_get_imports() {
21930
22782
  const ret = arg0.length;
21931
22783
  return ret;
21932
22784
  },
21933
- __wbg_listSettingKeys_177323a7e3eb8746: function(arg0, arg1) {
22785
+ __wbg_listSettingKeys_bd877420952aabcf: function(arg0, arg1) {
21934
22786
  const ret = listSettingKeys(getStringFromWasm0(arg0, arg1));
21935
22787
  return ret;
21936
22788
  },
21937
- __wbg_lockAccount_6e14a5747a738708: function(arg0, arg1, arg2, arg3) {
22789
+ __wbg_lockAccount_b4469b288371ce1b: function(arg0, arg1, arg2, arg3) {
21938
22790
  let deferred0_0;
21939
22791
  let deferred0_1;
21940
22792
  try {
@@ -22018,7 +22870,7 @@ function __wbg_get_imports() {
22018
22870
  const a = state0.a;
22019
22871
  state0.a = 0;
22020
22872
  try {
22021
- return wasm_bindgen__convert__closures_____invoke__h4e730be6209b5f2c(a, state0.b, arg0, arg1);
22873
+ return wasm_bindgen__convert__closures_____invoke__h5e71136c5fac87ef(a, state0.b, arg0, arg1);
22022
22874
  } finally {
22023
22875
  state0.a = a;
22024
22876
  }
@@ -22113,6 +22965,10 @@ function __wbg_get_imports() {
22113
22965
  const ret = NoteScript.__wrap(arg0);
22114
22966
  return ret;
22115
22967
  },
22968
+ __wbg_notesyncblock_new: function(arg0) {
22969
+ const ret = NoteSyncBlock.__wrap(arg0);
22970
+ return ret;
22971
+ },
22116
22972
  __wbg_notesyncinfo_new: function(arg0) {
22117
22973
  const ret = NoteSyncInfo.__wrap(arg0);
22118
22974
  return ret;
@@ -22121,7 +22977,7 @@ function __wbg_get_imports() {
22121
22977
  const ret = NoteTag.__unwrap(arg0);
22122
22978
  return ret;
22123
22979
  },
22124
- __wbg_openDatabase_92372e9cfd9e1a0d: function(arg0, arg1, arg2, arg3) {
22980
+ __wbg_openDatabase_2b359f6f1c11112f: function(arg0, arg1, arg2, arg3) {
22125
22981
  const ret = openDatabase(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
22126
22982
  return ret;
22127
22983
  },
@@ -22137,10 +22993,6 @@ function __wbg_get_imports() {
22137
22993
  const ret = OutputNoteRecord.__wrap(arg0);
22138
22994
  return ret;
22139
22995
  },
22140
- __wbg_outputnotes_unwrap: function(arg0) {
22141
- const ret = OutputNotes.__unwrap(arg0);
22142
- return ret;
22143
- },
22144
22996
  __wbg_procedurethreshold_new: function(arg0) {
22145
22997
  const ret = ProcedureThreshold.__wrap(arg0);
22146
22998
  return ret;
@@ -22156,7 +23008,24 @@ function __wbg_get_imports() {
22156
23008
  const ret = ProvenTransaction.__wrap(arg0);
22157
23009
  return ret;
22158
23010
  },
22159
- __wbg_pruneIrrelevantBlocks_e695903338107987: function(arg0, arg1) {
23011
+ __wbg_pruneAccountHistory_f6d2c239f5188516: function(arg0, arg1, arg2, arg3, arg4, arg5) {
23012
+ let deferred0_0;
23013
+ let deferred0_1;
23014
+ let deferred1_0;
23015
+ let deferred1_1;
23016
+ try {
23017
+ deferred0_0 = arg2;
23018
+ deferred0_1 = arg3;
23019
+ deferred1_0 = arg4;
23020
+ deferred1_1 = arg5;
23021
+ const ret = pruneAccountHistory(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
23022
+ return ret;
23023
+ } finally {
23024
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
23025
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
23026
+ }
23027
+ },
23028
+ __wbg_pruneIrrelevantBlocks_2634ac68b91e6214: function(arg0, arg1) {
22160
23029
  const ret = pruneIrrelevantBlocks(getStringFromWasm0(arg0, arg1));
22161
23030
  return ret;
22162
23031
  },
@@ -22174,13 +23043,37 @@ function __wbg_get_imports() {
22174
23043
  __wbg_releaseLock_aa5846c2494b3032: function(arg0) {
22175
23044
  arg0.releaseLock();
22176
23045
  },
22177
- __wbg_removeAccountAddress_26320801b9cf78cb: function(arg0, arg1, arg2, arg3) {
23046
+ __wbg_removeAccountAddress_9378ec2111cfd073: function(arg0, arg1, arg2, arg3) {
22178
23047
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
22179
23048
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
22180
23049
  const ret = removeAccountAddress(getStringFromWasm0(arg0, arg1), v0);
22181
23050
  return ret;
22182
23051
  },
22183
- __wbg_removeNoteTag_a80684c949d5d911: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23052
+ __wbg_removeAccountAuth_1b38ce482f3a2a01: function(arg0, arg1, arg2, arg3) {
23053
+ let deferred0_0;
23054
+ let deferred0_1;
23055
+ try {
23056
+ deferred0_0 = arg2;
23057
+ deferred0_1 = arg3;
23058
+ const ret = removeAccountAuth(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
23059
+ return ret;
23060
+ } finally {
23061
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
23062
+ }
23063
+ },
23064
+ __wbg_removeAllMappingsForKey_8e731aa44d99defa: function(arg0, arg1, arg2, arg3) {
23065
+ let deferred0_0;
23066
+ let deferred0_1;
23067
+ try {
23068
+ deferred0_0 = arg2;
23069
+ deferred0_1 = arg3;
23070
+ const ret = removeAllMappingsForKey(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
23071
+ return ret;
23072
+ } finally {
23073
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
23074
+ }
23075
+ },
23076
+ __wbg_removeNoteTag_66b88893678278ff: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22184
23077
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
22185
23078
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
22186
23079
  let v1;
@@ -22196,7 +23089,7 @@ function __wbg_get_imports() {
22196
23089
  const ret = removeNoteTag(getStringFromWasm0(arg0, arg1), v0, v1, v2);
22197
23090
  return ret;
22198
23091
  },
22199
- __wbg_removeSetting_9baeabb180b1a28d: function(arg0, arg1, arg2, arg3) {
23092
+ __wbg_removeSetting_09bade6bd24dd314: function(arg0, arg1, arg2, arg3) {
22200
23093
  let deferred0_0;
22201
23094
  let deferred0_1;
22202
23095
  try {
@@ -22243,6 +23136,10 @@ function __wbg_get_imports() {
22243
23136
  const ret = setTimeout(arg0, arg1);
22244
23137
  return ret;
22245
23138
  },
23139
+ __wbg_setTimeout_db2dbaeefb6f39c7: function() { return handleError(function (arg0, arg1) {
23140
+ const ret = setTimeout(arg0, arg1);
23141
+ return ret;
23142
+ }, arguments); },
22246
23143
  __wbg_set_6cb8631f80447a67: function() { return handleError(function (arg0, arg1, arg2) {
22247
23144
  const ret = Reflect.set(arg0, arg1, arg2);
22248
23145
  return ret;
@@ -22324,6 +23221,18 @@ function __wbg_get_imports() {
22324
23221
  const ret = arg0.status;
22325
23222
  return ret;
22326
23223
  },
23224
+ __wbg_storagemapentry_new: function(arg0) {
23225
+ const ret = StorageMapEntry.__wrap(arg0);
23226
+ return ret;
23227
+ },
23228
+ __wbg_storagemapinfo_new: function(arg0) {
23229
+ const ret = StorageMapInfo.__wrap(arg0);
23230
+ return ret;
23231
+ },
23232
+ __wbg_storagemapupdate_new: function(arg0) {
23233
+ const ret = StorageMapUpdate.__wrap(arg0);
23234
+ return ret;
23235
+ },
22327
23236
  __wbg_storageslot_unwrap: function(arg0) {
22328
23237
  const ret = StorageSlot.__unwrap(arg0);
22329
23238
  return ret;
@@ -22372,13 +23281,13 @@ function __wbg_get_imports() {
22372
23281
  const ret = TransactionSummary.__wrap(arg0);
22373
23282
  return ret;
22374
23283
  },
22375
- __wbg_undoAccountStates_418528d3ab74f47d: function(arg0, arg1, arg2, arg3) {
23284
+ __wbg_undoAccountStates_a9bb97fcb6ee8a5b: function(arg0, arg1, arg2, arg3) {
22376
23285
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
22377
23286
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
22378
23287
  const ret = undoAccountStates(getStringFromWasm0(arg0, arg1), v0);
22379
23288
  return ret;
22380
23289
  },
22381
- __wbg_upsertAccountCode_f0064d5ee703c4d4: function(arg0, arg1, arg2, arg3, arg4, arg5) {
23290
+ __wbg_upsertAccountCode_9f6c4b97ffdc2a70: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22382
23291
  let deferred0_0;
22383
23292
  let deferred0_1;
22384
23293
  try {
@@ -22392,7 +23301,7 @@ function __wbg_get_imports() {
22392
23301
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22393
23302
  }
22394
23303
  },
22395
- __wbg_upsertAccountRecord_1a44a04b996eea5b: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) {
23304
+ __wbg_upsertAccountRecord_871acd6aa086e68f: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) {
22396
23305
  let deferred0_0;
22397
23306
  let deferred0_1;
22398
23307
  let deferred1_0;
@@ -22434,26 +23343,21 @@ function __wbg_get_imports() {
22434
23343
  wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
22435
23344
  }
22436
23345
  },
22437
- __wbg_upsertAccountStorage_5496ac9020784880: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23346
+ __wbg_upsertAccountStorage_a50e64183e253d97: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22438
23347
  let deferred0_0;
22439
23348
  let deferred0_1;
22440
- let deferred1_0;
22441
- let deferred1_1;
22442
23349
  try {
22443
23350
  deferred0_0 = arg2;
22444
23351
  deferred0_1 = arg3;
22445
- deferred1_0 = arg4;
22446
- deferred1_1 = arg5;
22447
- var v2 = getArrayJsValueFromWasm0(arg6, arg7).slice();
22448
- wasm.__wbindgen_free(arg6, arg7 * 4, 4);
22449
- const ret = upsertAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), v2);
23352
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
23353
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
23354
+ const ret = upsertAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
22450
23355
  return ret;
22451
23356
  } finally {
22452
23357
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22453
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22454
23358
  }
22455
23359
  },
22456
- __wbg_upsertForeignAccountCode_e29fa0e4e5f4f985: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23360
+ __wbg_upsertForeignAccountCode_9e93abdae6f4c0c7: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22457
23361
  let deferred0_0;
22458
23362
  let deferred0_1;
22459
23363
  let deferred2_0;
@@ -22472,7 +23376,7 @@ function __wbg_get_imports() {
22472
23376
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
22473
23377
  }
22474
23378
  },
22475
- __wbg_upsertInputNote_b4afadbc48fcb67f: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20) {
23379
+ __wbg_upsertInputNote_ebefca636604089b: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24) {
22476
23380
  let deferred0_0;
22477
23381
  let deferred0_1;
22478
23382
  let deferred4_0;
@@ -22500,7 +23404,12 @@ function __wbg_get_imports() {
22500
23404
  deferred7_1 = arg17;
22501
23405
  var v8 = getArrayU8FromWasm0(arg19, arg20).slice();
22502
23406
  wasm.__wbindgen_free(arg19, arg20 * 1, 1);
22503
- const ret = upsertInputNote(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1, v2, v3, getStringFromWasm0(arg10, arg11), v5, getStringFromWasm0(arg14, arg15), getStringFromWasm0(arg16, arg17), arg18, v8);
23407
+ let v9;
23408
+ if (arg23 !== 0) {
23409
+ v9 = getStringFromWasm0(arg23, arg24).slice();
23410
+ wasm.__wbindgen_free(arg23, arg24 * 1, 1);
23411
+ }
23412
+ const ret = upsertInputNote(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1, v2, v3, getStringFromWasm0(arg10, arg11), v5, getStringFromWasm0(arg14, arg15), getStringFromWasm0(arg16, arg17), arg18, v8, arg21 === 0x100000001 ? undefined : arg21, arg22 === 0x100000001 ? undefined : arg22, v9);
22504
23413
  return ret;
22505
23414
  } finally {
22506
23415
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
@@ -22509,7 +23418,7 @@ function __wbg_get_imports() {
22509
23418
  wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
22510
23419
  }
22511
23420
  },
22512
- __wbg_upsertNoteScript_2f97ba16d0d984d0: function(arg0, arg1, arg2, arg3, arg4, arg5) {
23421
+ __wbg_upsertNoteScript_19e8fc1a041edf85: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22513
23422
  let deferred0_0;
22514
23423
  let deferred0_1;
22515
23424
  try {
@@ -22523,7 +23432,7 @@ function __wbg_get_imports() {
22523
23432
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22524
23433
  }
22525
23434
  },
22526
- __wbg_upsertOutputNote_d46cc5c171b7997d: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
23435
+ __wbg_upsertOutputNote_fc6f81a8309ef41b: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
22527
23436
  let deferred0_0;
22528
23437
  let deferred0_1;
22529
23438
  let deferred2_0;
@@ -22551,26 +23460,21 @@ function __wbg_get_imports() {
22551
23460
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
22552
23461
  }
22553
23462
  },
22554
- __wbg_upsertStorageMapEntries_4cd61775348e0806: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23463
+ __wbg_upsertStorageMapEntries_a39827348033fe1a: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22555
23464
  let deferred0_0;
22556
23465
  let deferred0_1;
22557
- let deferred1_0;
22558
- let deferred1_1;
22559
23466
  try {
22560
23467
  deferred0_0 = arg2;
22561
23468
  deferred0_1 = arg3;
22562
- deferred1_0 = arg4;
22563
- deferred1_1 = arg5;
22564
- var v2 = getArrayJsValueFromWasm0(arg6, arg7).slice();
22565
- wasm.__wbindgen_free(arg6, arg7 * 4, 4);
22566
- const ret = upsertStorageMapEntries(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), v2);
23469
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
23470
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
23471
+ const ret = upsertStorageMapEntries(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
22567
23472
  return ret;
22568
23473
  } finally {
22569
23474
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22570
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22571
23475
  }
22572
23476
  },
22573
- __wbg_upsertTransactionRecord_71e12e0dca7738c3: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) {
23477
+ __wbg_upsertTransactionRecord_01aaa20c21552b32: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) {
22574
23478
  let deferred0_0;
22575
23479
  let deferred0_1;
22576
23480
  try {
@@ -22591,23 +23495,18 @@ function __wbg_get_imports() {
22591
23495
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22592
23496
  }
22593
23497
  },
22594
- __wbg_upsertVaultAssets_9afc250da96bd5ab: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23498
+ __wbg_upsertVaultAssets_fa65d63a2d8af8de: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22595
23499
  let deferred0_0;
22596
23500
  let deferred0_1;
22597
- let deferred1_0;
22598
- let deferred1_1;
22599
23501
  try {
22600
23502
  deferred0_0 = arg2;
22601
23503
  deferred0_1 = arg3;
22602
- deferred1_0 = arg4;
22603
- deferred1_1 = arg5;
22604
- var v2 = getArrayJsValueFromWasm0(arg6, arg7).slice();
22605
- wasm.__wbindgen_free(arg6, arg7 * 4, 4);
22606
- const ret = upsertVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), v2);
23504
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
23505
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
23506
+ const ret = upsertVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
22607
23507
  return ret;
22608
23508
  } finally {
22609
23509
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22610
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22611
23510
  }
22612
23511
  },
22613
23512
  __wbg_value_0546255b415e96c1: function(arg0) {
@@ -22627,13 +23526,13 @@ function __wbg_get_imports() {
22627
23526
  return ret;
22628
23527
  },
22629
23528
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
22630
- // Cast intrinsic for `Closure(Closure { dtor_idx: 646, function: Function { arguments: [Externref], shim_idx: 651, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
22631
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he3a977abd70bfc9b, wasm_bindgen__convert__closures_____invoke__h9b776fcb85dcda59);
23529
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 373, function: Function { arguments: [Externref], shim_idx: 695, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
23530
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h391391dffb6a09df, wasm_bindgen__convert__closures_____invoke__h2a909b4e7ff298f2);
22632
23531
  return ret;
22633
23532
  },
22634
23533
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
22635
- // Cast intrinsic for `Closure(Closure { dtor_idx: 646, function: Function { arguments: [], shim_idx: 647, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
22636
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he3a977abd70bfc9b, wasm_bindgen__convert__closures_____invoke__h8c553039fb936537);
23534
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 373, function: Function { arguments: [], shim_idx: 374, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
23535
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h391391dffb6a09df, wasm_bindgen__convert__closures_____invoke__h53c1e1d8115a3864);
22637
23536
  return ret;
22638
23537
  },
22639
23538
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -22737,16 +23636,16 @@ function __wbg_get_imports() {
22737
23636
  };
22738
23637
  }
22739
23638
 
22740
- function wasm_bindgen__convert__closures_____invoke__h8c553039fb936537(arg0, arg1) {
22741
- wasm.wasm_bindgen__convert__closures_____invoke__h8c553039fb936537(arg0, arg1);
23639
+ function wasm_bindgen__convert__closures_____invoke__h53c1e1d8115a3864(arg0, arg1) {
23640
+ wasm.wasm_bindgen__convert__closures_____invoke__h53c1e1d8115a3864(arg0, arg1);
22742
23641
  }
22743
23642
 
22744
- function wasm_bindgen__convert__closures_____invoke__h9b776fcb85dcda59(arg0, arg1, arg2) {
22745
- wasm.wasm_bindgen__convert__closures_____invoke__h9b776fcb85dcda59(arg0, arg1, arg2);
23643
+ function wasm_bindgen__convert__closures_____invoke__h2a909b4e7ff298f2(arg0, arg1, arg2) {
23644
+ wasm.wasm_bindgen__convert__closures_____invoke__h2a909b4e7ff298f2(arg0, arg1, arg2);
22746
23645
  }
22747
23646
 
22748
- function wasm_bindgen__convert__closures_____invoke__h4e730be6209b5f2c(arg0, arg1, arg2, arg3) {
22749
- wasm.wasm_bindgen__convert__closures_____invoke__h4e730be6209b5f2c(arg0, arg1, arg2, arg3);
23647
+ function wasm_bindgen__convert__closures_____invoke__h5e71136c5fac87ef(arg0, arg1, arg2, arg3) {
23648
+ wasm.wasm_bindgen__convert__closures_____invoke__h5e71136c5fac87ef(arg0, arg1, arg2, arg3);
22750
23649
  }
22751
23650
 
22752
23651
 
@@ -22952,6 +23851,9 @@ const NoteAndArgsFinalization = (typeof FinalizationRegistry === 'undefined')
22952
23851
  const NoteAndArgsArrayFinalization = (typeof FinalizationRegistry === 'undefined')
22953
23852
  ? { register: () => {}, unregister: () => {} }
22954
23853
  : new FinalizationRegistry(ptr => wasm.__wbg_noteandargsarray_free(ptr >>> 0, 1));
23854
+ const NoteArrayFinalization = (typeof FinalizationRegistry === 'undefined')
23855
+ ? { register: () => {}, unregister: () => {} }
23856
+ : new FinalizationRegistry(ptr => wasm.__wbg_notearray_free(ptr >>> 0, 1));
22955
23857
  const NoteAssetsFinalization = (typeof FinalizationRegistry === 'undefined')
22956
23858
  ? { register: () => {}, unregister: () => {} }
22957
23859
  : new FinalizationRegistry(ptr => wasm.__wbg_noteassets_free(ptr >>> 0, 1));
@@ -23018,6 +23920,9 @@ const NoteScriptFinalization = (typeof FinalizationRegistry === 'undefined')
23018
23920
  const NoteStorageFinalization = (typeof FinalizationRegistry === 'undefined')
23019
23921
  ? { register: () => {}, unregister: () => {} }
23020
23922
  : new FinalizationRegistry(ptr => wasm.__wbg_notestorage_free(ptr >>> 0, 1));
23923
+ const NoteSyncBlockFinalization = (typeof FinalizationRegistry === 'undefined')
23924
+ ? { register: () => {}, unregister: () => {} }
23925
+ : new FinalizationRegistry(ptr => wasm.__wbg_notesyncblock_free(ptr >>> 0, 1));
23021
23926
  const NoteSyncInfoFinalization = (typeof FinalizationRegistry === 'undefined')
23022
23927
  ? { register: () => {}, unregister: () => {} }
23023
23928
  : new FinalizationRegistry(ptr => wasm.__wbg_notesyncinfo_free(ptr >>> 0, 1));
@@ -23036,15 +23941,15 @@ const OutputNoteRecordFinalization = (typeof FinalizationRegistry === 'undefined
23036
23941
  const OutputNotesFinalization = (typeof FinalizationRegistry === 'undefined')
23037
23942
  ? { register: () => {}, unregister: () => {} }
23038
23943
  : new FinalizationRegistry(ptr => wasm.__wbg_outputnotes_free(ptr >>> 0, 1));
23039
- const OutputNotesArrayFinalization = (typeof FinalizationRegistry === 'undefined')
23040
- ? { register: () => {}, unregister: () => {} }
23041
- : new FinalizationRegistry(ptr => wasm.__wbg_outputnotesarray_free(ptr >>> 0, 1));
23042
23944
  const PackageFinalization = (typeof FinalizationRegistry === 'undefined')
23043
23945
  ? { register: () => {}, unregister: () => {} }
23044
23946
  : new FinalizationRegistry(ptr => wasm.__wbg_package_free(ptr >>> 0, 1));
23045
23947
  const PartialNoteFinalization = (typeof FinalizationRegistry === 'undefined')
23046
23948
  ? { register: () => {}, unregister: () => {} }
23047
23949
  : new FinalizationRegistry(ptr => wasm.__wbg_partialnote_free(ptr >>> 0, 1));
23950
+ const Poseidon2Finalization = (typeof FinalizationRegistry === 'undefined')
23951
+ ? { register: () => {}, unregister: () => {} }
23952
+ : new FinalizationRegistry(ptr => wasm.__wbg_poseidon2_free(ptr >>> 0, 1));
23048
23953
  const ProcedureThresholdFinalization = (typeof FinalizationRegistry === 'undefined')
23049
23954
  ? { register: () => {}, unregister: () => {} }
23050
23955
  : new FinalizationRegistry(ptr => wasm.__wbg_procedurethreshold_free(ptr >>> 0, 1));
@@ -23087,6 +23992,15 @@ const SparseMerklePathFinalization = (typeof FinalizationRegistry === 'undefined
23087
23992
  const StorageMapFinalization = (typeof FinalizationRegistry === 'undefined')
23088
23993
  ? { register: () => {}, unregister: () => {} }
23089
23994
  : new FinalizationRegistry(ptr => wasm.__wbg_storagemap_free(ptr >>> 0, 1));
23995
+ const StorageMapEntryFinalization = (typeof FinalizationRegistry === 'undefined')
23996
+ ? { register: () => {}, unregister: () => {} }
23997
+ : new FinalizationRegistry(ptr => wasm.__wbg_storagemapentry_free(ptr >>> 0, 1));
23998
+ const StorageMapInfoFinalization = (typeof FinalizationRegistry === 'undefined')
23999
+ ? { register: () => {}, unregister: () => {} }
24000
+ : new FinalizationRegistry(ptr => wasm.__wbg_storagemapinfo_free(ptr >>> 0, 1));
24001
+ const StorageMapUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
24002
+ ? { register: () => {}, unregister: () => {} }
24003
+ : new FinalizationRegistry(ptr => wasm.__wbg_storagemapupdate_free(ptr >>> 0, 1));
23090
24004
  const StorageSlotFinalization = (typeof FinalizationRegistry === 'undefined')
23091
24005
  ? { register: () => {}, unregister: () => {} }
23092
24006
  : new FinalizationRegistry(ptr => wasm.__wbg_storageslot_free(ptr >>> 0, 1));
@@ -23147,6 +24061,9 @@ const TransactionSummaryFinalization = (typeof FinalizationRegistry === 'undefin
23147
24061
  const WebClientFinalization = (typeof FinalizationRegistry === 'undefined')
23148
24062
  ? { register: () => {}, unregister: () => {} }
23149
24063
  : new FinalizationRegistry(ptr => wasm.__wbg_webclient_free(ptr >>> 0, 1));
24064
+ const WebKeystoreApiFinalization = (typeof FinalizationRegistry === 'undefined')
24065
+ ? { register: () => {}, unregister: () => {} }
24066
+ : new FinalizationRegistry(ptr => wasm.__wbg_webkeystoreapi_free(ptr >>> 0, 1));
23150
24067
  const WordFinalization = (typeof FinalizationRegistry === 'undefined')
23151
24068
  ? { register: () => {}, unregister: () => {} }
23152
24069
  : new FinalizationRegistry(ptr => wasm.__wbg_word_free(ptr >>> 0, 1));
@@ -23530,8 +24447,5 @@ async function __wbg_init(module_or_path) {
23530
24447
  }
23531
24448
 
23532
24449
  const module$1 = new URL("assets/miden_client_web.wasm", import.meta.url);
23533
-
23534
- await __wbg_init({ module_or_path: module$1 });
23535
-
23536
- export { Account, AccountArray, AccountBuilder, AccountBuilderResult, AccountCode, AccountComponent, AccountComponentCode, AccountDelta, AccountFile, AccountHeader, AccountId, AccountIdArray, AccountInterface, AccountProof, AccountReader, AccountStatus, AccountStorage, AccountStorageDelta, AccountStorageMode, AccountStorageRequirements, AccountType, AccountVaultDelta, Address, AdviceInputs, AdviceMap, AssetVault, AuthFalcon512RpoMultisigConfig, AuthScheme, AuthSecretKey, BasicFungibleFaucetComponent, BlockHeader, CodeBuilder, CommittedNote, ConsumableNoteRecord, Endpoint, ExecutedTransaction, Felt, FeltArray, FetchedAccount, FetchedNote, FlattenedU8Vec, ForeignAccount, ForeignAccountArray, FungibleAsset, FungibleAssetDelta, FungibleAssetDeltaItem, GetProceduresResultItem, InputNote, InputNoteRecord, InputNoteState, InputNotes, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, JsAccountUpdate, JsStateSyncUpdate, JsStorageMapEntry, JsStorageSlot, JsVaultAsset, Library, MerklePath, NetworkId, NetworkType, Note, NoteAndArgs, NoteAndArgsArray, NoteAssets, NoteAttachment, NoteAttachmentKind, NoteAttachmentScheme, NoteConsumability, NoteConsumptionStatus, NoteDetails, NoteDetailsAndTag, NoteDetailsAndTagArray, NoteExecutionHint, NoteExportFormat, NoteFile, NoteFilter, NoteFilterTypes, NoteHeader, NoteId, NoteIdAndArgs, NoteIdAndArgsArray, NoteInclusionProof, NoteLocation, NoteMetadata, NoteRecipient, NoteRecipientArray, NoteScript, NoteStorage, NoteSyncInfo, NoteTag, NoteType, OutputNote, OutputNoteArray, OutputNoteRecord, OutputNoteState, OutputNotes, OutputNotesArray, Package, PartialNote, ProcedureThreshold, Program, ProvenTransaction, PublicKey, RpcClient, Rpo256, SerializedInputNoteData, SerializedOutputNoteData, SerializedTransactionData, Signature, SigningInputs, SigningInputsType, SlotAndKeys, SparseMerklePath, StorageMap, StorageSlot, StorageSlotArray, SyncSummary, TestUtils, TokenSymbol, TransactionArgs, TransactionFilter, TransactionId, TransactionProver, TransactionRecord, TransactionRequest, TransactionRequestBuilder, TransactionResult, TransactionScript, TransactionScriptInputPair, TransactionScriptInputPairArray, TransactionStatus, TransactionStoreUpdate, TransactionSummary, WebClient, Word, createAuthFalcon512RpoMultisig, initSync, setupLogging };
23537
- //# sourceMappingURL=Cargo-DlfmzoDc.js.map
24450
+ export { Account, AccountArray, AccountBuilder, AccountBuilderResult, AccountCode, AccountComponent, AccountComponentCode, AccountDelta, AccountFile, AccountHeader, AccountId, AccountIdArray, AccountInterface, AccountProof, AccountReader, AccountStatus, AccountStorage, AccountStorageDelta, AccountStorageMode, AccountStorageRequirements, AccountType, AccountVaultDelta, Address, AdviceInputs, AdviceMap, AssetVault, AuthFalcon512RpoMultisigConfig, AuthScheme, AuthSecretKey, BasicFungibleFaucetComponent, BlockHeader, CodeBuilder, CommittedNote, ConsumableNoteRecord, Endpoint, ExecutedTransaction, Felt, FeltArray, FetchedAccount, FetchedNote, FlattenedU8Vec, ForeignAccount, ForeignAccountArray, FungibleAsset, FungibleAssetDelta, FungibleAssetDeltaItem, GetProceduresResultItem, InputNote, InputNoteRecord, InputNoteState, InputNotes, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, JsAccountUpdate, JsStateSyncUpdate, JsStorageMapEntry, JsStorageSlot, JsVaultAsset, Library, MerklePath, NetworkId, NetworkType, Note, NoteAndArgs, NoteAndArgsArray, NoteArray, NoteAssets, NoteAttachment, NoteAttachmentKind, NoteAttachmentScheme, NoteConsumability, NoteConsumptionStatus, NoteDetails, NoteDetailsAndTag, NoteDetailsAndTagArray, NoteExecutionHint, NoteExportFormat, NoteFile, NoteFilter, NoteFilterTypes, NoteHeader, NoteId, NoteIdAndArgs, NoteIdAndArgsArray, NoteInclusionProof, NoteLocation, NoteMetadata, NoteRecipient, NoteRecipientArray, NoteScript, NoteStorage, NoteSyncBlock, NoteSyncInfo, NoteTag, NoteType, OutputNote, OutputNoteArray, OutputNoteRecord, OutputNoteState, OutputNotes, Package, PartialNote, Poseidon2, ProcedureThreshold, Program, ProvenTransaction, PublicKey, RpcClient, Rpo256, SerializedInputNoteData, SerializedOutputNoteData, SerializedTransactionData, Signature, SigningInputs, SigningInputsType, SlotAndKeys, SparseMerklePath, StorageMap, StorageMapEntry, StorageMapInfo, StorageMapUpdate, StorageSlot, StorageSlotArray, SyncSummary, TestUtils, TokenSymbol, TransactionArgs, TransactionFilter, TransactionId, TransactionProver, TransactionRecord, TransactionRequest, TransactionRequestBuilder, TransactionResult, TransactionScript, TransactionScriptInputPair, TransactionScriptInputPairArray, TransactionStatus, TransactionStoreUpdate, TransactionSummary, WebClient, WebKeystoreApi, Word, createAuthFalcon512RpoMultisig, exportStore2 as exportStore, importStore, initSync, setupLogging , __wbg_init, module$1 as __wasm_url };
24451
+ //# sourceMappingURL=Cargo-BZOulF0S.js.map