@miden-sdk/miden-sdk 0.15.5 → 0.15.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 (44) hide show
  1. package/README.md +28 -0
  2. package/dist/mt/{Cargo-C001gt8g.js → Cargo-CnGom-_z.js} +244 -86
  3. package/dist/mt/Cargo-CnGom-_z.js.map +1 -0
  4. package/dist/mt/api-types.d.ts +120 -0
  5. package/dist/mt/assets/miden_client_web.wasm +0 -0
  6. package/dist/mt/crates/miden_client_web.d.ts +80 -1
  7. package/dist/mt/docs-entry.d.ts +3 -0
  8. package/dist/mt/eager.js +1 -1
  9. package/dist/mt/index.js +252 -5
  10. package/dist/mt/index.js.map +1 -1
  11. package/dist/mt/wasm.js +1 -1
  12. package/dist/mt/workerHelpers.js +1 -1
  13. package/dist/mt/workers/{Cargo-C001gt8g-B8wBADUI.js → Cargo-CnGom-_z-X_3VwTbo.js} +244 -86
  14. package/dist/mt/workers/Cargo-CnGom-_z-X_3VwTbo.js.map +1 -0
  15. package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
  16. package/dist/mt/workers/web-client-methods-worker.js +245 -86
  17. package/dist/mt/workers/web-client-methods-worker.js.map +1 -1
  18. package/dist/mt/workers/web-client-methods-worker.module.js +1 -1
  19. package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -1
  20. package/dist/mt/workers/workerHelpers.js +1 -1
  21. package/dist/st/{Cargo-CR1mzjgg.js → Cargo-DR9fiMbE.js} +253 -96
  22. package/dist/st/Cargo-DR9fiMbE.js.map +1 -0
  23. package/dist/st/api-types.d.ts +120 -0
  24. package/dist/st/assets/miden_client_web.wasm +0 -0
  25. package/dist/st/crates/miden_client_web.d.ts +80 -1
  26. package/dist/st/docs-entry.d.ts +3 -0
  27. package/dist/st/eager.js +1 -1
  28. package/dist/st/index.js +252 -5
  29. package/dist/st/index.js.map +1 -1
  30. package/dist/st/wasm.js +1 -1
  31. package/dist/st/workers/{Cargo-CR1mzjgg-DeDmKA4W.js → Cargo-DR9fiMbE-C0G0clA_.js} +253 -96
  32. package/dist/st/workers/Cargo-DR9fiMbE-C0G0clA_.js.map +1 -0
  33. package/dist/st/workers/assets/miden_client_web.wasm +0 -0
  34. package/dist/st/workers/web-client-methods-worker.js +254 -96
  35. package/dist/st/workers/web-client-methods-worker.js.map +1 -1
  36. package/dist/st/workers/web-client-methods-worker.module.js +1 -1
  37. package/dist/st/workers/web-client-methods-worker.module.js.map +1 -1
  38. package/js/node-index.js +1 -0
  39. package/js/resources/transactions.js +251 -4
  40. package/package.json +4 -4
  41. package/dist/mt/Cargo-C001gt8g.js.map +0 -1
  42. package/dist/mt/workers/Cargo-C001gt8g-B8wBADUI.js.map +0 -1
  43. package/dist/st/Cargo-CR1mzjgg.js.map +0 -1
  44. package/dist/st/workers/Cargo-CR1mzjgg-DeDmKA4W.js.map +0 -1
package/README.md CHANGED
@@ -504,6 +504,21 @@ const { blockNumber } = await client.transactions.submitBatch(wallet, [
504
504
 
505
505
  The V1 batch primitive returns only the block number — there are no per-tx ids in the result. `waitForConfirmation` polls local sync height until it reaches `blockNumber` (rather than per-tx polling like singular `send` / `consume`).
506
506
 
507
+ ### Manual Transaction Lifecycle
508
+
509
+ `client.transactions.submit(account, request)` runs execute → prove → submit → apply in one call. To drive the stages yourself — benchmarking each step or handling errors per stage — `executeRequest` returns a staged handle you advance one step at a time. Each stage carries its own context, so you never re-thread the result or block number:
510
+
511
+ ```typescript
512
+ const executed = await client.transactions.executeRequest(wallet, request); // local only
513
+ const proven = await executed.prove(); // optional { prover } override
514
+ const submitted = await proven.submit(); // network; submitted.blockNumber
515
+ await submitted.apply(); // persist + fire observers
516
+ ```
517
+
518
+ Nothing is persisted until `apply` runs — stopping after `submit()` leaves the local store unaware of the transaction until the next sync. `submitted.waitForConfirmation()` blocks until the transaction commits on-chain.
519
+
520
+ To submit a proof produced somewhere that shares nothing with this client (a detached prover), pass it back in with `client.transactions.submitProven(proof, result)`, which returns the same submitted handle.
521
+
507
522
  ### Partial-Swap (PSWAP) Orders
508
523
 
509
524
  A partial-swap note offers one asset for another and can be filled by multiple
@@ -576,6 +591,19 @@ console.log(note.isNetworkNote()); // true
576
591
 
577
592
  Provide exactly one of `script` or `recipient`. Notes are always Public — the attachment, not the tag, is what a network account matches on. The standalone `buildNetworkNote(opts)` builds the same note without submitting.
578
593
 
594
+ To create the receiving account, build a **public** account carrying the network-account auth component — its note-script allowlist tells the node which notes the account may auto-consume:
595
+
596
+ ```typescript
597
+ const auth = AccountComponent.createNetworkAuth([myNoteScript.root()]);
598
+ const { account } = new AccountBuilder(seed)
599
+ .storageMode(AccountStorageMode.public())
600
+ .withComponent(myComponent)
601
+ .withAuthComponent(auth)
602
+ .build();
603
+ ```
604
+
605
+ The allowlist must be non-empty. Transaction scripts are forbidden unless allowlisted via the optional second argument (`TransactionScript.root()`); the component bumps the nonce itself, so the account deploys via a scriptless transaction. Readback: `account.isNetworkAccount()` and `account.networkNoteAllowlist()`.
606
+
579
607
  ### Cleanup
580
608
 
581
609
  When you're finished using a MidenClient instance, call `terminate()` to release its Web Worker: