@miden-sdk/miden-sdk 0.15.0-alpha.5 → 0.15.0-alpha.7

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.
Files changed (40) hide show
  1. package/dist/mt/{Cargo-smJQCGjz.js → Cargo-C9UbiAcT.js} +62 -6
  2. package/dist/mt/{Cargo-smJQCGjz.js.map → Cargo-C9UbiAcT.js.map} +1 -1
  3. package/dist/mt/api-types.d.ts +6 -2
  4. package/dist/mt/assets/miden_client_web.wasm +0 -0
  5. package/dist/mt/crates/miden_client_web.d.ts +31 -1
  6. package/dist/mt/eager.js +2 -2
  7. package/dist/mt/index.d.ts +2 -1
  8. package/dist/mt/index.js +477 -375
  9. package/dist/mt/index.js.map +1 -1
  10. package/dist/mt/wasm.js +1 -1
  11. package/dist/mt/workerHelpers.js +1 -1
  12. package/dist/mt/workers/{Cargo-smJQCGjz-q4GYXDiD.js → Cargo-C9UbiAcT-Z344cyB1.js} +62 -6
  13. package/dist/mt/workers/{Cargo-smJQCGjz-q4GYXDiD.js.map → Cargo-C9UbiAcT-Z344cyB1.js.map} +1 -1
  14. package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
  15. package/dist/mt/workers/web-client-methods-worker.js +118 -7
  16. package/dist/mt/workers/web-client-methods-worker.js.map +1 -1
  17. package/dist/mt/workers/web-client-methods-worker.module.js +55 -2
  18. package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -1
  19. package/dist/mt/workers/workerHelpers.js +1 -1
  20. package/dist/st/{Cargo-CG4XszZo.js → Cargo-OZMlHpic.js} +24 -2
  21. package/dist/st/{Cargo-CG4XszZo.js.map → Cargo-OZMlHpic.js.map} +1 -1
  22. package/dist/st/api-types.d.ts +6 -2
  23. package/dist/st/assets/miden_client_web.wasm +0 -0
  24. package/dist/st/crates/miden_client_web.d.ts +15 -1
  25. package/dist/st/eager.js +2 -2
  26. package/dist/st/index.d.ts +2 -1
  27. package/dist/st/index.js +477 -375
  28. package/dist/st/index.js.map +1 -1
  29. package/dist/st/wasm.js +1 -1
  30. package/dist/st/workers/{Cargo-CG4XszZo-S7EHAZSa.js → Cargo-OZMlHpic-DZjvJlWc.js} +24 -2
  31. package/dist/st/workers/{Cargo-CG4XszZo-S7EHAZSa.js.map → Cargo-OZMlHpic-DZjvJlWc.js.map} +1 -1
  32. package/dist/st/workers/assets/miden_client_web.wasm +0 -0
  33. package/dist/st/workers/web-client-methods-worker.js +79 -4
  34. package/dist/st/workers/web-client-methods-worker.js.map +1 -1
  35. package/dist/st/workers/web-client-methods-worker.module.js +55 -2
  36. package/dist/st/workers/web-client-methods-worker.module.js.map +1 -1
  37. package/js/client.js +24 -5
  38. package/js/node/napi-compat.js +7 -3
  39. package/js/resources/transactions.js +4 -1
  40. package/package.json +4 -4
package/dist/mt/wasm.js CHANGED
@@ -4,7 +4,7 @@
4
4
  async function loadWasm() {
5
5
  let wasmModule;
6
6
  if (!import.meta.env || (import.meta.env && !import.meta.env.SSR)) {
7
- wasmModule = await import('./Cargo-smJQCGjz.js');
7
+ wasmModule = await import('./Cargo-C9UbiAcT.js');
8
8
  // The Cargo glue's __wbg_init TLA is stripped by the rollup build to
9
9
  // prevent blocking WKWebView module evaluation. Call it explicitly here
10
10
  // with the WASM URL that the Cargo glue pre-resolves (relative to its
@@ -14,7 +14,7 @@ function waitForMsgType(target, type) {
14
14
  });
15
15
  }
16
16
  waitForMsgType(self, 'wasm_bindgen_worker_init').then(async ({ init, receiver }) => {
17
- const pkg = await import('./Cargo-smJQCGjz.js');
17
+ const pkg = await import('./Cargo-C9UbiAcT.js');
18
18
  // Our build exports __wbg_init by name (the [remove-wasm-tla] plugin adds
19
19
  // it back so loadWasm() can call it explicitly). Stock wasm-bindgen-rayon
20
20
  // expects pkg.default — not present here, since rollup-plugin-rust's
@@ -22771,6 +22771,12 @@ class WebClient {
22771
22771
  /**
22772
22772
  * Generates a transaction proof using either the provided prover or the client's default
22773
22773
  * prover if none is supplied.
22774
+ *
22775
+ * With an explicit prover this is a pure computation over the `TransactionResult` and does
22776
+ * not touch client state, so it works on a bare `WebClient` that never ran
22777
+ * `createClient()`. "Prover-only" hosts rely on this — e.g. a `chrome.offscreen` document
22778
+ * that proves on its own rayon thread pool. Only the default-prover fallback requires an
22779
+ * initialized client.
22774
22780
  * @param {TransactionResult} transaction_result
22775
22781
  * @param {TransactionProver | null} [prover]
22776
22782
  * @returns {Promise<ProvenTransaction>}
@@ -22935,7 +22941,23 @@ class WebClient {
22935
22941
  return ret;
22936
22942
  }
22937
22943
  /**
22938
- * Internal implementation of `sync_state`.
22944
+ * Internal implementation of `sync_chain` (on-chain-only sync). Use `syncChain()` from JS.
22945
+ * @returns {Promise<SyncSummary>}
22946
+ */
22947
+ syncChainImpl() {
22948
+ const ret = wasm.webclient_syncChainImpl(this.__wbg_ptr);
22949
+ return ret;
22950
+ }
22951
+ /**
22952
+ * Internal implementation of `sync_note_transport`. Use `syncNoteTransport()` from JS.
22953
+ * @returns {Promise<void>}
22954
+ */
22955
+ syncNoteTransportImpl() {
22956
+ const ret = wasm.webclient_syncNoteTransportImpl(this.__wbg_ptr);
22957
+ return ret;
22958
+ }
22959
+ /**
22960
+ * Internal implementation of `sync_state` (combined NTL + chain sync).
22939
22961
  *
22940
22962
  * This method performs the actual sync operation. Concurrent call coordination
22941
22963
  * is handled at the JavaScript layer using the Web Locks API.
@@ -23222,6 +23244,38 @@ function initThreadPool(num_threads) {
23222
23244
  return ret;
23223
23245
  }
23224
23246
 
23247
+ /**
23248
+ * Same probe, but exported as an async fn so it runs inside a
23249
+ * wasm-bindgen-futures task — mirroring the context `proveTransaction`
23250
+ * executes in. Divergence between the two reveals whether the futures
23251
+ * context breaks rayon dispatch.
23252
+ * @returns {Promise<string>}
23253
+ */
23254
+ function mtProbeAsync() {
23255
+ const ret = wasm.mtProbeAsync();
23256
+ return ret;
23257
+ }
23258
+
23259
+ /**
23260
+ * MT diagnostics: report which rayon threads execute a tiny par_iter when
23261
+ * dispatched from a plain synchronous wasm export. `outer` is the calling
23262
+ * thread's pool index (-1 = external), `inside` the distinct pool indexes
23263
+ * that ran chunks.
23264
+ * @returns {string}
23265
+ */
23266
+ function mtProbeSync() {
23267
+ let deferred1_0;
23268
+ let deferred1_1;
23269
+ try {
23270
+ const ret = wasm.mtProbeSync();
23271
+ deferred1_0 = ret[0];
23272
+ deferred1_1 = ret[1];
23273
+ return getStringFromWasm0(ret[0], ret[1]);
23274
+ } finally {
23275
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
23276
+ }
23277
+ }
23278
+
23225
23279
  /**
23226
23280
  * Synthetic parallel benchmark: sums 0..n via `par_iter()` on the global
23227
23281
  * rayon pool. Returns elapsed micros. If the pool is actually multi-threaded,
@@ -25026,17 +25080,17 @@ function __wbg_get_imports(memory) {
25026
25080
  return ret;
25027
25081
  },
25028
25082
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
25029
- // Cast intrinsic for `Closure(Closure { dtor_idx: 122, function: Function { arguments: [Externref], shim_idx: 123, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
25083
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 125, function: Function { arguments: [Externref], shim_idx: 126, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
25030
25084
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9615981aab4586b0___closure__destroy___dyn_core_91ed24bc3d45dfd0___ops__function__FnMut__wasm_bindgen_9615981aab4586b0___JsValue____Output_______, wasm_bindgen_9615981aab4586b0___convert__closures_____invoke___wasm_bindgen_9615981aab4586b0___JsValue_____);
25031
25085
  return ret;
25032
25086
  },
25033
25087
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
25034
- // Cast intrinsic for `Closure(Closure { dtor_idx: 122, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 123, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
25088
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 125, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 126, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
25035
25089
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9615981aab4586b0___closure__destroy___dyn_core_91ed24bc3d45dfd0___ops__function__FnMut__wasm_bindgen_9615981aab4586b0___JsValue____Output_______, wasm_bindgen_9615981aab4586b0___convert__closures_____invoke___wasm_bindgen_9615981aab4586b0___JsValue_____);
25036
25090
  return ret;
25037
25091
  },
25038
25092
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
25039
- // Cast intrinsic for `Closure(Closure { dtor_idx: 122, function: Function { arguments: [], shim_idx: 444, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
25093
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 125, function: Function { arguments: [], shim_idx: 448, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
25040
25094
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9615981aab4586b0___closure__destroy___dyn_core_91ed24bc3d45dfd0___ops__function__FnMut__wasm_bindgen_9615981aab4586b0___JsValue____Output_______, wasm_bindgen_9615981aab4586b0___convert__closures_____invoke______);
25041
25095
  return ret;
25042
25096
  },
@@ -26133,6 +26187,8 @@ var index = /*#__PURE__*/Object.freeze({
26133
26187
  importStore: importStore,
26134
26188
  initSync: initSync,
26135
26189
  initThreadPool: initThreadPool,
26190
+ mtProbeAsync: mtProbeAsync,
26191
+ mtProbeSync: mtProbeSync,
26136
26192
  parallelSumBench: parallelSumBench,
26137
26193
  rayonThreadCount: rayonThreadCount,
26138
26194
  sequentialSumBench: sequentialSumBench,
@@ -26143,5 +26199,5 @@ var index = /*#__PURE__*/Object.freeze({
26143
26199
 
26144
26200
  const module$1 = new URL("assets/miden_client_web.wasm", import.meta.url);
26145
26201
 
26146
- 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, NetworkNoteStatusInfo, NetworkType, Note, NoteAndArgs, NoteAndArgsArray, NoteArray, NoteAssets, NoteAttachment, 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, StorageMapEntryJs, StorageMapInfo, StorageMapUpdate, StorageSlot, StorageSlotArray, SyncSummary, TestUtils, TokenSymbol, TransactionArgs, TransactionFilter, TransactionId, TransactionProver, TransactionRecord, TransactionRequest, TransactionRequestBuilder, TransactionResult, TransactionScript, TransactionScriptInputPair, TransactionScriptInputPairArray, TransactionStatus, TransactionStoreUpdate, TransactionSummary, WebClient, WebKeystoreApi, Word, module$1 as __wasm_url, __wbg_init, createAuthFalcon512RpoMultisig, exportStore2 as exportStore, importStore, initSync, initThreadPool, parallelSumBench, rayonThreadCount, sequentialSumBench, setupLogging, wbg_rayon_PoolBuilder, wbg_rayon_start_worker };
26147
- //# sourceMappingURL=Cargo-smJQCGjz-q4GYXDiD.js.map
26202
+ 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, NetworkNoteStatusInfo, NetworkType, Note, NoteAndArgs, NoteAndArgsArray, NoteArray, NoteAssets, NoteAttachment, 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, StorageMapEntryJs, StorageMapInfo, StorageMapUpdate, StorageSlot, StorageSlotArray, SyncSummary, TestUtils, TokenSymbol, TransactionArgs, TransactionFilter, TransactionId, TransactionProver, TransactionRecord, TransactionRequest, TransactionRequestBuilder, TransactionResult, TransactionScript, TransactionScriptInputPair, TransactionScriptInputPairArray, TransactionStatus, TransactionStoreUpdate, TransactionSummary, WebClient, WebKeystoreApi, Word, module$1 as __wasm_url, __wbg_init, createAuthFalcon512RpoMultisig, exportStore2 as exportStore, importStore, initSync, initThreadPool, mtProbeAsync, mtProbeSync, parallelSumBench, rayonThreadCount, sequentialSumBench, setupLogging, wbg_rayon_PoolBuilder, wbg_rayon_start_worker };
26203
+ //# sourceMappingURL=Cargo-C9UbiAcT-Z344cyB1.js.map