@miden-sdk/miden-sdk 0.15.4 → 0.15.6
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.
- package/README.md +29 -0
- package/dist/mt/{Cargo-DjVnfWKi.js → Cargo-mvyTli7g.js} +364 -88
- package/dist/mt/Cargo-mvyTli7g.js.map +1 -0
- package/dist/mt/api-types.d.ts +59 -0
- package/dist/mt/assets/miden_client_web.wasm +0 -0
- package/dist/mt/crates/miden_client_web.d.ts +108 -1
- package/dist/mt/docs-entry.d.ts +1 -0
- package/dist/mt/eager.js +1 -1
- package/dist/mt/index.js +92 -1
- package/dist/mt/index.js.map +1 -1
- package/dist/mt/wasm.js +1 -1
- package/dist/mt/workerHelpers.js +1 -1
- package/dist/mt/workers/{Cargo-DjVnfWKi-DvLbB_Zb.js → Cargo-mvyTli7g-BwMMSyoq.js} +364 -88
- package/dist/mt/workers/Cargo-mvyTli7g-BwMMSyoq.js.map +1 -0
- package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
- package/dist/mt/workers/web-client-methods-worker.js +365 -88
- package/dist/mt/workers/web-client-methods-worker.js.map +1 -1
- package/dist/mt/workers/web-client-methods-worker.module.js +1 -1
- package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -1
- package/dist/mt/workers/workerHelpers.js +1 -1
- package/dist/st/{Cargo-Cwpuvlbc.js → Cargo-Cysp4vto.js} +371 -96
- package/dist/st/Cargo-Cysp4vto.js.map +1 -0
- package/dist/st/api-types.d.ts +59 -0
- package/dist/st/assets/miden_client_web.wasm +0 -0
- package/dist/st/crates/miden_client_web.d.ts +108 -1
- package/dist/st/docs-entry.d.ts +1 -0
- package/dist/st/eager.js +1 -1
- package/dist/st/index.js +92 -1
- package/dist/st/index.js.map +1 -1
- package/dist/st/wasm.js +1 -1
- package/dist/st/workers/{Cargo-Cwpuvlbc-B0V_MEMU.js → Cargo-Cysp4vto-BIw-TeJn.js} +371 -96
- package/dist/st/workers/Cargo-Cysp4vto-BIw-TeJn.js.map +1 -0
- package/dist/st/workers/assets/miden_client_web.wasm +0 -0
- package/dist/st/workers/web-client-methods-worker.js +372 -96
- package/dist/st/workers/web-client-methods-worker.js.map +1 -1
- package/dist/st/workers/web-client-methods-worker.module.js +1 -1
- package/dist/st/workers/web-client-methods-worker.module.js.map +1 -1
- package/js/node-index.js +3 -0
- package/js/resources/transactions.js +91 -0
- package/js/standalone.js +61 -0
- package/package.json +4 -4
- package/dist/mt/Cargo-DjVnfWKi.js.map +0 -1
- package/dist/mt/workers/Cargo-DjVnfWKi-DvLbB_Zb.js.map +0 -1
- package/dist/st/Cargo-Cwpuvlbc.js.map +0 -1
- package/dist/st/workers/Cargo-Cwpuvlbc-B0V_MEMU.js.map +0 -1
package/README.md
CHANGED
|
@@ -560,6 +560,35 @@ await client.transactions.bridge({
|
|
|
560
560
|
|
|
561
561
|
The 20-byte destination is also available as an `EthAddress` (`EthAddress.fromHex("0x…")`) for the lower-level builders `Note.createB2AggNote(...)` and `client.newB2AggTransactionRequest(...)`.
|
|
562
562
|
|
|
563
|
+
### Network Notes
|
|
564
|
+
|
|
565
|
+
A network note is a Public note carrying a `NetworkAccountTarget` attachment; a public network account auto-consumes it once the note lands on-chain — no manual `consume` call needed on the target side.
|
|
566
|
+
|
|
567
|
+
```typescript
|
|
568
|
+
const { txId, note } = await client.transactions.createNetworkNote({
|
|
569
|
+
account: senderId,
|
|
570
|
+
target: networkAccountId,
|
|
571
|
+
script: myNoteScript, // or: recipient: myRecipient
|
|
572
|
+
waitForConfirmation: true,
|
|
573
|
+
});
|
|
574
|
+
console.log(note.isNetworkNote()); // true
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
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
|
+
|
|
579
|
+
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:
|
|
580
|
+
|
|
581
|
+
```typescript
|
|
582
|
+
const auth = AccountComponent.createNetworkAuth([myNoteScript.root()]);
|
|
583
|
+
const { account } = new AccountBuilder(seed)
|
|
584
|
+
.storageMode(AccountStorageMode.public())
|
|
585
|
+
.withComponent(myComponent)
|
|
586
|
+
.withAuthComponent(auth)
|
|
587
|
+
.build();
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
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()`.
|
|
591
|
+
|
|
563
592
|
### Cleanup
|
|
564
593
|
|
|
565
594
|
When you're finished using a MidenClient instance, call `terminate()` to release its Web Worker:
|