@miden-sdk/miden-sdk 0.14.11 → 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/dist/mt/{Cargo-CZopJ--X.js → Cargo-smJQCGjz.js} +1111 -768
- package/dist/mt/Cargo-smJQCGjz.js.map +1 -0
- package/dist/mt/api-types.d.ts +122 -33
- package/dist/mt/assets/miden_client_web.wasm +0 -0
- package/dist/mt/crates/miden_client_web.d.ts +376 -303
- package/dist/mt/docs-entry.d.ts +3 -0
- package/dist/mt/eager.js +7 -4
- package/dist/mt/eager.js.map +1 -1
- package/dist/mt/index.d.ts +103 -10
- package/dist/mt/index.js +669 -312
- 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-CZopJ--X-SsyOTzpb.js → Cargo-smJQCGjz-q4GYXDiD.js} +1111 -768
- 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 +1140 -792
- package/dist/mt/workers/web-client-methods-worker.js.map +1 -1
- package/dist/mt/workers/web-client-methods-worker.module.js +23 -19
- 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-DC6jSekr.js → Cargo-CG4XszZo.js} +1105 -763
- package/dist/st/Cargo-CG4XszZo.js.map +1 -0
- package/dist/st/api-types.d.ts +122 -33
- package/dist/st/assets/miden_client_web.wasm +0 -0
- package/dist/st/crates/miden_client_web.d.ts +376 -303
- package/dist/st/docs-entry.d.ts +3 -0
- package/dist/st/eager.js +7 -4
- package/dist/st/eager.js.map +1 -1
- package/dist/st/index.d.ts +103 -10
- package/dist/st/index.js +669 -312
- package/dist/st/index.js.map +1 -1
- package/dist/st/wasm.js +1 -1
- package/dist/st/workers/{Cargo-DC6jSekr-BG7C7m56.js → Cargo-CG4XszZo-S7EHAZSa.js} +1105 -763
- package/dist/st/workers/Cargo-CG4XszZo-S7EHAZSa.js.map +1 -0
- package/dist/st/workers/assets/miden_client_web.wasm +0 -0
- package/dist/st/workers/web-client-methods-worker.js +1134 -787
- package/dist/st/workers/web-client-methods-worker.js.map +1 -1
- package/dist/st/workers/web-client-methods-worker.module.js +23 -19
- package/dist/st/workers/web-client-methods-worker.module.js.map +1 -1
- package/js/client.js +491 -0
- package/js/node/client-factory.js +117 -0
- package/js/node/loader.js +138 -0
- package/js/node/napi-compat.js +253 -0
- package/js/node-index.js +194 -0
- package/js/resources/accounts.js +222 -0
- package/js/resources/compiler.js +74 -0
- package/js/resources/keystore.js +54 -0
- package/js/resources/notes.js +124 -0
- package/js/resources/settings.js +30 -0
- package/js/resources/tags.js +31 -0
- package/js/resources/transactions.js +667 -0
- package/js/standalone.js +109 -0
- package/js/utils.js +232 -0
- package/package.json +17 -2
- package/dist/mt/Cargo-CZopJ--X.js.map +0 -1
- package/dist/mt/workers/Cargo-CZopJ--X-SsyOTzpb.js.map +0 -1
- package/dist/st/Cargo-DC6jSekr.js.map +0 -1
- package/dist/st/workers/Cargo-DC6jSekr-BG7C7m56.js.map +0 -1
|
@@ -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
|
*/
|
|
@@ -121,14 +113,6 @@ export class AccountArray {
|
|
|
121
113
|
length(): number;
|
|
122
114
|
constructor(elements?: Account[] | null);
|
|
123
115
|
push(element: Account): void;
|
|
124
|
-
/**
|
|
125
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
126
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
127
|
-
* after the call. Without this borrow, passing `elem` by
|
|
128
|
-
* value would move the underlying Rust value out of the
|
|
129
|
-
* caller's JS handle and any subsequent method on it would
|
|
130
|
-
* panic with `"null pointer passed to rust"`.
|
|
131
|
-
*/
|
|
132
116
|
replaceAt(index: number, elem: Account): void;
|
|
133
117
|
}
|
|
134
118
|
|
|
@@ -137,22 +121,28 @@ export class AccountBuilder {
|
|
|
137
121
|
[Symbol.dispose](): void;
|
|
138
122
|
/**
|
|
139
123
|
* Sets the account type (regular, faucet, etc.).
|
|
140
|
-
*
|
|
141
|
-
* Accepts either a numeric WASM enum value (0–3) or a string name
|
|
142
|
-
* (`"FungibleFaucet"`, `"NonFungibleFaucet"`,
|
|
143
|
-
* `"RegularAccountImmutableCode"`, `"RegularAccountUpdatableCode"`).
|
|
144
124
|
*/
|
|
145
|
-
accountType(account_type:
|
|
125
|
+
accountType(account_type: AccountType): AccountBuilder;
|
|
146
126
|
/**
|
|
147
|
-
* Builds the account
|
|
127
|
+
* Builds the account (including merged storage schema commitment metadata) and returns it
|
|
128
|
+
* together with the derived seed.
|
|
148
129
|
*/
|
|
149
130
|
build(): AccountBuilderResult;
|
|
131
|
+
/**
|
|
132
|
+
* Builds the account without adding the schema commitment component (legacy behavior).
|
|
133
|
+
*/
|
|
134
|
+
buildWithoutSchemaCommitment(): AccountBuilderResult;
|
|
150
135
|
/**
|
|
151
136
|
* Creates a new account builder from a 32-byte initial seed.
|
|
152
137
|
*/
|
|
153
138
|
constructor(init_seed: Uint8Array);
|
|
154
139
|
/**
|
|
155
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.
|
|
156
146
|
*/
|
|
157
147
|
storageMode(storage_mode: AccountStorageMode): AccountBuilder;
|
|
158
148
|
/**
|
|
@@ -242,6 +232,11 @@ export class AccountComponent {
|
|
|
242
232
|
getProcedures(): GetProceduresResultItem[];
|
|
243
233
|
/**
|
|
244
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.
|
|
245
240
|
*/
|
|
246
241
|
withSupportsAllTypes(): AccountComponent;
|
|
247
242
|
}
|
|
@@ -397,14 +392,6 @@ export class AccountId {
|
|
|
397
392
|
* Returns an error if the provided felts do not form a valid account ID.
|
|
398
393
|
*/
|
|
399
394
|
static fromPrefixSuffix(prefix: Felt, suffix: Felt): AccountId;
|
|
400
|
-
/**
|
|
401
|
-
* Returns true if the ID refers to a faucet.
|
|
402
|
-
*/
|
|
403
|
-
isFaucet(): boolean;
|
|
404
|
-
/**
|
|
405
|
-
* Returns true if the ID is reserved for network accounts.
|
|
406
|
-
*/
|
|
407
|
-
isNetwork(): boolean;
|
|
408
395
|
/**
|
|
409
396
|
* Returns true if the account uses private storage.
|
|
410
397
|
*/
|
|
@@ -413,10 +400,6 @@ export class AccountId {
|
|
|
413
400
|
* Returns true if the account uses public storage.
|
|
414
401
|
*/
|
|
415
402
|
isPublic(): boolean;
|
|
416
|
-
/**
|
|
417
|
-
* Returns true if the ID refers to a regular account.
|
|
418
|
-
*/
|
|
419
|
-
isRegularAccount(): boolean;
|
|
420
403
|
/**
|
|
421
404
|
* Returns the prefix field element storing metadata about version, type, and storage mode.
|
|
422
405
|
*/
|
|
@@ -453,14 +436,6 @@ export class AccountIdArray {
|
|
|
453
436
|
length(): number;
|
|
454
437
|
constructor(elements?: AccountId[] | null);
|
|
455
438
|
push(element: AccountId): void;
|
|
456
|
-
/**
|
|
457
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
458
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
459
|
-
* after the call. Without this borrow, passing `elem` by
|
|
460
|
-
* value would move the underlying Rust value out of the
|
|
461
|
-
* caller's JS handle and any subsequent method on it would
|
|
462
|
-
* panic with `"null pointer passed to rust"`.
|
|
463
|
-
*/
|
|
464
439
|
replaceAt(index: number, elem: AccountId): void;
|
|
465
440
|
}
|
|
466
441
|
|
|
@@ -510,7 +485,7 @@ export class AccountProof {
|
|
|
510
485
|
*
|
|
511
486
|
* Each entry contains a `key` and `value` as `Word` objects.
|
|
512
487
|
*/
|
|
513
|
-
getStorageMapEntries(slot_name: string):
|
|
488
|
+
getStorageMapEntries(slot_name: string): StorageMapEntryJs[] | undefined;
|
|
514
489
|
/**
|
|
515
490
|
* Returns the names of all storage slots that have map details available.
|
|
516
491
|
*
|
|
@@ -540,6 +515,13 @@ export class AccountProof {
|
|
|
540
515
|
* Returns the number of storage slots, if available (public accounts only).
|
|
541
516
|
*/
|
|
542
517
|
numStorageSlots(): number | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* Returns the fungible assets in the account's vault, if vault details were included
|
|
520
|
+
* in the proof response.
|
|
521
|
+
*
|
|
522
|
+
* Returns `undefined` if the account is private or vault data was not requested.
|
|
523
|
+
*/
|
|
524
|
+
vaultFungibleAssets(): FungibleAsset[] | undefined;
|
|
543
525
|
}
|
|
544
526
|
|
|
545
527
|
/**
|
|
@@ -669,7 +651,7 @@ export class AccountStorage {
|
|
|
669
651
|
* Returns `undefined` if the slot isn't a map or doesn't exist.
|
|
670
652
|
* Returns `[]` if the map exists but is empty.
|
|
671
653
|
*/
|
|
672
|
-
getMapEntries(slot_name: string):
|
|
654
|
+
getMapEntries(slot_name: string): StorageMapEntry[] | undefined;
|
|
673
655
|
/**
|
|
674
656
|
* Returns the value for a key in the map stored at the given slot, if any.
|
|
675
657
|
*/
|
|
@@ -713,6 +695,15 @@ export class AccountStorageDelta {
|
|
|
713
695
|
|
|
714
696
|
/**
|
|
715
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.
|
|
716
707
|
*/
|
|
717
708
|
export class AccountStorageMode {
|
|
718
709
|
private constructor();
|
|
@@ -722,10 +713,6 @@ export class AccountStorageMode {
|
|
|
722
713
|
* Returns the storage mode as a string.
|
|
723
714
|
*/
|
|
724
715
|
asStr(): string;
|
|
725
|
-
/**
|
|
726
|
-
* Creates a network storage mode.
|
|
727
|
-
*/
|
|
728
|
-
static network(): AccountStorageMode;
|
|
729
716
|
/**
|
|
730
717
|
* Creates a private storage mode.
|
|
731
718
|
*/
|
|
@@ -736,6 +723,9 @@ export class AccountStorageMode {
|
|
|
736
723
|
static public(): AccountStorageMode;
|
|
737
724
|
/**
|
|
738
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.
|
|
739
729
|
*/
|
|
740
730
|
static tryFromStr(s: string): AccountStorageMode;
|
|
741
731
|
}
|
|
@@ -753,11 +743,17 @@ export class AccountStorageRequirements {
|
|
|
753
743
|
constructor();
|
|
754
744
|
}
|
|
755
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
|
+
*/
|
|
756
754
|
export enum AccountType {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
RegularAccountImmutableCode = 2,
|
|
760
|
-
RegularAccountUpdatableCode = 3,
|
|
755
|
+
Private = 0,
|
|
756
|
+
Public = 1,
|
|
761
757
|
}
|
|
762
758
|
|
|
763
759
|
/**
|
|
@@ -903,6 +899,17 @@ export class AssetVault {
|
|
|
903
899
|
fungibleAssets(): FungibleAsset[];
|
|
904
900
|
/**
|
|
905
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.
|
|
906
913
|
*/
|
|
907
914
|
getBalance(faucet_id: AccountId): bigint;
|
|
908
915
|
/**
|
|
@@ -968,6 +975,9 @@ export class AuthSecretKey {
|
|
|
968
975
|
|
|
969
976
|
/**
|
|
970
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).
|
|
971
981
|
*/
|
|
972
982
|
export class BasicFungibleFaucetComponent {
|
|
973
983
|
private constructor();
|
|
@@ -1029,7 +1039,7 @@ export class BlockHeader {
|
|
|
1029
1039
|
* discover the native faucet by reading any block header rather than hardcoding it per
|
|
1030
1040
|
* network.
|
|
1031
1041
|
*/
|
|
1032
|
-
|
|
1042
|
+
feeFaucetId(): AccountId;
|
|
1033
1043
|
/**
|
|
1034
1044
|
* Returns the note commitment root.
|
|
1035
1045
|
*/
|
|
@@ -1137,10 +1147,6 @@ export class CommittedNote {
|
|
|
1137
1147
|
private constructor();
|
|
1138
1148
|
free(): void;
|
|
1139
1149
|
[Symbol.dispose](): void;
|
|
1140
|
-
/**
|
|
1141
|
-
* Returns the full note metadata when the attachment payload is available.
|
|
1142
|
-
*/
|
|
1143
|
-
fullMetadata(): NoteMetadata | undefined;
|
|
1144
1150
|
/**
|
|
1145
1151
|
* Returns the inclusion path for the note in the block's note tree.
|
|
1146
1152
|
*/
|
|
@@ -1151,9 +1157,6 @@ export class CommittedNote {
|
|
|
1151
1157
|
inclusionProof(): NoteInclusionProof;
|
|
1152
1158
|
/**
|
|
1153
1159
|
* Returns the note metadata.
|
|
1154
|
-
*
|
|
1155
|
-
* If only metadata headers are available, the returned metadata contains
|
|
1156
|
-
* the sender, note type, and tag without attachment payload.
|
|
1157
1160
|
*/
|
|
1158
1161
|
metadata(): NoteMetadata;
|
|
1159
1162
|
/**
|
|
@@ -1311,7 +1314,10 @@ export class Felt {
|
|
|
1311
1314
|
*/
|
|
1312
1315
|
asInt(): bigint;
|
|
1313
1316
|
/**
|
|
1314
|
-
* Creates a new field element
|
|
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).
|
|
1315
1321
|
*/
|
|
1316
1322
|
constructor(value: bigint);
|
|
1317
1323
|
/**
|
|
@@ -1338,14 +1344,6 @@ export class FeltArray {
|
|
|
1338
1344
|
length(): number;
|
|
1339
1345
|
constructor(elements?: Felt[] | null);
|
|
1340
1346
|
push(element: Felt): void;
|
|
1341
|
-
/**
|
|
1342
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
1343
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
1344
|
-
* after the call. Without this borrow, passing `elem` by
|
|
1345
|
-
* value would move the underlying Rust value out of the
|
|
1346
|
-
* caller's JS handle and any subsequent method on it would
|
|
1347
|
-
* panic with `"null pointer passed to rust"`.
|
|
1348
|
-
*/
|
|
1349
1347
|
replaceAt(index: number, elem: Felt): void;
|
|
1350
1348
|
}
|
|
1351
1349
|
|
|
@@ -1368,10 +1366,6 @@ export class FetchedAccount {
|
|
|
1368
1366
|
* Returns the account commitment reported by the node.
|
|
1369
1367
|
*/
|
|
1370
1368
|
commitment(): Word;
|
|
1371
|
-
/**
|
|
1372
|
-
* Returns true when the account is a network account.
|
|
1373
|
-
*/
|
|
1374
|
-
isNetwork(): boolean;
|
|
1375
1369
|
/**
|
|
1376
1370
|
* Returns true when the account is private.
|
|
1377
1371
|
*/
|
|
@@ -1389,8 +1383,15 @@ export class FetchedAccount {
|
|
|
1389
1383
|
/**
|
|
1390
1384
|
* Wrapper for a note fetched over RPC.
|
|
1391
1385
|
*
|
|
1392
|
-
* It
|
|
1393
|
-
* 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.
|
|
1394
1395
|
*/
|
|
1395
1396
|
export class FetchedNote {
|
|
1396
1397
|
free(): void;
|
|
@@ -1407,9 +1408,13 @@ export class FetchedNote {
|
|
|
1407
1408
|
*/
|
|
1408
1409
|
constructor(note_id: NoteId, metadata: NoteMetadata, inclusion_proof: NoteInclusionProof, note?: Note | null);
|
|
1409
1410
|
/**
|
|
1410
|
-
* 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.
|
|
1411
1416
|
*/
|
|
1412
|
-
readonly
|
|
1417
|
+
readonly attachments: NoteAttachment[];
|
|
1413
1418
|
/**
|
|
1414
1419
|
* The note's inclusion proof.
|
|
1415
1420
|
*
|
|
@@ -1486,14 +1491,6 @@ export class ForeignAccountArray {
|
|
|
1486
1491
|
length(): number;
|
|
1487
1492
|
constructor(elements?: ForeignAccount[] | null);
|
|
1488
1493
|
push(element: ForeignAccount): void;
|
|
1489
|
-
/**
|
|
1490
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
1491
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
1492
|
-
* after the call. Without this borrow, passing `elem` by
|
|
1493
|
-
* value would move the underlying Rust value out of the
|
|
1494
|
-
* caller's JS handle and any subsequent method on it would
|
|
1495
|
-
* panic with `"null pointer passed to rust"`.
|
|
1496
|
-
*/
|
|
1497
1494
|
replaceAt(index: number, elem: ForeignAccount): void;
|
|
1498
1495
|
}
|
|
1499
1496
|
|
|
@@ -1533,6 +1530,10 @@ export class FungibleAssetDelta {
|
|
|
1533
1530
|
[Symbol.dispose](): void;
|
|
1534
1531
|
/**
|
|
1535
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.
|
|
1536
1537
|
*/
|
|
1537
1538
|
amount(faucet_id: AccountId): bigint | undefined;
|
|
1538
1539
|
/**
|
|
@@ -1606,7 +1607,12 @@ export class InputNote {
|
|
|
1606
1607
|
*/
|
|
1607
1608
|
static authenticated(note: Note, inclusion_proof: NoteInclusionProof): InputNote;
|
|
1608
1609
|
/**
|
|
1609
|
-
* 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.
|
|
1610
1616
|
*/
|
|
1611
1617
|
commitment(): Word;
|
|
1612
1618
|
/**
|
|
@@ -1651,6 +1657,16 @@ export class InputNoteRecord {
|
|
|
1651
1657
|
private constructor();
|
|
1652
1658
|
free(): void;
|
|
1653
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[];
|
|
1654
1670
|
/**
|
|
1655
1671
|
* Returns the note commitment (id + metadata), if available.
|
|
1656
1672
|
*/
|
|
@@ -1664,9 +1680,13 @@ export class InputNoteRecord {
|
|
|
1664
1680
|
*/
|
|
1665
1681
|
details(): NoteDetails;
|
|
1666
1682
|
/**
|
|
1667
|
-
* 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.
|
|
1668
1688
|
*/
|
|
1669
|
-
id(): NoteId;
|
|
1689
|
+
id(): NoteId | undefined;
|
|
1670
1690
|
/**
|
|
1671
1691
|
* Returns the inclusion proof when the note is authenticated.
|
|
1672
1692
|
*/
|
|
@@ -1688,9 +1708,12 @@ export class InputNoteRecord {
|
|
|
1688
1708
|
*/
|
|
1689
1709
|
metadata(): NoteMetadata | undefined;
|
|
1690
1710
|
/**
|
|
1691
|
-
* 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.
|
|
1692
1715
|
*/
|
|
1693
|
-
nullifier(): string;
|
|
1716
|
+
nullifier(): string | undefined;
|
|
1694
1717
|
/**
|
|
1695
1718
|
* Returns the current processing state for this note.
|
|
1696
1719
|
*/
|
|
@@ -1870,24 +1893,26 @@ export class JsStateSyncUpdate {
|
|
|
1870
1893
|
*/
|
|
1871
1894
|
blockNum: number;
|
|
1872
1895
|
/**
|
|
1873
|
-
*
|
|
1896
|
+
* Details-commitment hex of committed notes whose tracking tags
|
|
1897
|
+
* (`NoteTagSource::Note`) should be removed from the client's local state.
|
|
1874
1898
|
*/
|
|
1875
|
-
|
|
1899
|
+
committedNoteTagSources: string[];
|
|
1876
1900
|
/**
|
|
1877
1901
|
* The new block headers for this state update, serialized into a flattened byte array.
|
|
1878
1902
|
*/
|
|
1879
1903
|
flattenedNewBlockHeaders: FlattenedU8Vec;
|
|
1880
|
-
/**
|
|
1881
|
-
* Flattened byte array containing partial blockchain peaks used for merkle tree
|
|
1882
|
-
* verification.
|
|
1883
|
-
*/
|
|
1884
|
-
flattenedPartialBlockChainPeaks: FlattenedU8Vec;
|
|
1885
1904
|
/**
|
|
1886
1905
|
* The block numbers corresponding to each header in `flattened_new_block_headers`.
|
|
1887
1906
|
* This vec should have the same length as the number of headers, with each index
|
|
1888
1907
|
* representing the block number for the header at that same index.
|
|
1889
1908
|
*/
|
|
1890
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;
|
|
1891
1916
|
/**
|
|
1892
1917
|
* Input notes for this state update in serialized form.
|
|
1893
1918
|
*/
|
|
@@ -2027,6 +2052,32 @@ export class NetworkId {
|
|
|
2027
2052
|
static testnet(): NetworkId;
|
|
2028
2053
|
}
|
|
2029
2054
|
|
|
2055
|
+
/**
|
|
2056
|
+
* Status of a network note in the node.
|
|
2057
|
+
*/
|
|
2058
|
+
export class NetworkNoteStatusInfo {
|
|
2059
|
+
private constructor();
|
|
2060
|
+
free(): void;
|
|
2061
|
+
[Symbol.dispose](): void;
|
|
2062
|
+
/**
|
|
2063
|
+
* Returns the number of processing attempts.
|
|
2064
|
+
*/
|
|
2065
|
+
readonly attemptCount: number;
|
|
2066
|
+
/**
|
|
2067
|
+
* Returns the block number of the last processing attempt, if any.
|
|
2068
|
+
*/
|
|
2069
|
+
readonly lastAttemptBlockNum: number | undefined;
|
|
2070
|
+
/**
|
|
2071
|
+
* Returns the last error message, if any.
|
|
2072
|
+
*/
|
|
2073
|
+
readonly lastError: string | undefined;
|
|
2074
|
+
/**
|
|
2075
|
+
* Returns the status as a string: `"Pending"`, `"NullifierInflight"`, `"Discarded"`, or
|
|
2076
|
+
* `"NullifierCommitted"`.
|
|
2077
|
+
*/
|
|
2078
|
+
readonly status: string;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2030
2081
|
/**
|
|
2031
2082
|
* The type of a Miden network.
|
|
2032
2083
|
*/
|
|
@@ -2064,7 +2115,12 @@ export class Note {
|
|
|
2064
2115
|
*/
|
|
2065
2116
|
assets(): NoteAssets;
|
|
2066
2117
|
/**
|
|
2067
|
-
* 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.
|
|
2068
2124
|
*/
|
|
2069
2125
|
commitment(): Word;
|
|
2070
2126
|
/**
|
|
@@ -2089,6 +2145,10 @@ export class Note {
|
|
|
2089
2145
|
metadata(): NoteMetadata;
|
|
2090
2146
|
/**
|
|
2091
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.
|
|
2092
2152
|
*/
|
|
2093
2153
|
constructor(note_assets: NoteAssets, note_metadata: NoteMetadata, note_recipient: NoteRecipient);
|
|
2094
2154
|
/**
|
|
@@ -2136,14 +2196,6 @@ export class NoteAndArgsArray {
|
|
|
2136
2196
|
length(): number;
|
|
2137
2197
|
constructor(elements?: NoteAndArgs[] | null);
|
|
2138
2198
|
push(element: NoteAndArgs): void;
|
|
2139
|
-
/**
|
|
2140
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
2141
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
2142
|
-
* after the call. Without this borrow, passing `elem` by
|
|
2143
|
-
* value would move the underlying Rust value out of the
|
|
2144
|
-
* caller's JS handle and any subsequent method on it would
|
|
2145
|
-
* panic with `"null pointer passed to rust"`.
|
|
2146
|
-
*/
|
|
2147
2199
|
replaceAt(index: number, elem: NoteAndArgs): void;
|
|
2148
2200
|
}
|
|
2149
2201
|
|
|
@@ -2165,14 +2217,6 @@ export class NoteArray {
|
|
|
2165
2217
|
length(): number;
|
|
2166
2218
|
constructor(elements?: Note[] | null);
|
|
2167
2219
|
push(element: Note): void;
|
|
2168
|
-
/**
|
|
2169
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
2170
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
2171
|
-
* after the call. Without this borrow, passing `elem` by
|
|
2172
|
-
* value would move the underlying Rust value out of the
|
|
2173
|
-
* caller's JS handle and any subsequent method on it would
|
|
2174
|
-
* panic with `"null pointer passed to rust"`.
|
|
2175
|
-
*/
|
|
2176
2220
|
replaceAt(index: number, elem: Note): void;
|
|
2177
2221
|
}
|
|
2178
2222
|
|
|
@@ -2206,65 +2250,62 @@ export class NoteAssets {
|
|
|
2206
2250
|
/**
|
|
2207
2251
|
* An attachment to a note.
|
|
2208
2252
|
*
|
|
2209
|
-
*
|
|
2210
|
-
*
|
|
2211
|
-
*
|
|
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.
|
|
2212
2260
|
*/
|
|
2213
2261
|
export class NoteAttachment {
|
|
2214
2262
|
free(): void;
|
|
2215
2263
|
[Symbol.dispose](): void;
|
|
2216
|
-
/**
|
|
2217
|
-
* Returns the content as an array of Felts if the attachment kind is Array, otherwise None.
|
|
2218
|
-
*/
|
|
2219
|
-
asArray(): FeltArray | undefined;
|
|
2220
|
-
/**
|
|
2221
|
-
* Returns the content as a Word if the attachment kind is Word, otherwise None.
|
|
2222
|
-
*/
|
|
2223
|
-
asWord(): Word | undefined;
|
|
2224
|
-
/**
|
|
2225
|
-
* Returns the attachment kind.
|
|
2226
|
-
*/
|
|
2227
|
-
attachmentKind(): NoteAttachmentKind;
|
|
2228
2264
|
/**
|
|
2229
2265
|
* Returns the attachment scheme.
|
|
2230
2266
|
*/
|
|
2231
2267
|
attachmentScheme(): NoteAttachmentScheme;
|
|
2232
2268
|
/**
|
|
2233
|
-
* Creates a
|
|
2269
|
+
* Creates a new note attachment from a single word.
|
|
2234
2270
|
*/
|
|
2235
|
-
|
|
2271
|
+
static fromWord(scheme: NoteAttachmentScheme, word: Word): NoteAttachment;
|
|
2236
2272
|
/**
|
|
2237
|
-
* 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`.
|
|
2238
2277
|
*/
|
|
2239
|
-
static
|
|
2278
|
+
static fromWords(scheme: NoteAttachmentScheme, words: Word[]): NoteAttachment;
|
|
2240
2279
|
/**
|
|
2241
|
-
* Creates a
|
|
2242
|
-
*
|
|
2243
|
-
* This attachment indicates that the note should be consumed by a specific network account.
|
|
2244
|
-
* Network accounts are accounts whose storage mode is `Network`, meaning the network (nodes)
|
|
2245
|
-
* can execute transactions on behalf of the account.
|
|
2280
|
+
* Creates a note attachment from an optional list of packed values.
|
|
2246
2281
|
*
|
|
2247
|
-
*
|
|
2248
|
-
*
|
|
2249
|
-
*
|
|
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.
|
|
2250
2290
|
*
|
|
2251
2291
|
* # Errors
|
|
2252
|
-
* 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`.
|
|
2253
2294
|
*/
|
|
2254
|
-
|
|
2295
|
+
constructor(values?: BigUint64Array | null);
|
|
2255
2296
|
/**
|
|
2256
|
-
*
|
|
2297
|
+
* Returns the number of words in this attachment.
|
|
2257
2298
|
*/
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
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[];
|
|
2268
2309
|
}
|
|
2269
2310
|
|
|
2270
2311
|
/**
|
|
@@ -2276,16 +2317,16 @@ export enum NoteAttachmentKind {
|
|
|
2276
2317
|
export class NoteAttachmentScheme {
|
|
2277
2318
|
free(): void;
|
|
2278
2319
|
[Symbol.dispose](): void;
|
|
2279
|
-
/**
|
|
2280
|
-
* Returns the note attachment scheme as a u32.
|
|
2281
|
-
*/
|
|
2282
|
-
asU32(): number;
|
|
2283
2320
|
/**
|
|
2284
2321
|
* Returns true if the attachment scheme is the reserved value that signals an absent scheme.
|
|
2285
2322
|
*/
|
|
2286
2323
|
isNone(): boolean;
|
|
2287
2324
|
/**
|
|
2288
|
-
* 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).
|
|
2289
2330
|
*/
|
|
2290
2331
|
constructor(scheme: number);
|
|
2291
2332
|
/**
|
|
@@ -2347,6 +2388,14 @@ export class NoteConsumptionStatus {
|
|
|
2347
2388
|
* Details of a note consisting of assets, script, inputs, and a serial number.
|
|
2348
2389
|
*
|
|
2349
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.
|
|
2350
2399
|
*/
|
|
2351
2400
|
export class NoteDetails {
|
|
2352
2401
|
free(): void;
|
|
@@ -2355,18 +2404,10 @@ export class NoteDetails {
|
|
|
2355
2404
|
* Returns the assets locked by the note.
|
|
2356
2405
|
*/
|
|
2357
2406
|
assets(): NoteAssets;
|
|
2358
|
-
/**
|
|
2359
|
-
* Returns the note identifier derived from these details.
|
|
2360
|
-
*/
|
|
2361
|
-
id(): NoteId;
|
|
2362
2407
|
/**
|
|
2363
2408
|
* Creates a new set of note details from the given assets and recipient.
|
|
2364
2409
|
*/
|
|
2365
2410
|
constructor(note_assets: NoteAssets, note_recipient: NoteRecipient);
|
|
2366
|
-
/**
|
|
2367
|
-
* Returns the note nullifier as a word.
|
|
2368
|
-
*/
|
|
2369
|
-
nullifier(): Word;
|
|
2370
2411
|
/**
|
|
2371
2412
|
* Returns the recipient which controls when the note can be consumed.
|
|
2372
2413
|
*/
|
|
@@ -2411,14 +2452,6 @@ export class NoteDetailsAndTagArray {
|
|
|
2411
2452
|
length(): number;
|
|
2412
2453
|
constructor(elements?: NoteDetailsAndTag[] | null);
|
|
2413
2454
|
push(element: NoteDetailsAndTag): void;
|
|
2414
|
-
/**
|
|
2415
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
2416
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
2417
|
-
* after the call. Without this borrow, passing `elem` by
|
|
2418
|
-
* value would move the underlying Rust value out of the
|
|
2419
|
-
* caller's JS handle and any subsequent method on it would
|
|
2420
|
-
* panic with `"null pointer passed to rust"`.
|
|
2421
|
-
*/
|
|
2422
2455
|
replaceAt(index: number, elem: NoteDetailsAndTag): void;
|
|
2423
2456
|
}
|
|
2424
2457
|
|
|
@@ -2514,9 +2547,14 @@ export class NoteFile {
|
|
|
2514
2547
|
*/
|
|
2515
2548
|
noteDetails(): NoteDetails | undefined;
|
|
2516
2549
|
/**
|
|
2517
|
-
* 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.
|
|
2518
2556
|
*/
|
|
2519
|
-
noteId(): NoteId;
|
|
2557
|
+
noteId(): NoteId | undefined;
|
|
2520
2558
|
/**
|
|
2521
2559
|
* Returns the note tag hint when present.
|
|
2522
2560
|
*/
|
|
@@ -2527,6 +2565,10 @@ export class NoteFile {
|
|
|
2527
2565
|
noteType(): string;
|
|
2528
2566
|
/**
|
|
2529
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`.
|
|
2530
2572
|
*/
|
|
2531
2573
|
nullifier(): string | undefined;
|
|
2532
2574
|
/**
|
|
@@ -2576,10 +2618,6 @@ export class NoteHeader {
|
|
|
2576
2618
|
* Returns the public metadata attached to the note.
|
|
2577
2619
|
*/
|
|
2578
2620
|
metadata(): NoteMetadata;
|
|
2579
|
-
/**
|
|
2580
|
-
* Returns a commitment to the note ID and metadata.
|
|
2581
|
-
*/
|
|
2582
|
-
toCommitment(): Word;
|
|
2583
2621
|
}
|
|
2584
2622
|
|
|
2585
2623
|
/**
|
|
@@ -2587,18 +2625,17 @@ export class NoteHeader {
|
|
|
2587
2625
|
*
|
|
2588
2626
|
* Note ID is computed as:
|
|
2589
2627
|
*
|
|
2590
|
-
* > `hash(
|
|
2591
|
-
*
|
|
2592
|
-
* where `recipient` is defined as:
|
|
2593
|
-
*
|
|
2594
|
-
* > `hash(hash(hash(serial_num, ZERO), script_root), input_commitment)`
|
|
2628
|
+
* > `hash(details_commitment, metadata_commitment)`
|
|
2595
2629
|
*
|
|
2596
|
-
*
|
|
2597
|
-
*
|
|
2598
|
-
*
|
|
2599
|
-
*
|
|
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).
|
|
2600
2636
|
*/
|
|
2601
2637
|
export class NoteId {
|
|
2638
|
+
private constructor();
|
|
2602
2639
|
free(): void;
|
|
2603
2640
|
[Symbol.dispose](): void;
|
|
2604
2641
|
/**
|
|
@@ -2606,9 +2643,13 @@ export class NoteId {
|
|
|
2606
2643
|
*/
|
|
2607
2644
|
static fromHex(hex: string): NoteId;
|
|
2608
2645
|
/**
|
|
2609
|
-
* 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.
|
|
2610
2651
|
*/
|
|
2611
|
-
|
|
2652
|
+
static fromRaw(word: Word): NoteId;
|
|
2612
2653
|
/**
|
|
2613
2654
|
* Returns the canonical hex representation of the note ID.
|
|
2614
2655
|
*/
|
|
@@ -2645,14 +2686,6 @@ export class NoteIdAndArgsArray {
|
|
|
2645
2686
|
length(): number;
|
|
2646
2687
|
constructor(elements?: NoteIdAndArgs[] | null);
|
|
2647
2688
|
push(element: NoteIdAndArgs): void;
|
|
2648
|
-
/**
|
|
2649
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
2650
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
2651
|
-
* after the call. Without this borrow, passing `elem` by
|
|
2652
|
-
* value would move the underlying Rust value out of the
|
|
2653
|
-
* caller's JS handle and any subsequent method on it would
|
|
2654
|
-
* panic with `"null pointer passed to rust"`.
|
|
2655
|
-
*/
|
|
2656
2689
|
replaceAt(index: number, elem: NoteIdAndArgs): void;
|
|
2657
2690
|
}
|
|
2658
2691
|
|
|
@@ -2693,18 +2726,19 @@ export class NoteLocation {
|
|
|
2693
2726
|
/**
|
|
2694
2727
|
* Metadata associated with a note.
|
|
2695
2728
|
*
|
|
2696
|
-
*
|
|
2697
|
-
*
|
|
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.
|
|
2698
2736
|
*/
|
|
2699
2737
|
export class NoteMetadata {
|
|
2700
2738
|
free(): void;
|
|
2701
2739
|
[Symbol.dispose](): void;
|
|
2702
2740
|
/**
|
|
2703
|
-
*
|
|
2704
|
-
*/
|
|
2705
|
-
attachment(): NoteAttachment;
|
|
2706
|
-
/**
|
|
2707
|
-
* Creates metadata for a note.
|
|
2741
|
+
* Creates metadata for a note with no attachments.
|
|
2708
2742
|
*/
|
|
2709
2743
|
constructor(sender: AccountId, note_type: NoteType, note_tag: NoteTag);
|
|
2710
2744
|
/**
|
|
@@ -2719,18 +2753,6 @@ export class NoteMetadata {
|
|
|
2719
2753
|
* Returns the tag associated with the note.
|
|
2720
2754
|
*/
|
|
2721
2755
|
tag(): NoteTag;
|
|
2722
|
-
/**
|
|
2723
|
-
* Adds an attachment to this metadata and returns the updated metadata.
|
|
2724
|
-
*
|
|
2725
|
-
* Attachments provide additional context about how notes should be processed.
|
|
2726
|
-
* For example, a `NetworkAccountTarget` attachment indicates that the note
|
|
2727
|
-
* should be consumed by a specific network account.
|
|
2728
|
-
*/
|
|
2729
|
-
withAttachment(attachment: NoteAttachment): NoteMetadata;
|
|
2730
|
-
/**
|
|
2731
|
-
* Sets the tag for this metadata and returns the updated metadata.
|
|
2732
|
-
*/
|
|
2733
|
-
withTag(tag: NoteTag): NoteMetadata;
|
|
2734
2756
|
}
|
|
2735
2757
|
|
|
2736
2758
|
/**
|
|
@@ -2787,14 +2809,6 @@ export class NoteRecipientArray {
|
|
|
2787
2809
|
length(): number;
|
|
2788
2810
|
constructor(elements?: NoteRecipient[] | null);
|
|
2789
2811
|
push(element: NoteRecipient): void;
|
|
2790
|
-
/**
|
|
2791
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
2792
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
2793
|
-
* after the call. Without this borrow, passing `elem` by
|
|
2794
|
-
* value would move the underlying Rust value out of the
|
|
2795
|
-
* caller's JS handle and any subsequent method on it would
|
|
2796
|
-
* panic with `"null pointer passed to rust"`.
|
|
2797
|
-
*/
|
|
2798
2812
|
replaceAt(index: number, elem: NoteRecipient): void;
|
|
2799
2813
|
}
|
|
2800
2814
|
|
|
@@ -2867,7 +2881,7 @@ export class NoteStorage {
|
|
|
2867
2881
|
}
|
|
2868
2882
|
|
|
2869
2883
|
/**
|
|
2870
|
-
* Represents a single block's worth of note sync data
|
|
2884
|
+
* Represents a single block's worth of note sync data returned by `syncNotes`.
|
|
2871
2885
|
*/
|
|
2872
2886
|
export class NoteSyncBlock {
|
|
2873
2887
|
private constructor();
|
|
@@ -2888,34 +2902,38 @@ export class NoteSyncBlock {
|
|
|
2888
2902
|
}
|
|
2889
2903
|
|
|
2890
2904
|
/**
|
|
2891
|
-
*
|
|
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.
|
|
2892
2911
|
*/
|
|
2893
2912
|
export class NoteSyncInfo {
|
|
2894
2913
|
private constructor();
|
|
2895
2914
|
free(): void;
|
|
2896
2915
|
[Symbol.dispose](): void;
|
|
2897
2916
|
/**
|
|
2898
|
-
* 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.
|
|
2899
2920
|
*/
|
|
2900
2921
|
blockHeader(): BlockHeader | undefined;
|
|
2901
2922
|
/**
|
|
2902
|
-
* Returns the
|
|
2923
|
+
* Returns the upper bound of the block range scanned in this call (the
|
|
2924
|
+
* `blockTo` argument passed to `syncNotes`).
|
|
2903
2925
|
*/
|
|
2904
2926
|
blockTo(): number;
|
|
2905
2927
|
/**
|
|
2906
|
-
* Returns the
|
|
2928
|
+
* Returns the per-block breakdown.
|
|
2907
2929
|
*/
|
|
2908
2930
|
blocks(): NoteSyncBlock[];
|
|
2909
2931
|
/**
|
|
2910
|
-
* Returns the
|
|
2911
|
-
*/
|
|
2912
|
-
chainTip(): number;
|
|
2913
|
-
/**
|
|
2914
|
-
* 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.
|
|
2915
2933
|
*/
|
|
2916
2934
|
mmrPath(): MerklePath | undefined;
|
|
2917
2935
|
/**
|
|
2918
|
-
* Returns
|
|
2936
|
+
* Returns every committed note across all matching blocks (flattened).
|
|
2919
2937
|
*/
|
|
2920
2938
|
notes(): CommittedNote[];
|
|
2921
2939
|
}
|
|
@@ -3016,14 +3034,6 @@ export class OutputNoteArray {
|
|
|
3016
3034
|
length(): number;
|
|
3017
3035
|
constructor(elements?: OutputNote[] | null);
|
|
3018
3036
|
push(element: OutputNote): void;
|
|
3019
|
-
/**
|
|
3020
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
3021
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
3022
|
-
* after the call. Without this borrow, passing `elem` by
|
|
3023
|
-
* value would move the underlying Rust value out of the
|
|
3024
|
-
* caller's JS handle and any subsequent method on it would
|
|
3025
|
-
* panic with `"null pointer passed to rust"`.
|
|
3026
|
-
*/
|
|
3027
3037
|
replaceAt(index: number, elem: OutputNote): void;
|
|
3028
3038
|
}
|
|
3029
3039
|
|
|
@@ -3312,15 +3322,31 @@ export class RpcClient {
|
|
|
3312
3322
|
getAccountProof(account_id: AccountId, storage_requirements?: AccountStorageRequirements | null, block_num?: number | null, known_vault_commitment?: Word | null): Promise<AccountProof>;
|
|
3313
3323
|
/**
|
|
3314
3324
|
* Fetches a block header by number. When `block_num` is undefined, returns the latest header.
|
|
3325
|
+
*
|
|
3326
|
+
* @param `block_num` - Optional block number. When `undefined`, returns the latest header.
|
|
3327
|
+
* @param `include_mmr_proof` - When `true`, includes the MMR proof in the response. Defaults
|
|
3328
|
+
* to `false` when `undefined`.
|
|
3329
|
+
*/
|
|
3330
|
+
getBlockHeaderByNumber(block_num?: number | null, include_mmr_proof?: boolean | null): Promise<BlockHeader>;
|
|
3331
|
+
/**
|
|
3332
|
+
* Fetches the processing status of a network note by its ID.
|
|
3333
|
+
*
|
|
3334
|
+
* Returns information about the note's current status in the network,
|
|
3335
|
+
* including whether it is pending, processed, discarded, or committed,
|
|
3336
|
+
* along with error details and attempt count.
|
|
3337
|
+
*
|
|
3338
|
+
* @param `note_id` - The ID of the note to query.
|
|
3339
|
+
* @returns Promise that resolves to a `NetworkNoteStatusInfo` object.
|
|
3315
3340
|
*/
|
|
3316
|
-
|
|
3341
|
+
getNetworkNoteStatus(note_id: NoteId): Promise<NetworkNoteStatusInfo>;
|
|
3317
3342
|
/**
|
|
3318
3343
|
* Fetches a note script by its root hash from the connected Miden node.
|
|
3319
3344
|
*
|
|
3320
3345
|
* @param script_root - The root hash of the note script to fetch.
|
|
3321
|
-
* @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.
|
|
3322
3348
|
*/
|
|
3323
|
-
getNoteScriptByRoot(script_root: Word): Promise<NoteScript>;
|
|
3349
|
+
getNoteScriptByRoot(script_root: Word): Promise<NoteScript | undefined>;
|
|
3324
3350
|
/**
|
|
3325
3351
|
* Fetches notes by their IDs from the connected Miden node.
|
|
3326
3352
|
*
|
|
@@ -3344,7 +3370,7 @@ export class RpcClient {
|
|
|
3344
3370
|
/**
|
|
3345
3371
|
* Fetches notes matching the provided tags from the node.
|
|
3346
3372
|
*/
|
|
3347
|
-
syncNotes(
|
|
3373
|
+
syncNotes(block_from: number, block_to: number, note_tags: NoteTag[]): Promise<NoteSyncInfo>;
|
|
3348
3374
|
/**
|
|
3349
3375
|
* Syncs storage map updates for an account within a block range.
|
|
3350
3376
|
*
|
|
@@ -3376,6 +3402,7 @@ export class SerializedInputNoteData {
|
|
|
3376
3402
|
private constructor();
|
|
3377
3403
|
free(): void;
|
|
3378
3404
|
[Symbol.dispose](): void;
|
|
3405
|
+
attachments: Uint8Array;
|
|
3379
3406
|
get consumedBlockHeight(): number | undefined;
|
|
3380
3407
|
set consumedBlockHeight(value: number | null | undefined);
|
|
3381
3408
|
get consumedTxOrder(): number | undefined;
|
|
@@ -3383,9 +3410,11 @@ export class SerializedInputNoteData {
|
|
|
3383
3410
|
get consumerAccountId(): string | undefined;
|
|
3384
3411
|
set consumerAccountId(value: string | null | undefined);
|
|
3385
3412
|
createdAt: string;
|
|
3413
|
+
detailsCommitment: string;
|
|
3386
3414
|
inputs: Uint8Array;
|
|
3387
3415
|
noteAssets: Uint8Array;
|
|
3388
|
-
noteId: string;
|
|
3416
|
+
get noteId(): string | undefined;
|
|
3417
|
+
set noteId(value: string | null | undefined);
|
|
3389
3418
|
noteScriptRoot: string;
|
|
3390
3419
|
noteScript: Uint8Array;
|
|
3391
3420
|
nullifier: string;
|
|
@@ -3398,6 +3427,7 @@ export class SerializedOutputNoteData {
|
|
|
3398
3427
|
private constructor();
|
|
3399
3428
|
free(): void;
|
|
3400
3429
|
[Symbol.dispose](): void;
|
|
3430
|
+
attachments: Uint8Array;
|
|
3401
3431
|
expectedHeight: number;
|
|
3402
3432
|
metadata: Uint8Array;
|
|
3403
3433
|
noteAssets: Uint8Array;
|
|
@@ -3583,10 +3613,27 @@ export class StorageMap {
|
|
|
3583
3613
|
constructor();
|
|
3584
3614
|
}
|
|
3585
3615
|
|
|
3616
|
+
export class StorageMapEntry {
|
|
3617
|
+
private constructor();
|
|
3618
|
+
/**
|
|
3619
|
+
** Return copy of self without private attributes.
|
|
3620
|
+
*/
|
|
3621
|
+
toJSON(): Object;
|
|
3622
|
+
/**
|
|
3623
|
+
* Return stringified version of self.
|
|
3624
|
+
*/
|
|
3625
|
+
toString(): string;
|
|
3626
|
+
free(): void;
|
|
3627
|
+
[Symbol.dispose](): void;
|
|
3628
|
+
key: string;
|
|
3629
|
+
root: string;
|
|
3630
|
+
value: string;
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3586
3633
|
/**
|
|
3587
3634
|
* A key-value entry from a storage map.
|
|
3588
3635
|
*/
|
|
3589
|
-
export class
|
|
3636
|
+
export class StorageMapEntryJs {
|
|
3590
3637
|
private constructor();
|
|
3591
3638
|
free(): void;
|
|
3592
3639
|
[Symbol.dispose](): void;
|
|
@@ -3690,14 +3737,6 @@ export class StorageSlotArray {
|
|
|
3690
3737
|
length(): number;
|
|
3691
3738
|
constructor(elements?: StorageSlot[] | null);
|
|
3692
3739
|
push(element: StorageSlot): void;
|
|
3693
|
-
/**
|
|
3694
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
3695
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
3696
|
-
* after the call. Without this borrow, passing `elem` by
|
|
3697
|
-
* value would move the underlying Rust value out of the
|
|
3698
|
-
* caller's JS handle and any subsequent method on it would
|
|
3699
|
-
* panic with `"null pointer passed to rust"`.
|
|
3700
|
-
*/
|
|
3701
3740
|
replaceAt(index: number, elem: StorageSlot): void;
|
|
3702
3741
|
}
|
|
3703
3742
|
|
|
@@ -4167,14 +4206,6 @@ export class TransactionScriptInputPairArray {
|
|
|
4167
4206
|
length(): number;
|
|
4168
4207
|
constructor(elements?: TransactionScriptInputPair[] | null);
|
|
4169
4208
|
push(element: TransactionScriptInputPair): void;
|
|
4170
|
-
/**
|
|
4171
|
-
* Replace the element at `index`. Borrows + clones the input
|
|
4172
|
-
* (mirrors `push`), so the caller's JS handle remains valid
|
|
4173
|
-
* after the call. Without this borrow, passing `elem` by
|
|
4174
|
-
* value would move the underlying Rust value out of the
|
|
4175
|
-
* caller's JS handle and any subsequent method on it would
|
|
4176
|
-
* panic with `"null pointer passed to rust"`.
|
|
4177
|
-
*/
|
|
4178
4209
|
replaceAt(index: number, elem: TransactionScriptInputPair): void;
|
|
4179
4210
|
}
|
|
4180
4211
|
|
|
@@ -4313,7 +4344,8 @@ export class WebClient {
|
|
|
4313
4344
|
* const balance = await reader.getBalance(faucetId);
|
|
4314
4345
|
* ```
|
|
4315
4346
|
*/
|
|
4316
|
-
accountReader(account_id: AccountId): AccountReader
|
|
4347
|
+
accountReader(account_id: AccountId): Promise<AccountReader>;
|
|
4348
|
+
addAccountSecretKeyToWebStore(account_id: AccountId, secret_key: AuthSecretKey): Promise<void>;
|
|
4317
4349
|
addTag(tag: string): Promise<void>;
|
|
4318
4350
|
applyTransaction(transaction_result: TransactionResult, submission_height: number): Promise<TransactionStoreUpdate>;
|
|
4319
4351
|
static buildSwapTag(note_type: NoteType, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint): NoteTag;
|
|
@@ -4327,6 +4359,9 @@ export class WebClient {
|
|
|
4327
4359
|
* * `store_name`: Optional name for the web store. If `None`, the store name defaults to
|
|
4328
4360
|
* `MidenClientDB_{network_id}`, where `network_id` is derived from the `node_url`.
|
|
4329
4361
|
* Explicitly setting this allows for creating multiple isolated clients.
|
|
4362
|
+
* * `debug_mode`: Optional flag to enable debug mode for transaction execution. When enabled,
|
|
4363
|
+
* the transaction executor records additional information useful for debugging. Defaults to
|
|
4364
|
+
* disabled.
|
|
4330
4365
|
*/
|
|
4331
4366
|
createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null, debug_mode?: boolean | null): Promise<any>;
|
|
4332
4367
|
/**
|
|
@@ -4342,14 +4377,16 @@ export class WebClient {
|
|
|
4342
4377
|
* * `get_key_cb`: Callback to retrieve the secret key bytes for a given public key.
|
|
4343
4378
|
* * `insert_key_cb`: Callback to persist a secret key.
|
|
4344
4379
|
* * `sign_cb`: Callback to produce serialized signature bytes for the provided inputs.
|
|
4380
|
+
* * `debug_mode`: Optional flag to enable debug mode for transaction execution. Defaults to
|
|
4381
|
+
* disabled.
|
|
4345
4382
|
*/
|
|
4346
4383
|
createClientWithExternalKeystore(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null, get_key_cb?: Function | null, insert_key_cb?: Function | null, sign_cb?: Function | null, debug_mode?: boolean | null): Promise<any>;
|
|
4347
|
-
createCodeBuilder(): CodeBuilder
|
|
4384
|
+
createCodeBuilder(): Promise<CodeBuilder>;
|
|
4348
4385
|
/**
|
|
4349
4386
|
* Creates a new client with a mock RPC API. Useful for testing purposes and proof-of-concept
|
|
4350
4387
|
* applications as it uses a mock chain that simulates the behavior of a real node.
|
|
4351
4388
|
*/
|
|
4352
|
-
createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise<
|
|
4389
|
+
createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise<string>;
|
|
4353
4390
|
/**
|
|
4354
4391
|
* Executes a transaction and returns the `TransactionSummary`.
|
|
4355
4392
|
*
|
|
@@ -4400,6 +4437,18 @@ export class WebClient {
|
|
|
4400
4437
|
* This method loads the complete account state including vault, storage, and code.
|
|
4401
4438
|
*/
|
|
4402
4439
|
getAccount(account_id: AccountId): Promise<Account | undefined>;
|
|
4440
|
+
/**
|
|
4441
|
+
* Retrieves an authentication secret key from the keystore given a public key commitment.
|
|
4442
|
+
*
|
|
4443
|
+
* The public key commitment should correspond to one of the keys tracked by the keystore.
|
|
4444
|
+
* Returns the associated [`AuthSecretKey`] if found, or an error if not found.
|
|
4445
|
+
*/
|
|
4446
|
+
getAccountAuthByPubKeyCommitment(pub_key_commitment: Word): Promise<AuthSecretKey>;
|
|
4447
|
+
/**
|
|
4448
|
+
* Retrieves the full account data for the account associated with the given public key
|
|
4449
|
+
* commitment, returning `null` if no account is found.
|
|
4450
|
+
*/
|
|
4451
|
+
getAccountByKeyCommitment(pub_key_commitment: Word): Promise<Account | undefined>;
|
|
4403
4452
|
/**
|
|
4404
4453
|
* Retrieves the account code for a specific account.
|
|
4405
4454
|
*
|
|
@@ -4425,14 +4474,35 @@ export class WebClient {
|
|
|
4425
4474
|
getOutputNote(note_id: string): Promise<OutputNoteRecord>;
|
|
4426
4475
|
getOutputNotes(filter: NoteFilter): Promise<OutputNoteRecord[]>;
|
|
4427
4476
|
/**
|
|
4428
|
-
*
|
|
4477
|
+
* Returns all public key commitments associated with the given account ID.
|
|
4478
|
+
*
|
|
4479
|
+
* These commitments can be used with [`getAccountAuthByPubKeyCommitment`]
|
|
4480
|
+
* to retrieve the corresponding secret keys from the keystore.
|
|
4481
|
+
*/
|
|
4482
|
+
getPublicKeyCommitmentsOfAccount(account_id: AccountId): Promise<Word[]>;
|
|
4483
|
+
/**
|
|
4484
|
+
* Retrieves the setting value for `key`, or `None` if it hasn't been set.
|
|
4429
4485
|
*/
|
|
4430
4486
|
getSetting(key: string): Promise<any | undefined>;
|
|
4431
4487
|
getSyncHeight(): Promise<number>;
|
|
4432
4488
|
getTransactions(transaction_filter: TransactionFilter): Promise<TransactionRecord[]>;
|
|
4433
|
-
importAccountById(account_id: AccountId): Promise<
|
|
4434
|
-
importAccountFile(account_file: AccountFile): Promise<
|
|
4435
|
-
|
|
4489
|
+
importAccountById(account_id: AccountId): Promise<void>;
|
|
4490
|
+
importAccountFile(account_file: AccountFile): Promise<string>;
|
|
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>;
|
|
4436
4506
|
importPublicAccountFromSeed(init_seed: Uint8Array, mutable: boolean, auth_scheme: AuthScheme): Promise<Account>;
|
|
4437
4507
|
insertAccountAddress(account_id: AccountId, address: Address): Promise<void>;
|
|
4438
4508
|
/**
|
|
@@ -4464,7 +4534,7 @@ export class WebClient {
|
|
|
4464
4534
|
* Returns all the existing setting keys from the store.
|
|
4465
4535
|
*/
|
|
4466
4536
|
listSettingKeys(): Promise<string[]>;
|
|
4467
|
-
listTags(): Promise<
|
|
4537
|
+
listTags(): Promise<string[]>;
|
|
4468
4538
|
constructor();
|
|
4469
4539
|
newAccount(account: Account, overwrite: boolean): Promise<void>;
|
|
4470
4540
|
/**
|
|
@@ -4475,27 +4545,27 @@ export class WebClient {
|
|
|
4475
4545
|
*/
|
|
4476
4546
|
newAccountWithSecretKey(account: Account, secret_key: AuthSecretKey): Promise<void>;
|
|
4477
4547
|
newConsumeTransactionRequest(list_of_notes: Note[]): TransactionRequest;
|
|
4478
|
-
newFaucet(storage_mode: AccountStorageMode, non_fungible: boolean, token_symbol: string, decimals: number, max_supply: bigint, auth_scheme: AuthScheme): Promise<Account>;
|
|
4479
|
-
newMintTransactionRequest(target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint): TransactionRequest;
|
|
4480
|
-
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): TransactionRequest;
|
|
4481
|
-
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): TransactionRequest;
|
|
4482
|
-
newWallet(storage_mode: AccountStorageMode, mutable: boolean, auth_scheme: AuthScheme, init_seed?: Uint8Array | null): Promise<Account>;
|
|
4483
|
-
proveBlock(): void;
|
|
4484
4548
|
/**
|
|
4485
|
-
*
|
|
4486
|
-
*/
|
|
4487
|
-
proveTransaction(transaction_result: TransactionResult): Promise<ProvenTransaction>;
|
|
4488
|
-
/**
|
|
4489
|
-
* Generates a transaction proof using the provided prover.
|
|
4549
|
+
* Creates, persists, and returns a new fungible faucet account.
|
|
4490
4550
|
*
|
|
4491
|
-
*
|
|
4492
|
-
*
|
|
4493
|
-
*
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
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>;
|
|
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>;
|
|
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>;
|
|
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>;
|
|
4562
|
+
newWallet(storage_mode: AccountStorageMode, mutable: boolean, auth_scheme: AuthScheme, init_seed?: Uint8Array | null): Promise<Account>;
|
|
4563
|
+
proveBlock(): Promise<void>;
|
|
4564
|
+
/**
|
|
4565
|
+
* Generates a transaction proof using either the provided prover or the client's default
|
|
4566
|
+
* prover if none is supplied.
|
|
4497
4567
|
*/
|
|
4498
|
-
|
|
4568
|
+
proveTransaction(transaction_result: TransactionResult, prover?: TransactionProver | null): Promise<ProvenTransaction>;
|
|
4499
4569
|
/**
|
|
4500
4570
|
* Prunes historical account states for the specified account up to the given nonce.
|
|
4501
4571
|
*
|
|
@@ -4519,11 +4589,11 @@ export class WebClient {
|
|
|
4519
4589
|
/**
|
|
4520
4590
|
* Returns the inner serialized mock chain if it exists.
|
|
4521
4591
|
*/
|
|
4522
|
-
serializeMockChain(): Uint8Array
|
|
4592
|
+
serializeMockChain(): Promise<Uint8Array>;
|
|
4523
4593
|
/**
|
|
4524
4594
|
* Returns the inner serialized mock note transport node if it exists.
|
|
4525
4595
|
*/
|
|
4526
|
-
serializeMockNoteTransportNode(): Uint8Array
|
|
4596
|
+
serializeMockNoteTransportNode(): Promise<Uint8Array>;
|
|
4527
4597
|
/**
|
|
4528
4598
|
* Sets a setting key-value in the store. It can then be retrieved using `get_setting`.
|
|
4529
4599
|
*/
|
|
@@ -4531,7 +4601,7 @@ export class WebClient {
|
|
|
4531
4601
|
/**
|
|
4532
4602
|
* Returns the identifier of the underlying store (e.g. `IndexedDB` database name, file path).
|
|
4533
4603
|
*/
|
|
4534
|
-
storeIdentifier(): string
|
|
4604
|
+
storeIdentifier(): Promise<string>;
|
|
4535
4605
|
/**
|
|
4536
4606
|
* Executes a transaction specified by the request against the specified account,
|
|
4537
4607
|
* proves it, submits it to the network, and updates the local database.
|
|
@@ -4563,7 +4633,7 @@ export class WebClient {
|
|
|
4563
4633
|
* which provides proper coordination for concurrent calls.
|
|
4564
4634
|
*/
|
|
4565
4635
|
syncStateImpl(): Promise<SyncSummary>;
|
|
4566
|
-
usesMockChain(): boolean
|
|
4636
|
+
usesMockChain(): Promise<boolean>;
|
|
4567
4637
|
/**
|
|
4568
4638
|
* Returns a `WebKeystoreApi` handle for managing secret keys.
|
|
4569
4639
|
*
|
|
@@ -4616,11 +4686,14 @@ export class Word {
|
|
|
4616
4686
|
static deserialize(bytes: Uint8Array): Word;
|
|
4617
4687
|
/**
|
|
4618
4688
|
* Creates a Word from a hex string.
|
|
4619
|
-
* Fails if the provided string is not a valid hex representation of a Word.
|
|
4620
4689
|
*/
|
|
4621
4690
|
static fromHex(hex: string): Word;
|
|
4622
4691
|
/**
|
|
4623
|
-
* Creates a word from four
|
|
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.
|
|
4624
4697
|
*/
|
|
4625
4698
|
constructor(u64_vec: BigUint64Array);
|
|
4626
4699
|
/**
|
|
@@ -4640,7 +4713,7 @@ export class Word {
|
|
|
4640
4713
|
*/
|
|
4641
4714
|
toHex(): string;
|
|
4642
4715
|
/**
|
|
4643
|
-
* Returns the word as an array of
|
|
4716
|
+
* Returns the word as an array of numeric values.
|
|
4644
4717
|
*/
|
|
4645
4718
|
toU64s(): BigUint64Array;
|
|
4646
4719
|
}
|