@miden-sdk/miden-sdk 0.15.0-alpha.4 → 0.15.0-alpha.5
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 +139 -9
- package/dist/mt/Cargo-smJQCGjz.js +26146 -0
- package/dist/mt/Cargo-smJQCGjz.js.map +1 -0
- package/dist/{api-types.d.ts → mt/api-types.d.ts} +154 -4
- package/dist/mt/assets/miden_client_web.wasm +0 -0
- package/dist/mt/crates/miden_client_web.d.ts +4791 -0
- package/dist/mt/eager.js +38 -0
- package/dist/mt/eager.js.map +1 -0
- package/dist/{index.d.ts → mt/index.d.ts} +4 -2
- package/dist/mt/index.js +3778 -0
- package/dist/mt/index.js.map +1 -0
- package/dist/{wasm.js → mt/wasm.js} +1 -1
- package/dist/mt/wasm.js.map +1 -0
- package/dist/mt/workerHelpers.js +28 -0
- package/dist/mt/workers/Cargo-smJQCGjz-q4GYXDiD.js +26147 -0
- package/dist/mt/workers/Cargo-smJQCGjz-q4GYXDiD.js.map +1 -0
- package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
- package/dist/mt/workers/web-client-methods-worker.js +26885 -0
- package/dist/mt/workers/web-client-methods-worker.js.map +1 -0
- package/dist/{workers → mt/workers}/web-client-methods-worker.module.js +17 -1
- package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -0
- package/dist/mt/workers/workerHelpers.js +28 -0
- package/dist/{Cargo-CVlXCH_2.js → st/Cargo-CG4XszZo.js} +698 -495
- package/dist/st/Cargo-CG4XszZo.js.map +1 -0
- package/dist/st/api-types.d.ts +1140 -0
- package/dist/{workers → st}/assets/miden_client_web.wasm +0 -0
- package/dist/{crates → st/crates}/miden_client_web.d.ts +342 -196
- package/dist/st/docs-entry.d.ts +38 -0
- package/dist/{eager.js → st/eager.js} +1 -1
- package/dist/st/eager.js.map +1 -0
- package/dist/st/index.d.ts +182 -0
- package/dist/{index.js → st/index.js} +425 -19
- package/dist/st/index.js.map +1 -0
- package/dist/st/wasm.js +23 -0
- package/dist/st/wasm.js.map +1 -0
- package/dist/{workers/Cargo-CVlXCH_2-CWA-5vlh.js → st/workers/Cargo-CG4XszZo-S7EHAZSa.js} +698 -495
- package/dist/st/workers/Cargo-CG4XszZo-S7EHAZSa.js.map +1 -0
- package/dist/{assets → st/workers/assets}/miden_client_web.wasm +0 -0
- package/dist/{workers → st/workers}/web-client-methods-worker.js +715 -496
- package/dist/st/workers/web-client-methods-worker.js.map +1 -0
- package/dist/st/workers/web-client-methods-worker.module.js +575 -0
- package/dist/st/workers/web-client-methods-worker.module.js.map +1 -0
- package/js/client.js +166 -2
- package/js/node/napi-compat.js +15 -0
- package/js/node-index.js +0 -1
- package/js/resources/accounts.js +4 -6
- package/js/resources/transactions.js +134 -0
- package/lazy/package.json +2 -2
- package/mt/lazy/package.json +4 -0
- package/mt/package.json +4 -0
- package/package.json +30 -15
- package/dist/Cargo-CVlXCH_2.js.map +0 -1
- package/dist/eager.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/wasm.js.map +0 -1
- package/dist/workers/Cargo-CVlXCH_2-CWA-5vlh.js.map +0 -1
- package/dist/workers/web-client-methods-worker.js.map +0 -1
- package/dist/workers/web-client-methods-worker.module.js.map +0 -1
- /package/dist/{docs-entry.d.ts → mt/docs-entry.d.ts} +0 -0
|
@@ -54,13 +54,9 @@ export class Account {
|
|
|
54
54
|
*/
|
|
55
55
|
id(): AccountId;
|
|
56
56
|
/**
|
|
57
|
-
* Returns true if the account
|
|
57
|
+
* Returns true if the account exposes a fungible-faucet interface.
|
|
58
58
|
*/
|
|
59
59
|
isFaucet(): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Returns true if this is a network-owned account.
|
|
62
|
-
*/
|
|
63
|
-
isNetwork(): boolean;
|
|
64
60
|
/**
|
|
65
61
|
* Returns true if the account has not yet been committed to the chain.
|
|
66
62
|
*/
|
|
@@ -74,13 +70,9 @@ export class Account {
|
|
|
74
70
|
*/
|
|
75
71
|
isPublic(): boolean;
|
|
76
72
|
/**
|
|
77
|
-
* Returns true if the account is a regular
|
|
73
|
+
* Returns true if the account is a regular (non-faucet) account.
|
|
78
74
|
*/
|
|
79
75
|
isRegularAccount(): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Returns true if the account can update its code.
|
|
82
|
-
*/
|
|
83
|
-
isUpdatable(): boolean;
|
|
84
76
|
/**
|
|
85
77
|
* Returns the account nonce, which is incremented on every state update.
|
|
86
78
|
*/
|
|
@@ -146,6 +138,11 @@ export class AccountBuilder {
|
|
|
146
138
|
constructor(init_seed: Uint8Array);
|
|
147
139
|
/**
|
|
148
140
|
* Sets the storage mode (public/private) for the account.
|
|
141
|
+
*
|
|
142
|
+
* The 0.15 protocol surface collapsed `AccountStorageMode` and `AccountType` into a
|
|
143
|
+
* single 2-way `AccountType` flag: setting the storage mode IS setting the account
|
|
144
|
+
* type. Calling both `accountType()` and `storageMode()` on the same builder is the
|
|
145
|
+
* last-write-wins on the underlying flag. Method kept for JS-surface back-compat.
|
|
149
146
|
*/
|
|
150
147
|
storageMode(storage_mode: AccountStorageMode): AccountBuilder;
|
|
151
148
|
/**
|
|
@@ -235,6 +232,11 @@ export class AccountComponent {
|
|
|
235
232
|
getProcedures(): GetProceduresResultItem[];
|
|
236
233
|
/**
|
|
237
234
|
* Marks the component as supporting all account types.
|
|
235
|
+
*
|
|
236
|
+
* The 0.15 protocol collapsed the per-account-type flag set on
|
|
237
|
+
* `AccountComponentMetadata::new` — every component now applies to every account type
|
|
238
|
+
* implicitly, so this method's job is to re-derive the metadata under the new
|
|
239
|
+
* (name-only) constructor while keeping the JS API surface stable.
|
|
238
240
|
*/
|
|
239
241
|
withSupportsAllTypes(): AccountComponent;
|
|
240
242
|
}
|
|
@@ -390,14 +392,6 @@ export class AccountId {
|
|
|
390
392
|
* Returns an error if the provided felts do not form a valid account ID.
|
|
391
393
|
*/
|
|
392
394
|
static fromPrefixSuffix(prefix: Felt, suffix: Felt): AccountId;
|
|
393
|
-
/**
|
|
394
|
-
* Returns true if the ID refers to a faucet.
|
|
395
|
-
*/
|
|
396
|
-
isFaucet(): boolean;
|
|
397
|
-
/**
|
|
398
|
-
* Returns true if the ID is reserved for network accounts.
|
|
399
|
-
*/
|
|
400
|
-
isNetwork(): boolean;
|
|
401
395
|
/**
|
|
402
396
|
* Returns true if the account uses private storage.
|
|
403
397
|
*/
|
|
@@ -406,10 +400,6 @@ export class AccountId {
|
|
|
406
400
|
* Returns true if the account uses public storage.
|
|
407
401
|
*/
|
|
408
402
|
isPublic(): boolean;
|
|
409
|
-
/**
|
|
410
|
-
* Returns true if the ID refers to a regular account.
|
|
411
|
-
*/
|
|
412
|
-
isRegularAccount(): boolean;
|
|
413
403
|
/**
|
|
414
404
|
* Returns the prefix field element storing metadata about version, type, and storage mode.
|
|
415
405
|
*/
|
|
@@ -705,6 +695,15 @@ export class AccountStorageDelta {
|
|
|
705
695
|
|
|
706
696
|
/**
|
|
707
697
|
* Storage visibility mode for an account.
|
|
698
|
+
*
|
|
699
|
+
* In the 0.15 protocol surface this is the same enum as `AccountType`
|
|
700
|
+
* (the on-chain identifier no longer carries any faucet-vs-regular or
|
|
701
|
+
* updatable-vs-immutable distinction), so internally we wrap an
|
|
702
|
+
* `AccountType`. The standalone `AccountStorageMode` type still exists at
|
|
703
|
+
* the JS API surface for backwards compatibility with code that wrote
|
|
704
|
+
* `AccountStorageMode.public()` / `.private()`. The pre-existing `.network()`
|
|
705
|
+
* constructor was removed — the network storage mode does not exist on the
|
|
706
|
+
* 0.15 chain.
|
|
708
707
|
*/
|
|
709
708
|
export class AccountStorageMode {
|
|
710
709
|
private constructor();
|
|
@@ -714,10 +713,6 @@ export class AccountStorageMode {
|
|
|
714
713
|
* Returns the storage mode as a string.
|
|
715
714
|
*/
|
|
716
715
|
asStr(): string;
|
|
717
|
-
/**
|
|
718
|
-
* Creates a network storage mode.
|
|
719
|
-
*/
|
|
720
|
-
static network(): AccountStorageMode;
|
|
721
716
|
/**
|
|
722
717
|
* Creates a private storage mode.
|
|
723
718
|
*/
|
|
@@ -728,6 +723,9 @@ export class AccountStorageMode {
|
|
|
728
723
|
static public(): AccountStorageMode;
|
|
729
724
|
/**
|
|
730
725
|
* Parses a storage mode from its string representation.
|
|
726
|
+
*
|
|
727
|
+
* Accepts `"private"` and `"public"`; any other input — including the
|
|
728
|
+
* previously-supported `"network"` — is rejected.
|
|
731
729
|
*/
|
|
732
730
|
static tryFromStr(s: string): AccountStorageMode;
|
|
733
731
|
}
|
|
@@ -745,11 +743,17 @@ export class AccountStorageRequirements {
|
|
|
745
743
|
constructor();
|
|
746
744
|
}
|
|
747
745
|
|
|
746
|
+
/**
|
|
747
|
+
* Storage mode of an account. The 0.15 protocol collapses the previous
|
|
748
|
+
* 4-way `{ FungibleFaucet, NonFungibleFaucet, RegularAccountImmutableCode,
|
|
749
|
+
* RegularAccountUpdatableCode }` distinction into a 2-way storage flag —
|
|
750
|
+
* faucet-vs-regular and updatable-vs-immutable distinctions are no longer
|
|
751
|
+
* part of the on-chain `AccountType` and the API loses no information by
|
|
752
|
+
* narrowing here too.
|
|
753
|
+
*/
|
|
748
754
|
export enum AccountType {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
RegularAccountImmutableCode = 2,
|
|
752
|
-
RegularAccountUpdatableCode = 3,
|
|
755
|
+
Private = 0,
|
|
756
|
+
Public = 1,
|
|
753
757
|
}
|
|
754
758
|
|
|
755
759
|
/**
|
|
@@ -895,6 +899,17 @@ export class AssetVault {
|
|
|
895
899
|
fungibleAssets(): FungibleAsset[];
|
|
896
900
|
/**
|
|
897
901
|
* Returns the balance for the given fungible faucet, or zero if absent.
|
|
902
|
+
*
|
|
903
|
+
* `get_balance` on the 0.15 surface keys by `AssetVaultKey`, not `AccountId`, and
|
|
904
|
+
* validates the composition. The callback flag is `Disabled` because fungible balance
|
|
905
|
+
* reads don't run asset callbacks. Returns zero on lookup error (`Err` arms here would
|
|
906
|
+
* indicate the key was constructed wrong, which can't happen for fungible keys built
|
|
907
|
+
* this way).
|
|
908
|
+
*
|
|
909
|
+
* NOTE: the `AssetVaultKey` encodes the callback flag, so this reports only the balance
|
|
910
|
+
* of callback-*disabled* fungible assets. Faucets built by this SDK omit transfer policies
|
|
911
|
+
* and therefore mint callback-disabled assets, so this is exact for them; an asset minted
|
|
912
|
+
* elsewhere with callbacks enabled would not be counted here.
|
|
898
913
|
*/
|
|
899
914
|
getBalance(faucet_id: AccountId): bigint;
|
|
900
915
|
/**
|
|
@@ -960,6 +975,9 @@ export class AuthSecretKey {
|
|
|
960
975
|
|
|
961
976
|
/**
|
|
962
977
|
* Provides metadata for a basic fungible faucet account component.
|
|
978
|
+
*
|
|
979
|
+
* Reads the on-chain [`FungibleFaucet`] component for the account, which holds the
|
|
980
|
+
* per-token info (symbol/decimals/maxSupply).
|
|
963
981
|
*/
|
|
964
982
|
export class BasicFungibleFaucetComponent {
|
|
965
983
|
private constructor();
|
|
@@ -1013,6 +1031,15 @@ export class BlockHeader {
|
|
|
1013
1031
|
* Returns the commitment to the block contents.
|
|
1014
1032
|
*/
|
|
1015
1033
|
commitment(): Word;
|
|
1034
|
+
/**
|
|
1035
|
+
* Returns the account ID of the fungible faucet whose assets are accepted as the native
|
|
1036
|
+
* asset of the blockchain (i.e. the asset used for paying transaction verification fees).
|
|
1037
|
+
*
|
|
1038
|
+
* This is stored on-chain as part of the block's fee parameters, which means consumers can
|
|
1039
|
+
* discover the native faucet by reading any block header rather than hardcoding it per
|
|
1040
|
+
* network.
|
|
1041
|
+
*/
|
|
1042
|
+
feeFaucetId(): AccountId;
|
|
1016
1043
|
/**
|
|
1017
1044
|
* Returns the note commitment root.
|
|
1018
1045
|
*/
|
|
@@ -1120,10 +1147,6 @@ export class CommittedNote {
|
|
|
1120
1147
|
private constructor();
|
|
1121
1148
|
free(): void;
|
|
1122
1149
|
[Symbol.dispose](): void;
|
|
1123
|
-
/**
|
|
1124
|
-
* Returns the full note metadata when the attachment payload is available.
|
|
1125
|
-
*/
|
|
1126
|
-
fullMetadata(): NoteMetadata | undefined;
|
|
1127
1150
|
/**
|
|
1128
1151
|
* Returns the inclusion path for the note in the block's note tree.
|
|
1129
1152
|
*/
|
|
@@ -1134,9 +1157,6 @@ export class CommittedNote {
|
|
|
1134
1157
|
inclusionProof(): NoteInclusionProof;
|
|
1135
1158
|
/**
|
|
1136
1159
|
* Returns the note metadata.
|
|
1137
|
-
*
|
|
1138
|
-
* If only metadata headers are available, the returned metadata contains
|
|
1139
|
-
* the sender, note type, and tag without attachment payload.
|
|
1140
1160
|
*/
|
|
1141
1161
|
metadata(): NoteMetadata;
|
|
1142
1162
|
/**
|
|
@@ -1295,6 +1315,9 @@ export class Felt {
|
|
|
1295
1315
|
asInt(): bigint;
|
|
1296
1316
|
/**
|
|
1297
1317
|
* Creates a new field element.
|
|
1318
|
+
*
|
|
1319
|
+
* Returns an error if `value` is outside the field's representable
|
|
1320
|
+
* range (`Felt::new` is fallible on the 0.15 protocol surface).
|
|
1298
1321
|
*/
|
|
1299
1322
|
constructor(value: bigint);
|
|
1300
1323
|
/**
|
|
@@ -1343,10 +1366,6 @@ export class FetchedAccount {
|
|
|
1343
1366
|
* Returns the account commitment reported by the node.
|
|
1344
1367
|
*/
|
|
1345
1368
|
commitment(): Word;
|
|
1346
|
-
/**
|
|
1347
|
-
* Returns true when the account is a network account.
|
|
1348
|
-
*/
|
|
1349
|
-
isNetwork(): boolean;
|
|
1350
1369
|
/**
|
|
1351
1370
|
* Returns true when the account is private.
|
|
1352
1371
|
*/
|
|
@@ -1364,8 +1383,15 @@ export class FetchedAccount {
|
|
|
1364
1383
|
/**
|
|
1365
1384
|
* Wrapper for a note fetched over RPC.
|
|
1366
1385
|
*
|
|
1367
|
-
* It
|
|
1368
|
-
* public notes
|
|
1386
|
+
* It carries the note ID, public metadata, and inclusion proof. The full note body is only
|
|
1387
|
+
* present for public notes; for private notes only the header-shaped fields and inclusion
|
|
1388
|
+
* proof are available — the body lives off-chain.
|
|
1389
|
+
*
|
|
1390
|
+
* 0.15 protocol surface: the on-chain `NoteHeader` now commits to a
|
|
1391
|
+
* `NoteDetailsCommitment` rather than the `NoteId`, so a `NoteHeader` can no longer be
|
|
1392
|
+
* reconstructed from header-shaped fields alone for private notes. We therefore expose
|
|
1393
|
+
* the constituent fields (`noteId`, `metadata`) directly on `FetchedNote` instead of a
|
|
1394
|
+
* `header` getter.
|
|
1369
1395
|
*/
|
|
1370
1396
|
export class FetchedNote {
|
|
1371
1397
|
free(): void;
|
|
@@ -1382,9 +1408,13 @@ export class FetchedNote {
|
|
|
1382
1408
|
*/
|
|
1383
1409
|
constructor(note_id: NoteId, metadata: NoteMetadata, inclusion_proof: NoteInclusionProof, note?: Note | null);
|
|
1384
1410
|
/**
|
|
1385
|
-
* The note's
|
|
1411
|
+
* The note's attachments.
|
|
1412
|
+
*
|
|
1413
|
+
* 0.15 returns attachment content over RPC for both public and private notes, so this is
|
|
1414
|
+
* populated even when the note body itself is private. An empty array means the note
|
|
1415
|
+
* carries no attachments.
|
|
1386
1416
|
*/
|
|
1387
|
-
readonly
|
|
1417
|
+
readonly attachments: NoteAttachment[];
|
|
1388
1418
|
/**
|
|
1389
1419
|
* The note's inclusion proof.
|
|
1390
1420
|
*
|
|
@@ -1500,6 +1530,10 @@ export class FungibleAssetDelta {
|
|
|
1500
1530
|
[Symbol.dispose](): void;
|
|
1501
1531
|
/**
|
|
1502
1532
|
* Returns the delta amount for a given faucet, if present.
|
|
1533
|
+
*
|
|
1534
|
+
* The vault key here is the one used by the fungible-delta tree, which the upstream
|
|
1535
|
+
* surface keys with `AssetCallbackFlag::Disabled` — fungible balance deltas don't run
|
|
1536
|
+
* asset callbacks. `new_fungible` on the 0.15 surface is infallible.
|
|
1503
1537
|
*/
|
|
1504
1538
|
amount(faucet_id: AccountId): bigint | undefined;
|
|
1505
1539
|
/**
|
|
@@ -1573,7 +1607,12 @@ export class InputNote {
|
|
|
1573
1607
|
*/
|
|
1574
1608
|
static authenticated(note: Note, inclusion_proof: NoteInclusionProof): InputNote;
|
|
1575
1609
|
/**
|
|
1576
|
-
* Returns the commitment to the note ID
|
|
1610
|
+
* Returns the commitment to the note (its ID).
|
|
1611
|
+
*
|
|
1612
|
+
* Migration note (miden-client PR #2214): `Note::commitment()` was
|
|
1613
|
+
* removed on the 0.15 surface — the note ID *is* the commitment (it
|
|
1614
|
+
* hashes details + metadata). Return the underlying `NoteId` as a
|
|
1615
|
+
* `Word` so the JS API contract is unchanged.
|
|
1577
1616
|
*/
|
|
1578
1617
|
commitment(): Word;
|
|
1579
1618
|
/**
|
|
@@ -1618,6 +1657,16 @@ export class InputNoteRecord {
|
|
|
1618
1657
|
private constructor();
|
|
1619
1658
|
free(): void;
|
|
1620
1659
|
[Symbol.dispose](): void;
|
|
1660
|
+
/**
|
|
1661
|
+
* Returns the note's attachments.
|
|
1662
|
+
*
|
|
1663
|
+
* On the 0.15 surface the full attachment content (the packed words) lives
|
|
1664
|
+
* on the note record itself rather than on `NoteMetadata` (which only
|
|
1665
|
+
* carries the attachment headers). This exposes that content so JS callers
|
|
1666
|
+
* can decode payloads packed via the `createNoteAttachment` helper. An
|
|
1667
|
+
* empty array means the note carries no attachments.
|
|
1668
|
+
*/
|
|
1669
|
+
attachments(): NoteAttachment[];
|
|
1621
1670
|
/**
|
|
1622
1671
|
* Returns the note commitment (id + metadata), if available.
|
|
1623
1672
|
*/
|
|
@@ -1631,9 +1680,13 @@ export class InputNoteRecord {
|
|
|
1631
1680
|
*/
|
|
1632
1681
|
details(): NoteDetails;
|
|
1633
1682
|
/**
|
|
1634
|
-
* Returns the note ID.
|
|
1683
|
+
* Returns the note ID when available.
|
|
1684
|
+
*
|
|
1685
|
+
* Migration note (miden-client PR #2214): `InputNoteRecord::id()`
|
|
1686
|
+
* returns `Option<NoteId>` — partial / metadata-less notes have no
|
|
1687
|
+
* metadata-bearing ID yet.
|
|
1635
1688
|
*/
|
|
1636
|
-
id(): NoteId;
|
|
1689
|
+
id(): NoteId | undefined;
|
|
1637
1690
|
/**
|
|
1638
1691
|
* Returns the inclusion proof when the note is authenticated.
|
|
1639
1692
|
*/
|
|
@@ -1655,9 +1708,12 @@ export class InputNoteRecord {
|
|
|
1655
1708
|
*/
|
|
1656
1709
|
metadata(): NoteMetadata | undefined;
|
|
1657
1710
|
/**
|
|
1658
|
-
* Returns the nullifier for this note.
|
|
1711
|
+
* Returns the nullifier for this note when available.
|
|
1712
|
+
*
|
|
1713
|
+
* Migration note (miden-client PR #2214): `InputNoteRecord::nullifier()`
|
|
1714
|
+
* returns `Option<Nullifier>` — partial notes have no nullifier yet.
|
|
1659
1715
|
*/
|
|
1660
|
-
nullifier(): string;
|
|
1716
|
+
nullifier(): string | undefined;
|
|
1661
1717
|
/**
|
|
1662
1718
|
* Returns the current processing state for this note.
|
|
1663
1719
|
*/
|
|
@@ -1743,17 +1799,24 @@ export class IntoUnderlyingSource {
|
|
|
1743
1799
|
|
|
1744
1800
|
/**
|
|
1745
1801
|
* Represents an update to a single account's state.
|
|
1802
|
+
*
|
|
1803
|
+
* `inspectable` is intentionally omitted (see #2183). When `inspectable` is
|
|
1804
|
+
* set on a struct with public fields, wasm-bindgen auto-generates a
|
|
1805
|
+
* `toJSON()` method that reads every field-getter — each of which calls
|
|
1806
|
+
* back into WASM via `__wbg_get_<class>_<field>(this.__wbg_ptr)`. Under
|
|
1807
|
+
* Next.js 16.2 dev-mode the patched `console.*` runs every non-primitive
|
|
1808
|
+
* argument through `safe-stable-stringify`, which invokes `toJSON()`
|
|
1809
|
+
* automatically. If the underlying pointer has been freed (or another
|
|
1810
|
+
* WASM call is in flight) the resulting `"null pointer passed to rust"`
|
|
1811
|
+
* trap propagates out of the user's `console.log` and crashes the
|
|
1812
|
+
* caller. Without `inspectable`, no `toJSON()` is emitted; JSON.stringify
|
|
1813
|
+
* falls back to `{}` (the wasm-bindgen wrapper has no own enumerable
|
|
1814
|
+
* data — it's all behind the `__wbg_ptr`), and the re-entry never
|
|
1815
|
+
* happens. Field access via the named getters still works exactly as
|
|
1816
|
+
* before; only the auto-stringification path is muted.
|
|
1746
1817
|
*/
|
|
1747
1818
|
export class JsAccountUpdate {
|
|
1748
1819
|
private constructor();
|
|
1749
|
-
/**
|
|
1750
|
-
** Return copy of self without private attributes.
|
|
1751
|
-
*/
|
|
1752
|
-
toJSON(): Object;
|
|
1753
|
-
/**
|
|
1754
|
-
* Return stringified version of self.
|
|
1755
|
-
*/
|
|
1756
|
-
toString(): string;
|
|
1757
1820
|
free(): void;
|
|
1758
1821
|
[Symbol.dispose](): void;
|
|
1759
1822
|
/**
|
|
@@ -1830,24 +1893,26 @@ export class JsStateSyncUpdate {
|
|
|
1830
1893
|
*/
|
|
1831
1894
|
blockNum: number;
|
|
1832
1895
|
/**
|
|
1833
|
-
*
|
|
1896
|
+
* Details-commitment hex of committed notes whose tracking tags
|
|
1897
|
+
* (`NoteTagSource::Note`) should be removed from the client's local state.
|
|
1834
1898
|
*/
|
|
1835
|
-
|
|
1899
|
+
committedNoteTagSources: string[];
|
|
1836
1900
|
/**
|
|
1837
1901
|
* The new block headers for this state update, serialized into a flattened byte array.
|
|
1838
1902
|
*/
|
|
1839
1903
|
flattenedNewBlockHeaders: FlattenedU8Vec;
|
|
1840
|
-
/**
|
|
1841
|
-
* Flattened byte array containing partial blockchain peaks used for merkle tree
|
|
1842
|
-
* verification.
|
|
1843
|
-
*/
|
|
1844
|
-
flattenedPartialBlockChainPeaks: FlattenedU8Vec;
|
|
1845
1904
|
/**
|
|
1846
1905
|
* The block numbers corresponding to each header in `flattened_new_block_headers`.
|
|
1847
1906
|
* This vec should have the same length as the number of headers, with each index
|
|
1848
1907
|
* representing the block number for the header at that same index.
|
|
1849
1908
|
*/
|
|
1850
1909
|
newBlockNums: Uint32Array;
|
|
1910
|
+
/**
|
|
1911
|
+
* Serialized MMR peaks at the new sync height (single set for the whole update).
|
|
1912
|
+
* Written onto the chain-tip block's `blockHeaders` row (the one whose
|
|
1913
|
+
* `blockNum` matches `block_num`) and read back by `getCurrentBlockchainPeaks`.
|
|
1914
|
+
*/
|
|
1915
|
+
partialBlockchainPeaks: Uint8Array;
|
|
1851
1916
|
/**
|
|
1852
1917
|
* Input notes for this state update in serialized form.
|
|
1853
1918
|
*/
|
|
@@ -1872,17 +1937,12 @@ export class JsStateSyncUpdate {
|
|
|
1872
1937
|
|
|
1873
1938
|
/**
|
|
1874
1939
|
* A JavaScript representation of a storage map entry in an account.
|
|
1940
|
+
*
|
|
1941
|
+
* `inspectable` is intentionally omitted — see the note on
|
|
1942
|
+
* `JsAccountUpdate` for the full rationale (#2183).
|
|
1875
1943
|
*/
|
|
1876
1944
|
export class JsStorageMapEntry {
|
|
1877
1945
|
private constructor();
|
|
1878
|
-
/**
|
|
1879
|
-
** Return copy of self without private attributes.
|
|
1880
|
-
*/
|
|
1881
|
-
toJSON(): Object;
|
|
1882
|
-
/**
|
|
1883
|
-
* Return stringified version of self.
|
|
1884
|
-
*/
|
|
1885
|
-
toString(): string;
|
|
1886
1946
|
free(): void;
|
|
1887
1947
|
[Symbol.dispose](): void;
|
|
1888
1948
|
/**
|
|
@@ -1901,17 +1961,12 @@ export class JsStorageMapEntry {
|
|
|
1901
1961
|
|
|
1902
1962
|
/**
|
|
1903
1963
|
* A JavaScript representation of a storage slot in an account.
|
|
1964
|
+
*
|
|
1965
|
+
* `inspectable` is intentionally omitted — see the note on
|
|
1966
|
+
* `JsAccountUpdate` for the full rationale (#2183).
|
|
1904
1967
|
*/
|
|
1905
1968
|
export class JsStorageSlot {
|
|
1906
1969
|
private constructor();
|
|
1907
|
-
/**
|
|
1908
|
-
** Return copy of self without private attributes.
|
|
1909
|
-
*/
|
|
1910
|
-
toJSON(): Object;
|
|
1911
|
-
/**
|
|
1912
|
-
* Return stringified version of self.
|
|
1913
|
-
*/
|
|
1914
|
-
toString(): string;
|
|
1915
1970
|
free(): void;
|
|
1916
1971
|
[Symbol.dispose](): void;
|
|
1917
1972
|
/**
|
|
@@ -1930,17 +1985,12 @@ export class JsStorageSlot {
|
|
|
1930
1985
|
|
|
1931
1986
|
/**
|
|
1932
1987
|
* An object that contains a serialized vault asset.
|
|
1988
|
+
*
|
|
1989
|
+
* `inspectable` is intentionally omitted — see the note on
|
|
1990
|
+
* `JsAccountUpdate` for the full rationale (#2183).
|
|
1933
1991
|
*/
|
|
1934
1992
|
export class JsVaultAsset {
|
|
1935
1993
|
private constructor();
|
|
1936
|
-
/**
|
|
1937
|
-
** Return copy of self without private attributes.
|
|
1938
|
-
*/
|
|
1939
|
-
toJSON(): Object;
|
|
1940
|
-
/**
|
|
1941
|
-
* Return stringified version of self.
|
|
1942
|
-
*/
|
|
1943
|
-
toString(): string;
|
|
1944
1994
|
free(): void;
|
|
1945
1995
|
[Symbol.dispose](): void;
|
|
1946
1996
|
/**
|
|
@@ -2065,7 +2115,12 @@ export class Note {
|
|
|
2065
2115
|
*/
|
|
2066
2116
|
assets(): NoteAssets;
|
|
2067
2117
|
/**
|
|
2068
|
-
* Returns the commitment to the note ID
|
|
2118
|
+
* Returns the commitment to the note (its ID).
|
|
2119
|
+
*
|
|
2120
|
+
* Migration note (miden-client PR #2214): `Note::commitment()` was
|
|
2121
|
+
* removed on the 0.15 surface — the note ID is the commitment. Return
|
|
2122
|
+
* the underlying `NoteId` as a `Word` so the JS API contract is
|
|
2123
|
+
* unchanged.
|
|
2069
2124
|
*/
|
|
2070
2125
|
commitment(): Word;
|
|
2071
2126
|
/**
|
|
@@ -2090,6 +2145,10 @@ export class Note {
|
|
|
2090
2145
|
metadata(): NoteMetadata;
|
|
2091
2146
|
/**
|
|
2092
2147
|
* Creates a new note from the provided assets, metadata, and recipient.
|
|
2148
|
+
*
|
|
2149
|
+
* Migration note (miden-client PR #2214): `Note::new` now takes a
|
|
2150
|
+
* `PartialNoteMetadata` (not `NoteMetadata`). Extract the partial
|
|
2151
|
+
* fields from the JS-side `NoteMetadata` and reconstruct.
|
|
2093
2152
|
*/
|
|
2094
2153
|
constructor(note_assets: NoteAssets, note_metadata: NoteMetadata, note_recipient: NoteRecipient);
|
|
2095
2154
|
/**
|
|
@@ -2191,65 +2250,62 @@ export class NoteAssets {
|
|
|
2191
2250
|
/**
|
|
2192
2251
|
* An attachment to a note.
|
|
2193
2252
|
*
|
|
2194
|
-
*
|
|
2195
|
-
*
|
|
2196
|
-
*
|
|
2253
|
+
* 0.15 protocol surface: an attachment is a `(scheme, content)` pair where
|
|
2254
|
+
* `content` is a flat `Vec<Word>` of 1..=256 words. The previous
|
|
2255
|
+
* `NoteAttachmentKind { Word, Array }` dispatch and the per-variant
|
|
2256
|
+
* `asWord` / `asArray` / `newWord` / `newArray` getters/constructors no
|
|
2257
|
+
* longer exist — content is always word-vector-shaped now. Use
|
|
2258
|
+
* `fromWord(scheme, word)` for the common single-word case or
|
|
2259
|
+
* `fromWords(scheme, words)` for multi-word content.
|
|
2197
2260
|
*/
|
|
2198
2261
|
export class NoteAttachment {
|
|
2199
2262
|
free(): void;
|
|
2200
2263
|
[Symbol.dispose](): void;
|
|
2201
|
-
/**
|
|
2202
|
-
* Returns the content as an array of Felts if the attachment kind is Array, otherwise None.
|
|
2203
|
-
*/
|
|
2204
|
-
asArray(): FeltArray | undefined;
|
|
2205
|
-
/**
|
|
2206
|
-
* Returns the content as a Word if the attachment kind is Word, otherwise None.
|
|
2207
|
-
*/
|
|
2208
|
-
asWord(): Word | undefined;
|
|
2209
|
-
/**
|
|
2210
|
-
* Returns the attachment kind.
|
|
2211
|
-
*/
|
|
2212
|
-
attachmentKind(): NoteAttachmentKind;
|
|
2213
2264
|
/**
|
|
2214
2265
|
* Returns the attachment scheme.
|
|
2215
2266
|
*/
|
|
2216
2267
|
attachmentScheme(): NoteAttachmentScheme;
|
|
2217
2268
|
/**
|
|
2218
|
-
* Creates a
|
|
2269
|
+
* Creates a new note attachment from a single word.
|
|
2219
2270
|
*/
|
|
2220
|
-
|
|
2271
|
+
static fromWord(scheme: NoteAttachmentScheme, word: Word): NoteAttachment;
|
|
2221
2272
|
/**
|
|
2222
|
-
* Creates a new note attachment
|
|
2273
|
+
* Creates a new note attachment from a vector of words.
|
|
2274
|
+
*
|
|
2275
|
+
* # Errors
|
|
2276
|
+
* Returns an error if `words` is empty or exceeds `NoteAttachment::MAX_NUM_WORDS`.
|
|
2223
2277
|
*/
|
|
2224
|
-
static
|
|
2278
|
+
static fromWords(scheme: NoteAttachmentScheme, words: Word[]): NoteAttachment;
|
|
2225
2279
|
/**
|
|
2226
|
-
* Creates a
|
|
2280
|
+
* Creates a note attachment from an optional list of packed values.
|
|
2227
2281
|
*
|
|
2228
|
-
*
|
|
2229
|
-
*
|
|
2230
|
-
*
|
|
2231
|
-
*
|
|
2232
|
-
*
|
|
2233
|
-
*
|
|
2234
|
-
*
|
|
2282
|
+
* Mirrors the encoding the JS-side `createNoteAttachment` helper performs
|
|
2283
|
+
* and preserves the `new NoteAttachment()` / `new NoteAttachment([...])`
|
|
2284
|
+
* ergonomics the package's own JS wrappers (`js/standalone.js`,
|
|
2285
|
+
* `js/resources/transactions.js`) rely on. The 0.15 surface has no truly
|
|
2286
|
+
* empty attachment (content is 1..=256 words), so the empty case is
|
|
2287
|
+
* represented as a single zero [`Word`] with the `none` scheme:
|
|
2288
|
+
* - no args / empty list → single zero-`Word`, `none` scheme.
|
|
2289
|
+
* - any number of values → padded to a whole number of `Word`s, `none` scheme.
|
|
2235
2290
|
*
|
|
2236
2291
|
* # Errors
|
|
2237
|
-
* Returns an error if
|
|
2292
|
+
* Returns an error if a value is not a canonical field element, or if the
|
|
2293
|
+
* packed word count exceeds `NoteAttachment::MAX_NUM_WORDS`.
|
|
2238
2294
|
*/
|
|
2239
|
-
|
|
2295
|
+
constructor(values?: BigUint64Array | null);
|
|
2240
2296
|
/**
|
|
2241
|
-
*
|
|
2297
|
+
* Returns the number of words in this attachment.
|
|
2242
2298
|
*/
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2299
|
+
numWords(): number;
|
|
2300
|
+
/**
|
|
2301
|
+
* Returns the attachment content as its constituent words.
|
|
2302
|
+
*
|
|
2303
|
+
* The content is always word-vector-shaped on the 0.15 surface, so this is
|
|
2304
|
+
* the inverse of `fromWord` / `fromWords`: it yields the same `Word`s the
|
|
2305
|
+
* attachment was built from (in order), letting JS callers decode the
|
|
2306
|
+
* packed values back out.
|
|
2307
|
+
*/
|
|
2308
|
+
toWords(): Word[];
|
|
2253
2309
|
}
|
|
2254
2310
|
|
|
2255
2311
|
/**
|
|
@@ -2261,16 +2317,16 @@ export enum NoteAttachmentKind {
|
|
|
2261
2317
|
export class NoteAttachmentScheme {
|
|
2262
2318
|
free(): void;
|
|
2263
2319
|
[Symbol.dispose](): void;
|
|
2264
|
-
/**
|
|
2265
|
-
* Returns the note attachment scheme as a u32.
|
|
2266
|
-
*/
|
|
2267
|
-
asU32(): number;
|
|
2268
2320
|
/**
|
|
2269
2321
|
* Returns true if the attachment scheme is the reserved value that signals an absent scheme.
|
|
2270
2322
|
*/
|
|
2271
2323
|
isNone(): boolean;
|
|
2272
2324
|
/**
|
|
2273
|
-
* Creates a new `NoteAttachmentScheme` from a u32.
|
|
2325
|
+
* Creates a new `NoteAttachmentScheme` from a u32 value.
|
|
2326
|
+
*
|
|
2327
|
+
* Errors if `scheme` is out of range (the 0.15 surface narrowed the
|
|
2328
|
+
* underlying type from u32 → u16, so values outside `0..=u16::MAX`
|
|
2329
|
+
* are rejected).
|
|
2274
2330
|
*/
|
|
2275
2331
|
constructor(scheme: number);
|
|
2276
2332
|
/**
|
|
@@ -2332,6 +2388,14 @@ export class NoteConsumptionStatus {
|
|
|
2332
2388
|
* Details of a note consisting of assets, script, inputs, and a serial number.
|
|
2333
2389
|
*
|
|
2334
2390
|
* See the {@link Note} type for more details.
|
|
2391
|
+
*
|
|
2392
|
+
* Migration note (miden-client PR #2214): `NoteDetails::id()` and
|
|
2393
|
+
* `NoteDetails::nullifier()` were removed on the 0.15 protocol surface —
|
|
2394
|
+
* the ID now requires a `NoteMetadata` to compute (see `NoteId::new`),
|
|
2395
|
+
* and the nullifier moved onto `InputNoteRecord` where it is optional.
|
|
2396
|
+
* Use `details_commitment()` on a containing record (e.g.
|
|
2397
|
+
* `InputNoteRecord::details_commitment`) for the metadata-independent
|
|
2398
|
+
* identifier.
|
|
2335
2399
|
*/
|
|
2336
2400
|
export class NoteDetails {
|
|
2337
2401
|
free(): void;
|
|
@@ -2340,18 +2404,10 @@ export class NoteDetails {
|
|
|
2340
2404
|
* Returns the assets locked by the note.
|
|
2341
2405
|
*/
|
|
2342
2406
|
assets(): NoteAssets;
|
|
2343
|
-
/**
|
|
2344
|
-
* Returns the note identifier derived from these details.
|
|
2345
|
-
*/
|
|
2346
|
-
id(): NoteId;
|
|
2347
2407
|
/**
|
|
2348
2408
|
* Creates a new set of note details from the given assets and recipient.
|
|
2349
2409
|
*/
|
|
2350
2410
|
constructor(note_assets: NoteAssets, note_recipient: NoteRecipient);
|
|
2351
|
-
/**
|
|
2352
|
-
* Returns the note nullifier as a word.
|
|
2353
|
-
*/
|
|
2354
|
-
nullifier(): Word;
|
|
2355
2411
|
/**
|
|
2356
2412
|
* Returns the recipient which controls when the note can be consumed.
|
|
2357
2413
|
*/
|
|
@@ -2491,9 +2547,14 @@ export class NoteFile {
|
|
|
2491
2547
|
*/
|
|
2492
2548
|
noteDetails(): NoteDetails | undefined;
|
|
2493
2549
|
/**
|
|
2494
|
-
* Returns the note ID
|
|
2550
|
+
* Returns the note ID when the file carries one.
|
|
2551
|
+
*
|
|
2552
|
+
* Migration note (miden-client PR #2214): `NoteDetails::id()` was
|
|
2553
|
+
* removed (computing the ID now requires `NoteMetadata`), so the
|
|
2554
|
+
* `NoteDetails`-only variant cannot synthesize one without extra
|
|
2555
|
+
* information. Returns `None` in that case.
|
|
2495
2556
|
*/
|
|
2496
|
-
noteId(): NoteId;
|
|
2557
|
+
noteId(): NoteId | undefined;
|
|
2497
2558
|
/**
|
|
2498
2559
|
* Returns the note tag hint when present.
|
|
2499
2560
|
*/
|
|
@@ -2504,6 +2565,10 @@ export class NoteFile {
|
|
|
2504
2565
|
noteType(): string;
|
|
2505
2566
|
/**
|
|
2506
2567
|
* Returns the note nullifier when present.
|
|
2568
|
+
*
|
|
2569
|
+
* Migration note (miden-client PR #2214): `NoteDetails::nullifier()`
|
|
2570
|
+
* was removed (the nullifier moved onto `InputNoteRecord` and is
|
|
2571
|
+
* optional there), so the `NoteDetails`-only variant returns `None`.
|
|
2507
2572
|
*/
|
|
2508
2573
|
nullifier(): string | undefined;
|
|
2509
2574
|
/**
|
|
@@ -2553,10 +2618,6 @@ export class NoteHeader {
|
|
|
2553
2618
|
* Returns the public metadata attached to the note.
|
|
2554
2619
|
*/
|
|
2555
2620
|
metadata(): NoteMetadata;
|
|
2556
|
-
/**
|
|
2557
|
-
* Returns a commitment to the note ID and metadata.
|
|
2558
|
-
*/
|
|
2559
|
-
toCommitment(): Word;
|
|
2560
2621
|
}
|
|
2561
2622
|
|
|
2562
2623
|
/**
|
|
@@ -2564,18 +2625,17 @@ export class NoteHeader {
|
|
|
2564
2625
|
*
|
|
2565
2626
|
* Note ID is computed as:
|
|
2566
2627
|
*
|
|
2567
|
-
* > `hash(
|
|
2568
|
-
*
|
|
2569
|
-
* where `recipient` is defined as:
|
|
2628
|
+
* > `hash(details_commitment, metadata_commitment)`
|
|
2570
2629
|
*
|
|
2571
|
-
*
|
|
2572
|
-
*
|
|
2573
|
-
*
|
|
2574
|
-
*
|
|
2575
|
-
* -
|
|
2576
|
-
*
|
|
2630
|
+
* On the 0.15 protocol surface the upstream `NoteId::new` signature
|
|
2631
|
+
* changed from `(recipient_digest, asset_commitment)` to
|
|
2632
|
+
* `(NoteDetailsCommitment, &NoteMetadata)`. The JS API exposes
|
|
2633
|
+
* `NoteId.fromRaw(word)` for constructing an ID from a pre-computed
|
|
2634
|
+
* 32-byte commitment word (the previous two-Word constructor has no
|
|
2635
|
+
* 0.15 equivalent).
|
|
2577
2636
|
*/
|
|
2578
2637
|
export class NoteId {
|
|
2638
|
+
private constructor();
|
|
2579
2639
|
free(): void;
|
|
2580
2640
|
[Symbol.dispose](): void;
|
|
2581
2641
|
/**
|
|
@@ -2583,9 +2643,13 @@ export class NoteId {
|
|
|
2583
2643
|
*/
|
|
2584
2644
|
static fromHex(hex: string): NoteId;
|
|
2585
2645
|
/**
|
|
2586
|
-
* Builds a note ID from
|
|
2646
|
+
* Builds a note ID from its raw commitment word.
|
|
2647
|
+
*
|
|
2648
|
+
* `word` must already encode the final note-ID commitment — the
|
|
2649
|
+
* metadata-mixing that the previous 2-Word constructor did is no
|
|
2650
|
+
* longer part of the protocol surface.
|
|
2587
2651
|
*/
|
|
2588
|
-
|
|
2652
|
+
static fromRaw(word: Word): NoteId;
|
|
2589
2653
|
/**
|
|
2590
2654
|
* Returns the canonical hex representation of the note ID.
|
|
2591
2655
|
*/
|
|
@@ -2662,18 +2726,19 @@ export class NoteLocation {
|
|
|
2662
2726
|
/**
|
|
2663
2727
|
* Metadata associated with a note.
|
|
2664
2728
|
*
|
|
2665
|
-
*
|
|
2666
|
-
*
|
|
2729
|
+
* 0.15 protocol surface: `NoteMetadata` is now constructed from a
|
|
2730
|
+
* [`PartialNoteMetadata`] (sender / `note_type` / tag) plus a `NoteAttachments`
|
|
2731
|
+
* collection — the previous `with_tag` / `with_attachment` / `attachment`
|
|
2732
|
+
* methods on `NoteMetadata` were moved (`with_tag` lives on
|
|
2733
|
+
* `PartialNoteMetadata`) or removed (`with_attachment` / `attachment`).
|
|
2734
|
+
* The JS constructor narrows back to the common case of an
|
|
2735
|
+
* attachment-less metadata.
|
|
2667
2736
|
*/
|
|
2668
2737
|
export class NoteMetadata {
|
|
2669
2738
|
free(): void;
|
|
2670
2739
|
[Symbol.dispose](): void;
|
|
2671
2740
|
/**
|
|
2672
|
-
*
|
|
2673
|
-
*/
|
|
2674
|
-
attachment(): NoteAttachment;
|
|
2675
|
-
/**
|
|
2676
|
-
* Creates metadata for a note.
|
|
2741
|
+
* Creates metadata for a note with no attachments.
|
|
2677
2742
|
*/
|
|
2678
2743
|
constructor(sender: AccountId, note_type: NoteType, note_tag: NoteTag);
|
|
2679
2744
|
/**
|
|
@@ -2688,18 +2753,6 @@ export class NoteMetadata {
|
|
|
2688
2753
|
* Returns the tag associated with the note.
|
|
2689
2754
|
*/
|
|
2690
2755
|
tag(): NoteTag;
|
|
2691
|
-
/**
|
|
2692
|
-
* Adds an attachment to this metadata and returns the updated metadata.
|
|
2693
|
-
*
|
|
2694
|
-
* Attachments provide additional context about how notes should be processed.
|
|
2695
|
-
* For example, a `NetworkAccountTarget` attachment indicates that the note
|
|
2696
|
-
* should be consumed by a specific network account.
|
|
2697
|
-
*/
|
|
2698
|
-
withAttachment(attachment: NoteAttachment): NoteMetadata;
|
|
2699
|
-
/**
|
|
2700
|
-
* Sets the tag for this metadata and returns the updated metadata.
|
|
2701
|
-
*/
|
|
2702
|
-
withTag(tag: NoteTag): NoteMetadata;
|
|
2703
2756
|
}
|
|
2704
2757
|
|
|
2705
2758
|
/**
|
|
@@ -2828,7 +2881,7 @@ export class NoteStorage {
|
|
|
2828
2881
|
}
|
|
2829
2882
|
|
|
2830
2883
|
/**
|
|
2831
|
-
* Represents a single block's worth of note sync data
|
|
2884
|
+
* Represents a single block's worth of note sync data returned by `syncNotes`.
|
|
2832
2885
|
*/
|
|
2833
2886
|
export class NoteSyncBlock {
|
|
2834
2887
|
private constructor();
|
|
@@ -2849,34 +2902,38 @@ export class NoteSyncBlock {
|
|
|
2849
2902
|
}
|
|
2850
2903
|
|
|
2851
2904
|
/**
|
|
2852
|
-
*
|
|
2905
|
+
* Aggregates the response data from `syncNotes`: the per-block updates plus
|
|
2906
|
+
* the upper bound of the requested range.
|
|
2907
|
+
*
|
|
2908
|
+
* The previous `chain_tip` accessor is gone — the upstream `sync_notes` RPC
|
|
2909
|
+
* no longer returns the current chain tip on this endpoint. Use the
|
|
2910
|
+
* regular state-sync flow (`syncState`) for the latest synced height.
|
|
2853
2911
|
*/
|
|
2854
2912
|
export class NoteSyncInfo {
|
|
2855
2913
|
private constructor();
|
|
2856
2914
|
free(): void;
|
|
2857
2915
|
[Symbol.dispose](): void;
|
|
2858
2916
|
/**
|
|
2859
|
-
* Returns the first block header
|
|
2917
|
+
* Returns the first block header with matching notes, if any. Convenience
|
|
2918
|
+
* for callers that only requested a single tag and want the most recent
|
|
2919
|
+
* inclusion block.
|
|
2860
2920
|
*/
|
|
2861
2921
|
blockHeader(): BlockHeader | undefined;
|
|
2862
2922
|
/**
|
|
2863
|
-
* Returns the
|
|
2923
|
+
* Returns the upper bound of the block range scanned in this call (the
|
|
2924
|
+
* `blockTo` argument passed to `syncNotes`).
|
|
2864
2925
|
*/
|
|
2865
2926
|
blockTo(): number;
|
|
2866
2927
|
/**
|
|
2867
|
-
* Returns the
|
|
2928
|
+
* Returns the per-block breakdown.
|
|
2868
2929
|
*/
|
|
2869
2930
|
blocks(): NoteSyncBlock[];
|
|
2870
2931
|
/**
|
|
2871
|
-
* Returns the
|
|
2872
|
-
*/
|
|
2873
|
-
chainTip(): number;
|
|
2874
|
-
/**
|
|
2875
|
-
* Returns the first block MMR path associated with matching notes, if any.
|
|
2932
|
+
* Returns the MMR path of the first block with matching notes, if any.
|
|
2876
2933
|
*/
|
|
2877
2934
|
mmrPath(): MerklePath | undefined;
|
|
2878
2935
|
/**
|
|
2879
|
-
* Returns
|
|
2936
|
+
* Returns every committed note across all matching blocks (flattened).
|
|
2880
2937
|
*/
|
|
2881
2938
|
notes(): CommittedNote[];
|
|
2882
2939
|
}
|
|
@@ -3286,9 +3343,10 @@ export class RpcClient {
|
|
|
3286
3343
|
* Fetches a note script by its root hash from the connected Miden node.
|
|
3287
3344
|
*
|
|
3288
3345
|
* @param script_root - The root hash of the note script to fetch.
|
|
3289
|
-
* @returns Promise that resolves to the `NoteScript
|
|
3346
|
+
* @returns Promise that resolves to the `NoteScript`, or `undefined` if the node has no
|
|
3347
|
+
* script for that root.
|
|
3290
3348
|
*/
|
|
3291
|
-
getNoteScriptByRoot(script_root: Word): Promise<NoteScript>;
|
|
3349
|
+
getNoteScriptByRoot(script_root: Word): Promise<NoteScript | undefined>;
|
|
3292
3350
|
/**
|
|
3293
3351
|
* Fetches notes by their IDs from the connected Miden node.
|
|
3294
3352
|
*
|
|
@@ -3312,7 +3370,7 @@ export class RpcClient {
|
|
|
3312
3370
|
/**
|
|
3313
3371
|
* Fetches notes matching the provided tags from the node.
|
|
3314
3372
|
*/
|
|
3315
|
-
syncNotes(
|
|
3373
|
+
syncNotes(block_from: number, block_to: number, note_tags: NoteTag[]): Promise<NoteSyncInfo>;
|
|
3316
3374
|
/**
|
|
3317
3375
|
* Syncs storage map updates for an account within a block range.
|
|
3318
3376
|
*
|
|
@@ -3344,6 +3402,7 @@ export class SerializedInputNoteData {
|
|
|
3344
3402
|
private constructor();
|
|
3345
3403
|
free(): void;
|
|
3346
3404
|
[Symbol.dispose](): void;
|
|
3405
|
+
attachments: Uint8Array;
|
|
3347
3406
|
get consumedBlockHeight(): number | undefined;
|
|
3348
3407
|
set consumedBlockHeight(value: number | null | undefined);
|
|
3349
3408
|
get consumedTxOrder(): number | undefined;
|
|
@@ -3351,9 +3410,11 @@ export class SerializedInputNoteData {
|
|
|
3351
3410
|
get consumerAccountId(): string | undefined;
|
|
3352
3411
|
set consumerAccountId(value: string | null | undefined);
|
|
3353
3412
|
createdAt: string;
|
|
3413
|
+
detailsCommitment: string;
|
|
3354
3414
|
inputs: Uint8Array;
|
|
3355
3415
|
noteAssets: Uint8Array;
|
|
3356
|
-
noteId: string;
|
|
3416
|
+
get noteId(): string | undefined;
|
|
3417
|
+
set noteId(value: string | null | undefined);
|
|
3357
3418
|
noteScriptRoot: string;
|
|
3358
3419
|
noteScript: Uint8Array;
|
|
3359
3420
|
nullifier: string;
|
|
@@ -3366,6 +3427,7 @@ export class SerializedOutputNoteData {
|
|
|
3366
3427
|
private constructor();
|
|
3367
3428
|
free(): void;
|
|
3368
3429
|
[Symbol.dispose](): void;
|
|
3430
|
+
attachments: Uint8Array;
|
|
3369
3431
|
expectedHeight: number;
|
|
3370
3432
|
metadata: Uint8Array;
|
|
3371
3433
|
noteAssets: Uint8Array;
|
|
@@ -3854,6 +3916,28 @@ export class TransactionProver {
|
|
|
3854
3916
|
* Returns the endpoint if this is a remote prover.
|
|
3855
3917
|
*/
|
|
3856
3918
|
endpoint(): string | undefined;
|
|
3919
|
+
/**
|
|
3920
|
+
* Creates a prover that delegates `prove()` to a JavaScript callback.
|
|
3921
|
+
*
|
|
3922
|
+
* The callback receives the serialized [`TransactionInputs`] as a
|
|
3923
|
+
* `Uint8Array` and must return a `Promise<Uint8Array>` resolving to a
|
|
3924
|
+
* serialized [`ProvenTransaction`] (same encoding the gRPC remote
|
|
3925
|
+
* prover uses: `tx_inputs.to_bytes()` in, `ProvenTransaction::read_from_bytes`
|
|
3926
|
+
* out).
|
|
3927
|
+
*
|
|
3928
|
+
* Use case: routing prove to a native iOS / Android plugin
|
|
3929
|
+
* (`@miden/native-prover`) so mobile builds skip WASM prove entirely
|
|
3930
|
+
* — `WKWebView` can't be made cross-origin-isolated reliably and the
|
|
3931
|
+
* MT WASM bundle can't instantiate without `SharedArrayBuffer`, so the
|
|
3932
|
+
* host wraps a native Rust prover (built with the same `miden_tx`
|
|
3933
|
+
* crate) and exposes a JS-shaped callback over the Capacitor bridge.
|
|
3934
|
+
*
|
|
3935
|
+
* The SDK does NOT serialize the prover for persistence across
|
|
3936
|
+
* reloads (unlike `newRemoteProver`), since the callback is a
|
|
3937
|
+
* runtime JS reference. Hosts must recreate the prover on every
|
|
3938
|
+
* page load.
|
|
3939
|
+
*/
|
|
3940
|
+
static newCallbackProver(callback: Function): TransactionProver;
|
|
3857
3941
|
/**
|
|
3858
3942
|
* Creates a prover that uses the local proving backend.
|
|
3859
3943
|
*/
|
|
@@ -4404,9 +4488,48 @@ export class WebClient {
|
|
|
4404
4488
|
getTransactions(transaction_filter: TransactionFilter): Promise<TransactionRecord[]>;
|
|
4405
4489
|
importAccountById(account_id: AccountId): Promise<void>;
|
|
4406
4490
|
importAccountFile(account_file: AccountFile): Promise<string>;
|
|
4407
|
-
|
|
4491
|
+
/**
|
|
4492
|
+
* Imports a note file and returns the imported note's identifier.
|
|
4493
|
+
*
|
|
4494
|
+
* A note file that carries metadata — an explicit `NoteId` or a full note
|
|
4495
|
+
* with proof — resolves to a concrete `NoteId`, which is returned so the
|
|
4496
|
+
* caller can look the note up with [`get_input_note`]. A details-only file
|
|
4497
|
+
* (`NoteDetails`) has no metadata and therefore no `NoteId` yet, so its
|
|
4498
|
+
* metadata-independent details commitment is returned instead.
|
|
4499
|
+
*
|
|
4500
|
+
* Migration note (miden-client PR #2214): `Client::import_notes` now
|
|
4501
|
+
* returns `Vec<NoteDetailsCommitment>` rather than `Vec<NoteId>`, since
|
|
4502
|
+
* metadata-less imports have no note ID; this method recovers the `NoteId`
|
|
4503
|
+
* from the note file when one is available.
|
|
4504
|
+
*/
|
|
4505
|
+
importNoteFile(note_file: NoteFile): Promise<string>;
|
|
4408
4506
|
importPublicAccountFromSeed(init_seed: Uint8Array, mutable: boolean, auth_scheme: AuthScheme): Promise<Account>;
|
|
4409
4507
|
insertAccountAddress(account_id: AccountId, address: Address): Promise<void>;
|
|
4508
|
+
/**
|
|
4509
|
+
* Returns the raw JS value that the most recent sign-callback invocation
|
|
4510
|
+
* threw, or `null` if the last sign call succeeded (or no call has
|
|
4511
|
+
* happened yet).
|
|
4512
|
+
*
|
|
4513
|
+
* Combined with the serialized-call discipline enforced at the JS
|
|
4514
|
+
* `WebClient` wrapper, this lets a caller that caught a failed
|
|
4515
|
+
* `executeTransaction` / `submitNewTransaction` recover the original
|
|
4516
|
+
* JS error the signing callback threw — preserving any structured
|
|
4517
|
+
* metadata (e.g. a `reason: 'locked'` property) that the kernel-level
|
|
4518
|
+
* `auth::request` diagnostic would otherwise have erased.
|
|
4519
|
+
*
|
|
4520
|
+
* # Usage (TS)
|
|
4521
|
+
* ```ts
|
|
4522
|
+
* try {
|
|
4523
|
+
* await client.submitNewTransaction(acc, req);
|
|
4524
|
+
* } catch (e) {
|
|
4525
|
+
* const authErr = client.lastAuthError();
|
|
4526
|
+
* if (authErr && authErr.reason === 'locked') {
|
|
4527
|
+
* // wait for unlock, then retry
|
|
4528
|
+
* }
|
|
4529
|
+
* }
|
|
4530
|
+
* ```
|
|
4531
|
+
*/
|
|
4532
|
+
lastAuthError(): any;
|
|
4410
4533
|
/**
|
|
4411
4534
|
* Returns all the existing setting keys from the store.
|
|
4412
4535
|
*/
|
|
@@ -4422,8 +4545,18 @@ export class WebClient {
|
|
|
4422
4545
|
*/
|
|
4423
4546
|
newAccountWithSecretKey(account: Account, secret_key: AuthSecretKey): Promise<void>;
|
|
4424
4547
|
newConsumeTransactionRequest(list_of_notes: Note[]): TransactionRequest;
|
|
4425
|
-
|
|
4548
|
+
/**
|
|
4549
|
+
* Creates, persists, and returns a new fungible faucet account.
|
|
4550
|
+
*
|
|
4551
|
+
* Only fungible faucets are supported, so passing `non_fungible = true` fails fast with a
|
|
4552
|
+
* clear message. The faucet is registered with mint and burn policies (both `AllowAll`); its
|
|
4553
|
+
* secret key is added to the keystore.
|
|
4554
|
+
*/
|
|
4555
|
+
newFaucet(storage_mode: AccountStorageMode, non_fungible: boolean, token_name: string, token_symbol: string, decimals: number, max_supply: bigint, auth_scheme: AuthScheme): Promise<Account>;
|
|
4426
4556
|
newMintTransactionRequest(target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint): Promise<TransactionRequest>;
|
|
4557
|
+
newPswapCancelTransactionRequest(pswap_note: Note, creator_account_id: AccountId): TransactionRequest;
|
|
4558
|
+
newPswapConsumeTransactionRequest(pswap_note: Note, consumer_account_id: AccountId, account_fill_amount: bigint, note_fill_amount: bigint): TransactionRequest;
|
|
4559
|
+
newPswapCreateTransactionRequest(creator_account_id: AccountId, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint, note_type: NoteType, payback_note_type: NoteType): Promise<TransactionRequest>;
|
|
4427
4560
|
newSendTransactionRequest(sender_account_id: AccountId, target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint, recall_height?: number | null, timelock_height?: number | null): Promise<TransactionRequest>;
|
|
4428
4561
|
newSwapTransactionRequest(sender_account_id: AccountId, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint, note_type: NoteType, payback_note_type: NoteType): Promise<TransactionRequest>;
|
|
4429
4562
|
newWallet(storage_mode: AccountStorageMode, mutable: boolean, auth_scheme: AuthScheme, init_seed?: Uint8Array | null): Promise<Account>;
|
|
@@ -4557,6 +4690,10 @@ export class Word {
|
|
|
4557
4690
|
static fromHex(hex: string): Word;
|
|
4558
4691
|
/**
|
|
4559
4692
|
* Creates a word from four numeric values.
|
|
4693
|
+
*
|
|
4694
|
+
* Each input must be a canonical field element, i.e. strictly less than the field modulus.
|
|
4695
|
+
* `Felt::new` (now fallible on the 0.15 surface) errors out on inputs at or beyond the
|
|
4696
|
+
* modulus; the error is surfaced to JS.
|
|
4560
4697
|
*/
|
|
4561
4698
|
constructor(u64_vec: BigUint64Array);
|
|
4562
4699
|
/**
|
|
@@ -4601,6 +4738,15 @@ export { exportStore2 as exportStore }
|
|
|
4601
4738
|
*/
|
|
4602
4739
|
export function importStore(store_name: string, store_dump: string): Promise<void>;
|
|
4603
4740
|
|
|
4741
|
+
/**
|
|
4742
|
+
* Single-threaded version of `parallel_sum_bench` for direct comparison.
|
|
4743
|
+
* Same workload, plain `iter()` — bypasses rayon entirely. Needs to live
|
|
4744
|
+
* on the WASM side rather than be reimplemented in JS so the workload is
|
|
4745
|
+
* bit-for-bit identical to `parallel_sum_bench` (same libm, same FP
|
|
4746
|
+
* determinism, same constant-folding resistance).
|
|
4747
|
+
*/
|
|
4748
|
+
export function sequentialSumBench(n: bigint): bigint;
|
|
4749
|
+
|
|
4604
4750
|
/**
|
|
4605
4751
|
* Initializes the `tracing` subscriber that routes Rust log output to the
|
|
4606
4752
|
* browser console via `console.log` / `console.warn` / `console.error`.
|