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

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.
@@ -7515,7 +7515,10 @@ function getDatabase(dbId) {
7515
7515
  */
7516
7516
  async function openDatabase(network, clientVersion) {
7517
7517
  const db = new MidenDatabase(network);
7518
- await db.open(clientVersion);
7518
+ const success = await db.open(clientVersion);
7519
+ if (!success) {
7520
+ throw new Error(`Failed to open IndexedDB database: ${network}`);
7521
+ }
7519
7522
  databaseRegistry.set(network, db);
7520
7523
  return network;
7521
7524
  }
@@ -7553,19 +7556,19 @@ function indexes(...items) {
7553
7556
  const V1_STORES = {
7554
7557
  [Table.AccountCode]: indexes("root"),
7555
7558
  [Table.LatestAccountStorage]: indexes("[accountId+slotName]", "accountId"),
7556
- [Table.HistoricalAccountStorage]: indexes("[accountId+nonce+slotName]", "accountId", "[accountId+nonce]"),
7559
+ [Table.HistoricalAccountStorage]: indexes("[accountId+replacedAtNonce+slotName]", "accountId", "[accountId+replacedAtNonce]"),
7557
7560
  [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]"),
7561
+ [Table.HistoricalStorageMapEntries]: indexes("[accountId+replacedAtNonce+slotName+key]", "accountId", "[accountId+replacedAtNonce]"),
7562
+ [Table.LatestAccountAssets]: indexes("[accountId+vaultKey]", "accountId"),
7563
+ [Table.HistoricalAccountAssets]: indexes("[accountId+replacedAtNonce+vaultKey]", "accountId", "[accountId+replacedAtNonce]"),
7561
7564
  [Table.AccountAuth]: indexes("pubKeyCommitmentHex"),
7562
7565
  [Table.AccountKeyMapping]: indexes("[accountIdHex+pubKeyCommitmentHex]", "accountIdHex", "pubKeyCommitmentHex"),
7563
7566
  [Table.LatestAccountHeaders]: indexes("&id", "accountCommitment"),
7564
- [Table.HistoricalAccountHeaders]: indexes("&accountCommitment", "id", "[id+nonce]"),
7567
+ [Table.HistoricalAccountHeaders]: indexes("&accountCommitment", "id", "[id+replacedAtNonce]"),
7565
7568
  [Table.Addresses]: indexes("address", "id"),
7566
7569
  [Table.Transactions]: indexes("id", "statusVariant"),
7567
7570
  [Table.TransactionScripts]: indexes("scriptRoot"),
7568
- [Table.InputNotes]: indexes("noteId", "nullifier", "stateDiscriminant"),
7571
+ [Table.InputNotes]: indexes("noteId", "nullifier", "stateDiscriminant", "[consumedBlockHeight+consumedTxOrder+noteId]"),
7569
7572
  [Table.OutputNotes]: indexes("noteId", "recipientDigest", "stateDiscriminant", "nullifier"),
7570
7573
  [Table.NotesScripts]: indexes("scriptRoot"),
7571
7574
  [Table.StateSync]: indexes("id"),
@@ -7843,21 +7846,25 @@ async function getAccountCode(dbId, codeRoot) {
7843
7846
  logWebStoreError(error, `Error fetching account code for root ${codeRoot}`);
7844
7847
  }
7845
7848
  }
7846
- async function getAccountStorage(dbId, accountId) {
7849
+ async function getAccountStorage(dbId, accountId, slotNames) {
7847
7850
  try {
7848
7851
  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;
7852
+ let query = db.latestAccountStorages.where("accountId").equals(accountId);
7853
+ let allMatchingRecords;
7854
+ if (slotNames.length) {
7855
+ const nameSet = new Set(slotNames);
7856
+ allMatchingRecords = await query
7857
+ .and((record) => nameSet.has(record.slotName))
7858
+ .toArray();
7859
+ }
7860
+ else {
7861
+ allMatchingRecords = await query.toArray();
7862
+ }
7863
+ return allMatchingRecords.map((record) => ({
7864
+ slotName: record.slotName,
7865
+ slotValue: record.slotValue,
7866
+ slotType: record.slotType,
7867
+ }));
7861
7868
  }
7862
7869
  catch (error) {
7863
7870
  logWebStoreError(error, `Error fetching account storage for account ${accountId}`);
@@ -7876,38 +7883,29 @@ async function getAccountStorageMaps(dbId, accountId) {
7876
7883
  logWebStoreError(error, `Error fetching account storage maps for account ${accountId}`);
7877
7884
  }
7878
7885
  }
7879
- async function getAccountVaultAssets(dbId, accountId) {
7886
+ async function getAccountVaultAssets(dbId, accountId, vaultKeys) {
7880
7887
  try {
7881
7888
  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;
7889
+ let query = db.latestAccountAssets.where("accountId").equals(accountId);
7890
+ let records;
7891
+ if (vaultKeys.length) {
7892
+ const keySet = new Set(vaultKeys);
7893
+ records = await query
7894
+ .and((record) => keySet.has(record.vaultKey))
7895
+ .toArray();
7896
+ }
7897
+ else {
7898
+ records = await query.toArray();
7899
+ }
7900
+ return records.map((record) => ({
7901
+ vaultKey: record.vaultKey,
7902
+ asset: record.asset,
7903
+ }));
7892
7904
  }
7893
7905
  catch (error) {
7894
7906
  logWebStoreError(error, `Error fetching account vault for account ${accountId}`);
7895
7907
  }
7896
7908
  }
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
7909
  async function getAccountAddresses(dbId, accountId) {
7912
7910
  try {
7913
7911
  const db = getDatabase(dbId);
@@ -7938,7 +7936,7 @@ async function upsertAccountCode(dbId, codeRoot, code) {
7938
7936
  logWebStoreError(error, `Error inserting code with root: ${codeRoot}`);
7939
7937
  }
7940
7938
  }
7941
- async function upsertAccountStorage(dbId, accountId, nonce, storageSlots) {
7939
+ async function upsertAccountStorage(dbId, accountId, storageSlots) {
7942
7940
  try {
7943
7941
  const db = getDatabase(dbId);
7944
7942
  await db.latestAccountStorages
@@ -7953,43 +7951,19 @@ async function upsertAccountStorage(dbId, accountId, nonce, storageSlots) {
7953
7951
  slotValue: slot.slotValue,
7954
7952
  slotType: slot.slotType,
7955
7953
  }));
7956
- const historicalEntries = latestEntries.map((entry) => ({
7957
- ...entry,
7958
- nonce,
7959
- }));
7960
7954
  await db.latestAccountStorages.bulkPut(latestEntries);
7961
- await db.historicalAccountStorages.bulkPut(historicalEntries);
7962
7955
  }
7963
7956
  catch (error) {
7964
7957
  logWebStoreError(error, `Error inserting storage slots`);
7965
7958
  }
7966
7959
  }
7967
- async function upsertStorageMapEntries(dbId, accountId, nonce, entries) {
7960
+ async function upsertStorageMapEntries(dbId, accountId, entries) {
7968
7961
  try {
7969
7962
  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
7963
  await db.latestStorageMapEntries
7976
7964
  .where("accountId")
7977
7965
  .equals(accountId)
7978
7966
  .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
7967
  if (entries.length === 0)
7994
7968
  return;
7995
7969
  const latestEntries = entries.map((entry) => ({
@@ -7998,60 +7972,30 @@ async function upsertStorageMapEntries(dbId, accountId, nonce, entries) {
7998
7972
  key: entry.key,
7999
7973
  value: entry.value,
8000
7974
  }));
8001
- const historicalEntries = latestEntries.map((entry) => ({
8002
- ...entry,
8003
- nonce,
8004
- }));
8005
7975
  await db.latestStorageMapEntries.bulkPut(latestEntries);
8006
- await db.historicalStorageMapEntries.bulkPut(historicalEntries);
8007
7976
  }
8008
7977
  catch (error) {
8009
7978
  logWebStoreError(error, `Error inserting storage map entries`);
8010
7979
  }
8011
7980
  }
8012
- async function upsertVaultAssets(dbId, accountId, nonce, assets) {
7981
+ async function upsertVaultAssets(dbId, accountId, assets) {
8013
7982
  try {
8014
7983
  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
7984
  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
7985
  if (assets.length === 0)
8036
7986
  return;
8037
7987
  const latestEntries = assets.map((asset) => ({
8038
7988
  accountId,
8039
7989
  vaultKey: asset.vaultKey,
8040
- faucetIdPrefix: asset.faucetIdPrefix,
8041
7990
  asset: asset.asset,
8042
7991
  }));
8043
- const historicalEntries = latestEntries.map((entry) => ({
8044
- ...entry,
8045
- nonce,
8046
- }));
8047
7992
  await db.latestAccountAssets.bulkPut(latestEntries);
8048
- await db.historicalAccountAssets.bulkPut(historicalEntries);
8049
7993
  }
8050
7994
  catch (error) {
8051
7995
  logWebStoreError(error, `Error inserting assets`);
8052
7996
  }
8053
7997
  }
8054
- async function applyTransactionDelta(dbId, accountId, nonce, updatedSlots, changedMapEntries, changedAssets, codeRoot, storageRoot, vaultRoot, committed, commitment, accountSeed) {
7998
+ async function applyTransactionDelta(dbId, accountId, nonce, updatedSlots, changedMapEntries, changedAssets, codeRoot, storageRoot, vaultRoot, committed, commitment) {
8055
7999
  try {
8056
8000
  const db = getDatabase(dbId);
8057
8001
  await db.dexie.transaction("rw", [
@@ -8064,108 +8008,299 @@ async function applyTransactionDelta(dbId, accountId, nonce, updatedSlots, chang
8064
8008
  db.latestAccountHeaders,
8065
8009
  db.historicalAccountHeaders,
8066
8010
  ], async () => {
8067
- // Apply storage delta
8011
+ // Apply storage delta: read old → archive → write new
8068
8012
  for (const slot of updatedSlots) {
8069
- await db.latestAccountStorages.put({
8013
+ const oldSlot = await db.latestAccountStorages
8014
+ .where("[accountId+slotName]")
8015
+ .equals([accountId, slot.slotName])
8016
+ .first();
8017
+ await db.historicalAccountStorages.put({
8070
8018
  accountId,
8019
+ replacedAtNonce: nonce,
8071
8020
  slotName: slot.slotName,
8072
- slotValue: slot.slotValue,
8021
+ oldSlotValue: oldSlot?.slotValue ?? null,
8073
8022
  slotType: slot.slotType,
8074
8023
  });
8075
- await db.historicalAccountStorages.put({
8024
+ await db.latestAccountStorages.put({
8076
8025
  accountId,
8077
- nonce,
8078
8026
  slotName: slot.slotName,
8079
8027
  slotValue: slot.slotValue,
8080
8028
  slotType: slot.slotType,
8081
8029
  });
8082
8030
  }
8083
- // Process map entries: value="" means removal
8031
+ // Process map entries: read old → archive → update latest
8084
8032
  for (const entry of changedMapEntries) {
8033
+ const oldEntry = await db.latestStorageMapEntries
8034
+ .where("[accountId+slotName+key]")
8035
+ .equals([accountId, entry.slotName, entry.key])
8036
+ .first();
8037
+ await db.historicalStorageMapEntries.put({
8038
+ accountId,
8039
+ replacedAtNonce: nonce,
8040
+ slotName: entry.slotName,
8041
+ key: entry.key,
8042
+ oldValue: oldEntry?.value ?? null,
8043
+ });
8044
+ // "" means removal
8085
8045
  if (entry.value === "") {
8086
- // Removal: delete from latest, write tombstone to historical
8087
8046
  await db.latestStorageMapEntries
8088
8047
  .where("[accountId+slotName+key]")
8089
8048
  .equals([accountId, entry.slotName, entry.key])
8090
8049
  .delete();
8091
- await db.historicalStorageMapEntries.put({
8092
- accountId,
8093
- nonce,
8094
- slotName: entry.slotName,
8095
- key: entry.key,
8096
- value: null,
8097
- });
8098
8050
  }
8099
8051
  else {
8100
- // Update: put to both latest and historical
8101
8052
  await db.latestStorageMapEntries.put({
8102
8053
  accountId,
8103
8054
  slotName: entry.slotName,
8104
8055
  key: entry.key,
8105
8056
  value: entry.value,
8106
8057
  });
8107
- await db.historicalStorageMapEntries.put({
8108
- accountId,
8109
- nonce,
8110
- slotName: entry.slotName,
8111
- key: entry.key,
8112
- value: entry.value,
8113
- });
8114
8058
  }
8115
8059
  }
8116
- // Apply vault delta
8060
+ // Apply vault delta: read old → archive → update latest
8117
8061
  for (const entry of changedAssets) {
8062
+ const oldAsset = await db.latestAccountAssets
8063
+ .where("[accountId+vaultKey]")
8064
+ .equals([accountId, entry.vaultKey])
8065
+ .first();
8066
+ await db.historicalAccountAssets.put({
8067
+ accountId,
8068
+ replacedAtNonce: nonce,
8069
+ vaultKey: entry.vaultKey,
8070
+ oldAsset: oldAsset?.asset ?? null,
8071
+ });
8072
+ // "" means removal
8118
8073
  if (entry.asset === "") {
8119
- // Removal: delete from latest, write tombstone to historical
8120
8074
  await db.latestAccountAssets
8121
8075
  .where("[accountId+vaultKey]")
8122
8076
  .equals([accountId, entry.vaultKey])
8123
8077
  .delete();
8124
- await db.historicalAccountAssets.put({
8125
- accountId,
8126
- nonce,
8127
- vaultKey: entry.vaultKey,
8128
- faucetIdPrefix: entry.faucetIdPrefix,
8129
- asset: null,
8130
- });
8131
8078
  }
8132
8079
  else {
8133
- // Update: put to both latest and historical
8134
8080
  await db.latestAccountAssets.put({
8135
8081
  accountId,
8136
8082
  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
8083
  asset: entry.asset,
8146
8084
  });
8147
8085
  }
8148
8086
  }
8149
- // Upsert account record
8150
- const data = {
8087
+ // Archive old header and write new header
8088
+ const oldHeader = await db.latestAccountHeaders
8089
+ .where("id")
8090
+ .equals(accountId)
8091
+ .first();
8092
+ if (oldHeader) {
8093
+ await db.historicalAccountHeaders.put({
8094
+ id: accountId,
8095
+ replacedAtNonce: nonce,
8096
+ codeRoot: oldHeader.codeRoot,
8097
+ storageRoot: oldHeader.storageRoot,
8098
+ vaultRoot: oldHeader.vaultRoot,
8099
+ nonce: oldHeader.nonce,
8100
+ committed: oldHeader.committed,
8101
+ accountSeed: oldHeader.accountSeed,
8102
+ accountCommitment: oldHeader.accountCommitment,
8103
+ locked: oldHeader.locked,
8104
+ });
8105
+ }
8106
+ await db.latestAccountHeaders.put({
8151
8107
  id: accountId,
8152
8108
  codeRoot,
8153
8109
  storageRoot,
8154
8110
  vaultRoot,
8155
8111
  nonce,
8156
8112
  committed,
8157
- accountSeed,
8113
+ accountSeed: undefined,
8158
8114
  accountCommitment: commitment,
8159
8115
  locked: false,
8160
- };
8161
- await db.historicalAccountHeaders.put(data);
8162
- await db.latestAccountHeaders.put(data);
8116
+ });
8163
8117
  });
8164
8118
  }
8165
8119
  catch (error) {
8166
8120
  logWebStoreError(error, `Error applying transaction delta`);
8167
8121
  }
8168
8122
  }
8123
+ async function archiveAndReplaceStorageSlots(db, accountId, nonce, newSlots) {
8124
+ const oldSlots = await db.latestAccountStorages
8125
+ .where("accountId")
8126
+ .equals(accountId)
8127
+ .toArray();
8128
+ // Archive every old slot
8129
+ for (const slot of oldSlots) {
8130
+ await db.historicalAccountStorages.put({
8131
+ accountId,
8132
+ replacedAtNonce: nonce,
8133
+ slotName: slot.slotName,
8134
+ oldSlotValue: slot.slotValue,
8135
+ slotType: slot.slotType,
8136
+ });
8137
+ }
8138
+ // Write NULL markers for genuinely new slots (no old value to archive)
8139
+ const oldSlotNames = new Set(oldSlots.map((s) => s.slotName));
8140
+ for (const slot of newSlots) {
8141
+ if (!oldSlotNames.has(slot.slotName)) {
8142
+ await db.historicalAccountStorages.put({
8143
+ accountId,
8144
+ replacedAtNonce: nonce,
8145
+ slotName: slot.slotName,
8146
+ oldSlotValue: null,
8147
+ slotType: slot.slotType,
8148
+ });
8149
+ }
8150
+ }
8151
+ // Replace latest
8152
+ await db.latestAccountStorages.where("accountId").equals(accountId).delete();
8153
+ if (newSlots.length > 0) {
8154
+ await db.latestAccountStorages.bulkPut(newSlots.map((slot) => ({
8155
+ accountId,
8156
+ slotName: slot.slotName,
8157
+ slotValue: slot.slotValue,
8158
+ slotType: slot.slotType,
8159
+ })));
8160
+ }
8161
+ }
8162
+ async function archiveAndReplaceMapEntries(db, accountId, nonce, newEntries) {
8163
+ const oldEntries = await db.latestStorageMapEntries
8164
+ .where("accountId")
8165
+ .equals(accountId)
8166
+ .toArray();
8167
+ for (const entry of oldEntries) {
8168
+ await db.historicalStorageMapEntries.put({
8169
+ accountId,
8170
+ replacedAtNonce: nonce,
8171
+ slotName: entry.slotName,
8172
+ key: entry.key,
8173
+ oldValue: entry.value,
8174
+ });
8175
+ }
8176
+ const oldKeys = new Set(oldEntries.map((e) => `${e.slotName}\0${e.key}`));
8177
+ for (const entry of newEntries) {
8178
+ if (!oldKeys.has(`${entry.slotName}\0${entry.key}`)) {
8179
+ await db.historicalStorageMapEntries.put({
8180
+ accountId,
8181
+ replacedAtNonce: nonce,
8182
+ slotName: entry.slotName,
8183
+ key: entry.key,
8184
+ oldValue: null,
8185
+ });
8186
+ }
8187
+ }
8188
+ await db.latestStorageMapEntries
8189
+ .where("accountId")
8190
+ .equals(accountId)
8191
+ .delete();
8192
+ if (newEntries.length > 0) {
8193
+ await db.latestStorageMapEntries.bulkPut(newEntries.map((entry) => ({
8194
+ accountId,
8195
+ slotName: entry.slotName,
8196
+ key: entry.key,
8197
+ value: entry.value,
8198
+ })));
8199
+ }
8200
+ }
8201
+ async function archiveAndReplaceVaultAssets(db, accountId, nonce, newAssets) {
8202
+ const oldAssets = await db.latestAccountAssets
8203
+ .where("accountId")
8204
+ .equals(accountId)
8205
+ .toArray();
8206
+ for (const asset of oldAssets) {
8207
+ await db.historicalAccountAssets.put({
8208
+ accountId,
8209
+ replacedAtNonce: nonce,
8210
+ vaultKey: asset.vaultKey,
8211
+ oldAsset: asset.asset,
8212
+ });
8213
+ }
8214
+ const oldKeys = new Set(oldAssets.map((a) => a.vaultKey));
8215
+ for (const asset of newAssets) {
8216
+ if (!oldKeys.has(asset.vaultKey)) {
8217
+ await db.historicalAccountAssets.put({
8218
+ accountId,
8219
+ replacedAtNonce: nonce,
8220
+ vaultKey: asset.vaultKey,
8221
+ oldAsset: null,
8222
+ });
8223
+ }
8224
+ }
8225
+ await db.latestAccountAssets.where("accountId").equals(accountId).delete();
8226
+ if (newAssets.length > 0) {
8227
+ await db.latestAccountAssets.bulkPut(newAssets.map((asset) => ({
8228
+ accountId,
8229
+ vaultKey: asset.vaultKey,
8230
+ asset: asset.asset,
8231
+ })));
8232
+ }
8233
+ }
8234
+ async function restoreSlotsFromHistorical(db, accountId, nonce) {
8235
+ const oldSlots = await db.historicalAccountStorages
8236
+ .where("[accountId+replacedAtNonce]")
8237
+ .equals([accountId, nonce])
8238
+ .toArray();
8239
+ for (const slot of oldSlots) {
8240
+ if (slot.oldSlotValue !== null) {
8241
+ await db.latestAccountStorages.put({
8242
+ accountId: slot.accountId,
8243
+ slotName: slot.slotName,
8244
+ slotValue: slot.oldSlotValue,
8245
+ slotType: slot.slotType,
8246
+ });
8247
+ }
8248
+ else {
8249
+ await db.latestAccountStorages
8250
+ .where("[accountId+slotName]")
8251
+ .equals([accountId, slot.slotName])
8252
+ .delete();
8253
+ }
8254
+ }
8255
+ }
8256
+ async function restoreMapEntriesFromHistorical(db, accountId, nonce) {
8257
+ const oldEntries = await db.historicalStorageMapEntries
8258
+ .where("[accountId+replacedAtNonce]")
8259
+ .equals([accountId, nonce])
8260
+ .toArray();
8261
+ for (const entry of oldEntries) {
8262
+ if (entry.oldValue !== null) {
8263
+ await db.latestStorageMapEntries.put({
8264
+ accountId: entry.accountId,
8265
+ slotName: entry.slotName,
8266
+ key: entry.key,
8267
+ value: entry.oldValue,
8268
+ });
8269
+ }
8270
+ else {
8271
+ await db.latestStorageMapEntries
8272
+ .where("[accountId+slotName+key]")
8273
+ .equals([accountId, entry.slotName, entry.key])
8274
+ .delete();
8275
+ }
8276
+ }
8277
+ }
8278
+ async function restoreAssetsFromHistorical(db, accountId, nonce) {
8279
+ const oldAssets = await db.historicalAccountAssets
8280
+ .where("[accountId+replacedAtNonce]")
8281
+ .equals([accountId, nonce])
8282
+ .toArray();
8283
+ for (const asset of oldAssets) {
8284
+ if (asset.oldAsset !== null) {
8285
+ await db.latestAccountAssets.put({
8286
+ accountId: asset.accountId,
8287
+ vaultKey: asset.vaultKey,
8288
+ asset: asset.oldAsset,
8289
+ });
8290
+ }
8291
+ else {
8292
+ await db.latestAccountAssets
8293
+ .where("[accountId+vaultKey]")
8294
+ .equals([accountId, asset.vaultKey])
8295
+ .delete();
8296
+ }
8297
+ }
8298
+ }
8299
+ /**
8300
+ * Replaces an account's full state (storage, map entries, vault assets, header)
8301
+ * with a new snapshot. Before overwriting, all current latest values are archived
8302
+ * to historical.
8303
+ */
8169
8304
  async function applyFullAccountState(dbId, accountState) {
8170
8305
  try {
8171
8306
  const db = getDatabase(dbId);
@@ -8180,13 +8315,31 @@ async function applyFullAccountState(dbId, accountState) {
8180
8315
  db.latestAccountHeaders,
8181
8316
  db.historicalAccountHeaders,
8182
8317
  ], 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 = {
8318
+ // Archive: save current latest values to historical (so they can be
8319
+ // restored on undo), then replace latest with the new state.
8320
+ await archiveAndReplaceStorageSlots(db, accountId, nonce, storageSlots);
8321
+ await archiveAndReplaceMapEntries(db, accountId, nonce, storageMapEntries);
8322
+ await archiveAndReplaceVaultAssets(db, accountId, nonce, assets);
8323
+ // Archive old header and write new header
8324
+ const oldHeader = await db.latestAccountHeaders
8325
+ .where("id")
8326
+ .equals(accountId)
8327
+ .first();
8328
+ if (oldHeader) {
8329
+ await db.historicalAccountHeaders.put({
8330
+ id: accountId,
8331
+ replacedAtNonce: nonce,
8332
+ codeRoot: oldHeader.codeRoot,
8333
+ storageRoot: oldHeader.storageRoot,
8334
+ vaultRoot: oldHeader.vaultRoot,
8335
+ nonce: oldHeader.nonce,
8336
+ committed: oldHeader.committed,
8337
+ accountSeed: oldHeader.accountSeed,
8338
+ accountCommitment: oldHeader.accountCommitment,
8339
+ locked: oldHeader.locked,
8340
+ });
8341
+ }
8342
+ await db.latestAccountHeaders.put({
8190
8343
  id: accountId,
8191
8344
  codeRoot,
8192
8345
  storageRoot,
@@ -8196,9 +8349,7 @@ async function applyFullAccountState(dbId, accountState) {
8196
8349
  accountSeed,
8197
8350
  accountCommitment,
8198
8351
  locked: false,
8199
- };
8200
- await db.historicalAccountHeaders.put(data);
8201
- await db.latestAccountHeaders.put(data);
8352
+ });
8202
8353
  });
8203
8354
  }
8204
8355
  catch (error) {
@@ -8219,26 +8370,12 @@ async function upsertAccountRecord(dbId, accountId, codeRoot, storageRoot, vault
8219
8370
  accountCommitment: commitment,
8220
8371
  locked: false,
8221
8372
  };
8222
- await db.historicalAccountHeaders.put(data);
8223
8373
  await db.latestAccountHeaders.put(data);
8224
8374
  }
8225
8375
  catch (error) {
8226
8376
  logWebStoreError(error, `Error inserting account: ${accountId}`);
8227
8377
  }
8228
8378
  }
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
8379
  async function insertAccountAddress(dbId, accountId, address) {
8243
8380
  try {
8244
8381
  const db = getDatabase(dbId);
@@ -8328,96 +8465,87 @@ async function lockAccount(dbId, accountId) {
8328
8465
  }
8329
8466
  }
8330
8467
  /**
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.
8468
+ * Prunes historical account states for a single account up to the given nonce.
8469
+ *
8470
+ * Deletes all historical entries with `replacedAtNonce <= upToNonce` and any
8471
+ * orphaned account code. Mirrors the SQLite implementation.
8334
8472
  */
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);
8473
+ async function pruneAccountHistory(dbId, accountId, upToNonce) {
8474
+ try {
8475
+ const db = getDatabase(dbId);
8476
+ let totalDeleted = 0;
8477
+ const boundaryNonce = BigInt(upToNonce);
8478
+ await db.dexie.transaction("rw", [
8479
+ db.historicalAccountHeaders,
8480
+ db.historicalAccountStorages,
8481
+ db.historicalStorageMapEntries,
8482
+ db.historicalAccountAssets,
8483
+ db.accountCodes,
8484
+ db.latestAccountHeaders,
8485
+ db.foreignAccountCode,
8486
+ ], async () => {
8487
+ // Nonces are stored as strings so we cannot use index range queries
8488
+ // (lexicographic ordering would be wrong). Filter in JS instead.
8489
+ const headers = await db.historicalAccountHeaders
8490
+ .where("id")
8491
+ .equals(accountId)
8492
+ .toArray();
8493
+ const toPrune = headers.filter((h) => BigInt(h.replacedAtNonce) <= boundaryNonce);
8494
+ // Collect code roots from headers we are about to delete.
8495
+ const candidateCodeRoots = new Set(toPrune.map((h) => h.codeRoot));
8496
+ for (const h of toPrune) {
8497
+ await db.historicalAccountHeaders
8498
+ .where("accountCommitment")
8499
+ .equals(h.accountCommitment)
8500
+ .delete();
8501
+ const rat = h.replacedAtNonce;
8502
+ totalDeleted += 1;
8503
+ totalDeleted += await db.historicalAccountStorages
8504
+ .where("[accountId+replacedAtNonce]")
8505
+ .equals([accountId, rat])
8506
+ .delete();
8507
+ totalDeleted += await db.historicalStorageMapEntries
8508
+ .where("[accountId+replacedAtNonce]")
8509
+ .equals([accountId, rat])
8510
+ .delete();
8511
+ totalDeleted += await db.historicalAccountAssets
8512
+ .where("[accountId+replacedAtNonce]")
8513
+ .equals([accountId, rat])
8514
+ .delete();
8515
+ }
8516
+ // Delete orphaned code: only check roots from the deleted headers,
8517
+ // and only if they are not referenced by any remaining header or foreign code.
8518
+ if (candidateCodeRoots.size > 0) {
8519
+ const latestHeaders = await db.latestAccountHeaders.toArray();
8520
+ const remainingHistorical = await db.historicalAccountHeaders.toArray();
8521
+ const foreignCodes = await db.foreignAccountCode.toArray();
8522
+ const referencedCodeRoots = new Set();
8523
+ for (const h of latestHeaders)
8524
+ referencedCodeRoots.add(h.codeRoot);
8525
+ for (const h of remainingHistorical)
8526
+ referencedCodeRoots.add(h.codeRoot);
8527
+ for (const f of foreignCodes)
8528
+ referencedCodeRoots.add(f.codeRoot);
8529
+ for (const root of candidateCodeRoots) {
8530
+ if (!referencedCodeRoots.has(root)) {
8531
+ await db.accountCodes.where("root").equals(root).delete();
8532
+ totalDeleted += 1;
8533
+ }
8534
+ }
8535
+ }
8536
+ });
8537
+ return totalDeleted;
8353
8538
  }
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);
8539
+ catch (error) {
8540
+ logWebStoreError(error, `Error pruning account history for ${accountId}`);
8541
+ throw error;
8388
8542
  }
8389
8543
  }
8390
8544
  /**
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).
8545
+ * Undoes discarded account states by restoring old values from historical
8546
+ * back to latest. Non-null old values overwrite latest; null old values
8547
+ * (entries that didn't exist before that nonce) cause deletion from latest.
8394
8548
  */
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
8549
  async function undoAccountStates(dbId, accountCommitments) {
8422
8550
  try {
8423
8551
  const db = getDatabase(dbId);
@@ -8431,49 +8559,66 @@ async function undoAccountStates(dbId, accountCommitments) {
8431
8559
  db.latestAccountHeaders,
8432
8560
  db.historicalAccountHeaders,
8433
8561
  ], 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
8562
+ // Step 1: Resolve nonces from both latest and historical headers
8440
8563
  const accountNonces = new Map();
8441
- for (const record of affectedRecords) {
8442
- if (!accountNonces.has(record.id)) {
8443
- accountNonces.set(record.id, new Set());
8564
+ for (const commitment of accountCommitments) {
8565
+ const latestRecord = await db.latestAccountHeaders
8566
+ .where("accountCommitment")
8567
+ .equals(commitment)
8568
+ .first();
8569
+ if (latestRecord) {
8570
+ if (!accountNonces.has(latestRecord.id)) {
8571
+ accountNonces.set(latestRecord.id, new Set());
8572
+ }
8573
+ accountNonces.get(latestRecord.id).add(latestRecord.nonce);
8574
+ continue;
8575
+ }
8576
+ const histRecord = await db.historicalAccountHeaders
8577
+ .where("accountCommitment")
8578
+ .equals(commitment)
8579
+ .first();
8580
+ if (histRecord) {
8581
+ if (!accountNonces.has(histRecord.id)) {
8582
+ accountNonces.set(histRecord.id, new Set());
8583
+ }
8584
+ accountNonces.get(histRecord.id).add(histRecord.nonce);
8444
8585
  }
8445
- accountNonces.get(record.id).add(record.nonce);
8446
8586
  }
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
8587
+ // Step 2: Group nonces by account, sort descending (undo most recent first).
8588
+ // Descending order is needed because each nonce's old value is the state before
8589
+ // that nonce — processing most recent first lets earlier nonces overwrite with
8590
+ // the correct final value.
8453
8591
  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();
8592
+ const sortedNonces = [...nonces].sort((a, b) => Number(BigInt(b) - BigInt(a)));
8593
+ // Step 3: Restore old values from historical back to latest, undoing
8594
+ // each nonce in descending order. Non-null old values overwrite latest;
8595
+ // null old values (entries that didn't exist before) cause deletion.
8596
+ for (const nonce of sortedNonces) {
8597
+ await restoreSlotsFromHistorical(db, accountId, nonce);
8598
+ await restoreMapEntriesFromHistorical(db, accountId, nonce);
8599
+ await restoreAssetsFromHistorical(db, accountId, nonce);
8467
8600
  }
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
8601
+ // Step 4: Restore old header from the earliest discarded nonce
8602
+ const minNonce = sortedNonces[sortedNonces.length - 1];
8603
+ const oldHeader = await db.historicalAccountHeaders
8604
+ .where("[id+replacedAtNonce]")
8605
+ .equals([accountId, minNonce])
8606
+ .first();
8607
+ if (oldHeader) {
8608
+ await db.latestAccountHeaders.put({
8609
+ id: oldHeader.id,
8610
+ codeRoot: oldHeader.codeRoot,
8611
+ storageRoot: oldHeader.storageRoot,
8612
+ vaultRoot: oldHeader.vaultRoot,
8613
+ nonce: oldHeader.nonce,
8614
+ committed: oldHeader.committed,
8615
+ accountSeed: oldHeader.accountSeed,
8616
+ accountCommitment: oldHeader.accountCommitment,
8617
+ locked: oldHeader.locked,
8618
+ });
8619
+ }
8620
+ else {
8621
+ // No previous state — delete the account entirely
8477
8622
  await db.latestAccountHeaders
8478
8623
  .where("id")
8479
8624
  .equals(accountId)
@@ -8491,25 +8636,71 @@ async function undoAccountStates(dbId, accountCommitments) {
8491
8636
  .equals(accountId)
8492
8637
  .delete();
8493
8638
  }
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);
8639
+ // Step 5: Delete consumed historical entries at discarded nonces
8640
+ for (const nonce of sortedNonces) {
8641
+ await db.historicalAccountStorages
8642
+ .where("[accountId+replacedAtNonce]")
8643
+ .equals([accountId, nonce])
8644
+ .delete();
8645
+ await db.historicalStorageMapEntries
8646
+ .where("[accountId+replacedAtNonce]")
8647
+ .equals([accountId, nonce])
8648
+ .delete();
8649
+ await db.historicalAccountAssets
8650
+ .where("[accountId+replacedAtNonce]")
8651
+ .equals([accountId, nonce])
8652
+ .delete();
8653
+ await db.historicalAccountHeaders
8654
+ .where("[id+replacedAtNonce]")
8655
+ .equals([accountId, nonce])
8656
+ .delete();
8507
8657
  }
8508
8658
  }
8509
8659
  });
8510
8660
  }
8511
8661
  catch (error) {
8512
8662
  logWebStoreError(error, `Error undoing account states: ${accountCommitments.join(",")}`);
8663
+ throw error;
8664
+ }
8665
+ }
8666
+
8667
+ async function insertAccountAuth(dbId, pubKeyCommitmentHex, secretKey) {
8668
+ try {
8669
+ const db = getDatabase(dbId);
8670
+ const data = {
8671
+ pubKeyCommitmentHex,
8672
+ secretKeyHex: secretKey,
8673
+ };
8674
+ await db.accountAuths.add(data);
8675
+ }
8676
+ catch (error) {
8677
+ logWebStoreError(error, `Error inserting account auth for pubKey: ${pubKeyCommitmentHex}`);
8678
+ }
8679
+ }
8680
+ async function getAccountAuthByPubKeyCommitment(dbId, pubKeyCommitmentHex) {
8681
+ const db = getDatabase(dbId);
8682
+ const accountSecretKey = await db.accountAuths
8683
+ .where("pubKeyCommitmentHex")
8684
+ .equals(pubKeyCommitmentHex)
8685
+ .first();
8686
+ if (!accountSecretKey) {
8687
+ throw new Error("Account auth not found in cache.");
8688
+ }
8689
+ const data = {
8690
+ secretKey: accountSecretKey.secretKeyHex,
8691
+ };
8692
+ return data;
8693
+ }
8694
+ async function removeAccountAuth(dbId, pubKeyCommitmentHex) {
8695
+ try {
8696
+ const db = getDatabase(dbId);
8697
+ await db.accountAuths
8698
+ .where("pubKeyCommitmentHex")
8699
+ .equals(pubKeyCommitmentHex)
8700
+ .delete();
8701
+ }
8702
+ catch (error) {
8703
+ logWebStoreError(error, `Error removing account auth for pubKey: ${pubKeyCommitmentHex}`);
8513
8704
  }
8514
8705
  }
8515
8706
  async function insertAccountKeyMapping(dbId, accountIdHex, pubKeyCommitmentHex) {
@@ -8539,6 +8730,18 @@ async function getKeyCommitmentsByAccountId(dbId, accountIdHex) {
8539
8730
  return [];
8540
8731
  }
8541
8732
  }
8733
+ async function removeAllMappingsForKey(dbId, pubKeyCommitmentHex) {
8734
+ try {
8735
+ const db = getDatabase(dbId);
8736
+ await db.accountKeyMappings
8737
+ .where("pubKeyCommitmentHex")
8738
+ .equals(pubKeyCommitmentHex)
8739
+ .delete();
8740
+ }
8741
+ catch (error) {
8742
+ logWebStoreError(error, `Error removing all mappings for key: ${pubKeyCommitmentHex}`);
8743
+ }
8744
+ }
8542
8745
  async function getAccountIdByKeyCommitment(dbId, pubKeyCommitmentHex) {
8543
8746
  try {
8544
8747
  const db = getDatabase(dbId);
@@ -8636,6 +8839,19 @@ async function getTrackedBlockHeaders(dbId) {
8636
8839
  logWebStoreError(err, "Failed to get tracked block headers");
8637
8840
  }
8638
8841
  }
8842
+ async function getTrackedBlockHeaderNumbers(dbId) {
8843
+ try {
8844
+ const db = getDatabase(dbId);
8845
+ const blockNums = await db.blockHeaders
8846
+ .where("hasClientNotes")
8847
+ .equals("true")
8848
+ .primaryKeys();
8849
+ return blockNums;
8850
+ }
8851
+ catch (err) {
8852
+ logWebStoreError(err, "Failed to get tracked block header numbers");
8853
+ }
8854
+ }
8639
8855
  async function getPartialBlockchainPeaksByBlockNum(dbId, blockNum) {
8640
8856
  try {
8641
8857
  const db = getDatabase(dbId);
@@ -8717,7 +8933,10 @@ async function pruneIrrelevantBlocks(dbId) {
8717
8933
  async function recursivelyTransformForExport(obj) {
8718
8934
  switch (obj.type) {
8719
8935
  case "Uint8Array":
8720
- return Array.from(obj.value);
8936
+ return {
8937
+ __type: "Uint8Array",
8938
+ data: uint8ArrayToBase64(obj.value),
8939
+ };
8721
8940
  case "Blob":
8722
8941
  return {
8723
8942
  __type: "Blob",
@@ -8769,6 +8988,8 @@ async function recursivelyTransformForImport(obj) {
8769
8988
  switch (obj.type) {
8770
8989
  case "Blob":
8771
8990
  return new Blob([base64ToUint8Array(obj.value.data)]);
8991
+ case "Uint8Array":
8992
+ return base64ToUint8Array(obj.value.data);
8772
8993
  case "Array":
8773
8994
  return await Promise.all(obj.value.map((v) => recursivelyTransformForImport({ type: getImportType(v), value: v })));
8774
8995
  case "Object":
@@ -8787,6 +9008,9 @@ function getImportType(value) {
8787
9008
  if (value && typeof value === "object" && value.__type === "Blob") {
8788
9009
  return "Blob";
8789
9010
  }
9011
+ if (value && typeof value === "object" && value.__type === "Uint8Array") {
9012
+ return "Uint8Array";
9013
+ }
8790
9014
  if (Array.isArray(value))
8791
9015
  return "Array";
8792
9016
  if (value && typeof value === "object")
@@ -8946,9 +9170,9 @@ async function getNoteScript(dbId, scriptRoot) {
8946
9170
  logWebStoreError(err, "Failed to get note script from root");
8947
9171
  }
8948
9172
  }
8949
- async function upsertInputNote(dbId, noteId, assets, serialNumber, inputs, scriptRoot, serializedNoteScript, nullifier, serializedCreatedAt, stateDiscriminant, state) {
9173
+ async function upsertInputNote(dbId, noteId, assets, serialNumber, inputs, scriptRoot, serializedNoteScript, nullifier, serializedCreatedAt, stateDiscriminant, state, consumedBlockHeight, consumedTxOrder, consumerAccountId, tx) {
8950
9174
  const db = getDatabase(dbId);
8951
- return db.dexie.transaction("rw", db.inputNotes, db.notesScripts, async (tx) => {
9175
+ const doWork = async (t) => {
8952
9176
  try {
8953
9177
  const data = {
8954
9178
  noteId,
@@ -8960,22 +9184,59 @@ async function upsertInputNote(dbId, noteId, assets, serialNumber, inputs, scrip
8960
9184
  state,
8961
9185
  stateDiscriminant,
8962
9186
  serializedCreatedAt,
9187
+ // These fields are null for non-consumed notes.
9188
+ // Convert null -> undefined so Dexie omits them from compound indexes.
9189
+ consumedBlockHeight: consumedBlockHeight ?? undefined,
9190
+ consumedTxOrder: consumedTxOrder ?? undefined,
9191
+ consumerAccountId: consumerAccountId ?? undefined,
8963
9192
  };
8964
- await tx.inputNotes.put(data);
9193
+ await t.inputNotes.put(data);
8965
9194
  const noteScriptData = {
8966
9195
  scriptRoot,
8967
9196
  serializedNoteScript,
8968
9197
  };
8969
- await tx.notesScripts.put(noteScriptData);
9198
+ await t.notesScripts.put(noteScriptData);
8970
9199
  }
8971
9200
  catch (error) {
8972
9201
  logWebStoreError(error, `Error inserting note: ${noteId}`);
8973
9202
  }
8974
- });
9203
+ };
9204
+ return db.dexie.transaction("rw", db.inputNotes, db.notesScripts, doWork);
8975
9205
  }
8976
- async function upsertOutputNote(dbId, noteId, assets, recipientDigest, metadata, nullifier, expectedHeight, stateDiscriminant, state) {
9206
+ // Uses the [consumedBlockHeight+consumedTxOrder+noteId] compound index for cursor-based
9207
+ // iteration, filtering by consumer account.
9208
+ async function getInputNoteByOffset(dbId, states, consumerAccountId, blockStart, blockEnd, offset) {
9209
+ try {
9210
+ const db = getDatabase(dbId);
9211
+ // The compound index sorts by consumedBlockHeight, consumedTxOrder, noteId.
9212
+ // Rows without these fields are excluded by the index.
9213
+ const results = await db.inputNotes
9214
+ .orderBy("[consumedBlockHeight+consumedTxOrder+noteId]")
9215
+ .filter((n) => {
9216
+ if (states.length > 0 && !states.includes(n.stateDiscriminant))
9217
+ return false;
9218
+ if (n.consumerAccountId !== consumerAccountId)
9219
+ return false;
9220
+ if (blockStart != null && n.consumedBlockHeight < blockStart)
9221
+ return false;
9222
+ if (blockEnd != null && n.consumedBlockHeight > blockEnd)
9223
+ return false;
9224
+ return true;
9225
+ })
9226
+ .offset(offset)
9227
+ .limit(1)
9228
+ .toArray();
9229
+ if (results.length === 0)
9230
+ return [];
9231
+ return await processInputNotes(dbId, results);
9232
+ }
9233
+ catch (err) {
9234
+ logWebStoreError(err, "Failed to get input note by offset");
9235
+ }
9236
+ }
9237
+ async function upsertOutputNote(dbId, noteId, assets, recipientDigest, metadata, nullifier, expectedHeight, stateDiscriminant, state, tx) {
8977
9238
  const db = getDatabase(dbId);
8978
- return db.dexie.transaction("rw", db.outputNotes, db.notesScripts, async (tx) => {
9239
+ const doWork = async (t) => {
8979
9240
  try {
8980
9241
  const data = {
8981
9242
  noteId,
@@ -8987,12 +9248,13 @@ async function upsertOutputNote(dbId, noteId, assets, recipientDigest, metadata,
8987
9248
  stateDiscriminant,
8988
9249
  state,
8989
9250
  };
8990
- await tx.outputNotes.put(data);
9251
+ await t.outputNotes.put(data);
8991
9252
  }
8992
9253
  catch (error) {
8993
9254
  logWebStoreError(error, `Error inserting note: ${noteId}`);
8994
9255
  }
8995
- });
9256
+ };
9257
+ return db.dexie.transaction("rw", db.outputNotes, db.notesScripts, doWork);
8996
9258
  }
8997
9259
  async function processInputNotes(dbId, notes) {
8998
9260
  const db = getDatabase(dbId);
@@ -9190,7 +9452,7 @@ async function getTransactions(dbId, filter) {
9190
9452
  logWebStoreError(err, "Failed to get transactions");
9191
9453
  }
9192
9454
  }
9193
- async function insertTransactionScript(dbId, scriptRoot, txScript) {
9455
+ async function insertTransactionScript(dbId, scriptRoot, txScript, tx) {
9194
9456
  try {
9195
9457
  const db = getDatabase(dbId);
9196
9458
  const scriptRootArray = new Uint8Array(scriptRoot);
@@ -9199,13 +9461,13 @@ async function insertTransactionScript(dbId, scriptRoot, txScript) {
9199
9461
  scriptRoot: scriptRootBase64,
9200
9462
  txScript: mapOption(txScript, (txScript) => new Uint8Array(txScript)),
9201
9463
  };
9202
- await db.transactionScripts.put(data);
9464
+ await (tx || db).transactionScripts.put(data);
9203
9465
  }
9204
9466
  catch (error) {
9205
9467
  logWebStoreError(error, "Failed to insert transaction script");
9206
9468
  }
9207
9469
  }
9208
- async function upsertTransactionRecord(dbId, transactionId, details, blockNum, statusVariant, status, scriptRoot) {
9470
+ async function upsertTransactionRecord(dbId, transactionId, details, blockNum, statusVariant, status, scriptRoot, tx) {
9209
9471
  try {
9210
9472
  const db = getDatabase(dbId);
9211
9473
  const data = {
@@ -9216,7 +9478,7 @@ async function upsertTransactionRecord(dbId, transactionId, details, blockNum, s
9216
9478
  statusVariant,
9217
9479
  status,
9218
9480
  };
9219
- await db.transactions.put(data);
9481
+ await (tx || db).transactions.put(data);
9220
9482
  }
9221
9483
  catch (err) {
9222
9484
  logWebStoreError(err, "Failed to insert proven transaction data");
@@ -9317,7 +9579,7 @@ async function applyStateSync(dbId, stateUpdate) {
9317
9579
  return await db.dexie.transaction("rw", tablesToAccess, async (tx) => {
9318
9580
  await Promise.all([
9319
9581
  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);
9582
+ 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
9583
  })),
9322
9584
  Promise.all(serializedOutputNotes.map((note) => {
9323
9585
  return upsertOutputNote(dbId, note.noteId, note.noteAssets, note.recipientDigest, note.metadata, note.nullifier, note.expectedHeight, note.stateDiscriminant, note.state);
@@ -9331,14 +9593,19 @@ async function applyStateSync(dbId, stateUpdate) {
9331
9593
  }
9332
9594
  return Promise.all(promises);
9333
9595
  })),
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
- })),
9596
+ Promise.all(accountUpdates.map((accountUpdate) => applyFullAccountState(dbId, {
9597
+ accountId: accountUpdate.accountId,
9598
+ nonce: accountUpdate.nonce,
9599
+ storageSlots: accountUpdate.storageSlots,
9600
+ storageMapEntries: accountUpdate.storageMapEntries,
9601
+ assets: accountUpdate.assets,
9602
+ codeRoot: accountUpdate.codeRoot,
9603
+ storageRoot: accountUpdate.storageRoot,
9604
+ vaultRoot: accountUpdate.vaultRoot,
9605
+ committed: accountUpdate.committed,
9606
+ accountCommitment: accountUpdate.accountCommitment,
9607
+ accountSeed: accountUpdate.accountSeed,
9608
+ }))),
9342
9609
  updateSyncHeight(tx, blockNum),
9343
9610
  updatePartialBlockchainNodes(tx, serializedNodeIds, serializedNodes),
9344
9611
  updateCommittedNoteTags(tx, committedNoteIds),
@@ -9697,13 +9964,20 @@ class AccountBuilder {
9697
9964
  }
9698
9965
  /**
9699
9966
  * Sets the account type (regular, faucet, etc.).
9700
- * @param {AccountType} account_type
9967
+ *
9968
+ * Accepts either a numeric WASM enum value (0–3) or a string name
9969
+ * (`"FungibleFaucet"`, `"NonFungibleFaucet"`,
9970
+ * `"RegularAccountImmutableCode"`, `"RegularAccountUpdatableCode"`).
9971
+ * @param {any} account_type
9701
9972
  * @returns {AccountBuilder}
9702
9973
  */
9703
9974
  accountType(account_type) {
9704
9975
  const ptr = this.__destroy_into_raw();
9705
9976
  const ret = wasm.accountbuilder_accountType(ptr, account_type);
9706
- return AccountBuilder.__wrap(ret);
9977
+ if (ret[2]) {
9978
+ throw takeFromExternrefTable0(ret[1]);
9979
+ }
9980
+ return AccountBuilder.__wrap(ret[0]);
9707
9981
  }
9708
9982
  /**
9709
9983
  * Builds the account and returns it together with the derived seed.
@@ -9965,6 +10239,10 @@ class AccountComponent {
9965
10239
  }
9966
10240
  /**
9967
10241
  * Returns the hex-encoded MAST root for a procedure by name.
10242
+ *
10243
+ * Matches by full path, relative path, or local name (after the last `::`).
10244
+ * When matching by local name, if multiple procedures share the same local
10245
+ * name across modules, the first match is returned.
9968
10246
  * @param {string} procedure_name
9969
10247
  * @returns {string}
9970
10248
  */
@@ -10339,6 +10617,26 @@ class AccountId {
10339
10617
  }
10340
10618
  return AccountId.__wrap(ret[0]);
10341
10619
  }
10620
+ /**
10621
+ * Builds an account ID from its prefix and suffix field elements.
10622
+ *
10623
+ * This is useful when the account ID components are stored separately (e.g., in storage
10624
+ * maps) and need to be recombined into an `AccountId`.
10625
+ *
10626
+ * Returns an error if the provided felts do not form a valid account ID.
10627
+ * @param {Felt} prefix
10628
+ * @param {Felt} suffix
10629
+ * @returns {AccountId}
10630
+ */
10631
+ static fromPrefixSuffix(prefix, suffix) {
10632
+ _assertClass(prefix, Felt);
10633
+ _assertClass(suffix, Felt);
10634
+ const ret = wasm.accountid_fromPrefixSuffix(prefix.__wbg_ptr, suffix.__wbg_ptr);
10635
+ if (ret[2]) {
10636
+ throw takeFromExternrefTable0(ret[1]);
10637
+ }
10638
+ return AccountId.__wrap(ret[0]);
10639
+ }
10342
10640
  /**
10343
10641
  * Returns true if the ID refers to a faucet.
10344
10642
  * @returns {boolean}
@@ -10523,7 +10821,8 @@ const AccountInterface = Object.freeze({
10523
10821
  /**
10524
10822
  * Proof of existence of an account's state at a specific block number, as returned by the node.
10525
10823
  *
10526
- * For public accounts, this includes the account header, storage slot values and account code.
10824
+ * For public accounts, this includes the account header, storage slot values, account code,
10825
+ * and optionally storage map entries for the requested storage maps.
10527
10826
  * For private accounts, only the account commitment and merkle proof are available.
10528
10827
  */
10529
10828
  class AccountProof {
@@ -10584,6 +10883,46 @@ class AccountProof {
10584
10883
  const ret = wasm.accountproof_blockNum(this.__wbg_ptr);
10585
10884
  return ret >>> 0;
10586
10885
  }
10886
+ /**
10887
+ * Returns storage map entries for a given slot name, if available.
10888
+ *
10889
+ * Returns `undefined` if the account is private, the slot was not requested in the
10890
+ * storage requirements, or the slot is not a map.
10891
+ *
10892
+ * Each entry contains a `key` and `value` as `Word` objects.
10893
+ * @param {string} slot_name
10894
+ * @returns {StorageMapEntry[] | undefined}
10895
+ */
10896
+ getStorageMapEntries(slot_name) {
10897
+ const ptr0 = passStringToWasm0(slot_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10898
+ const len0 = WASM_VECTOR_LEN;
10899
+ const ret = wasm.accountproof_getStorageMapEntries(this.__wbg_ptr, ptr0, len0);
10900
+ if (ret[3]) {
10901
+ throw takeFromExternrefTable0(ret[2]);
10902
+ }
10903
+ let v2;
10904
+ if (ret[0] !== 0) {
10905
+ v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
10906
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10907
+ }
10908
+ return v2;
10909
+ }
10910
+ /**
10911
+ * Returns the names of all storage slots that have map details available.
10912
+ *
10913
+ * This can be used to discover which storage maps were included in the proof response.
10914
+ * Returns `undefined` if the account is private.
10915
+ * @returns {string[] | undefined}
10916
+ */
10917
+ getStorageMapSlotNames() {
10918
+ const ret = wasm.accountproof_getStorageMapSlotNames(this.__wbg_ptr);
10919
+ let v1;
10920
+ if (ret[0] !== 0) {
10921
+ v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
10922
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10923
+ }
10924
+ return v1;
10925
+ }
10587
10926
  /**
10588
10927
  * Returns the value of a storage slot by name, if available.
10589
10928
  *
@@ -10603,6 +10942,25 @@ class AccountProof {
10603
10942
  }
10604
10943
  return ret[0] === 0 ? undefined : Word.__wrap(ret[0]);
10605
10944
  }
10945
+ /**
10946
+ * Returns whether a storage map slot had too many entries to return inline.
10947
+ *
10948
+ * When this returns `true`, use `RpcClient.syncStorageMaps()` to fetch the full
10949
+ * storage map data.
10950
+ *
10951
+ * Returns `undefined` if the slot was not found or the account is private.
10952
+ * @param {string} slot_name
10953
+ * @returns {boolean | undefined}
10954
+ */
10955
+ hasStorageMapTooManyEntries(slot_name) {
10956
+ const ptr0 = passStringToWasm0(slot_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10957
+ const len0 = WASM_VECTOR_LEN;
10958
+ const ret = wasm.accountproof_hasStorageMapTooManyEntries(this.__wbg_ptr, ptr0, len0);
10959
+ if (ret[2]) {
10960
+ throw takeFromExternrefTable0(ret[1]);
10961
+ }
10962
+ return ret[0] === 0xFFFFFF ? undefined : ret[0] !== 0;
10963
+ }
10606
10964
  /**
10607
10965
  * Returns the number of storage slots, if available (public accounts only).
10608
10966
  * @returns {number | undefined}
@@ -11366,6 +11724,16 @@ class AdviceInputs {
11366
11724
  }
11367
11725
  return v1;
11368
11726
  }
11727
+ /**
11728
+ * `wasm_bindgen` requires an explicit constructor; `#[derive(Default)]` alone
11729
+ * is not callable from JS.
11730
+ */
11731
+ constructor() {
11732
+ const ret = wasm.adviceinputs_new();
11733
+ this.__wbg_ptr = ret >>> 0;
11734
+ AdviceInputsFinalization.register(this, this.__wbg_ptr, this);
11735
+ return this;
11736
+ }
11369
11737
  /**
11370
11738
  * Returns the stack inputs as a vector of felts.
11371
11739
  * @returns {Felt[]}
@@ -11478,7 +11846,7 @@ class AssetVault {
11478
11846
  * @returns {Word}
11479
11847
  */
11480
11848
  root() {
11481
- const ret = wasm.accountcode_commitment(this.__wbg_ptr);
11849
+ const ret = wasm.accountheader_codeCommitment(this.__wbg_ptr);
11482
11850
  return Word.__wrap(ret);
11483
11851
  }
11484
11852
  }
@@ -11748,7 +12116,7 @@ class BasicFungibleFaucetComponent {
11748
12116
  * @returns {Felt}
11749
12117
  */
11750
12118
  maxSupply() {
11751
- const ret = wasm.accountid_suffix(this.__wbg_ptr);
12119
+ const ret = wasm.accountid_prefix(this.__wbg_ptr);
11752
12120
  return Felt.__wrap(ret);
11753
12121
  }
11754
12122
  /**
@@ -11883,7 +12251,7 @@ class BlockHeader {
11883
12251
  * @returns {Word}
11884
12252
  */
11885
12253
  txKernelCommitment() {
11886
- const ret = wasm.accountbuilderresult_seed(this.__wbg_ptr);
12254
+ const ret = wasm.blockheader_txKernelCommitment(this.__wbg_ptr);
11887
12255
  return Word.__wrap(ret);
11888
12256
  }
11889
12257
  /**
@@ -12042,7 +12410,7 @@ class CodeBuilder {
12042
12410
  if (Symbol.dispose) CodeBuilder.prototype[Symbol.dispose] = CodeBuilder.prototype.free;
12043
12411
 
12044
12412
  /**
12045
- * Represents a note committed on chain, as returned by `syncNotes`.
12413
+ * Represents a note committed on chain.
12046
12414
  */
12047
12415
  class CommittedNote {
12048
12416
  static __wrap(ptr) {
@@ -12063,15 +12431,34 @@ class CommittedNote {
12063
12431
  wasm.__wbg_committednote_free(ptr, 0);
12064
12432
  }
12065
12433
  /**
12066
- * Returns the inclusion path for the note.
12434
+ * Returns the full note metadata when the attachment payload is available.
12435
+ * @returns {NoteMetadata | undefined}
12436
+ */
12437
+ fullMetadata() {
12438
+ const ret = wasm.committednote_fullMetadata(this.__wbg_ptr);
12439
+ return ret === 0 ? undefined : NoteMetadata.__wrap(ret);
12440
+ }
12441
+ /**
12442
+ * Returns the inclusion path for the note in the block's note tree.
12067
12443
  * @returns {SparseMerklePath}
12068
12444
  */
12069
12445
  inclusionPath() {
12070
12446
  const ret = wasm.committednote_inclusionPath(this.__wbg_ptr);
12071
12447
  return SparseMerklePath.__wrap(ret);
12072
12448
  }
12449
+ /**
12450
+ * Returns the inclusion proof for this note.
12451
+ * @returns {NoteInclusionProof}
12452
+ */
12453
+ inclusionProof() {
12454
+ const ret = wasm.committednote_inclusionProof(this.__wbg_ptr);
12455
+ return NoteInclusionProof.__wrap(ret);
12456
+ }
12073
12457
  /**
12074
12458
  * Returns the note metadata.
12459
+ *
12460
+ * If only metadata headers are available, the returned metadata contains
12461
+ * the sender, note type, and tag without attachment payload.
12075
12462
  * @returns {NoteMetadata}
12076
12463
  */
12077
12464
  metadata() {
@@ -12094,6 +12481,30 @@ class CommittedNote {
12094
12481
  const ret = wasm.committednote_noteIndex(this.__wbg_ptr);
12095
12482
  return ret;
12096
12483
  }
12484
+ /**
12485
+ * Returns the note type (public, private, etc.).
12486
+ * @returns {NoteType}
12487
+ */
12488
+ noteType() {
12489
+ const ret = wasm.committednote_noteType(this.__wbg_ptr);
12490
+ return ret;
12491
+ }
12492
+ /**
12493
+ * Returns the note sender, even when only header metadata is available.
12494
+ * @returns {AccountId}
12495
+ */
12496
+ sender() {
12497
+ const ret = wasm.committednote_sender(this.__wbg_ptr);
12498
+ return AccountId.__wrap(ret);
12499
+ }
12500
+ /**
12501
+ * Returns the note tag.
12502
+ * @returns {number}
12503
+ */
12504
+ tag() {
12505
+ const ret = wasm.committednote_tag(this.__wbg_ptr);
12506
+ return ret >>> 0;
12507
+ }
12097
12508
  }
12098
12509
  if (Symbol.dispose) CommittedNote.prototype[Symbol.dispose] = CommittedNote.prototype.free;
12099
12510
 
@@ -12601,7 +13012,7 @@ class FetchedAccount {
12601
13012
  * @returns {number}
12602
13013
  */
12603
13014
  lastBlockNum() {
12604
- const ret = wasm.fetchedaccount_lastBlockNum(this.__wbg_ptr);
13015
+ const ret = wasm.accountproof_blockNum(this.__wbg_ptr);
12605
13016
  return ret >>> 0;
12606
13017
  }
12607
13018
  }
@@ -14360,7 +14771,6 @@ class JsVaultAsset {
14360
14771
  toJSON() {
14361
14772
  return {
14362
14773
  asset: this.asset,
14363
- faucetIdPrefix: this.faucetIdPrefix,
14364
14774
  vaultKey: this.vaultKey,
14365
14775
  };
14366
14776
  }
@@ -14393,22 +14803,6 @@ class JsVaultAsset {
14393
14803
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
14394
14804
  }
14395
14805
  }
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
14806
  /**
14413
14807
  * The vault key associated with the asset.
14414
14808
  * @returns {string}
@@ -14430,15 +14824,6 @@ class JsVaultAsset {
14430
14824
  * @param {string} arg0
14431
14825
  */
14432
14826
  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
14827
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14443
14828
  const len0 = WASM_VECTOR_LEN;
14444
14829
  wasm.__wbg_set_jsstoragemapentry_key(this.__wbg_ptr, ptr0, len0);
@@ -14506,7 +14891,10 @@ class MerklePath {
14506
14891
  computeRoot(index, node) {
14507
14892
  _assertClass(node, Word);
14508
14893
  const ret = wasm.merklepath_computeRoot(this.__wbg_ptr, index, node.__wbg_ptr);
14509
- return Word.__wrap(ret);
14894
+ if (ret[2]) {
14895
+ throw takeFromExternrefTable0(ret[1]);
14896
+ }
14897
+ return Word.__wrap(ret[0]);
14510
14898
  }
14511
14899
  /**
14512
14900
  * Returns the depth of the path.
@@ -14763,7 +15151,7 @@ class Note {
14763
15151
  * @returns {Word}
14764
15152
  */
14765
15153
  nullifier() {
14766
- const ret = wasm.accountcode_commitment(this.__wbg_ptr);
15154
+ const ret = wasm.note_nullifier(this.__wbg_ptr);
14767
15155
  return Word.__wrap(ret);
14768
15156
  }
14769
15157
  /**
@@ -14824,13 +15212,12 @@ class NoteAndArgs {
14824
15212
  */
14825
15213
  constructor(note, args) {
14826
15214
  _assertClass(note, Note);
14827
- var ptr0 = note.__destroy_into_raw();
14828
- let ptr1 = 0;
15215
+ let ptr0 = 0;
14829
15216
  if (!isLikeNone(args)) {
14830
15217
  _assertClass(args, Word);
14831
- ptr1 = args.__destroy_into_raw();
15218
+ ptr0 = args.__destroy_into_raw();
14832
15219
  }
14833
- const ret = wasm.noteandargs_new(ptr0, ptr1);
15220
+ const ret = wasm.noteandargs_new(note.__wbg_ptr, ptr0);
14834
15221
  this.__wbg_ptr = ret >>> 0;
14835
15222
  NoteAndArgsFinalization.register(this, this.__wbg_ptr, this);
14836
15223
  return this;
@@ -14908,6 +15295,76 @@ class NoteAndArgsArray {
14908
15295
  }
14909
15296
  if (Symbol.dispose) NoteAndArgsArray.prototype[Symbol.dispose] = NoteAndArgsArray.prototype.free;
14910
15297
 
15298
+ class NoteArray {
15299
+ toJSON() {
15300
+ return {
15301
+ };
15302
+ }
15303
+ toString() {
15304
+ return JSON.stringify(this);
15305
+ }
15306
+ __destroy_into_raw() {
15307
+ const ptr = this.__wbg_ptr;
15308
+ this.__wbg_ptr = 0;
15309
+ NoteArrayFinalization.unregister(this);
15310
+ return ptr;
15311
+ }
15312
+ free() {
15313
+ const ptr = this.__destroy_into_raw();
15314
+ wasm.__wbg_notearray_free(ptr, 0);
15315
+ }
15316
+ /**
15317
+ * Get element at index, will always return a clone to avoid aliasing issues.
15318
+ * @param {number} index
15319
+ * @returns {Note}
15320
+ */
15321
+ get(index) {
15322
+ const ret = wasm.notearray_get(this.__wbg_ptr, index);
15323
+ if (ret[2]) {
15324
+ throw takeFromExternrefTable0(ret[1]);
15325
+ }
15326
+ return Note.__wrap(ret[0]);
15327
+ }
15328
+ /**
15329
+ * @returns {number}
15330
+ */
15331
+ length() {
15332
+ const ret = wasm.notearray_length(this.__wbg_ptr);
15333
+ return ret >>> 0;
15334
+ }
15335
+ /**
15336
+ * @param {Note[] | null} [elements]
15337
+ */
15338
+ constructor(elements) {
15339
+ var ptr0 = isLikeNone(elements) ? 0 : passArrayJsValueToWasm0(elements, wasm.__wbindgen_malloc);
15340
+ var len0 = WASM_VECTOR_LEN;
15341
+ const ret = wasm.notearray_new(ptr0, len0);
15342
+ this.__wbg_ptr = ret >>> 0;
15343
+ NoteArrayFinalization.register(this, this.__wbg_ptr, this);
15344
+ return this;
15345
+ }
15346
+ /**
15347
+ * @param {Note} element
15348
+ */
15349
+ push(element) {
15350
+ _assertClass(element, Note);
15351
+ wasm.notearray_push(this.__wbg_ptr, element.__wbg_ptr);
15352
+ }
15353
+ /**
15354
+ * @param {number} index
15355
+ * @param {Note} elem
15356
+ */
15357
+ replaceAt(index, elem) {
15358
+ _assertClass(elem, Note);
15359
+ var ptr0 = elem.__destroy_into_raw();
15360
+ const ret = wasm.notearray_replaceAt(this.__wbg_ptr, index, ptr0);
15361
+ if (ret[1]) {
15362
+ throw takeFromExternrefTable0(ret[0]);
15363
+ }
15364
+ }
15365
+ }
15366
+ if (Symbol.dispose) NoteArray.prototype[Symbol.dispose] = NoteArray.prototype.free;
15367
+
14911
15368
  /**
14912
15369
  * An asset container for a note.
14913
15370
  *
@@ -15530,7 +15987,10 @@ class NoteExecutionHint {
15530
15987
  */
15531
15988
  canBeConsumed(block_num) {
15532
15989
  const ret = wasm.noteexecutionhint_canBeConsumed(this.__wbg_ptr, block_num);
15533
- return ret !== 0;
15990
+ if (ret[2]) {
15991
+ throw takeFromExternrefTable0(ret[1]);
15992
+ }
15993
+ return ret[0] !== 0;
15534
15994
  }
15535
15995
  /**
15536
15996
  * Reconstructs a hint from its encoded tag and payload.
@@ -15540,7 +16000,10 @@ class NoteExecutionHint {
15540
16000
  */
15541
16001
  static fromParts(tag, payload) {
15542
16002
  const ret = wasm.noteexecutionhint_fromParts(tag, payload);
15543
- return NoteExecutionHint.__wrap(ret);
16003
+ if (ret[2]) {
16004
+ throw takeFromExternrefTable0(ret[1]);
16005
+ }
16006
+ return NoteExecutionHint.__wrap(ret[0]);
15544
16007
  }
15545
16008
  /**
15546
16009
  * Creates a hint that does not specify any execution constraint.
@@ -15814,14 +16277,6 @@ class NoteHeader {
15814
16277
  const ptr = this.__destroy_into_raw();
15815
16278
  wasm.__wbg_noteheader_free(ptr, 0);
15816
16279
  }
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
16280
  /**
15826
16281
  * Returns the unique identifier for the note.
15827
16282
  * @returns {NoteId}
@@ -15838,6 +16293,14 @@ class NoteHeader {
15838
16293
  const ret = wasm.noteheader_metadata(this.__wbg_ptr);
15839
16294
  return NoteMetadata.__wrap(ret);
15840
16295
  }
16296
+ /**
16297
+ * Returns a commitment to the note ID and metadata.
16298
+ * @returns {Word}
16299
+ */
16300
+ toCommitment() {
16301
+ const ret = wasm.noteheader_toCommitment(this.__wbg_ptr);
16302
+ return Word.__wrap(ret);
16303
+ }
15841
16304
  }
15842
16305
  if (Symbol.dispose) NoteHeader.prototype[Symbol.dispose] = NoteHeader.prototype.free;
15843
16306
 
@@ -16107,20 +16570,20 @@ class NoteLocation {
16107
16570
  wasm.__wbg_notelocation_free(ptr, 0);
16108
16571
  }
16109
16572
  /**
16110
- * Returns the block height containing the note.
16573
+ * Returns the index of the note leaf within the block's note tree.
16111
16574
  * @returns {number}
16112
16575
  */
16113
- blockNum() {
16114
- const ret = wasm.noteattachmentscheme_asU32(this.__wbg_ptr);
16115
- return ret >>> 0;
16576
+ blockNoteTreeIndex() {
16577
+ const ret = wasm.notelocation_blockNoteTreeIndex(this.__wbg_ptr);
16578
+ return ret;
16116
16579
  }
16117
16580
  /**
16118
- * Returns the index of the note leaf within the block's note tree.
16581
+ * Returns the block height containing the note.
16119
16582
  * @returns {number}
16120
16583
  */
16121
- nodeIndexInBlock() {
16122
- const ret = wasm.notelocation_nodeIndexInBlock(this.__wbg_ptr);
16123
- return ret;
16584
+ blockNum() {
16585
+ const ret = wasm.noteattachmentscheme_asU32(this.__wbg_ptr);
16586
+ return ret >>> 0;
16124
16587
  }
16125
16588
  }
16126
16589
  if (Symbol.dispose) NoteLocation.prototype[Symbol.dispose] = NoteLocation.prototype.free;
@@ -16415,7 +16878,8 @@ class NoteScript {
16415
16878
  }
16416
16879
  /**
16417
16880
  * Creates a `NoteScript` from the given `Package`.
16418
- * Throws if the package is invalid.
16881
+ * The package must contain a library with exactly one procedure annotated with
16882
+ * `@note_script`.
16419
16883
  * @param {Package} _package
16420
16884
  * @returns {NoteScript}
16421
16885
  */
@@ -16530,13 +16994,66 @@ class NoteStorage {
16530
16994
  constructor(felt_array) {
16531
16995
  _assertClass(felt_array, FeltArray);
16532
16996
  const ret = wasm.notestorage_new(felt_array.__wbg_ptr);
16533
- this.__wbg_ptr = ret >>> 0;
16997
+ if (ret[2]) {
16998
+ throw takeFromExternrefTable0(ret[1]);
16999
+ }
17000
+ this.__wbg_ptr = ret[0] >>> 0;
16534
17001
  NoteStorageFinalization.register(this, this.__wbg_ptr, this);
16535
17002
  return this;
16536
17003
  }
16537
17004
  }
16538
17005
  if (Symbol.dispose) NoteStorage.prototype[Symbol.dispose] = NoteStorage.prototype.free;
16539
17006
 
17007
+ /**
17008
+ * Represents a single block's worth of note sync data.
17009
+ */
17010
+ class NoteSyncBlock {
17011
+ static __wrap(ptr) {
17012
+ ptr = ptr >>> 0;
17013
+ const obj = Object.create(NoteSyncBlock.prototype);
17014
+ obj.__wbg_ptr = ptr;
17015
+ NoteSyncBlockFinalization.register(obj, obj.__wbg_ptr, obj);
17016
+ return obj;
17017
+ }
17018
+ __destroy_into_raw() {
17019
+ const ptr = this.__wbg_ptr;
17020
+ this.__wbg_ptr = 0;
17021
+ NoteSyncBlockFinalization.unregister(this);
17022
+ return ptr;
17023
+ }
17024
+ free() {
17025
+ const ptr = this.__destroy_into_raw();
17026
+ wasm.__wbg_notesyncblock_free(ptr, 0);
17027
+ }
17028
+ /**
17029
+ * Returns the block header for this block.
17030
+ * @returns {BlockHeader}
17031
+ */
17032
+ blockHeader() {
17033
+ const ret = wasm.notesyncblock_blockHeader(this.__wbg_ptr);
17034
+ return BlockHeader.__wrap(ret);
17035
+ }
17036
+ /**
17037
+ * Returns the MMR path for the block header.
17038
+ * @returns {MerklePath}
17039
+ */
17040
+ mmrPath() {
17041
+ const ret = wasm.notesyncblock_mmrPath(this.__wbg_ptr);
17042
+ return MerklePath.__wrap(ret);
17043
+ }
17044
+ /**
17045
+ * Returns the committed notes in this block.
17046
+ * @returns {CommittedNote[]}
17047
+ */
17048
+ notes() {
17049
+ const ret = wasm.notesyncblock_notes(this.__wbg_ptr);
17050
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
17051
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17052
+ return v1;
17053
+ }
17054
+ }
17055
+ if (Symbol.dispose) NoteSyncBlock.prototype[Symbol.dispose] = NoteSyncBlock.prototype.free;
17056
+
16540
17057
  /**
16541
17058
  * Represents the response data from `syncNotes`.
16542
17059
  */
@@ -16559,31 +17076,49 @@ class NoteSyncInfo {
16559
17076
  wasm.__wbg_notesyncinfo_free(ptr, 0);
16560
17077
  }
16561
17078
  /**
16562
- * Returns the block header associated with the matching notes.
16563
- * @returns {BlockHeader}
17079
+ * Returns the first block header associated with matching notes, if any.
17080
+ * @returns {BlockHeader | undefined}
16564
17081
  */
16565
17082
  blockHeader() {
16566
17083
  const ret = wasm.notesyncinfo_blockHeader(this.__wbg_ptr);
16567
- return BlockHeader.__wrap(ret);
17084
+ return ret === 0 ? undefined : BlockHeader.__wrap(ret);
17085
+ }
17086
+ /**
17087
+ * Returns the last block checked by the node. Used as a cursor for pagination.
17088
+ * @returns {number}
17089
+ */
17090
+ blockTo() {
17091
+ const ret = wasm.notesyncinfo_blockTo(this.__wbg_ptr);
17092
+ return ret >>> 0;
17093
+ }
17094
+ /**
17095
+ * Returns the blocks containing matching notes.
17096
+ * @returns {NoteSyncBlock[]}
17097
+ */
17098
+ blocks() {
17099
+ const ret = wasm.notesyncinfo_blocks(this.__wbg_ptr);
17100
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
17101
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17102
+ return v1;
16568
17103
  }
16569
17104
  /**
16570
17105
  * Returns the latest block number in the chain.
16571
17106
  * @returns {number}
16572
17107
  */
16573
17108
  chainTip() {
16574
- const ret = wasm.notesyncinfo_chainTip(this.__wbg_ptr);
17109
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
16575
17110
  return ret >>> 0;
16576
17111
  }
16577
17112
  /**
16578
- * Returns the MMR path for the block header.
16579
- * @returns {MerklePath}
17113
+ * Returns the first block MMR path associated with matching notes, if any.
17114
+ * @returns {MerklePath | undefined}
16580
17115
  */
16581
17116
  mmrPath() {
16582
17117
  const ret = wasm.notesyncinfo_mmrPath(this.__wbg_ptr);
16583
- return MerklePath.__wrap(ret);
17118
+ return ret === 0 ? undefined : MerklePath.__wrap(ret);
16584
17119
  }
16585
17120
  /**
16586
- * Returns the committed notes returned by the node.
17121
+ * Returns the committed notes across all matching blocks.
16587
17122
  * @returns {CommittedNote[]}
16588
17123
  */
16589
17124
  notes() {
@@ -16686,7 +17221,7 @@ const NoteType = Object.freeze({
16686
17221
  });
16687
17222
 
16688
17223
  /**
16689
- * Representation of a note produced by a transaction (full, partial, or header-only).
17224
+ * Representation of a note produced by a transaction (full or partial).
16690
17225
  */
16691
17226
  class OutputNote {
16692
17227
  static __wrap(ptr) {
@@ -16730,16 +17265,6 @@ class OutputNote {
16730
17265
  const ret = wasm.outputnote_full(note.__wbg_ptr);
16731
17266
  return OutputNote.__wrap(ret);
16732
17267
  }
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
17268
  /**
16744
17269
  * Returns the note ID for this output.
16745
17270
  * @returns {NoteId}
@@ -16776,20 +17301,12 @@ class OutputNote {
16776
17301
  return OutputNote.__wrap(ret);
16777
17302
  }
16778
17303
  /**
16779
- * Returns the recipient digest if the recipient is known.
16780
- * @returns {Word | undefined}
17304
+ * Returns the recipient digest.
17305
+ * @returns {Word}
16781
17306
  */
16782
17307
  recipientDigest() {
16783
17308
  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);
17309
+ return Word.__wrap(ret);
16793
17310
  }
16794
17311
  }
16795
17312
  if (Symbol.dispose) OutputNote.prototype[Symbol.dispose] = OutputNote.prototype.free;
@@ -16828,7 +17345,7 @@ class OutputNoteArray {
16828
17345
  * @returns {number}
16829
17346
  */
16830
17347
  length() {
16831
- const ret = wasm.outputnotearray_length(this.__wbg_ptr);
17348
+ const ret = wasm.notearray_length(this.__wbg_ptr);
16832
17349
  return ret >>> 0;
16833
17350
  }
16834
17351
  /**
@@ -17004,12 +17521,6 @@ class OutputNotes {
17004
17521
  OutputNotesFinalization.register(obj, obj.__wbg_ptr, obj);
17005
17522
  return obj;
17006
17523
  }
17007
- static __unwrap(jsValue) {
17008
- if (!(jsValue instanceof OutputNotes)) {
17009
- return 0;
17010
- }
17011
- return jsValue.__destroy_into_raw();
17012
- }
17013
17524
  __destroy_into_raw() {
17014
17525
  const ptr = this.__wbg_ptr;
17015
17526
  this.__wbg_ptr = 0;
@@ -17056,85 +17567,15 @@ class OutputNotes {
17056
17567
  return v1;
17057
17568
  }
17058
17569
  /**
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);
17123
- }
17124
- /**
17125
- * @param {number} index
17126
- * @param {OutputNotes} elem
17570
+ * Returns the number of notes emitted.
17571
+ * @returns {number}
17127
17572
  */
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
- }
17573
+ numNotes() {
17574
+ const ret = wasm.outputnotes_numNotes(this.__wbg_ptr);
17575
+ return ret >>> 0;
17135
17576
  }
17136
17577
  }
17137
- if (Symbol.dispose) OutputNotesArray.prototype[Symbol.dispose] = OutputNotesArray.prototype.free;
17578
+ if (Symbol.dispose) OutputNotes.prototype[Symbol.dispose] = OutputNotes.prototype.free;
17138
17579
 
17139
17580
  /**
17140
17581
  * Compiled VM package containing libraries and metadata.
@@ -17259,6 +17700,33 @@ class PartialNote {
17259
17700
  }
17260
17701
  if (Symbol.dispose) PartialNote.prototype[Symbol.dispose] = PartialNote.prototype.free;
17261
17702
 
17703
+ /**
17704
+ * Poseidon2 hashing helpers exposed to JavaScript.
17705
+ */
17706
+ class Poseidon2 {
17707
+ __destroy_into_raw() {
17708
+ const ptr = this.__wbg_ptr;
17709
+ this.__wbg_ptr = 0;
17710
+ Poseidon2Finalization.unregister(this);
17711
+ return ptr;
17712
+ }
17713
+ free() {
17714
+ const ptr = this.__destroy_into_raw();
17715
+ wasm.__wbg_poseidon2_free(ptr, 0);
17716
+ }
17717
+ /**
17718
+ * Computes a Poseidon2 digest from the provided field elements.
17719
+ * @param {FeltArray} felt_array
17720
+ * @returns {Word}
17721
+ */
17722
+ static hashElements(felt_array) {
17723
+ _assertClass(felt_array, FeltArray);
17724
+ const ret = wasm.poseidon2_hashElements(felt_array.__wbg_ptr);
17725
+ return Word.__wrap(ret);
17726
+ }
17727
+ }
17728
+ if (Symbol.dispose) Poseidon2.prototype[Symbol.dispose] = Poseidon2.prototype.free;
17729
+
17262
17730
  class ProcedureThreshold {
17263
17731
  static __wrap(ptr) {
17264
17732
  ptr = ptr >>> 0;
@@ -17359,7 +17827,7 @@ class ProvenTransaction {
17359
17827
  * @returns {AccountId}
17360
17828
  */
17361
17829
  accountId() {
17362
- const ret = wasm.proventransaction_accountId(this.__wbg_ptr);
17830
+ const ret = wasm.account_id(this.__wbg_ptr);
17363
17831
  return AccountId.__wrap(ret);
17364
17832
  }
17365
17833
  /**
@@ -17387,7 +17855,7 @@ class ProvenTransaction {
17387
17855
  * @returns {TransactionId}
17388
17856
  */
17389
17857
  id() {
17390
- const ret = wasm.proventransaction_id(this.__wbg_ptr);
17858
+ const ret = wasm.accountcode_commitment(this.__wbg_ptr);
17391
17859
  return TransactionId.__wrap(ret);
17392
17860
  }
17393
17861
  /**
@@ -17400,20 +17868,12 @@ class ProvenTransaction {
17400
17868
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
17401
17869
  return v1;
17402
17870
  }
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
17871
  /**
17412
17872
  * Returns the commitment of the reference block.
17413
17873
  * @returns {Word}
17414
17874
  */
17415
17875
  refBlockCommitment() {
17416
- const ret = wasm.proventransaction_refBlockCommitment(this.__wbg_ptr);
17876
+ const ret = wasm.accountheader_storageCommitment(this.__wbg_ptr);
17417
17877
  return Word.__wrap(ret);
17418
17878
  }
17419
17879
  /**
@@ -17551,20 +18011,44 @@ class RpcClient {
17551
18011
  * Fetches an account proof from the node.
17552
18012
  *
17553
18013
  * 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.
18014
+ * and returns the account proof alongside the account header, storage slot values, and
18015
+ * account code without reconstructing the full account state.
17556
18016
  *
17557
18017
  * For private accounts, the proof is returned but account details will not be available
17558
18018
  * since they are not stored on-chain.
17559
18019
  *
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.
18020
+ * Useful for reading storage slot values (e.g., faucet metadata) or specific storage map
18021
+ * entries without the overhead of fetching the complete account with all vault assets and
18022
+ * storage map entries.
18023
+ *
18024
+ * @param `account_id` - The account to fetch the proof for.
18025
+ * @param `storage_requirements` - Optional storage requirements specifying which storage
18026
+ * maps and keys to include. When `undefined`, no storage map data is requested.
18027
+ * @param `block_num` - Optional block number to fetch the account state at. When `undefined`,
18028
+ * fetches the latest state (chain tip).
18029
+ * @param `known_vault_commitment` - Optional known vault commitment. When provided,
18030
+ * vault data is returned only if the account's current vault root differs from this
18031
+ * value. Use `Word.new([0, 0, 0, 0])` to always fetch. When `undefined`, vault data
18032
+ * is not requested.
17562
18033
  * @param {AccountId} account_id
18034
+ * @param {AccountStorageRequirements | null} [storage_requirements]
18035
+ * @param {number | null} [block_num]
18036
+ * @param {Word | null} [known_vault_commitment]
17563
18037
  * @returns {Promise<AccountProof>}
17564
18038
  */
17565
- getAccountProof(account_id) {
18039
+ getAccountProof(account_id, storage_requirements, block_num, known_vault_commitment) {
17566
18040
  _assertClass(account_id, AccountId);
17567
- const ret = wasm.rpcclient_getAccountProof(this.__wbg_ptr, account_id.__wbg_ptr);
18041
+ let ptr0 = 0;
18042
+ if (!isLikeNone(storage_requirements)) {
18043
+ _assertClass(storage_requirements, AccountStorageRequirements);
18044
+ ptr0 = storage_requirements.__destroy_into_raw();
18045
+ }
18046
+ let ptr1 = 0;
18047
+ if (!isLikeNone(known_vault_commitment)) {
18048
+ _assertClass(known_vault_commitment, Word);
18049
+ ptr1 = known_vault_commitment.__destroy_into_raw();
18050
+ }
18051
+ const ret = wasm.rpcclient_getAccountProof(this.__wbg_ptr, account_id.__wbg_ptr, ptr0, isLikeNone(block_num) ? 0x100000001 : (block_num) >>> 0, ptr1);
17568
18052
  return ret;
17569
18053
  }
17570
18054
  /**
@@ -17647,6 +18131,26 @@ class RpcClient {
17647
18131
  const ret = wasm.rpcclient_syncNotes(this.__wbg_ptr, block_num, isLikeNone(block_to) ? 0x100000001 : (block_to) >>> 0, ptr0, len0);
17648
18132
  return ret;
17649
18133
  }
18134
+ /**
18135
+ * Syncs storage map updates for an account within a block range.
18136
+ *
18137
+ * This is used when `AccountProof.hasStorageMapTooManyEntries()` returns `true` for a
18138
+ * slot, indicating the storage map was too large to return inline. This endpoint fetches
18139
+ * the full storage map data with pagination support.
18140
+ *
18141
+ * @param `block_from` - The starting block number.
18142
+ * @param `block_to` - Optional ending block number. When `undefined`, syncs to chain tip.
18143
+ * @param `account_id` - The account to sync storage maps for.
18144
+ * @param {number} block_from
18145
+ * @param {number | null | undefined} block_to
18146
+ * @param {AccountId} account_id
18147
+ * @returns {Promise<StorageMapInfo>}
18148
+ */
18149
+ syncStorageMaps(block_from, block_to, account_id) {
18150
+ _assertClass(account_id, AccountId);
18151
+ const ret = wasm.rpcclient_syncStorageMaps(this.__wbg_ptr, block_from, isLikeNone(block_to) ? 0x100000001 : (block_to) >>> 0, account_id.__wbg_ptr);
18152
+ return ret;
18153
+ }
17650
18154
  }
17651
18155
  if (Symbol.dispose) RpcClient.prototype[Symbol.dispose] = RpcClient.prototype.free;
17652
18156
 
@@ -17701,6 +18205,32 @@ class SerializedInputNoteData {
17701
18205
  const ptr = this.__destroy_into_raw();
17702
18206
  wasm.__wbg_serializedinputnotedata_free(ptr, 0);
17703
18207
  }
18208
+ /**
18209
+ * @returns {number | undefined}
18210
+ */
18211
+ get consumedBlockHeight() {
18212
+ const ret = wasm.__wbg_get_serializedinputnotedata_consumedBlockHeight(this.__wbg_ptr);
18213
+ return ret === 0x100000001 ? undefined : ret;
18214
+ }
18215
+ /**
18216
+ * @returns {number | undefined}
18217
+ */
18218
+ get consumedTxOrder() {
18219
+ const ret = wasm.__wbg_get_serializedinputnotedata_consumedTxOrder(this.__wbg_ptr);
18220
+ return ret === 0x100000001 ? undefined : ret;
18221
+ }
18222
+ /**
18223
+ * @returns {string | undefined}
18224
+ */
18225
+ get consumerAccountId() {
18226
+ const ret = wasm.__wbg_get_serializedinputnotedata_consumerAccountId(this.__wbg_ptr);
18227
+ let v1;
18228
+ if (ret[0] !== 0) {
18229
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
18230
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
18231
+ }
18232
+ return v1;
18233
+ }
17704
18234
  /**
17705
18235
  * @returns {string}
17706
18236
  */
@@ -17813,13 +18343,33 @@ class SerializedInputNoteData {
17813
18343
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
17814
18344
  return v1;
17815
18345
  }
18346
+ /**
18347
+ * @param {number | null} [arg0]
18348
+ */
18349
+ set consumedBlockHeight(arg0) {
18350
+ wasm.__wbg_set_serializedinputnotedata_consumedBlockHeight(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0);
18351
+ }
18352
+ /**
18353
+ * @param {number | null} [arg0]
18354
+ */
18355
+ set consumedTxOrder(arg0) {
18356
+ wasm.__wbg_set_serializedinputnotedata_consumedTxOrder(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0);
18357
+ }
18358
+ /**
18359
+ * @param {string | null} [arg0]
18360
+ */
18361
+ set consumerAccountId(arg0) {
18362
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
18363
+ var len0 = WASM_VECTOR_LEN;
18364
+ wasm.__wbg_set_serializedinputnotedata_consumerAccountId(this.__wbg_ptr, ptr0, len0);
18365
+ }
17816
18366
  /**
17817
18367
  * @param {string} arg0
17818
18368
  */
17819
18369
  set createdAt(arg0) {
17820
18370
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17821
18371
  const len0 = WASM_VECTOR_LEN;
17822
- wasm.__wbg_set_jsaccountupdate_accountCommitment(this.__wbg_ptr, ptr0, len0);
18372
+ wasm.__wbg_set_serializedinputnotedata_createdAt(this.__wbg_ptr, ptr0, len0);
17823
18373
  }
17824
18374
  /**
17825
18375
  * @param {Uint8Array} arg0
@@ -17843,7 +18393,7 @@ class SerializedInputNoteData {
17843
18393
  set noteId(arg0) {
17844
18394
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17845
18395
  const len0 = WASM_VECTOR_LEN;
17846
- wasm.__wbg_set_jsaccountupdate_storageRoot(this.__wbg_ptr, ptr0, len0);
18396
+ wasm.__wbg_set_serializedinputnotedata_noteId(this.__wbg_ptr, ptr0, len0);
17847
18397
  }
17848
18398
  /**
17849
18399
  * @param {string} arg0
@@ -17859,7 +18409,7 @@ class SerializedInputNoteData {
17859
18409
  set noteScript(arg0) {
17860
18410
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
17861
18411
  const len0 = WASM_VECTOR_LEN;
17862
- wasm.__wbg_set_jsstatesyncupdate_blockHasRelevantNotes(this.__wbg_ptr, ptr0, len0);
18412
+ wasm.__wbg_set_serializedinputnotedata_noteScript(this.__wbg_ptr, ptr0, len0);
17863
18413
  }
17864
18414
  /**
17865
18415
  * @param {string} arg0
@@ -17867,7 +18417,7 @@ class SerializedInputNoteData {
17867
18417
  set nullifier(arg0) {
17868
18418
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17869
18419
  const len0 = WASM_VECTOR_LEN;
17870
- wasm.__wbg_set_jsaccountupdate_codeRoot(this.__wbg_ptr, ptr0, len0);
18420
+ wasm.__wbg_set_serializedinputnotedata_nullifier(this.__wbg_ptr, ptr0, len0);
17871
18421
  }
17872
18422
  /**
17873
18423
  * @param {Uint8Array} arg0
@@ -18013,7 +18563,7 @@ class SerializedOutputNoteData {
18013
18563
  set metadata(arg0) {
18014
18564
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18015
18565
  const len0 = WASM_VECTOR_LEN;
18016
- wasm.__wbg_set_serializedinputnotedata_inputs(this.__wbg_ptr, ptr0, len0);
18566
+ wasm.__wbg_set_serializedoutputnotedata_metadata(this.__wbg_ptr, ptr0, len0);
18017
18567
  }
18018
18568
  /**
18019
18569
  * @param {Uint8Array} arg0
@@ -18021,7 +18571,7 @@ class SerializedOutputNoteData {
18021
18571
  set noteAssets(arg0) {
18022
18572
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18023
18573
  const len0 = WASM_VECTOR_LEN;
18024
- wasm.__wbg_set_serializedinputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18574
+ wasm.__wbg_set_serializedoutputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18025
18575
  }
18026
18576
  /**
18027
18577
  * @param {string} arg0
@@ -18171,7 +18721,7 @@ class SerializedTransactionData {
18171
18721
  set details(arg0) {
18172
18722
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18173
18723
  const len0 = WASM_VECTOR_LEN;
18174
- wasm.__wbg_set_serializedinputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18724
+ wasm.__wbg_set_serializedoutputnotedata_noteAssets(this.__wbg_ptr, ptr0, len0);
18175
18725
  }
18176
18726
  /**
18177
18727
  * @param {string} arg0
@@ -18201,7 +18751,7 @@ class SerializedTransactionData {
18201
18751
  set status(arg0) {
18202
18752
  const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
18203
18753
  const len0 = WASM_VECTOR_LEN;
18204
- wasm.__wbg_set_serializedinputnotedata_serialNumber(this.__wbg_ptr, ptr0, len0);
18754
+ wasm.__wbg_set_serializedtransactiondata_status(this.__wbg_ptr, ptr0, len0);
18205
18755
  }
18206
18756
  /**
18207
18757
  * @param {Uint8Array | null} [arg0]
@@ -18592,6 +19142,165 @@ class StorageMap {
18592
19142
  }
18593
19143
  if (Symbol.dispose) StorageMap.prototype[Symbol.dispose] = StorageMap.prototype.free;
18594
19144
 
19145
+ /**
19146
+ * A key-value entry from a storage map.
19147
+ */
19148
+ class StorageMapEntry {
19149
+ static __wrap(ptr) {
19150
+ ptr = ptr >>> 0;
19151
+ const obj = Object.create(StorageMapEntry.prototype);
19152
+ obj.__wbg_ptr = ptr;
19153
+ StorageMapEntryFinalization.register(obj, obj.__wbg_ptr, obj);
19154
+ return obj;
19155
+ }
19156
+ __destroy_into_raw() {
19157
+ const ptr = this.__wbg_ptr;
19158
+ this.__wbg_ptr = 0;
19159
+ StorageMapEntryFinalization.unregister(this);
19160
+ return ptr;
19161
+ }
19162
+ free() {
19163
+ const ptr = this.__destroy_into_raw();
19164
+ wasm.__wbg_storagemapentry_free(ptr, 0);
19165
+ }
19166
+ /**
19167
+ * Returns the storage map key.
19168
+ * @returns {Word}
19169
+ */
19170
+ key() {
19171
+ const ret = wasm.accountcode_commitment(this.__wbg_ptr);
19172
+ return Word.__wrap(ret);
19173
+ }
19174
+ /**
19175
+ * Returns the storage map value.
19176
+ * @returns {Word}
19177
+ */
19178
+ value() {
19179
+ const ret = wasm.accountheader_storageCommitment(this.__wbg_ptr);
19180
+ return Word.__wrap(ret);
19181
+ }
19182
+ }
19183
+ if (Symbol.dispose) StorageMapEntry.prototype[Symbol.dispose] = StorageMapEntry.prototype.free;
19184
+
19185
+ /**
19186
+ * Information about storage map updates for an account, as returned by the
19187
+ * `syncStorageMaps` RPC endpoint.
19188
+ *
19189
+ * Contains the list of storage map updates within the requested block range,
19190
+ * along with the chain tip and last processed block number.
19191
+ */
19192
+ class StorageMapInfo {
19193
+ static __wrap(ptr) {
19194
+ ptr = ptr >>> 0;
19195
+ const obj = Object.create(StorageMapInfo.prototype);
19196
+ obj.__wbg_ptr = ptr;
19197
+ StorageMapInfoFinalization.register(obj, obj.__wbg_ptr, obj);
19198
+ return obj;
19199
+ }
19200
+ __destroy_into_raw() {
19201
+ const ptr = this.__wbg_ptr;
19202
+ this.__wbg_ptr = 0;
19203
+ StorageMapInfoFinalization.unregister(this);
19204
+ return ptr;
19205
+ }
19206
+ free() {
19207
+ const ptr = this.__destroy_into_raw();
19208
+ wasm.__wbg_storagemapinfo_free(ptr, 0);
19209
+ }
19210
+ /**
19211
+ * Returns the block number of the last check included in this response.
19212
+ * @returns {number}
19213
+ */
19214
+ blockNumber() {
19215
+ const ret = wasm.notesyncinfo_blockTo(this.__wbg_ptr);
19216
+ return ret >>> 0;
19217
+ }
19218
+ /**
19219
+ * Returns the current chain tip block number.
19220
+ * @returns {number}
19221
+ */
19222
+ chainTip() {
19223
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
19224
+ return ret >>> 0;
19225
+ }
19226
+ /**
19227
+ * Returns the list of storage map updates.
19228
+ * @returns {StorageMapUpdate[]}
19229
+ */
19230
+ updates() {
19231
+ const ret = wasm.storagemapinfo_updates(this.__wbg_ptr);
19232
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
19233
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
19234
+ return v1;
19235
+ }
19236
+ }
19237
+ if (Symbol.dispose) StorageMapInfo.prototype[Symbol.dispose] = StorageMapInfo.prototype.free;
19238
+
19239
+ /**
19240
+ * A single storage map update entry, containing the block number, slot name,
19241
+ * key, and new value.
19242
+ */
19243
+ class StorageMapUpdate {
19244
+ static __wrap(ptr) {
19245
+ ptr = ptr >>> 0;
19246
+ const obj = Object.create(StorageMapUpdate.prototype);
19247
+ obj.__wbg_ptr = ptr;
19248
+ StorageMapUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
19249
+ return obj;
19250
+ }
19251
+ __destroy_into_raw() {
19252
+ const ptr = this.__wbg_ptr;
19253
+ this.__wbg_ptr = 0;
19254
+ StorageMapUpdateFinalization.unregister(this);
19255
+ return ptr;
19256
+ }
19257
+ free() {
19258
+ const ptr = this.__destroy_into_raw();
19259
+ wasm.__wbg_storagemapupdate_free(ptr, 0);
19260
+ }
19261
+ /**
19262
+ * Returns the block number in which this update occurred.
19263
+ * @returns {number}
19264
+ */
19265
+ blockNum() {
19266
+ const ret = wasm.storagemapupdate_blockNum(this.__wbg_ptr);
19267
+ return ret >>> 0;
19268
+ }
19269
+ /**
19270
+ * Returns the storage map key that was updated.
19271
+ * @returns {Word}
19272
+ */
19273
+ key() {
19274
+ const ret = wasm.accountcode_commitment(this.__wbg_ptr);
19275
+ return Word.__wrap(ret);
19276
+ }
19277
+ /**
19278
+ * Returns the name of the storage slot that was updated.
19279
+ * @returns {string}
19280
+ */
19281
+ slotName() {
19282
+ let deferred1_0;
19283
+ let deferred1_1;
19284
+ try {
19285
+ const ret = wasm.storagemapupdate_slotName(this.__wbg_ptr);
19286
+ deferred1_0 = ret[0];
19287
+ deferred1_1 = ret[1];
19288
+ return getStringFromWasm0(ret[0], ret[1]);
19289
+ } finally {
19290
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
19291
+ }
19292
+ }
19293
+ /**
19294
+ * Returns the new value for this storage map key.
19295
+ * @returns {Word}
19296
+ */
19297
+ value() {
19298
+ const ret = wasm.accountheader_storageCommitment(this.__wbg_ptr);
19299
+ return Word.__wrap(ret);
19300
+ }
19301
+ }
19302
+ if (Symbol.dispose) StorageMapUpdate.prototype[Symbol.dispose] = StorageMapUpdate.prototype.free;
19303
+
18595
19304
  /**
18596
19305
  * A single storage slot value or map for an account component.
18597
19306
  */
@@ -18908,21 +19617,15 @@ class TokenSymbol {
18908
19617
  * @returns {string}
18909
19618
  */
18910
19619
  toString() {
18911
- let deferred2_0;
18912
- let deferred2_1;
19620
+ let deferred1_0;
19621
+ let deferred1_1;
18913
19622
  try {
18914
19623
  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);
19624
+ deferred1_0 = ret[0];
19625
+ deferred1_1 = ret[1];
19626
+ return getStringFromWasm0(ret[0], ret[1]);
18924
19627
  } finally {
18925
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
19628
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
18926
19629
  }
18927
19630
  }
18928
19631
  }
@@ -19547,6 +20250,16 @@ class TransactionRequestBuilder {
19547
20250
  const ret = wasm.transactionrequestbuilder_withExpectedOutputRecipients(ptr, recipients.__wbg_ptr);
19548
20251
  return TransactionRequestBuilder.__wrap(ret);
19549
20252
  }
20253
+ /**
20254
+ * Sets the maximum number of blocks until the transaction request expires.
20255
+ * @param {number} expiration_delta
20256
+ * @returns {TransactionRequestBuilder}
20257
+ */
20258
+ withExpirationDelta(expiration_delta) {
20259
+ const ptr = this.__destroy_into_raw();
20260
+ const ret = wasm.transactionrequestbuilder_withExpirationDelta(ptr, expiration_delta);
20261
+ return TransactionRequestBuilder.__wrap(ret);
20262
+ }
19550
20263
  /**
19551
20264
  * Registers foreign accounts referenced by the transaction.
19552
20265
  * @param {ForeignAccountArray} foreign_accounts
@@ -19570,13 +20283,13 @@ class TransactionRequestBuilder {
19570
20283
  return TransactionRequestBuilder.__wrap(ret);
19571
20284
  }
19572
20285
  /**
19573
- * Adds notes created by the sender that should be emitted by the transaction.
19574
- * @param {OutputNoteArray} notes
20286
+ * Adds output notes created by the sender that should be emitted by the transaction.
20287
+ * @param {NoteArray} notes
19575
20288
  * @returns {TransactionRequestBuilder}
19576
20289
  */
19577
20290
  withOwnOutputNotes(notes) {
19578
20291
  const ptr = this.__destroy_into_raw();
19579
- _assertClass(notes, OutputNoteArray);
20292
+ _assertClass(notes, NoteArray);
19580
20293
  const ret = wasm.transactionrequestbuilder_withOwnOutputNotes(ptr, notes.__wbg_ptr);
19581
20294
  return TransactionRequestBuilder.__wrap(ret);
19582
20295
  }
@@ -19813,7 +20526,7 @@ class TransactionScriptInputPairArray {
19813
20526
  * @returns {number}
19814
20527
  */
19815
20528
  length() {
19816
- const ret = wasm.outputnotesarray_length(this.__wbg_ptr);
20529
+ const ret = wasm.transactionscriptinputpairarray_length(this.__wbg_ptr);
19817
20530
  return ret >>> 0;
19818
20531
  }
19819
20532
  /**
@@ -19889,7 +20602,10 @@ class TransactionStatus {
19889
20602
  const ptr0 = passStringToWasm0(cause, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
19890
20603
  const len0 = WASM_VECTOR_LEN;
19891
20604
  const ret = wasm.transactionstatus_discarded(ptr0, len0);
19892
- return TransactionStatus.__wrap(ret);
20605
+ if (ret[2]) {
20606
+ throw takeFromExternrefTable0(ret[1]);
20607
+ }
20608
+ return TransactionStatus.__wrap(ret[0]);
19893
20609
  }
19894
20610
  /**
19895
20611
  * Returns the block number if the transaction was committed.
@@ -19973,7 +20689,7 @@ class TransactionStoreUpdate {
19973
20689
  return AccountDelta.__wrap(ret);
19974
20690
  }
19975
20691
  /**
19976
- * Returns the notes created by the transaction.
20692
+ * Returns the output notes created by the transaction.
19977
20693
  * @returns {OutputNotes}
19978
20694
  */
19979
20695
  createdNotes() {
@@ -20162,17 +20878,6 @@ class WebClient {
20162
20878
  }
20163
20879
  return AccountReader.__wrap(ret[0]);
20164
20880
  }
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
20881
  /**
20177
20882
  * @param {string} tag
20178
20883
  * @returns {Promise<void>}
@@ -20224,9 +20929,10 @@ class WebClient {
20224
20929
  * @param {string | null} [node_note_transport_url]
20225
20930
  * @param {Uint8Array | null} [seed]
20226
20931
  * @param {string | null} [store_name]
20932
+ * @param {boolean | null} [debug_mode]
20227
20933
  * @returns {Promise<any>}
20228
20934
  */
20229
- createClient(node_url, node_note_transport_url, seed, store_name) {
20935
+ createClient(node_url, node_note_transport_url, seed, store_name, debug_mode) {
20230
20936
  var ptr0 = isLikeNone(node_url) ? 0 : passStringToWasm0(node_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20231
20937
  var len0 = WASM_VECTOR_LEN;
20232
20938
  var ptr1 = isLikeNone(node_note_transport_url) ? 0 : passStringToWasm0(node_note_transport_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -20235,7 +20941,7 @@ class WebClient {
20235
20941
  var len2 = WASM_VECTOR_LEN;
20236
20942
  var ptr3 = isLikeNone(store_name) ? 0 : passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20237
20943
  var len3 = WASM_VECTOR_LEN;
20238
- const ret = wasm.webclient_createClient(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
20944
+ 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
20945
  return ret;
20240
20946
  }
20241
20947
  /**
@@ -20258,9 +20964,10 @@ class WebClient {
20258
20964
  * @param {Function | null} [get_key_cb]
20259
20965
  * @param {Function | null} [insert_key_cb]
20260
20966
  * @param {Function | null} [sign_cb]
20967
+ * @param {boolean | null} [debug_mode]
20261
20968
  * @returns {Promise<any>}
20262
20969
  */
20263
- createClientWithExternalKeystore(node_url, node_note_transport_url, seed, store_name, get_key_cb, insert_key_cb, sign_cb) {
20970
+ createClientWithExternalKeystore(node_url, node_note_transport_url, seed, store_name, get_key_cb, insert_key_cb, sign_cb, debug_mode) {
20264
20971
  var ptr0 = isLikeNone(node_url) ? 0 : passStringToWasm0(node_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20265
20972
  var len0 = WASM_VECTOR_LEN;
20266
20973
  var ptr1 = isLikeNone(node_note_transport_url) ? 0 : passStringToWasm0(node_note_transport_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -20269,7 +20976,7 @@ class WebClient {
20269
20976
  var len2 = WASM_VECTOR_LEN;
20270
20977
  var ptr3 = isLikeNone(store_name) ? 0 : passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
20271
20978
  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));
20979
+ 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
20980
  return ret;
20274
20981
  }
20275
20982
  /**
@@ -20311,13 +21018,31 @@ class WebClient {
20311
21018
  * # Errors
20312
21019
  * - If there is an internal failure during execution.
20313
21020
  * @param {AccountId} account_id
20314
- * @param {TransactionRequest} transaction_request
20315
- * @returns {Promise<TransactionSummary>}
21021
+ * @param {TransactionRequest} transaction_request
21022
+ * @returns {Promise<TransactionSummary>}
21023
+ */
21024
+ executeForSummary(account_id, transaction_request) {
21025
+ _assertClass(account_id, AccountId);
21026
+ _assertClass(transaction_request, TransactionRequest);
21027
+ const ret = wasm.webclient_executeForSummary(this.__wbg_ptr, account_id.__wbg_ptr, transaction_request.__wbg_ptr);
21028
+ return ret;
21029
+ }
21030
+ /**
21031
+ * Executes the provided transaction script against the specified account
21032
+ * and returns the resulting stack output. This is a local-only "view call"
21033
+ * that does not submit anything to the network.
21034
+ * @param {AccountId} account_id
21035
+ * @param {TransactionScript} tx_script
21036
+ * @param {AdviceInputs} advice_inputs
21037
+ * @param {ForeignAccountArray} foreign_accounts
21038
+ * @returns {Promise<FeltArray>}
20316
21039
  */
20317
- executeForSummary(account_id, transaction_request) {
21040
+ executeProgram(account_id, tx_script, advice_inputs, foreign_accounts) {
20318
21041
  _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);
21042
+ _assertClass(tx_script, TransactionScript);
21043
+ _assertClass(advice_inputs, AdviceInputs);
21044
+ _assertClass(foreign_accounts, ForeignAccountArray);
21045
+ 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
21046
  return ret;
20322
21047
  }
20323
21048
  /**
@@ -20358,16 +21083,6 @@ class WebClient {
20358
21083
  const ret = wasm.webclient_exportNoteFile(this.__wbg_ptr, ptr0, len0, export_format);
20359
21084
  return ret;
20360
21085
  }
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
21086
  /**
20372
21087
  * Fetch all private notes from the note transport layer
20373
21088
  *
@@ -20390,17 +21105,6 @@ class WebClient {
20390
21105
  const ret = wasm.webclient_fetchPrivateNotes(this.__wbg_ptr);
20391
21106
  return ret;
20392
21107
  }
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
21108
  /**
20405
21109
  * Retrieves the full account data for the given account ID, returning `null` if not found.
20406
21110
  *
@@ -20413,30 +21117,6 @@ class WebClient {
20413
21117
  const ret = wasm.webclient_getAccount(this.__wbg_ptr, account_id.__wbg_ptr);
20414
21118
  return ret;
20415
21119
  }
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
21120
  /**
20441
21121
  * Retrieves the account code for a specific account.
20442
21122
  *
@@ -20533,19 +21213,6 @@ class WebClient {
20533
21213
  const ret = wasm.webclient_getOutputNotes(this.__wbg_ptr, ptr0);
20534
21214
  return ret;
20535
21215
  }
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
21216
  /**
20550
21217
  * Retrieves the setting value for `key`, or `None` if it hasn’t been set.
20551
21218
  * @param {string} key
@@ -20626,6 +21293,19 @@ class WebClient {
20626
21293
  const ret = wasm.webclient_insertAccountAddress(this.__wbg_ptr, account_id.__wbg_ptr, address.__wbg_ptr);
20627
21294
  return ret;
20628
21295
  }
21296
+ /**
21297
+ * Returns a `WebKeystoreApi` handle for managing secret keys.
21298
+ *
21299
+ * The returned object can be used from JavaScript as `client.keystore`.
21300
+ * @returns {WebKeystoreApi}
21301
+ */
21302
+ get keystore() {
21303
+ const ret = wasm.webclient_keystore(this.__wbg_ptr);
21304
+ if (ret[2]) {
21305
+ throw takeFromExternrefTable0(ret[1]);
21306
+ }
21307
+ return WebKeystoreApi.__wrap(ret[0]);
21308
+ }
20629
21309
  /**
20630
21310
  * Returns all the existing setting keys from the store.
20631
21311
  * @returns {Promise<string[]>}
@@ -20657,6 +21337,21 @@ class WebClient {
20657
21337
  const ret = wasm.webclient_newAccount(this.__wbg_ptr, account.__wbg_ptr, overwrite);
20658
21338
  return ret;
20659
21339
  }
21340
+ /**
21341
+ * Inserts an account and its secret key in one call, matching how
21342
+ * `newWallet` / `newFaucet` already work internally. If the key
21343
+ * insertion fails the account is still persisted (same as wallet/faucet),
21344
+ * but callers only need a single await instead of two.
21345
+ * @param {Account} account
21346
+ * @param {AuthSecretKey} secret_key
21347
+ * @returns {Promise<void>}
21348
+ */
21349
+ newAccountWithSecretKey(account, secret_key) {
21350
+ _assertClass(account, Account);
21351
+ _assertClass(secret_key, AuthSecretKey);
21352
+ const ret = wasm.webclient_newAccountWithSecretKey(this.__wbg_ptr, account.__wbg_ptr, secret_key.__wbg_ptr);
21353
+ return ret;
21354
+ }
20660
21355
  /**
20661
21356
  * @param {Note[]} list_of_notes
20662
21357
  * @returns {TransactionRequest}
@@ -20779,6 +21474,24 @@ class WebClient {
20779
21474
  const ret = wasm.webclient_proveTransaction(this.__wbg_ptr, transaction_result.__wbg_ptr, ptr0);
20780
21475
  return ret;
20781
21476
  }
21477
+ /**
21478
+ * Prunes historical account states for the specified account up to the given nonce.
21479
+ *
21480
+ * Deletes all historical entries with `replaced_at_nonce <= up_to_nonce` and any
21481
+ * orphaned account code.
21482
+ *
21483
+ * Returns the total number of rows deleted, including historical entries and orphaned
21484
+ * account code.
21485
+ * @param {AccountId} account_id
21486
+ * @param {Felt} up_to_nonce
21487
+ * @returns {Promise<number>}
21488
+ */
21489
+ pruneAccountHistory(account_id, up_to_nonce) {
21490
+ _assertClass(account_id, AccountId);
21491
+ _assertClass(up_to_nonce, Felt);
21492
+ const ret = wasm.webclient_pruneAccountHistory(this.__wbg_ptr, account_id.__wbg_ptr, up_to_nonce.__wbg_ptr);
21493
+ return ret;
21494
+ }
20782
21495
  /**
20783
21496
  * @param {AccountId} account_id
20784
21497
  * @param {Address} address
@@ -20851,19 +21564,6 @@ class WebClient {
20851
21564
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
20852
21565
  return v1;
20853
21566
  }
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
21567
  /**
20868
21568
  * Sets a setting key-value in the store. It can then be retrieved using `get_setting`.
20869
21569
  * @param {string} key
@@ -20876,6 +21576,28 @@ class WebClient {
20876
21576
  const ret = wasm.webclient_setSetting(this.__wbg_ptr, ptr0, len0, value);
20877
21577
  return ret;
20878
21578
  }
21579
+ /**
21580
+ * Returns the identifier of the underlying store (e.g. `IndexedDB` database name, file path).
21581
+ * @returns {string}
21582
+ */
21583
+ storeIdentifier() {
21584
+ let deferred2_0;
21585
+ let deferred2_1;
21586
+ try {
21587
+ const ret = wasm.webclient_storeIdentifier(this.__wbg_ptr);
21588
+ var ptr1 = ret[0];
21589
+ var len1 = ret[1];
21590
+ if (ret[3]) {
21591
+ ptr1 = 0; len1 = 0;
21592
+ throw takeFromExternrefTable0(ret[2]);
21593
+ }
21594
+ deferred2_0 = ptr1;
21595
+ deferred2_1 = len1;
21596
+ return getStringFromWasm0(ptr1, len1);
21597
+ } finally {
21598
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
21599
+ }
21600
+ }
20879
21601
  /**
20880
21602
  * Executes a transaction specified by the request against the specified account,
20881
21603
  * proves it, submits it to the network, and updates the local database.
@@ -20949,6 +21671,88 @@ class WebClient {
20949
21671
  }
20950
21672
  if (Symbol.dispose) WebClient.prototype[Symbol.dispose] = WebClient.prototype.free;
20951
21673
 
21674
+ /**
21675
+ * JavaScript API for the client's keystore.
21676
+ *
21677
+ * Manages the association between accounts and their authentication secret keys,
21678
+ * indexed by public key commitment.
21679
+ */
21680
+ class WebKeystoreApi {
21681
+ static __wrap(ptr) {
21682
+ ptr = ptr >>> 0;
21683
+ const obj = Object.create(WebKeystoreApi.prototype);
21684
+ obj.__wbg_ptr = ptr;
21685
+ WebKeystoreApiFinalization.register(obj, obj.__wbg_ptr, obj);
21686
+ return obj;
21687
+ }
21688
+ __destroy_into_raw() {
21689
+ const ptr = this.__wbg_ptr;
21690
+ this.__wbg_ptr = 0;
21691
+ WebKeystoreApiFinalization.unregister(this);
21692
+ return ptr;
21693
+ }
21694
+ free() {
21695
+ const ptr = this.__destroy_into_raw();
21696
+ wasm.__wbg_webkeystoreapi_free(ptr, 0);
21697
+ }
21698
+ /**
21699
+ * Retrieves a secret key from the keystore given a public key commitment.
21700
+ *
21701
+ * Returns the associated `AuthSecretKey` if found, or `null` if not found.
21702
+ * @param {Word} pub_key_commitment
21703
+ * @returns {Promise<AuthSecretKey | undefined>}
21704
+ */
21705
+ get(pub_key_commitment) {
21706
+ _assertClass(pub_key_commitment, Word);
21707
+ const ret = wasm.webkeystoreapi_get(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
21708
+ return ret;
21709
+ }
21710
+ /**
21711
+ * Returns the account ID associated with a given public key commitment,
21712
+ * or `null` if no account is found.
21713
+ * @param {Word} pub_key_commitment
21714
+ * @returns {Promise<AccountId | undefined>}
21715
+ */
21716
+ getAccountId(pub_key_commitment) {
21717
+ _assertClass(pub_key_commitment, Word);
21718
+ const ret = wasm.webkeystoreapi_getAccountId(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
21719
+ return ret;
21720
+ }
21721
+ /**
21722
+ * Returns all public key commitments associated with the given account ID.
21723
+ * @param {AccountId} account_id
21724
+ * @returns {Promise<Word[]>}
21725
+ */
21726
+ getCommitments(account_id) {
21727
+ _assertClass(account_id, AccountId);
21728
+ const ret = wasm.webkeystoreapi_getCommitments(this.__wbg_ptr, account_id.__wbg_ptr);
21729
+ return ret;
21730
+ }
21731
+ /**
21732
+ * Inserts a secret key into the keystore, associating it with the given account ID.
21733
+ * @param {AccountId} account_id
21734
+ * @param {AuthSecretKey} secret_key
21735
+ * @returns {Promise<void>}
21736
+ */
21737
+ insert(account_id, secret_key) {
21738
+ _assertClass(account_id, AccountId);
21739
+ _assertClass(secret_key, AuthSecretKey);
21740
+ const ret = wasm.webkeystoreapi_insert(this.__wbg_ptr, account_id.__wbg_ptr, secret_key.__wbg_ptr);
21741
+ return ret;
21742
+ }
21743
+ /**
21744
+ * Removes a key from the keystore by its public key commitment.
21745
+ * @param {Word} pub_key_commitment
21746
+ * @returns {Promise<void>}
21747
+ */
21748
+ remove(pub_key_commitment) {
21749
+ _assertClass(pub_key_commitment, Word);
21750
+ const ret = wasm.webkeystoreapi_remove(this.__wbg_ptr, pub_key_commitment.__wbg_ptr);
21751
+ return ret;
21752
+ }
21753
+ }
21754
+ if (Symbol.dispose) WebKeystoreApi.prototype[Symbol.dispose] = WebKeystoreApi.prototype.free;
21755
+
20952
21756
  class Word {
20953
21757
  static __wrap(ptr) {
20954
21758
  ptr = ptr >>> 0;
@@ -21085,6 +21889,37 @@ function createAuthFalcon512RpoMultisig(config) {
21085
21889
  return AccountComponent.__wrap(ret[0]);
21086
21890
  }
21087
21891
 
21892
+ /**
21893
+ * Exports the entire contents of an `IndexedDB` store as a JSON string.
21894
+ *
21895
+ * Use together with [`import_store`].
21896
+ * @param {string} store_name
21897
+ * @returns {Promise<any>}
21898
+ */
21899
+ function exportStore2(store_name) {
21900
+ const ptr0 = passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
21901
+ const len0 = WASM_VECTOR_LEN;
21902
+ const ret = wasm.exportStore(ptr0, len0);
21903
+ return ret;
21904
+ }
21905
+
21906
+ /**
21907
+ * Imports store contents from a JSON string, replacing all existing data.
21908
+ *
21909
+ * Use together with [`export_store`].
21910
+ * @param {string} store_name
21911
+ * @param {string} store_dump
21912
+ * @returns {Promise<void>}
21913
+ */
21914
+ function importStore(store_name, store_dump) {
21915
+ const ptr0 = passStringToWasm0(store_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
21916
+ const len0 = WASM_VECTOR_LEN;
21917
+ const ptr1 = passStringToWasm0(store_dump, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
21918
+ const len1 = WASM_VECTOR_LEN;
21919
+ const ret = wasm.importStore(ptr0, len0, ptr1, len1);
21920
+ return ret;
21921
+ }
21922
+
21088
21923
  /**
21089
21924
  * Initializes the `tracing` subscriber that routes Rust log output to the
21090
21925
  * browser console via `console.log` / `console.warn` / `console.error`.
@@ -21239,7 +22074,7 @@ function __wbg_get_imports() {
21239
22074
  const ret = AccountStorage.__wrap(arg0);
21240
22075
  return ret;
21241
22076
  },
21242
- __wbg_addNoteTag_129c8d9b232bafa2: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22077
+ __wbg_addNoteTag_73f23a831a6e3b6a: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
21243
22078
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21244
22079
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21245
22080
  let v1;
@@ -21262,15 +22097,15 @@ function __wbg_get_imports() {
21262
22097
  __wbg_append_a992ccc37aa62dc4: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
21263
22098
  arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
21264
22099
  }, arguments); },
21265
- __wbg_applyFullAccountState_5984dfa1f9adbcb1: function(arg0, arg1, arg2) {
22100
+ __wbg_applyFullAccountState_0d845d902fcf8977: function(arg0, arg1, arg2) {
21266
22101
  const ret = applyFullAccountState(getStringFromWasm0(arg0, arg1), JsAccountUpdate.__wrap(arg2));
21267
22102
  return ret;
21268
22103
  },
21269
- __wbg_applyStateSync_164e7aaf2febbe98: function(arg0, arg1, arg2) {
22104
+ __wbg_applyStateSync_1bcd5a63e003b122: function(arg0, arg1, arg2) {
21270
22105
  const ret = applyStateSync(getStringFromWasm0(arg0, arg1), JsStateSyncUpdate.__wrap(arg2));
21271
22106
  return ret;
21272
22107
  },
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) {
22108
+ __wbg_applyTransactionDelta_e3969ada5c15edfa: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20) {
21274
22109
  let deferred0_0;
21275
22110
  let deferred0_1;
21276
22111
  let deferred1_0;
@@ -21302,12 +22137,7 @@ function __wbg_get_imports() {
21302
22137
  deferred7_1 = arg17;
21303
22138
  deferred8_0 = arg19;
21304
22139
  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);
22140
+ 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
22141
  return ret;
21312
22142
  } finally {
21313
22143
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
@@ -21370,6 +22200,10 @@ function __wbg_get_imports() {
21370
22200
  const ret = arg0.catch(arg1);
21371
22201
  return ret;
21372
22202
  },
22203
+ __wbg_clearTimeout_5a54f8841c30079a: function(arg0) {
22204
+ const ret = clearTimeout(arg0);
22205
+ return ret;
22206
+ },
21373
22207
  __wbg_clearTimeout_a7df70ff6fb2f0a7: function(arg0) {
21374
22208
  const ret = clearTimeout(arg0);
21375
22209
  return ret;
@@ -21406,7 +22240,7 @@ function __wbg_get_imports() {
21406
22240
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21407
22241
  }
21408
22242
  },
21409
- __wbg_exportStore_5874ec863915584b: function(arg0, arg1) {
22243
+ __wbg_exportStore_67cb33e10694e807: function(arg0, arg1) {
21410
22244
  const ret = exportStore(getStringFromWasm0(arg0, arg1));
21411
22245
  return ret;
21412
22246
  },
@@ -21418,6 +22252,10 @@ function __wbg_get_imports() {
21418
22252
  const ret = Felt.__unwrap(arg0);
21419
22253
  return ret;
21420
22254
  },
22255
+ __wbg_feltarray_new: function(arg0) {
22256
+ const ret = FeltArray.__wrap(arg0);
22257
+ return ret;
22258
+ },
21421
22259
  __wbg_fetch_a720bfbbf7f6c776: function(arg0, arg1) {
21422
22260
  const ret = fetch(arg0, arg1);
21423
22261
  return ret;
@@ -21434,7 +22272,7 @@ function __wbg_get_imports() {
21434
22272
  const ret = FetchedNote.__wrap(arg0);
21435
22273
  return ret;
21436
22274
  },
21437
- __wbg_forceImportStore_6c4f01c5c826a84a: function(arg0, arg1, arg2) {
22275
+ __wbg_forceImportStore_680f1469df7413c7: function(arg0, arg1, arg2) {
21438
22276
  const ret = forceImportStore(getStringFromWasm0(arg0, arg1), arg2);
21439
22277
  return ret;
21440
22278
  },
@@ -21454,7 +22292,7 @@ function __wbg_get_imports() {
21454
22292
  const ret = FungibleAssetDeltaItem.__wrap(arg0);
21455
22293
  return ret;
21456
22294
  },
21457
- __wbg_getAccountAddresses_82f229693e2ec7ae: function(arg0, arg1, arg2, arg3) {
22295
+ __wbg_getAccountAddresses_8baffdc3eeb998cf: function(arg0, arg1, arg2, arg3) {
21458
22296
  let deferred0_0;
21459
22297
  let deferred0_1;
21460
22298
  try {
@@ -21466,7 +22304,7 @@ function __wbg_get_imports() {
21466
22304
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21467
22305
  }
21468
22306
  },
21469
- __wbg_getAccountAuthByPubKeyCommitment_6fe602f9dfb51fae: function(arg0, arg1, arg2, arg3) {
22307
+ __wbg_getAccountAuthByPubKeyCommitment_e43b4fa523c75690: function(arg0, arg1, arg2, arg3) {
21470
22308
  let deferred0_0;
21471
22309
  let deferred0_1;
21472
22310
  try {
@@ -21478,7 +22316,7 @@ function __wbg_get_imports() {
21478
22316
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21479
22317
  }
21480
22318
  },
21481
- __wbg_getAccountCode_fff3da1c8f921fb0: function(arg0, arg1, arg2, arg3) {
22319
+ __wbg_getAccountCode_2c01e0b1d6e4c0c4: function(arg0, arg1, arg2, arg3) {
21482
22320
  let deferred0_0;
21483
22321
  let deferred0_1;
21484
22322
  try {
@@ -21490,7 +22328,7 @@ function __wbg_get_imports() {
21490
22328
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21491
22329
  }
21492
22330
  },
21493
- __wbg_getAccountHeaderByCommitment_75f89bbcd8556322: function(arg0, arg1, arg2, arg3) {
22331
+ __wbg_getAccountHeaderByCommitment_1937c881a4ffe36d: function(arg0, arg1, arg2, arg3) {
21494
22332
  let deferred0_0;
21495
22333
  let deferred0_1;
21496
22334
  try {
@@ -21502,7 +22340,7 @@ function __wbg_get_imports() {
21502
22340
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21503
22341
  }
21504
22342
  },
21505
- __wbg_getAccountHeader_f11be28051c305aa: function(arg0, arg1, arg2, arg3) {
22343
+ __wbg_getAccountHeader_31cd380543ca54bb: function(arg0, arg1, arg2, arg3) {
21506
22344
  let deferred0_0;
21507
22345
  let deferred0_1;
21508
22346
  try {
@@ -21514,7 +22352,7 @@ function __wbg_get_imports() {
21514
22352
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21515
22353
  }
21516
22354
  },
21517
- __wbg_getAccountIdByKeyCommitment_09d6d47e3075a887: function(arg0, arg1, arg2, arg3) {
22355
+ __wbg_getAccountIdByKeyCommitment_7e1627233d417ef0: function(arg0, arg1, arg2, arg3) {
21518
22356
  let deferred0_0;
21519
22357
  let deferred0_1;
21520
22358
  try {
@@ -21526,11 +22364,11 @@ function __wbg_get_imports() {
21526
22364
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21527
22365
  }
21528
22366
  },
21529
- __wbg_getAccountIds_47bd2e2f5585bdd3: function(arg0, arg1) {
22367
+ __wbg_getAccountIds_880fce01ae9ed908: function(arg0, arg1) {
21530
22368
  const ret = getAccountIds(getStringFromWasm0(arg0, arg1));
21531
22369
  return ret;
21532
22370
  },
21533
- __wbg_getAccountStorageMaps_dd2bbc0db626823c: function(arg0, arg1, arg2, arg3) {
22371
+ __wbg_getAccountStorageMaps_77f9e51e9f936384: function(arg0, arg1, arg2, arg3) {
21534
22372
  let deferred0_0;
21535
22373
  let deferred0_1;
21536
22374
  try {
@@ -21542,65 +22380,83 @@ function __wbg_get_imports() {
21542
22380
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21543
22381
  }
21544
22382
  },
21545
- __wbg_getAccountStorage_440a6bf20267a6af: function(arg0, arg1, arg2, arg3) {
22383
+ __wbg_getAccountStorage_b81f8fc1f4174bf4: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21546
22384
  let deferred0_0;
21547
22385
  let deferred0_1;
21548
22386
  try {
21549
22387
  deferred0_0 = arg2;
21550
22388
  deferred0_1 = arg3;
21551
- const ret = getAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
22389
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
22390
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
22391
+ const ret = getAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
21552
22392
  return ret;
21553
22393
  } finally {
21554
22394
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21555
22395
  }
21556
22396
  },
21557
- __wbg_getAccountVaultAssets_e97b428441d96ee9: function(arg0, arg1, arg2, arg3) {
22397
+ __wbg_getAccountVaultAssets_3aaa86634b9c362e: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21558
22398
  let deferred0_0;
21559
22399
  let deferred0_1;
21560
22400
  try {
21561
22401
  deferred0_0 = arg2;
21562
22402
  deferred0_1 = arg3;
21563
- const ret = getAccountVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
22403
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
22404
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
22405
+ const ret = getAccountVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
21564
22406
  return ret;
21565
22407
  } finally {
21566
22408
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21567
22409
  }
21568
22410
  },
21569
- __wbg_getAllAccountHeaders_15f6fcfa376fcb5b: function(arg0, arg1) {
22411
+ __wbg_getAllAccountHeaders_de7adaa6ce6f8022: function(arg0, arg1) {
21570
22412
  const ret = getAllAccountHeaders(getStringFromWasm0(arg0, arg1));
21571
22413
  return ret;
21572
22414
  },
21573
- __wbg_getBlockHeaders_c2ae17aac376da9c: function(arg0, arg1, arg2, arg3) {
22415
+ __wbg_getBlockHeaders_1a3602f84753a649: function(arg0, arg1, arg2, arg3) {
21574
22416
  var v0 = getArrayU32FromWasm0(arg2, arg3).slice();
21575
22417
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21576
22418
  const ret = getBlockHeaders(getStringFromWasm0(arg0, arg1), v0);
21577
22419
  return ret;
21578
22420
  },
21579
- __wbg_getForeignAccountCode_6c09a7caeb4b9647: function(arg0, arg1, arg2, arg3) {
22421
+ __wbg_getForeignAccountCode_dcbbf63304933fb9: function(arg0, arg1, arg2, arg3) {
21580
22422
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21581
22423
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21582
22424
  const ret = getForeignAccountCode(getStringFromWasm0(arg0, arg1), v0);
21583
22425
  return ret;
21584
22426
  },
21585
- __wbg_getInputNotesFromIds_83d99c60a0a16932: function(arg0, arg1, arg2, arg3) {
22427
+ __wbg_getInputNoteByOffset_afd8189342d490ba: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) {
22428
+ let deferred1_0;
22429
+ let deferred1_1;
22430
+ try {
22431
+ var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
22432
+ wasm.__wbindgen_free(arg2, arg3 * 1, 1);
22433
+ deferred1_0 = arg4;
22434
+ deferred1_1 = arg5;
22435
+ const ret = getInputNoteByOffset(getStringFromWasm0(arg0, arg1), v0, getStringFromWasm0(arg4, arg5), arg6 === 0x100000001 ? undefined : arg6, arg7 === 0x100000001 ? undefined : arg7, arg8 >>> 0);
22436
+ return ret;
22437
+ } finally {
22438
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22439
+ }
22440
+ },
22441
+ __wbg_getInputNotesFromIds_e24a7b2888455307: function(arg0, arg1, arg2, arg3) {
21586
22442
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21587
22443
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21588
22444
  const ret = getInputNotesFromIds(getStringFromWasm0(arg0, arg1), v0);
21589
22445
  return ret;
21590
22446
  },
21591
- __wbg_getInputNotesFromNullifiers_40921b17ee291c87: function(arg0, arg1, arg2, arg3) {
22447
+ __wbg_getInputNotesFromNullifiers_96cb2e010b7806d6: function(arg0, arg1, arg2, arg3) {
21592
22448
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21593
22449
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21594
22450
  const ret = getInputNotesFromNullifiers(getStringFromWasm0(arg0, arg1), v0);
21595
22451
  return ret;
21596
22452
  },
21597
- __wbg_getInputNotes_246e203a70392bb8: function(arg0, arg1, arg2, arg3) {
22453
+ __wbg_getInputNotes_51ceedc136efe8a5: function(arg0, arg1, arg2, arg3) {
21598
22454
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21599
22455
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21600
22456
  const ret = getInputNotes(getStringFromWasm0(arg0, arg1), v0);
21601
22457
  return ret;
21602
22458
  },
21603
- __wbg_getKeyCommitmentsByAccountId_2c21ea614d0bb0bb: function(arg0, arg1, arg2, arg3) {
22459
+ __wbg_getKeyCommitmentsByAccountId_e7f6c3397b516c99: function(arg0, arg1, arg2, arg3) {
21604
22460
  let deferred0_0;
21605
22461
  let deferred0_1;
21606
22462
  try {
@@ -21612,7 +22468,7 @@ function __wbg_get_imports() {
21612
22468
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21613
22469
  }
21614
22470
  },
21615
- __wbg_getNoteScript_d1134d3cd683d6b2: function(arg0, arg1, arg2, arg3) {
22471
+ __wbg_getNoteScript_ebcab1b756e132b7: function(arg0, arg1, arg2, arg3) {
21616
22472
  let deferred0_0;
21617
22473
  let deferred0_1;
21618
22474
  try {
@@ -21624,33 +22480,33 @@ function __wbg_get_imports() {
21624
22480
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21625
22481
  }
21626
22482
  },
21627
- __wbg_getNoteTags_e4f71e1a8f4feb21: function(arg0, arg1) {
22483
+ __wbg_getNoteTags_430e9c90b199fcaf: function(arg0, arg1) {
21628
22484
  const ret = getNoteTags(getStringFromWasm0(arg0, arg1));
21629
22485
  return ret;
21630
22486
  },
21631
- __wbg_getOutputNotesFromIds_de8fb6f5fee6c953: function(arg0, arg1, arg2, arg3) {
22487
+ __wbg_getOutputNotesFromIds_5e6d42b0b3a25b4b: function(arg0, arg1, arg2, arg3) {
21632
22488
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21633
22489
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21634
22490
  const ret = getOutputNotesFromIds(getStringFromWasm0(arg0, arg1), v0);
21635
22491
  return ret;
21636
22492
  },
21637
- __wbg_getOutputNotesFromNullifiers_9f51be76a0f6c916: function(arg0, arg1, arg2, arg3) {
22493
+ __wbg_getOutputNotesFromNullifiers_5a9fc255157b6fbd: function(arg0, arg1, arg2, arg3) {
21638
22494
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21639
22495
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21640
22496
  const ret = getOutputNotesFromNullifiers(getStringFromWasm0(arg0, arg1), v0);
21641
22497
  return ret;
21642
22498
  },
21643
- __wbg_getOutputNotes_9cdaa6245bd5714c: function(arg0, arg1, arg2, arg3) {
22499
+ __wbg_getOutputNotes_4809f2cd6485ad68: function(arg0, arg1, arg2, arg3) {
21644
22500
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21645
22501
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21646
22502
  const ret = getOutputNotes(getStringFromWasm0(arg0, arg1), v0);
21647
22503
  return ret;
21648
22504
  },
21649
- __wbg_getPartialBlockchainNodesAll_82f75763ea15d598: function(arg0, arg1) {
22505
+ __wbg_getPartialBlockchainNodesAll_674fcd3d1955cfaa: function(arg0, arg1) {
21650
22506
  const ret = getPartialBlockchainNodesAll(getStringFromWasm0(arg0, arg1));
21651
22507
  return ret;
21652
22508
  },
21653
- __wbg_getPartialBlockchainNodesUpToInOrderIndex_0f129ed50a5e4af5: function(arg0, arg1, arg2, arg3) {
22509
+ __wbg_getPartialBlockchainNodesUpToInOrderIndex_ce09946942839df4: function(arg0, arg1, arg2, arg3) {
21654
22510
  let deferred0_0;
21655
22511
  let deferred0_1;
21656
22512
  try {
@@ -21662,13 +22518,13 @@ function __wbg_get_imports() {
21662
22518
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21663
22519
  }
21664
22520
  },
21665
- __wbg_getPartialBlockchainNodes_42cb8c65e5dc9051: function(arg0, arg1, arg2, arg3) {
22521
+ __wbg_getPartialBlockchainNodes_8a5579c21093ba83: function(arg0, arg1, arg2, arg3) {
21666
22522
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21667
22523
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21668
22524
  const ret = getPartialBlockchainNodes(getStringFromWasm0(arg0, arg1), v0);
21669
22525
  return ret;
21670
22526
  },
21671
- __wbg_getPartialBlockchainPeaksByBlockNum_22a173865b3df735: function(arg0, arg1, arg2) {
22527
+ __wbg_getPartialBlockchainPeaksByBlockNum_d6eeb9e6a1fba098: function(arg0, arg1, arg2) {
21672
22528
  const ret = getPartialBlockchainPeaksByBlockNum(getStringFromWasm0(arg0, arg1), arg2 >>> 0);
21673
22529
  return ret;
21674
22530
  },
@@ -21679,7 +22535,7 @@ function __wbg_get_imports() {
21679
22535
  const ret = arg0.getReader();
21680
22536
  return ret;
21681
22537
  }, arguments); },
21682
- __wbg_getSetting_f7be8e05ab8bad69: function(arg0, arg1, arg2, arg3) {
22538
+ __wbg_getSetting_1d08025676323ba9: function(arg0, arg1, arg2, arg3) {
21683
22539
  let deferred0_0;
21684
22540
  let deferred0_1;
21685
22541
  try {
@@ -21691,7 +22547,7 @@ function __wbg_get_imports() {
21691
22547
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21692
22548
  }
21693
22549
  },
21694
- __wbg_getSyncHeight_30373234e1db7d59: function(arg0, arg1) {
22550
+ __wbg_getSyncHeight_945bdd99f3962099: function(arg0, arg1) {
21695
22551
  const ret = getSyncHeight(getStringFromWasm0(arg0, arg1));
21696
22552
  return ret;
21697
22553
  },
@@ -21699,11 +22555,15 @@ function __wbg_get_imports() {
21699
22555
  const ret = arg0.getTime();
21700
22556
  return ret;
21701
22557
  },
21702
- __wbg_getTrackedBlockHeaders_a2ff7ced468be82b: function(arg0, arg1) {
22558
+ __wbg_getTrackedBlockHeaderNumbers_63af295c749079e4: function(arg0, arg1) {
22559
+ const ret = getTrackedBlockHeaderNumbers(getStringFromWasm0(arg0, arg1));
22560
+ return ret;
22561
+ },
22562
+ __wbg_getTrackedBlockHeaders_3e40bc541ec5a490: function(arg0, arg1) {
21703
22563
  const ret = getTrackedBlockHeaders(getStringFromWasm0(arg0, arg1));
21704
22564
  return ret;
21705
22565
  },
21706
- __wbg_getTransactions_fba251dc1ae7c5be: function(arg0, arg1, arg2, arg3) {
22566
+ __wbg_getTransactions_3cd589dfbcd48460: function(arg0, arg1, arg2, arg3) {
21707
22567
  let deferred0_0;
21708
22568
  let deferred0_1;
21709
22569
  try {
@@ -21715,7 +22575,7 @@ function __wbg_get_imports() {
21715
22575
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21716
22576
  }
21717
22577
  },
21718
- __wbg_getUnspentInputNoteNullifiers_b282e57f53cd12ee: function(arg0, arg1) {
22578
+ __wbg_getUnspentInputNoteNullifiers_f403872bd5cdee30: function(arg0, arg1) {
21719
22579
  const ret = getUnspentInputNoteNullifiers(getStringFromWasm0(arg0, arg1));
21720
22580
  return ret;
21721
22581
  },
@@ -21759,7 +22619,7 @@ function __wbg_get_imports() {
21759
22619
  const ret = InputNoteRecord.__wrap(arg0);
21760
22620
  return ret;
21761
22621
  },
21762
- __wbg_insertAccountAddress_6231e3afe2424f42: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22622
+ __wbg_insertAccountAddress_010cd84f15a2fba0: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21763
22623
  let deferred0_0;
21764
22624
  let deferred0_1;
21765
22625
  try {
@@ -21773,7 +22633,7 @@ function __wbg_get_imports() {
21773
22633
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21774
22634
  }
21775
22635
  },
21776
- __wbg_insertAccountAuth_a99c26f21d124b5c: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22636
+ __wbg_insertAccountAuth_47c33fb7c61f1aea: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21777
22637
  let deferred0_0;
21778
22638
  let deferred0_1;
21779
22639
  let deferred1_0;
@@ -21790,7 +22650,7 @@ function __wbg_get_imports() {
21790
22650
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
21791
22651
  }
21792
22652
  },
21793
- __wbg_insertAccountKeyMapping_4039662d288a5400: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22653
+ __wbg_insertAccountKeyMapping_b94e28f85f7038ef: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21794
22654
  let deferred0_0;
21795
22655
  let deferred0_1;
21796
22656
  let deferred1_0;
@@ -21807,7 +22667,7 @@ function __wbg_get_imports() {
21807
22667
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
21808
22668
  }
21809
22669
  },
21810
- __wbg_insertBlockHeader_e30051a2b8f281b7: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22670
+ __wbg_insertBlockHeader_f5ae91cdec3dcadd: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
21811
22671
  var v0 = getArrayU8FromWasm0(arg3, arg4).slice();
21812
22672
  wasm.__wbindgen_free(arg3, arg4 * 1, 1);
21813
22673
  var v1 = getArrayU8FromWasm0(arg5, arg6).slice();
@@ -21815,7 +22675,7 @@ function __wbg_get_imports() {
21815
22675
  const ret = insertBlockHeader(getStringFromWasm0(arg0, arg1), arg2 >>> 0, v0, v1, arg7 !== 0);
21816
22676
  return ret;
21817
22677
  },
21818
- __wbg_insertPartialBlockchainNodes_f03e6846e58f99f7: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22678
+ __wbg_insertPartialBlockchainNodes_b0cb6befaab01e5f: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21819
22679
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
21820
22680
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
21821
22681
  var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
@@ -21823,7 +22683,7 @@ function __wbg_get_imports() {
21823
22683
  const ret = insertPartialBlockchainNodes(getStringFromWasm0(arg0, arg1), v0, v1);
21824
22684
  return ret;
21825
22685
  },
21826
- __wbg_insertSetting_7f257c949e4ba7f9: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22686
+ __wbg_insertSetting_db9299455a50a86e: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21827
22687
  let deferred0_0;
21828
22688
  let deferred0_1;
21829
22689
  try {
@@ -21837,7 +22697,7 @@ function __wbg_get_imports() {
21837
22697
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
21838
22698
  }
21839
22699
  },
21840
- __wbg_insertTransactionScript_c9c414607bf00695: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22700
+ __wbg_insertTransactionScript_0ce3812a118db4dd: function(arg0, arg1, arg2, arg3, arg4, arg5) {
21841
22701
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
21842
22702
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
21843
22703
  let v1;
@@ -21930,11 +22790,11 @@ function __wbg_get_imports() {
21930
22790
  const ret = arg0.length;
21931
22791
  return ret;
21932
22792
  },
21933
- __wbg_listSettingKeys_177323a7e3eb8746: function(arg0, arg1) {
22793
+ __wbg_listSettingKeys_0a51e3f4cad7f036: function(arg0, arg1) {
21934
22794
  const ret = listSettingKeys(getStringFromWasm0(arg0, arg1));
21935
22795
  return ret;
21936
22796
  },
21937
- __wbg_lockAccount_6e14a5747a738708: function(arg0, arg1, arg2, arg3) {
22797
+ __wbg_lockAccount_8a141fe8afe53d1f: function(arg0, arg1, arg2, arg3) {
21938
22798
  let deferred0_0;
21939
22799
  let deferred0_1;
21940
22800
  try {
@@ -22018,7 +22878,7 @@ function __wbg_get_imports() {
22018
22878
  const a = state0.a;
22019
22879
  state0.a = 0;
22020
22880
  try {
22021
- return wasm_bindgen__convert__closures_____invoke__h4e730be6209b5f2c(a, state0.b, arg0, arg1);
22881
+ return wasm_bindgen__convert__closures_____invoke__h25a2b6130ec77f92(a, state0.b, arg0, arg1);
22022
22882
  } finally {
22023
22883
  state0.a = a;
22024
22884
  }
@@ -22113,6 +22973,10 @@ function __wbg_get_imports() {
22113
22973
  const ret = NoteScript.__wrap(arg0);
22114
22974
  return ret;
22115
22975
  },
22976
+ __wbg_notesyncblock_new: function(arg0) {
22977
+ const ret = NoteSyncBlock.__wrap(arg0);
22978
+ return ret;
22979
+ },
22116
22980
  __wbg_notesyncinfo_new: function(arg0) {
22117
22981
  const ret = NoteSyncInfo.__wrap(arg0);
22118
22982
  return ret;
@@ -22121,7 +22985,7 @@ function __wbg_get_imports() {
22121
22985
  const ret = NoteTag.__unwrap(arg0);
22122
22986
  return ret;
22123
22987
  },
22124
- __wbg_openDatabase_92372e9cfd9e1a0d: function(arg0, arg1, arg2, arg3) {
22988
+ __wbg_openDatabase_cde23913ad00e851: function(arg0, arg1, arg2, arg3) {
22125
22989
  const ret = openDatabase(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
22126
22990
  return ret;
22127
22991
  },
@@ -22137,10 +23001,6 @@ function __wbg_get_imports() {
22137
23001
  const ret = OutputNoteRecord.__wrap(arg0);
22138
23002
  return ret;
22139
23003
  },
22140
- __wbg_outputnotes_unwrap: function(arg0) {
22141
- const ret = OutputNotes.__unwrap(arg0);
22142
- return ret;
22143
- },
22144
23004
  __wbg_procedurethreshold_new: function(arg0) {
22145
23005
  const ret = ProcedureThreshold.__wrap(arg0);
22146
23006
  return ret;
@@ -22156,7 +23016,24 @@ function __wbg_get_imports() {
22156
23016
  const ret = ProvenTransaction.__wrap(arg0);
22157
23017
  return ret;
22158
23018
  },
22159
- __wbg_pruneIrrelevantBlocks_e695903338107987: function(arg0, arg1) {
23019
+ __wbg_pruneAccountHistory_354251ecd3d1db75: function(arg0, arg1, arg2, arg3, arg4, arg5) {
23020
+ let deferred0_0;
23021
+ let deferred0_1;
23022
+ let deferred1_0;
23023
+ let deferred1_1;
23024
+ try {
23025
+ deferred0_0 = arg2;
23026
+ deferred0_1 = arg3;
23027
+ deferred1_0 = arg4;
23028
+ deferred1_1 = arg5;
23029
+ const ret = pruneAccountHistory(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
23030
+ return ret;
23031
+ } finally {
23032
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
23033
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
23034
+ }
23035
+ },
23036
+ __wbg_pruneIrrelevantBlocks_dc97d14f31702d1f: function(arg0, arg1) {
22160
23037
  const ret = pruneIrrelevantBlocks(getStringFromWasm0(arg0, arg1));
22161
23038
  return ret;
22162
23039
  },
@@ -22174,13 +23051,37 @@ function __wbg_get_imports() {
22174
23051
  __wbg_releaseLock_aa5846c2494b3032: function(arg0) {
22175
23052
  arg0.releaseLock();
22176
23053
  },
22177
- __wbg_removeAccountAddress_26320801b9cf78cb: function(arg0, arg1, arg2, arg3) {
23054
+ __wbg_removeAccountAddress_3f0e0ecc294d79fa: function(arg0, arg1, arg2, arg3) {
22178
23055
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
22179
23056
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
22180
23057
  const ret = removeAccountAddress(getStringFromWasm0(arg0, arg1), v0);
22181
23058
  return ret;
22182
23059
  },
22183
- __wbg_removeNoteTag_a80684c949d5d911: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23060
+ __wbg_removeAccountAuth_0c07288e7cb5a02d: function(arg0, arg1, arg2, arg3) {
23061
+ let deferred0_0;
23062
+ let deferred0_1;
23063
+ try {
23064
+ deferred0_0 = arg2;
23065
+ deferred0_1 = arg3;
23066
+ const ret = removeAccountAuth(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
23067
+ return ret;
23068
+ } finally {
23069
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
23070
+ }
23071
+ },
23072
+ __wbg_removeAllMappingsForKey_17fa2424f229b2ce: function(arg0, arg1, arg2, arg3) {
23073
+ let deferred0_0;
23074
+ let deferred0_1;
23075
+ try {
23076
+ deferred0_0 = arg2;
23077
+ deferred0_1 = arg3;
23078
+ const ret = removeAllMappingsForKey(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
23079
+ return ret;
23080
+ } finally {
23081
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
23082
+ }
23083
+ },
23084
+ __wbg_removeNoteTag_3d017b00fc0fe3f2: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22184
23085
  var v0 = getArrayU8FromWasm0(arg2, arg3).slice();
22185
23086
  wasm.__wbindgen_free(arg2, arg3 * 1, 1);
22186
23087
  let v1;
@@ -22196,7 +23097,7 @@ function __wbg_get_imports() {
22196
23097
  const ret = removeNoteTag(getStringFromWasm0(arg0, arg1), v0, v1, v2);
22197
23098
  return ret;
22198
23099
  },
22199
- __wbg_removeSetting_9baeabb180b1a28d: function(arg0, arg1, arg2, arg3) {
23100
+ __wbg_removeSetting_e2432798ff986675: function(arg0, arg1, arg2, arg3) {
22200
23101
  let deferred0_0;
22201
23102
  let deferred0_1;
22202
23103
  try {
@@ -22243,6 +23144,10 @@ function __wbg_get_imports() {
22243
23144
  const ret = setTimeout(arg0, arg1);
22244
23145
  return ret;
22245
23146
  },
23147
+ __wbg_setTimeout_db2dbaeefb6f39c7: function() { return handleError(function (arg0, arg1) {
23148
+ const ret = setTimeout(arg0, arg1);
23149
+ return ret;
23150
+ }, arguments); },
22246
23151
  __wbg_set_6cb8631f80447a67: function() { return handleError(function (arg0, arg1, arg2) {
22247
23152
  const ret = Reflect.set(arg0, arg1, arg2);
22248
23153
  return ret;
@@ -22324,6 +23229,18 @@ function __wbg_get_imports() {
22324
23229
  const ret = arg0.status;
22325
23230
  return ret;
22326
23231
  },
23232
+ __wbg_storagemapentry_new: function(arg0) {
23233
+ const ret = StorageMapEntry.__wrap(arg0);
23234
+ return ret;
23235
+ },
23236
+ __wbg_storagemapinfo_new: function(arg0) {
23237
+ const ret = StorageMapInfo.__wrap(arg0);
23238
+ return ret;
23239
+ },
23240
+ __wbg_storagemapupdate_new: function(arg0) {
23241
+ const ret = StorageMapUpdate.__wrap(arg0);
23242
+ return ret;
23243
+ },
22327
23244
  __wbg_storageslot_unwrap: function(arg0) {
22328
23245
  const ret = StorageSlot.__unwrap(arg0);
22329
23246
  return ret;
@@ -22372,13 +23289,13 @@ function __wbg_get_imports() {
22372
23289
  const ret = TransactionSummary.__wrap(arg0);
22373
23290
  return ret;
22374
23291
  },
22375
- __wbg_undoAccountStates_418528d3ab74f47d: function(arg0, arg1, arg2, arg3) {
23292
+ __wbg_undoAccountStates_f1df265279e53b63: function(arg0, arg1, arg2, arg3) {
22376
23293
  var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
22377
23294
  wasm.__wbindgen_free(arg2, arg3 * 4, 4);
22378
23295
  const ret = undoAccountStates(getStringFromWasm0(arg0, arg1), v0);
22379
23296
  return ret;
22380
23297
  },
22381
- __wbg_upsertAccountCode_f0064d5ee703c4d4: function(arg0, arg1, arg2, arg3, arg4, arg5) {
23298
+ __wbg_upsertAccountCode_a4ac11852963005d: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22382
23299
  let deferred0_0;
22383
23300
  let deferred0_1;
22384
23301
  try {
@@ -22392,7 +23309,7 @@ function __wbg_get_imports() {
22392
23309
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22393
23310
  }
22394
23311
  },
22395
- __wbg_upsertAccountRecord_1a44a04b996eea5b: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) {
23312
+ __wbg_upsertAccountRecord_e676487b1aeca41f: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) {
22396
23313
  let deferred0_0;
22397
23314
  let deferred0_1;
22398
23315
  let deferred1_0;
@@ -22434,26 +23351,21 @@ function __wbg_get_imports() {
22434
23351
  wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
22435
23352
  }
22436
23353
  },
22437
- __wbg_upsertAccountStorage_5496ac9020784880: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23354
+ __wbg_upsertAccountStorage_27c35c950278ccb7: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22438
23355
  let deferred0_0;
22439
23356
  let deferred0_1;
22440
- let deferred1_0;
22441
- let deferred1_1;
22442
23357
  try {
22443
23358
  deferred0_0 = arg2;
22444
23359
  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);
23360
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
23361
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
23362
+ const ret = upsertAccountStorage(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
22450
23363
  return ret;
22451
23364
  } finally {
22452
23365
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22453
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22454
23366
  }
22455
23367
  },
22456
- __wbg_upsertForeignAccountCode_e29fa0e4e5f4f985: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23368
+ __wbg_upsertForeignAccountCode_ca44fb2bb646a2e5: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
22457
23369
  let deferred0_0;
22458
23370
  let deferred0_1;
22459
23371
  let deferred2_0;
@@ -22472,7 +23384,7 @@ function __wbg_get_imports() {
22472
23384
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
22473
23385
  }
22474
23386
  },
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) {
23387
+ __wbg_upsertInputNote_c0a91baad890bea3: 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
23388
  let deferred0_0;
22477
23389
  let deferred0_1;
22478
23390
  let deferred4_0;
@@ -22500,7 +23412,12 @@ function __wbg_get_imports() {
22500
23412
  deferred7_1 = arg17;
22501
23413
  var v8 = getArrayU8FromWasm0(arg19, arg20).slice();
22502
23414
  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);
23415
+ let v9;
23416
+ if (arg23 !== 0) {
23417
+ v9 = getStringFromWasm0(arg23, arg24).slice();
23418
+ wasm.__wbindgen_free(arg23, arg24 * 1, 1);
23419
+ }
23420
+ 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
23421
  return ret;
22505
23422
  } finally {
22506
23423
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
@@ -22509,7 +23426,7 @@ function __wbg_get_imports() {
22509
23426
  wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
22510
23427
  }
22511
23428
  },
22512
- __wbg_upsertNoteScript_2f97ba16d0d984d0: function(arg0, arg1, arg2, arg3, arg4, arg5) {
23429
+ __wbg_upsertNoteScript_a3c063a2acfa4780: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22513
23430
  let deferred0_0;
22514
23431
  let deferred0_1;
22515
23432
  try {
@@ -22523,7 +23440,7 @@ function __wbg_get_imports() {
22523
23440
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22524
23441
  }
22525
23442
  },
22526
- __wbg_upsertOutputNote_d46cc5c171b7997d: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
23443
+ __wbg_upsertOutputNote_46d6890a38b77f16: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
22527
23444
  let deferred0_0;
22528
23445
  let deferred0_1;
22529
23446
  let deferred2_0;
@@ -22551,26 +23468,21 @@ function __wbg_get_imports() {
22551
23468
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
22552
23469
  }
22553
23470
  },
22554
- __wbg_upsertStorageMapEntries_4cd61775348e0806: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23471
+ __wbg_upsertStorageMapEntries_f21a9df772c69fc9: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22555
23472
  let deferred0_0;
22556
23473
  let deferred0_1;
22557
- let deferred1_0;
22558
- let deferred1_1;
22559
23474
  try {
22560
23475
  deferred0_0 = arg2;
22561
23476
  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);
23477
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
23478
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
23479
+ const ret = upsertStorageMapEntries(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
22567
23480
  return ret;
22568
23481
  } finally {
22569
23482
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22570
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22571
23483
  }
22572
23484
  },
22573
- __wbg_upsertTransactionRecord_71e12e0dca7738c3: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) {
23485
+ __wbg_upsertTransactionRecord_0bc4df87c698be51: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) {
22574
23486
  let deferred0_0;
22575
23487
  let deferred0_1;
22576
23488
  try {
@@ -22591,23 +23503,18 @@ function __wbg_get_imports() {
22591
23503
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22592
23504
  }
22593
23505
  },
22594
- __wbg_upsertVaultAssets_9afc250da96bd5ab: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
23506
+ __wbg_upsertVaultAssets_ceae9eb0e4c816f0: function(arg0, arg1, arg2, arg3, arg4, arg5) {
22595
23507
  let deferred0_0;
22596
23508
  let deferred0_1;
22597
- let deferred1_0;
22598
- let deferred1_1;
22599
23509
  try {
22600
23510
  deferred0_0 = arg2;
22601
23511
  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);
23512
+ var v1 = getArrayJsValueFromWasm0(arg4, arg5).slice();
23513
+ wasm.__wbindgen_free(arg4, arg5 * 4, 4);
23514
+ const ret = upsertVaultAssets(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v1);
22607
23515
  return ret;
22608
23516
  } finally {
22609
23517
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
22610
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22611
23518
  }
22612
23519
  },
22613
23520
  __wbg_value_0546255b415e96c1: function(arg0) {
@@ -22627,13 +23534,13 @@ function __wbg_get_imports() {
22627
23534
  return ret;
22628
23535
  },
22629
23536
  __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);
23537
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [Externref], shim_idx: 694, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
23538
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h26b09db1ae5ec871, wasm_bindgen__convert__closures_____invoke__hd8a2ee300ada83f0);
22632
23539
  return ret;
22633
23540
  },
22634
23541
  __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);
23542
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 356, function: Function { arguments: [], shim_idx: 357, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
23543
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h26b09db1ae5ec871, wasm_bindgen__convert__closures_____invoke__h1e8a9c24645c31f0);
22637
23544
  return ret;
22638
23545
  },
22639
23546
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -22737,16 +23644,16 @@ function __wbg_get_imports() {
22737
23644
  };
22738
23645
  }
22739
23646
 
22740
- function wasm_bindgen__convert__closures_____invoke__h8c553039fb936537(arg0, arg1) {
22741
- wasm.wasm_bindgen__convert__closures_____invoke__h8c553039fb936537(arg0, arg1);
23647
+ function wasm_bindgen__convert__closures_____invoke__h1e8a9c24645c31f0(arg0, arg1) {
23648
+ wasm.wasm_bindgen__convert__closures_____invoke__h1e8a9c24645c31f0(arg0, arg1);
22742
23649
  }
22743
23650
 
22744
- function wasm_bindgen__convert__closures_____invoke__h9b776fcb85dcda59(arg0, arg1, arg2) {
22745
- wasm.wasm_bindgen__convert__closures_____invoke__h9b776fcb85dcda59(arg0, arg1, arg2);
23651
+ function wasm_bindgen__convert__closures_____invoke__hd8a2ee300ada83f0(arg0, arg1, arg2) {
23652
+ wasm.wasm_bindgen__convert__closures_____invoke__hd8a2ee300ada83f0(arg0, arg1, arg2);
22746
23653
  }
22747
23654
 
22748
- function wasm_bindgen__convert__closures_____invoke__h4e730be6209b5f2c(arg0, arg1, arg2, arg3) {
22749
- wasm.wasm_bindgen__convert__closures_____invoke__h4e730be6209b5f2c(arg0, arg1, arg2, arg3);
23655
+ function wasm_bindgen__convert__closures_____invoke__h25a2b6130ec77f92(arg0, arg1, arg2, arg3) {
23656
+ wasm.wasm_bindgen__convert__closures_____invoke__h25a2b6130ec77f92(arg0, arg1, arg2, arg3);
22750
23657
  }
22751
23658
 
22752
23659
 
@@ -22952,6 +23859,9 @@ const NoteAndArgsFinalization = (typeof FinalizationRegistry === 'undefined')
22952
23859
  const NoteAndArgsArrayFinalization = (typeof FinalizationRegistry === 'undefined')
22953
23860
  ? { register: () => {}, unregister: () => {} }
22954
23861
  : new FinalizationRegistry(ptr => wasm.__wbg_noteandargsarray_free(ptr >>> 0, 1));
23862
+ const NoteArrayFinalization = (typeof FinalizationRegistry === 'undefined')
23863
+ ? { register: () => {}, unregister: () => {} }
23864
+ : new FinalizationRegistry(ptr => wasm.__wbg_notearray_free(ptr >>> 0, 1));
22955
23865
  const NoteAssetsFinalization = (typeof FinalizationRegistry === 'undefined')
22956
23866
  ? { register: () => {}, unregister: () => {} }
22957
23867
  : new FinalizationRegistry(ptr => wasm.__wbg_noteassets_free(ptr >>> 0, 1));
@@ -23018,6 +23928,9 @@ const NoteScriptFinalization = (typeof FinalizationRegistry === 'undefined')
23018
23928
  const NoteStorageFinalization = (typeof FinalizationRegistry === 'undefined')
23019
23929
  ? { register: () => {}, unregister: () => {} }
23020
23930
  : new FinalizationRegistry(ptr => wasm.__wbg_notestorage_free(ptr >>> 0, 1));
23931
+ const NoteSyncBlockFinalization = (typeof FinalizationRegistry === 'undefined')
23932
+ ? { register: () => {}, unregister: () => {} }
23933
+ : new FinalizationRegistry(ptr => wasm.__wbg_notesyncblock_free(ptr >>> 0, 1));
23021
23934
  const NoteSyncInfoFinalization = (typeof FinalizationRegistry === 'undefined')
23022
23935
  ? { register: () => {}, unregister: () => {} }
23023
23936
  : new FinalizationRegistry(ptr => wasm.__wbg_notesyncinfo_free(ptr >>> 0, 1));
@@ -23036,15 +23949,15 @@ const OutputNoteRecordFinalization = (typeof FinalizationRegistry === 'undefined
23036
23949
  const OutputNotesFinalization = (typeof FinalizationRegistry === 'undefined')
23037
23950
  ? { register: () => {}, unregister: () => {} }
23038
23951
  : 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
23952
  const PackageFinalization = (typeof FinalizationRegistry === 'undefined')
23043
23953
  ? { register: () => {}, unregister: () => {} }
23044
23954
  : new FinalizationRegistry(ptr => wasm.__wbg_package_free(ptr >>> 0, 1));
23045
23955
  const PartialNoteFinalization = (typeof FinalizationRegistry === 'undefined')
23046
23956
  ? { register: () => {}, unregister: () => {} }
23047
23957
  : new FinalizationRegistry(ptr => wasm.__wbg_partialnote_free(ptr >>> 0, 1));
23958
+ const Poseidon2Finalization = (typeof FinalizationRegistry === 'undefined')
23959
+ ? { register: () => {}, unregister: () => {} }
23960
+ : new FinalizationRegistry(ptr => wasm.__wbg_poseidon2_free(ptr >>> 0, 1));
23048
23961
  const ProcedureThresholdFinalization = (typeof FinalizationRegistry === 'undefined')
23049
23962
  ? { register: () => {}, unregister: () => {} }
23050
23963
  : new FinalizationRegistry(ptr => wasm.__wbg_procedurethreshold_free(ptr >>> 0, 1));
@@ -23087,6 +24000,15 @@ const SparseMerklePathFinalization = (typeof FinalizationRegistry === 'undefined
23087
24000
  const StorageMapFinalization = (typeof FinalizationRegistry === 'undefined')
23088
24001
  ? { register: () => {}, unregister: () => {} }
23089
24002
  : new FinalizationRegistry(ptr => wasm.__wbg_storagemap_free(ptr >>> 0, 1));
24003
+ const StorageMapEntryFinalization = (typeof FinalizationRegistry === 'undefined')
24004
+ ? { register: () => {}, unregister: () => {} }
24005
+ : new FinalizationRegistry(ptr => wasm.__wbg_storagemapentry_free(ptr >>> 0, 1));
24006
+ const StorageMapInfoFinalization = (typeof FinalizationRegistry === 'undefined')
24007
+ ? { register: () => {}, unregister: () => {} }
24008
+ : new FinalizationRegistry(ptr => wasm.__wbg_storagemapinfo_free(ptr >>> 0, 1));
24009
+ const StorageMapUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
24010
+ ? { register: () => {}, unregister: () => {} }
24011
+ : new FinalizationRegistry(ptr => wasm.__wbg_storagemapupdate_free(ptr >>> 0, 1));
23090
24012
  const StorageSlotFinalization = (typeof FinalizationRegistry === 'undefined')
23091
24013
  ? { register: () => {}, unregister: () => {} }
23092
24014
  : new FinalizationRegistry(ptr => wasm.__wbg_storageslot_free(ptr >>> 0, 1));
@@ -23147,6 +24069,9 @@ const TransactionSummaryFinalization = (typeof FinalizationRegistry === 'undefin
23147
24069
  const WebClientFinalization = (typeof FinalizationRegistry === 'undefined')
23148
24070
  ? { register: () => {}, unregister: () => {} }
23149
24071
  : new FinalizationRegistry(ptr => wasm.__wbg_webclient_free(ptr >>> 0, 1));
24072
+ const WebKeystoreApiFinalization = (typeof FinalizationRegistry === 'undefined')
24073
+ ? { register: () => {}, unregister: () => {} }
24074
+ : new FinalizationRegistry(ptr => wasm.__wbg_webkeystoreapi_free(ptr >>> 0, 1));
23150
24075
  const WordFinalization = (typeof FinalizationRegistry === 'undefined')
23151
24076
  ? { register: () => {}, unregister: () => {} }
23152
24077
  : new FinalizationRegistry(ptr => wasm.__wbg_word_free(ptr >>> 0, 1));
@@ -23533,5 +24458,5 @@ const module$1 = new URL("assets/miden_client_web.wasm", import.meta.url);
23533
24458
 
23534
24459
  await __wbg_init({ module_or_path: module$1 });
23535
24460
 
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
24461
+ 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 };
24462
+ //# sourceMappingURL=Cargo-M1xGvXNQ.js.map