@miden-sdk/miden-sdk 0.13.0-next.4 → 0.13.1
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/{Cargo-dd784ba2.js → Cargo-9005c576.js} +3122 -3082
- package/dist/Cargo-9005c576.js.map +1 -0
- package/dist/assets/miden_client_web.wasm +0 -0
- package/dist/crates/miden_client_web.d.ts +900 -887
- package/dist/index.d.ts +24 -3
- package/dist/index.js +50 -11
- package/dist/index.js.map +1 -1
- package/dist/wasm.js +1 -1
- package/dist/workers/{Cargo-dd784ba2-dd784ba2.js → Cargo-9005c576-9005c576.js} +3122 -3082
- package/dist/workers/Cargo-9005c576-9005c576.js.map +1 -0
- package/dist/workers/assets/miden_client_web.wasm +0 -0
- package/dist/workers/web-client-methods-worker.js +13 -2
- package/dist/workers/web-client-methods-worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/Cargo-dd784ba2.js.map +0 -1
- package/dist/workers/Cargo-dd784ba2-dd784ba2.js.map +0 -1
|
@@ -4,6 +4,19 @@
|
|
|
4
4
|
* Create an auth component for `Falcon512Rpo` multisig.
|
|
5
5
|
*/
|
|
6
6
|
export function createAuthFalcon512RpoMultisig(config: AuthFalcon512RpoMultisigConfig): AccountComponent;
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the `tracing` subscriber that routes Rust log output to the
|
|
9
|
+
* browser console via `console.log` / `console.warn` / `console.error`.
|
|
10
|
+
*
|
|
11
|
+
* `log_level` must be one of `"error"`, `"warn"`, `"info"`, `"debug"`,
|
|
12
|
+
* `"trace"`, `"off"`, or `"none"` (no logging). Unknown values are treated
|
|
13
|
+
* as "off".
|
|
14
|
+
*
|
|
15
|
+
* This is a **per-thread global** — call it once on the main thread and, if
|
|
16
|
+
* you use a Web Worker, once inside the worker. Subsequent calls on the same
|
|
17
|
+
* thread are harmless no-ops.
|
|
18
|
+
*/
|
|
19
|
+
export function setupLogging(log_level: string): void;
|
|
7
20
|
export enum AccountInterface {
|
|
8
21
|
/**
|
|
9
22
|
* Basic wallet address interface.
|
|
@@ -146,70 +159,70 @@ export class Account {
|
|
|
146
159
|
private constructor();
|
|
147
160
|
free(): void;
|
|
148
161
|
[Symbol.dispose](): void;
|
|
162
|
+
/**
|
|
163
|
+
* Returns the account identifier.
|
|
164
|
+
*/
|
|
165
|
+
id(): AccountId;
|
|
149
166
|
/**
|
|
150
167
|
* Returns the commitment to the account header, storage, and code.
|
|
151
168
|
*/
|
|
152
169
|
commitment(): Word;
|
|
153
170
|
/**
|
|
154
|
-
* Returns
|
|
171
|
+
* Returns the account nonce, which is incremented on every state update.
|
|
155
172
|
*/
|
|
156
|
-
|
|
173
|
+
nonce(): Felt;
|
|
157
174
|
/**
|
|
158
|
-
* Returns
|
|
175
|
+
* Returns the vault commitment for this account.
|
|
159
176
|
*/
|
|
160
|
-
|
|
177
|
+
vault(): AssetVault;
|
|
161
178
|
/**
|
|
162
|
-
*
|
|
179
|
+
* Returns the account storage commitment.
|
|
163
180
|
*/
|
|
164
|
-
|
|
181
|
+
storage(): AccountStorage;
|
|
165
182
|
/**
|
|
166
|
-
* Returns
|
|
183
|
+
* Returns the code commitment for this account.
|
|
167
184
|
*/
|
|
168
|
-
|
|
185
|
+
code(): AccountCode;
|
|
169
186
|
/**
|
|
170
|
-
* Returns true if the account is a
|
|
187
|
+
* Returns true if the account is a faucet.
|
|
171
188
|
*/
|
|
172
|
-
|
|
189
|
+
isFaucet(): boolean;
|
|
173
190
|
/**
|
|
174
|
-
* Returns
|
|
191
|
+
* Returns true if the account is a regular account (immutable or updatable code).
|
|
175
192
|
*/
|
|
176
|
-
|
|
193
|
+
isRegularAccount(): boolean;
|
|
177
194
|
/**
|
|
178
|
-
* Returns the account
|
|
195
|
+
* Returns true if the account can update its code.
|
|
179
196
|
*/
|
|
180
|
-
|
|
197
|
+
isUpdatable(): boolean;
|
|
181
198
|
/**
|
|
182
|
-
* Returns the
|
|
199
|
+
* Returns true if the account exposes public storage.
|
|
183
200
|
*/
|
|
184
|
-
|
|
201
|
+
isPublic(): boolean;
|
|
185
202
|
/**
|
|
186
|
-
* Returns the account
|
|
203
|
+
* Returns true if the account storage is private.
|
|
187
204
|
*/
|
|
188
|
-
|
|
205
|
+
isPrivate(): boolean;
|
|
189
206
|
/**
|
|
190
|
-
* Returns
|
|
207
|
+
* Returns true if this is a network-owned account.
|
|
191
208
|
*/
|
|
192
|
-
|
|
209
|
+
isNetwork(): boolean;
|
|
193
210
|
/**
|
|
194
211
|
* Returns true if the account has not yet been committed to the chain.
|
|
195
212
|
*/
|
|
196
213
|
isNew(): boolean;
|
|
197
214
|
/**
|
|
198
|
-
*
|
|
199
|
-
*/
|
|
200
|
-
storage(): AccountStorage;
|
|
201
|
-
/**
|
|
202
|
-
* Returns true if the account is a faucet.
|
|
215
|
+
* Serializes the account into bytes.
|
|
203
216
|
*/
|
|
204
|
-
|
|
217
|
+
serialize(): Uint8Array;
|
|
205
218
|
/**
|
|
206
|
-
*
|
|
219
|
+
* Restores an account from its serialized bytes.
|
|
207
220
|
*/
|
|
208
|
-
|
|
221
|
+
static deserialize(bytes: Uint8Array): Account;
|
|
209
222
|
/**
|
|
210
|
-
*
|
|
223
|
+
* Returns the public key commitments derived from the account's authentication scheme.
|
|
211
224
|
*/
|
|
212
|
-
|
|
225
|
+
getPublicKeyCommitments(): Word[];
|
|
213
226
|
}
|
|
214
227
|
export class AccountArray {
|
|
215
228
|
/**
|
|
@@ -222,18 +235,22 @@ export class AccountArray {
|
|
|
222
235
|
toString(): string;
|
|
223
236
|
free(): void;
|
|
224
237
|
[Symbol.dispose](): void;
|
|
225
|
-
|
|
238
|
+
constructor(elements?: Account[] | null);
|
|
226
239
|
/**
|
|
227
240
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
228
241
|
*/
|
|
229
242
|
get(index: number): Account;
|
|
230
|
-
|
|
243
|
+
replaceAt(index: number, elem: Account): void;
|
|
231
244
|
push(element: Account): void;
|
|
232
245
|
length(): number;
|
|
233
246
|
}
|
|
234
247
|
export class AccountBuilder {
|
|
235
248
|
free(): void;
|
|
236
249
|
[Symbol.dispose](): void;
|
|
250
|
+
/**
|
|
251
|
+
* Creates a new account builder from a 32-byte initial seed.
|
|
252
|
+
*/
|
|
253
|
+
constructor(init_seed: Uint8Array);
|
|
237
254
|
/**
|
|
238
255
|
* Sets the account type (regular, faucet, etc.).
|
|
239
256
|
*/
|
|
@@ -255,10 +272,6 @@ export class AccountBuilder {
|
|
|
255
272
|
*/
|
|
256
273
|
withNoAuthComponent(): AccountBuilder;
|
|
257
274
|
withBasicWalletComponent(): AccountBuilder;
|
|
258
|
-
/**
|
|
259
|
-
* Creates a new account builder from a 32-byte initial seed.
|
|
260
|
-
*/
|
|
261
|
-
constructor(init_seed: Uint8Array);
|
|
262
275
|
/**
|
|
263
276
|
* Builds the account and returns it together with the derived seed.
|
|
264
277
|
*/
|
|
@@ -268,14 +281,14 @@ export class AccountBuilderResult {
|
|
|
268
281
|
private constructor();
|
|
269
282
|
free(): void;
|
|
270
283
|
[Symbol.dispose](): void;
|
|
271
|
-
/**
|
|
272
|
-
* Returns the seed used to derive the account ID.
|
|
273
|
-
*/
|
|
274
|
-
readonly seed: Word;
|
|
275
284
|
/**
|
|
276
285
|
* Returns the built account.
|
|
277
286
|
*/
|
|
278
287
|
readonly account: Account;
|
|
288
|
+
/**
|
|
289
|
+
* Returns the seed used to derive the account ID.
|
|
290
|
+
*/
|
|
291
|
+
readonly seed: Word;
|
|
279
292
|
}
|
|
280
293
|
/**
|
|
281
294
|
* A public interface of an account.
|
|
@@ -304,34 +317,34 @@ export class AccountComponent {
|
|
|
304
317
|
free(): void;
|
|
305
318
|
[Symbol.dispose](): void;
|
|
306
319
|
/**
|
|
307
|
-
*
|
|
308
|
-
*/
|
|
309
|
-
static fromLibrary(library: Library, storage_slots: StorageSlot[]): AccountComponent;
|
|
310
|
-
/**
|
|
311
|
-
* Creates an account component from a compiled package and storage slots.
|
|
320
|
+
* Compiles account code with the given storage slots using the provided assembler.
|
|
312
321
|
*/
|
|
313
|
-
static
|
|
322
|
+
static compile(account_code: AccountComponentCode, storage_slots: StorageSlot[]): AccountComponent;
|
|
314
323
|
/**
|
|
315
|
-
*
|
|
324
|
+
* Marks the component as supporting all account types.
|
|
316
325
|
*/
|
|
317
|
-
|
|
326
|
+
withSupportsAllTypes(): AccountComponent;
|
|
318
327
|
/**
|
|
319
328
|
* Returns the hex-encoded MAST root for a procedure by name.
|
|
320
329
|
*/
|
|
321
330
|
getProcedureHash(procedure_name: string): string;
|
|
322
331
|
/**
|
|
323
|
-
*
|
|
332
|
+
* Returns all procedures exported by this component.
|
|
324
333
|
*/
|
|
325
|
-
|
|
326
|
-
static createAuthComponentFromCommitment(commitment: Word, auth_scheme: AuthScheme): AccountComponent;
|
|
334
|
+
getProcedures(): GetProceduresResultItem[];
|
|
327
335
|
/**
|
|
328
336
|
* Builds an auth component from a secret key, inferring the auth scheme from the key type.
|
|
329
337
|
*/
|
|
330
338
|
static createAuthComponentFromSecretKey(secret_key: AuthSecretKey): AccountComponent;
|
|
339
|
+
static createAuthComponentFromCommitment(commitment: Word, auth_scheme: AuthScheme): AccountComponent;
|
|
331
340
|
/**
|
|
332
|
-
*
|
|
341
|
+
* Creates an account component from a compiled package and storage slots.
|
|
333
342
|
*/
|
|
334
|
-
static
|
|
343
|
+
static fromPackage(_package: Package, storage_slots: StorageSlotArray): AccountComponent;
|
|
344
|
+
/**
|
|
345
|
+
* Creates an account component from a compiled library and storage slots.
|
|
346
|
+
*/
|
|
347
|
+
static fromLibrary(library: Library, storage_slots: StorageSlot[]): AccountComponent;
|
|
335
348
|
}
|
|
336
349
|
/**
|
|
337
350
|
* A Library that has been assembled for use as component code.
|
|
@@ -358,33 +371,33 @@ export class AccountDelta {
|
|
|
358
371
|
free(): void;
|
|
359
372
|
[Symbol.dispose](): void;
|
|
360
373
|
/**
|
|
361
|
-
*
|
|
374
|
+
* Serializes the account delta into bytes.
|
|
362
375
|
*/
|
|
363
|
-
|
|
376
|
+
serialize(): Uint8Array;
|
|
364
377
|
/**
|
|
365
|
-
*
|
|
378
|
+
* Deserializes an account delta from bytes.
|
|
366
379
|
*/
|
|
367
|
-
|
|
380
|
+
static deserialize(bytes: Uint8Array): AccountDelta;
|
|
368
381
|
/**
|
|
369
382
|
* Returns the affected account ID.
|
|
370
383
|
*/
|
|
371
384
|
id(): AccountId;
|
|
372
385
|
/**
|
|
373
|
-
* Returns
|
|
386
|
+
* Returns true if there are no changes.
|
|
374
387
|
*/
|
|
375
|
-
|
|
388
|
+
isEmpty(): boolean;
|
|
376
389
|
/**
|
|
377
390
|
* Returns the storage delta.
|
|
378
391
|
*/
|
|
379
392
|
storage(): AccountStorageDelta;
|
|
380
393
|
/**
|
|
381
|
-
* Returns
|
|
394
|
+
* Returns the vault delta.
|
|
382
395
|
*/
|
|
383
|
-
|
|
396
|
+
vault(): AccountVaultDelta;
|
|
384
397
|
/**
|
|
385
|
-
*
|
|
398
|
+
* Returns the nonce change.
|
|
386
399
|
*/
|
|
387
|
-
|
|
400
|
+
nonceDelta(): Felt;
|
|
388
401
|
}
|
|
389
402
|
export class AccountFile {
|
|
390
403
|
private constructor();
|
|
@@ -395,21 +408,21 @@ export class AccountFile {
|
|
|
395
408
|
*/
|
|
396
409
|
accountId(): AccountId;
|
|
397
410
|
/**
|
|
398
|
-
*
|
|
411
|
+
* Returns the account data.
|
|
399
412
|
*/
|
|
400
|
-
|
|
413
|
+
account(): Account;
|
|
401
414
|
/**
|
|
402
415
|
* Returns the number of auth secret keys included.
|
|
403
416
|
*/
|
|
404
417
|
authSecretKeyCount(): number;
|
|
405
|
-
/**
|
|
406
|
-
* Returns the account data.
|
|
407
|
-
*/
|
|
408
|
-
account(): Account;
|
|
409
418
|
/**
|
|
410
419
|
* Serializes the `AccountFile` into a byte array
|
|
411
420
|
*/
|
|
412
421
|
serialize(): Uint8Array;
|
|
422
|
+
/**
|
|
423
|
+
* Deserializes a byte array into an `AccountFile`
|
|
424
|
+
*/
|
|
425
|
+
static deserialize(bytes: Uint8Array): AccountFile;
|
|
413
426
|
}
|
|
414
427
|
/**
|
|
415
428
|
* A header of an account which contains information that succinctly describes the state of the
|
|
@@ -431,9 +444,13 @@ export class AccountHeader {
|
|
|
431
444
|
*/
|
|
432
445
|
commitment(): Word;
|
|
433
446
|
/**
|
|
434
|
-
* Returns the
|
|
447
|
+
* Returns the account ID.
|
|
435
448
|
*/
|
|
436
|
-
|
|
449
|
+
id(): AccountId;
|
|
450
|
+
/**
|
|
451
|
+
* Returns the current nonce.
|
|
452
|
+
*/
|
|
453
|
+
nonce(): Felt;
|
|
437
454
|
/**
|
|
438
455
|
* Returns the vault commitment.
|
|
439
456
|
*/
|
|
@@ -443,13 +460,9 @@ export class AccountHeader {
|
|
|
443
460
|
*/
|
|
444
461
|
storageCommitment(): Word;
|
|
445
462
|
/**
|
|
446
|
-
* Returns the
|
|
447
|
-
*/
|
|
448
|
-
id(): AccountId;
|
|
449
|
-
/**
|
|
450
|
-
* Returns the current nonce.
|
|
463
|
+
* Returns the code commitment.
|
|
451
464
|
*/
|
|
452
|
-
|
|
465
|
+
codeCommitment(): Word;
|
|
453
466
|
}
|
|
454
467
|
/**
|
|
455
468
|
* Uniquely identifies a specific account.
|
|
@@ -462,49 +475,49 @@ export class AccountId {
|
|
|
462
475
|
free(): void;
|
|
463
476
|
[Symbol.dispose](): void;
|
|
464
477
|
/**
|
|
465
|
-
*
|
|
466
|
-
*/
|
|
467
|
-
isNetwork(): boolean;
|
|
468
|
-
/**
|
|
469
|
-
* Returns true if the account uses private storage.
|
|
478
|
+
* Builds an account ID from its hex string representation.
|
|
470
479
|
*/
|
|
471
|
-
|
|
480
|
+
static fromHex(hex: string): AccountId;
|
|
472
481
|
/**
|
|
473
|
-
*
|
|
482
|
+
* Returns true if the ID refers to a faucet.
|
|
474
483
|
*/
|
|
475
|
-
|
|
484
|
+
isFaucet(): boolean;
|
|
476
485
|
/**
|
|
477
486
|
* Returns true if the ID refers to a regular account.
|
|
478
487
|
*/
|
|
479
488
|
isRegularAccount(): boolean;
|
|
480
489
|
/**
|
|
481
|
-
* Returns
|
|
482
|
-
*/
|
|
483
|
-
prefix(): Felt;
|
|
484
|
-
/**
|
|
485
|
-
* Returns the suffix field element derived from the account seed.
|
|
490
|
+
* Returns true if the account uses public storage.
|
|
486
491
|
*/
|
|
487
|
-
|
|
492
|
+
isPublic(): boolean;
|
|
488
493
|
/**
|
|
489
|
-
*
|
|
494
|
+
* Returns true if the account uses private storage.
|
|
490
495
|
*/
|
|
491
|
-
|
|
496
|
+
isPrivate(): boolean;
|
|
492
497
|
/**
|
|
493
|
-
* Returns true if the ID
|
|
498
|
+
* Returns true if the ID is reserved for network accounts.
|
|
494
499
|
*/
|
|
495
|
-
|
|
500
|
+
isNetwork(): boolean;
|
|
496
501
|
/**
|
|
497
|
-
* Returns
|
|
502
|
+
* Returns the canonical hex representation of the account ID.
|
|
498
503
|
*/
|
|
499
|
-
|
|
504
|
+
toString(): string;
|
|
500
505
|
/**
|
|
501
506
|
* Will turn the Account ID into its bech32 string representation.
|
|
502
507
|
*/
|
|
503
508
|
toBech32(network_id: NetworkId, account_interface: AccountInterface): string;
|
|
504
509
|
/**
|
|
505
|
-
*
|
|
510
|
+
* Given a bech32 encoded string, return the matching Account ID for it.
|
|
506
511
|
*/
|
|
507
|
-
|
|
512
|
+
static fromBech32(bech_32_encoded_id: string): AccountId;
|
|
513
|
+
/**
|
|
514
|
+
* Returns the prefix field element storing metadata about version, type, and storage mode.
|
|
515
|
+
*/
|
|
516
|
+
prefix(): Felt;
|
|
517
|
+
/**
|
|
518
|
+
* Returns the suffix field element derived from the account seed.
|
|
519
|
+
*/
|
|
520
|
+
suffix(): Felt;
|
|
508
521
|
}
|
|
509
522
|
export class AccountIdArray {
|
|
510
523
|
/**
|
|
@@ -517,12 +530,12 @@ export class AccountIdArray {
|
|
|
517
530
|
toString(): string;
|
|
518
531
|
free(): void;
|
|
519
532
|
[Symbol.dispose](): void;
|
|
520
|
-
|
|
533
|
+
constructor(elements?: AccountId[] | null);
|
|
521
534
|
/**
|
|
522
535
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
523
536
|
*/
|
|
524
537
|
get(index: number): AccountId;
|
|
525
|
-
|
|
538
|
+
replaceAt(index: number, elem: AccountId): void;
|
|
526
539
|
push(element: AccountId): void;
|
|
527
540
|
length(): number;
|
|
528
541
|
}
|
|
@@ -546,23 +559,23 @@ export class AccountStorage {
|
|
|
546
559
|
*/
|
|
547
560
|
commitment(): Word;
|
|
548
561
|
/**
|
|
549
|
-
* Returns the value
|
|
562
|
+
* Returns the value stored at the given slot name, if any.
|
|
550
563
|
*/
|
|
551
|
-
|
|
564
|
+
getItem(slot_name: string): Word | undefined;
|
|
552
565
|
/**
|
|
553
566
|
* Returns the names of all storage slots on this account.
|
|
554
567
|
*/
|
|
555
568
|
getSlotNames(): string[];
|
|
569
|
+
/**
|
|
570
|
+
* Returns the value for a key in the map stored at the given slot, if any.
|
|
571
|
+
*/
|
|
572
|
+
getMapItem(slot_name: string, key: Word): Word | undefined;
|
|
556
573
|
/**
|
|
557
574
|
* Get all key-value pairs from the map slot identified by `slot_name`.
|
|
558
575
|
* Returns `undefined` if the slot isn't a map or doesn't exist.
|
|
559
576
|
* Returns `[]` if the map exists but is empty.
|
|
560
577
|
*/
|
|
561
578
|
getMapEntries(slot_name: string): JsStorageMapEntry[] | undefined;
|
|
562
|
-
/**
|
|
563
|
-
* Returns the value stored at the given slot name, if any.
|
|
564
|
-
*/
|
|
565
|
-
getItem(slot_name: string): Word | undefined;
|
|
566
579
|
}
|
|
567
580
|
/**
|
|
568
581
|
* `AccountStorageDelta` stores the differences between two states of account storage.
|
|
@@ -578,21 +591,21 @@ export class AccountStorageDelta {
|
|
|
578
591
|
free(): void;
|
|
579
592
|
[Symbol.dispose](): void;
|
|
580
593
|
/**
|
|
581
|
-
*
|
|
594
|
+
* Serializes the storage delta into bytes.
|
|
582
595
|
*/
|
|
583
|
-
|
|
596
|
+
serialize(): Uint8Array;
|
|
584
597
|
/**
|
|
585
|
-
*
|
|
598
|
+
* Deserializes a storage delta from bytes.
|
|
586
599
|
*/
|
|
587
|
-
|
|
600
|
+
static deserialize(bytes: Uint8Array): AccountStorageDelta;
|
|
588
601
|
/**
|
|
589
602
|
* Returns true if no storage slots are changed.
|
|
590
603
|
*/
|
|
591
604
|
isEmpty(): boolean;
|
|
592
605
|
/**
|
|
593
|
-
*
|
|
606
|
+
* Returns the new values for modified storage slots.
|
|
594
607
|
*/
|
|
595
|
-
|
|
608
|
+
values(): Word[];
|
|
596
609
|
}
|
|
597
610
|
/**
|
|
598
611
|
* Storage visibility mode for an account.
|
|
@@ -602,13 +615,9 @@ export class AccountStorageMode {
|
|
|
602
615
|
free(): void;
|
|
603
616
|
[Symbol.dispose](): void;
|
|
604
617
|
/**
|
|
605
|
-
*
|
|
606
|
-
*/
|
|
607
|
-
static tryFromStr(s: string): AccountStorageMode;
|
|
608
|
-
/**
|
|
609
|
-
* Returns the storage mode as a string.
|
|
618
|
+
* Creates a private storage mode.
|
|
610
619
|
*/
|
|
611
|
-
|
|
620
|
+
static private(): AccountStorageMode;
|
|
612
621
|
/**
|
|
613
622
|
* Creates a public storage mode.
|
|
614
623
|
*/
|
|
@@ -618,21 +627,25 @@ export class AccountStorageMode {
|
|
|
618
627
|
*/
|
|
619
628
|
static network(): AccountStorageMode;
|
|
620
629
|
/**
|
|
621
|
-
*
|
|
630
|
+
* Parses a storage mode from its string representation.
|
|
622
631
|
*/
|
|
623
|
-
static
|
|
632
|
+
static tryFromStr(s: string): AccountStorageMode;
|
|
633
|
+
/**
|
|
634
|
+
* Returns the storage mode as a string.
|
|
635
|
+
*/
|
|
636
|
+
asStr(): string;
|
|
624
637
|
}
|
|
625
638
|
export class AccountStorageRequirements {
|
|
626
639
|
free(): void;
|
|
627
640
|
[Symbol.dispose](): void;
|
|
628
|
-
/**
|
|
629
|
-
* Builds storage requirements from a list of slot/key pairs.
|
|
630
|
-
*/
|
|
631
|
-
static fromSlotAndKeysArray(slots_and_keys: SlotAndKeys[]): AccountStorageRequirements;
|
|
632
641
|
/**
|
|
633
642
|
* Creates empty storage requirements.
|
|
634
643
|
*/
|
|
635
644
|
constructor();
|
|
645
|
+
/**
|
|
646
|
+
* Builds storage requirements from a list of slot/key pairs.
|
|
647
|
+
*/
|
|
648
|
+
static fromSlotAndKeysArray(slots_and_keys: SlotAndKeys[]): AccountStorageRequirements;
|
|
636
649
|
}
|
|
637
650
|
/**
|
|
638
651
|
* `AccountVaultDelta` stores the difference between the initial and final account vault states.
|
|
@@ -647,29 +660,29 @@ export class AccountVaultDelta {
|
|
|
647
660
|
free(): void;
|
|
648
661
|
[Symbol.dispose](): void;
|
|
649
662
|
/**
|
|
650
|
-
*
|
|
663
|
+
* Serializes the vault delta into bytes.
|
|
651
664
|
*/
|
|
652
|
-
|
|
665
|
+
serialize(): Uint8Array;
|
|
653
666
|
/**
|
|
654
|
-
*
|
|
667
|
+
* Deserializes a vault delta from bytes.
|
|
655
668
|
*/
|
|
656
|
-
|
|
669
|
+
static deserialize(bytes: Uint8Array): AccountVaultDelta;
|
|
657
670
|
/**
|
|
658
|
-
* Returns
|
|
671
|
+
* Returns true if no assets are changed.
|
|
659
672
|
*/
|
|
660
|
-
|
|
673
|
+
isEmpty(): boolean;
|
|
661
674
|
/**
|
|
662
675
|
* Returns the fungible portion of the delta.
|
|
663
676
|
*/
|
|
664
677
|
fungible(): FungibleAssetDelta;
|
|
665
678
|
/**
|
|
666
|
-
* Returns
|
|
679
|
+
* Returns the fungible assets that increased.
|
|
667
680
|
*/
|
|
668
|
-
|
|
681
|
+
addedFungibleAssets(): FungibleAsset[];
|
|
669
682
|
/**
|
|
670
|
-
*
|
|
683
|
+
* Returns the fungible assets that decreased.
|
|
671
684
|
*/
|
|
672
|
-
|
|
685
|
+
removedFungibleAssets(): FungibleAsset[];
|
|
673
686
|
}
|
|
674
687
|
/**
|
|
675
688
|
* Representation of a Miden address (account ID plus routing parameters).
|
|
@@ -686,30 +699,30 @@ export class Address {
|
|
|
686
699
|
toString(): string;
|
|
687
700
|
free(): void;
|
|
688
701
|
[Symbol.dispose](): void;
|
|
689
|
-
/**
|
|
690
|
-
* Returns the account ID embedded in the address.
|
|
691
|
-
*/
|
|
692
|
-
accountId(): AccountId;
|
|
693
702
|
/**
|
|
694
703
|
* Deserializes a byte array into an `Address`.
|
|
695
704
|
*/
|
|
696
705
|
static deserialize(bytes: Uint8Array): Address;
|
|
706
|
+
/**
|
|
707
|
+
* Builds an address from an account ID and optional interface.
|
|
708
|
+
*/
|
|
709
|
+
static fromAccountId(account_id: AccountId, _interface?: string | null): Address;
|
|
697
710
|
/**
|
|
698
711
|
* Builds an address from a bech32-encoded string.
|
|
699
712
|
*/
|
|
700
713
|
static fromBech32(bech32: string): Address;
|
|
701
714
|
/**
|
|
702
|
-
*
|
|
715
|
+
* Returns the address interface.
|
|
703
716
|
*/
|
|
704
|
-
|
|
717
|
+
interface(): AddressInterface;
|
|
705
718
|
/**
|
|
706
|
-
*
|
|
719
|
+
* Returns the account ID embedded in the address.
|
|
707
720
|
*/
|
|
708
|
-
|
|
721
|
+
accountId(): AccountId;
|
|
709
722
|
/**
|
|
710
|
-
*
|
|
723
|
+
* Converts the address into a note tag.
|
|
711
724
|
*/
|
|
712
|
-
|
|
725
|
+
toNoteTag(): NoteTag;
|
|
713
726
|
/**
|
|
714
727
|
* Encodes the address using the provided network prefix.
|
|
715
728
|
*/
|
|
@@ -722,14 +735,14 @@ export class AdviceInputs {
|
|
|
722
735
|
private constructor();
|
|
723
736
|
free(): void;
|
|
724
737
|
[Symbol.dispose](): void;
|
|
725
|
-
/**
|
|
726
|
-
* Returns mapped values for a given key if present.
|
|
727
|
-
*/
|
|
728
|
-
mappedValues(key: Word): Felt[] | undefined;
|
|
729
738
|
/**
|
|
730
739
|
* Returns the stack inputs as a vector of felts.
|
|
731
740
|
*/
|
|
732
741
|
stack(): Felt[];
|
|
742
|
+
/**
|
|
743
|
+
* Returns mapped values for a given key if present.
|
|
744
|
+
*/
|
|
745
|
+
mappedValues(key: Word): Felt[] | undefined;
|
|
733
746
|
}
|
|
734
747
|
/**
|
|
735
748
|
* Map of advice values keyed by words for script execution.
|
|
@@ -763,6 +776,10 @@ export class AssetVault {
|
|
|
763
776
|
private constructor();
|
|
764
777
|
free(): void;
|
|
765
778
|
[Symbol.dispose](): void;
|
|
779
|
+
/**
|
|
780
|
+
* Returns the root commitment of the asset vault tree.
|
|
781
|
+
*/
|
|
782
|
+
root(): Word;
|
|
766
783
|
/**
|
|
767
784
|
* Returns the balance for the given fungible faucet, or zero if absent.
|
|
768
785
|
*/
|
|
@@ -771,10 +788,6 @@ export class AssetVault {
|
|
|
771
788
|
* Returns the fungible assets contained in this vault.
|
|
772
789
|
*/
|
|
773
790
|
fungibleAssets(): FungibleAsset[];
|
|
774
|
-
/**
|
|
775
|
-
* Returns the root commitment of the asset vault tree.
|
|
776
|
-
*/
|
|
777
|
-
root(): Word;
|
|
778
791
|
}
|
|
779
792
|
/**
|
|
780
793
|
* Multisig auth configuration for `RpoFalcon512` signatures.
|
|
@@ -783,20 +796,20 @@ export class AuthFalcon512RpoMultisigConfig {
|
|
|
783
796
|
free(): void;
|
|
784
797
|
[Symbol.dispose](): void;
|
|
785
798
|
/**
|
|
786
|
-
*
|
|
799
|
+
* Build a configuration with a list of approver public key commitments and a default
|
|
800
|
+
* threshold.
|
|
801
|
+
*
|
|
802
|
+
* `default_threshold` must be >= 1 and <= `approvers.length`.
|
|
787
803
|
*/
|
|
788
|
-
|
|
804
|
+
constructor(approvers: Word[], default_threshold: number);
|
|
789
805
|
/**
|
|
790
806
|
* Attach per-procedure thresholds. Each threshold must be >= 1 and <= `approvers.length`.
|
|
791
807
|
*/
|
|
792
808
|
withProcThresholds(proc_thresholds: ProcedureThreshold[]): AuthFalcon512RpoMultisigConfig;
|
|
793
809
|
/**
|
|
794
|
-
*
|
|
795
|
-
* threshold.
|
|
796
|
-
*
|
|
797
|
-
* `default_threshold` must be >= 1 and <= `approvers.length`.
|
|
810
|
+
* Per-procedure thresholds.
|
|
798
811
|
*/
|
|
799
|
-
|
|
812
|
+
getProcThresholds(): ProcedureThreshold[];
|
|
800
813
|
readonly defaultThreshold: number;
|
|
801
814
|
/**
|
|
802
815
|
* Approver public key commitments as Words.
|
|
@@ -807,19 +820,19 @@ export class AuthSecretKey {
|
|
|
807
820
|
private constructor();
|
|
808
821
|
free(): void;
|
|
809
822
|
[Symbol.dispose](): void;
|
|
810
|
-
publicKey(): PublicKey;
|
|
811
|
-
static deserialize(bytes: Uint8Array): AuthSecretKey;
|
|
812
|
-
static ecdsaWithRNG(seed?: Uint8Array | null): AuthSecretKey;
|
|
813
823
|
static rpoFalconWithRNG(seed?: Uint8Array | null): AuthSecretKey;
|
|
824
|
+
static ecdsaWithRNG(seed?: Uint8Array | null): AuthSecretKey;
|
|
825
|
+
publicKey(): PublicKey;
|
|
814
826
|
getPublicKeyAsWord(): Word;
|
|
827
|
+
sign(message: Word): Signature;
|
|
828
|
+
signData(signing_inputs: SigningInputs): Signature;
|
|
829
|
+
serialize(): Uint8Array;
|
|
830
|
+
static deserialize(bytes: Uint8Array): AuthSecretKey;
|
|
815
831
|
getRpoFalcon512SecretKeyAsFelts(): Felt[];
|
|
816
832
|
/**
|
|
817
833
|
* Returns the ECDSA k256 Keccak secret key bytes encoded as felts.
|
|
818
834
|
*/
|
|
819
835
|
getEcdsaK256KeccakSecretKeyAsFelts(): Felt[];
|
|
820
|
-
sign(message: Word): Signature;
|
|
821
|
-
serialize(): Uint8Array;
|
|
822
|
-
signData(signing_inputs: SigningInputs): Signature;
|
|
823
836
|
}
|
|
824
837
|
/**
|
|
825
838
|
* Provides metadata for a basic fungible faucet account component.
|
|
@@ -828,10 +841,6 @@ export class BasicFungibleFaucetComponent {
|
|
|
828
841
|
private constructor();
|
|
829
842
|
free(): void;
|
|
830
843
|
[Symbol.dispose](): void;
|
|
831
|
-
/**
|
|
832
|
-
* Returns the maximum token supply.
|
|
833
|
-
*/
|
|
834
|
-
maxSupply(): Felt;
|
|
835
844
|
/**
|
|
836
845
|
* Extracts faucet metadata from an account.
|
|
837
846
|
*/
|
|
@@ -844,6 +853,10 @@ export class BasicFungibleFaucetComponent {
|
|
|
844
853
|
* Returns the number of decimal places for the token.
|
|
845
854
|
*/
|
|
846
855
|
decimals(): number;
|
|
856
|
+
/**
|
|
857
|
+
* Returns the maximum token supply.
|
|
858
|
+
*/
|
|
859
|
+
maxSupply(): Felt;
|
|
847
860
|
}
|
|
848
861
|
/**
|
|
849
862
|
* Public header for a block, containing commitments to the chain state and the proof attesting to
|
|
@@ -860,53 +873,53 @@ export class BlockHeader {
|
|
|
860
873
|
free(): void;
|
|
861
874
|
[Symbol.dispose](): void;
|
|
862
875
|
/**
|
|
863
|
-
* Returns the
|
|
876
|
+
* Returns the header version.
|
|
864
877
|
*/
|
|
865
|
-
|
|
878
|
+
version(): number;
|
|
866
879
|
/**
|
|
867
|
-
* Returns the
|
|
880
|
+
* Returns the commitment to the block contents.
|
|
868
881
|
*/
|
|
869
|
-
|
|
882
|
+
commitment(): Word;
|
|
870
883
|
/**
|
|
871
|
-
* Returns the
|
|
884
|
+
* Returns the commitment to block metadata.
|
|
872
885
|
*/
|
|
873
|
-
|
|
886
|
+
subCommitment(): Word;
|
|
874
887
|
/**
|
|
875
|
-
* Returns the
|
|
888
|
+
* Returns the commitment of the previous block.
|
|
876
889
|
*/
|
|
877
|
-
|
|
890
|
+
prevBlockCommitment(): Word;
|
|
878
891
|
/**
|
|
879
|
-
* Returns the
|
|
892
|
+
* Returns the block height.
|
|
880
893
|
*/
|
|
881
|
-
|
|
894
|
+
blockNum(): number;
|
|
882
895
|
/**
|
|
883
896
|
* Returns the chain commitment.
|
|
884
897
|
*/
|
|
885
898
|
chainCommitment(): Word;
|
|
886
899
|
/**
|
|
887
|
-
* Returns the
|
|
900
|
+
* Returns the account root commitment.
|
|
888
901
|
*/
|
|
889
|
-
|
|
902
|
+
accountRoot(): Word;
|
|
890
903
|
/**
|
|
891
|
-
* Returns the
|
|
904
|
+
* Returns the nullifier root commitment.
|
|
892
905
|
*/
|
|
893
|
-
|
|
906
|
+
nullifierRoot(): Word;
|
|
894
907
|
/**
|
|
895
|
-
* Returns the commitment
|
|
908
|
+
* Returns the note commitment root.
|
|
896
909
|
*/
|
|
897
|
-
|
|
910
|
+
noteRoot(): Word;
|
|
898
911
|
/**
|
|
899
|
-
* Returns the
|
|
912
|
+
* Returns the transaction commitment.
|
|
900
913
|
*/
|
|
901
|
-
|
|
914
|
+
txCommitment(): Word;
|
|
902
915
|
/**
|
|
903
|
-
* Returns the
|
|
916
|
+
* Returns the transaction kernel commitment.
|
|
904
917
|
*/
|
|
905
|
-
|
|
918
|
+
txKernelCommitment(): Word;
|
|
906
919
|
/**
|
|
907
|
-
* Returns the
|
|
920
|
+
* Returns the proof commitment.
|
|
908
921
|
*/
|
|
909
|
-
|
|
922
|
+
proofCommitment(): Word;
|
|
910
923
|
/**
|
|
911
924
|
* Returns the block timestamp.
|
|
912
925
|
*/
|
|
@@ -932,23 +945,6 @@ export class CodeBuilder {
|
|
|
932
945
|
* statically link it for use with scripts to be built with this builder.
|
|
933
946
|
*/
|
|
934
947
|
linkModule(module_path: string, module_code: string): void;
|
|
935
|
-
/**
|
|
936
|
-
* Given a Library Path, and a source code, turn it into a Library.
|
|
937
|
-
* E.g. A path library can be `miden::my_contract`. When turned into a library,
|
|
938
|
-
* this can be used from another script with an import statement, following the
|
|
939
|
-
* previous example: `use miden::my_contract'.
|
|
940
|
-
*/
|
|
941
|
-
buildLibrary(library_path: string, source_code: string): Library;
|
|
942
|
-
/**
|
|
943
|
-
* Given a Transaction Script's source code, compiles it with the available
|
|
944
|
-
* modules under this builder. Returns the compiled script.
|
|
945
|
-
*/
|
|
946
|
-
compileTxScript(tx_script: string): TransactionScript;
|
|
947
|
-
/**
|
|
948
|
-
* Given a Note Script's source code, compiles it with the available
|
|
949
|
-
* modules under this builder. Returns the compiled script.
|
|
950
|
-
*/
|
|
951
|
-
compileNoteScript(program: string): NoteScript;
|
|
952
948
|
/**
|
|
953
949
|
* Statically links the given library.
|
|
954
950
|
*
|
|
@@ -967,6 +963,23 @@ export class CodeBuilder {
|
|
|
967
963
|
* Receives as argument the library to be linked.
|
|
968
964
|
*/
|
|
969
965
|
linkDynamicLibrary(library: Library): void;
|
|
966
|
+
/**
|
|
967
|
+
* Given a Transaction Script's source code, compiles it with the available
|
|
968
|
+
* modules under this builder. Returns the compiled script.
|
|
969
|
+
*/
|
|
970
|
+
compileTxScript(tx_script: string): TransactionScript;
|
|
971
|
+
/**
|
|
972
|
+
* Given a Note Script's source code, compiles it with the available
|
|
973
|
+
* modules under this builder. Returns the compiled script.
|
|
974
|
+
*/
|
|
975
|
+
compileNoteScript(program: string): NoteScript;
|
|
976
|
+
/**
|
|
977
|
+
* Given a Library Path, and a source code, turn it into a Library.
|
|
978
|
+
* E.g. A path library can be `miden::my_contract`. When turned into a library,
|
|
979
|
+
* this can be used from another script with an import statement, following the
|
|
980
|
+
* previous example: `use miden::my_contract'.
|
|
981
|
+
*/
|
|
982
|
+
buildLibrary(library_path: string, source_code: string): Library;
|
|
970
983
|
/**
|
|
971
984
|
* Given an `AccountComponentCode`, compiles it
|
|
972
985
|
* with the available modules under this builder. Returns the compiled account component code.
|
|
@@ -980,6 +993,10 @@ export class CommittedNote {
|
|
|
980
993
|
private constructor();
|
|
981
994
|
free(): void;
|
|
982
995
|
[Symbol.dispose](): void;
|
|
996
|
+
/**
|
|
997
|
+
* Returns the note ID.
|
|
998
|
+
*/
|
|
999
|
+
noteId(): NoteId;
|
|
983
1000
|
/**
|
|
984
1001
|
* Returns the note index in the block's note tree.
|
|
985
1002
|
*/
|
|
@@ -988,10 +1005,6 @@ export class CommittedNote {
|
|
|
988
1005
|
* Returns the inclusion path for the note.
|
|
989
1006
|
*/
|
|
990
1007
|
inclusionPath(): SparseMerklePath;
|
|
991
|
-
/**
|
|
992
|
-
* Returns the note ID.
|
|
993
|
-
*/
|
|
994
|
-
noteId(): NoteId;
|
|
995
1008
|
/**
|
|
996
1009
|
* Returns the note metadata.
|
|
997
1010
|
*/
|
|
@@ -1003,6 +1016,10 @@ export class CommittedNote {
|
|
|
1003
1016
|
export class ConsumableNoteRecord {
|
|
1004
1017
|
free(): void;
|
|
1005
1018
|
[Symbol.dispose](): void;
|
|
1019
|
+
/**
|
|
1020
|
+
* Creates a new consumable note record from an input note record and consumability metadata.
|
|
1021
|
+
*/
|
|
1022
|
+
constructor(input_note_record: InputNoteRecord, note_consumability: NoteConsumability[]);
|
|
1006
1023
|
/**
|
|
1007
1024
|
* Returns the underlying input note record.
|
|
1008
1025
|
*/
|
|
@@ -1011,10 +1028,6 @@ export class ConsumableNoteRecord {
|
|
|
1011
1028
|
* Returns the consumability entries.
|
|
1012
1029
|
*/
|
|
1013
1030
|
noteConsumability(): NoteConsumability[];
|
|
1014
|
-
/**
|
|
1015
|
-
* Creates a new consumable note record from an input note record and consumability metadata.
|
|
1016
|
-
*/
|
|
1017
|
-
constructor(input_note_record: InputNoteRecord, note_consumability: NoteConsumability[]);
|
|
1018
1031
|
}
|
|
1019
1032
|
/**
|
|
1020
1033
|
* The `Endpoint` struct represents a network endpoint, consisting of a protocol, a host, and a
|
|
@@ -1032,14 +1045,14 @@ export class Endpoint {
|
|
|
1032
1045
|
* @throws throws an error if the URL is invalid
|
|
1033
1046
|
*/
|
|
1034
1047
|
constructor(url: string);
|
|
1035
|
-
/**
|
|
1036
|
-
* Returns the endpoint for the Miden devnet.
|
|
1037
|
-
*/
|
|
1038
|
-
static devnet(): Endpoint;
|
|
1039
1048
|
/**
|
|
1040
1049
|
* Returns the endpoint for the Miden testnet.
|
|
1041
1050
|
*/
|
|
1042
1051
|
static testnet(): Endpoint;
|
|
1052
|
+
/**
|
|
1053
|
+
* Returns the endpoint for the Miden devnet.
|
|
1054
|
+
*/
|
|
1055
|
+
static devnet(): Endpoint;
|
|
1043
1056
|
/**
|
|
1044
1057
|
* Returns the endpoint for a local Miden node.
|
|
1045
1058
|
*
|
|
@@ -1050,6 +1063,10 @@ export class Endpoint {
|
|
|
1050
1063
|
* Returns the string representation of the endpoint.
|
|
1051
1064
|
*/
|
|
1052
1065
|
toString(): string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Returns the protocol of the endpoint.
|
|
1068
|
+
*/
|
|
1069
|
+
readonly protocol: string;
|
|
1053
1070
|
/**
|
|
1054
1071
|
* Returns the host of the endpoint.
|
|
1055
1072
|
*/
|
|
@@ -1058,10 +1075,6 @@ export class Endpoint {
|
|
|
1058
1075
|
* Returns the port of the endpoint.
|
|
1059
1076
|
*/
|
|
1060
1077
|
readonly port: number | undefined;
|
|
1061
|
-
/**
|
|
1062
|
-
* Returns the protocol of the endpoint.
|
|
1063
|
-
*/
|
|
1064
|
-
readonly protocol: string;
|
|
1065
1078
|
}
|
|
1066
1079
|
/**
|
|
1067
1080
|
* Describes the result of executing a transaction program for the Miden protocol.
|
|
@@ -1080,41 +1093,41 @@ export class ExecutedTransaction {
|
|
|
1080
1093
|
free(): void;
|
|
1081
1094
|
[Symbol.dispose](): void;
|
|
1082
1095
|
/**
|
|
1083
|
-
* Returns the
|
|
1084
|
-
*/
|
|
1085
|
-
accountId(): AccountId;
|
|
1086
|
-
/**
|
|
1087
|
-
* Returns the input notes consumed by the transaction.
|
|
1088
|
-
*/
|
|
1089
|
-
inputNotes(): InputNotes;
|
|
1090
|
-
/**
|
|
1091
|
-
* Returns the block header that included the transaction.
|
|
1096
|
+
* Returns the transaction ID.
|
|
1092
1097
|
*/
|
|
1093
|
-
|
|
1098
|
+
id(): TransactionId;
|
|
1094
1099
|
/**
|
|
1095
|
-
* Returns the
|
|
1100
|
+
* Returns the account the transaction was executed against.
|
|
1096
1101
|
*/
|
|
1097
|
-
|
|
1102
|
+
accountId(): AccountId;
|
|
1098
1103
|
/**
|
|
1099
|
-
* Returns the account
|
|
1104
|
+
* Returns the initial account header before execution.
|
|
1100
1105
|
*/
|
|
1101
|
-
|
|
1106
|
+
initialAccountHeader(): AccountHeader;
|
|
1102
1107
|
/**
|
|
1103
1108
|
* Returns the final account header after execution.
|
|
1104
1109
|
*/
|
|
1105
1110
|
finalAccountHeader(): AccountHeader;
|
|
1106
1111
|
/**
|
|
1107
|
-
* Returns the
|
|
1112
|
+
* Returns the input notes consumed by the transaction.
|
|
1108
1113
|
*/
|
|
1109
|
-
|
|
1114
|
+
inputNotes(): InputNotes;
|
|
1110
1115
|
/**
|
|
1111
|
-
* Returns the transaction
|
|
1116
|
+
* Returns the output notes produced by the transaction.
|
|
1112
1117
|
*/
|
|
1113
|
-
|
|
1118
|
+
outputNotes(): OutputNotes;
|
|
1114
1119
|
/**
|
|
1115
1120
|
* Returns the arguments passed to the transaction script.
|
|
1116
1121
|
*/
|
|
1117
1122
|
txArgs(): TransactionArgs;
|
|
1123
|
+
/**
|
|
1124
|
+
* Returns the block header that included the transaction.
|
|
1125
|
+
*/
|
|
1126
|
+
blockHeader(): BlockHeader;
|
|
1127
|
+
/**
|
|
1128
|
+
* Returns the account delta resulting from execution.
|
|
1129
|
+
*/
|
|
1130
|
+
accountDelta(): AccountDelta;
|
|
1118
1131
|
}
|
|
1119
1132
|
/**
|
|
1120
1133
|
* Field element wrapper exposed to JavaScript.
|
|
@@ -1146,12 +1159,12 @@ export class FeltArray {
|
|
|
1146
1159
|
toString(): string;
|
|
1147
1160
|
free(): void;
|
|
1148
1161
|
[Symbol.dispose](): void;
|
|
1149
|
-
|
|
1162
|
+
constructor(elements?: Felt[] | null);
|
|
1150
1163
|
/**
|
|
1151
1164
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
1152
1165
|
*/
|
|
1153
1166
|
get(index: number): Felt;
|
|
1154
|
-
|
|
1167
|
+
replaceAt(index: number, elem: Felt): void;
|
|
1155
1168
|
push(element: Felt): void;
|
|
1156
1169
|
length(): number;
|
|
1157
1170
|
}
|
|
@@ -1170,14 +1183,6 @@ export class FetchedAccount {
|
|
|
1170
1183
|
* Returns the account commitment reported by the node.
|
|
1171
1184
|
*/
|
|
1172
1185
|
commitment(): Word;
|
|
1173
|
-
/**
|
|
1174
|
-
* Returns true when the account is a network account.
|
|
1175
|
-
*/
|
|
1176
|
-
isNetwork(): boolean;
|
|
1177
|
-
/**
|
|
1178
|
-
* Returns true when the account is private.
|
|
1179
|
-
*/
|
|
1180
|
-
isPrivate(): boolean;
|
|
1181
1186
|
/**
|
|
1182
1187
|
* Returns the last block height where the account was updated.
|
|
1183
1188
|
*/
|
|
@@ -1190,6 +1195,14 @@ export class FetchedAccount {
|
|
|
1190
1195
|
* Returns true when the account is public.
|
|
1191
1196
|
*/
|
|
1192
1197
|
isPublic(): boolean;
|
|
1198
|
+
/**
|
|
1199
|
+
* Returns true when the account is private.
|
|
1200
|
+
*/
|
|
1201
|
+
isPrivate(): boolean;
|
|
1202
|
+
/**
|
|
1203
|
+
* Returns true when the account is a network account.
|
|
1204
|
+
*/
|
|
1205
|
+
isNetwork(): boolean;
|
|
1193
1206
|
}
|
|
1194
1207
|
/**
|
|
1195
1208
|
* Wrapper for a note fetched over RPC.
|
|
@@ -1201,22 +1214,29 @@ export class FetchedNote {
|
|
|
1201
1214
|
free(): void;
|
|
1202
1215
|
[Symbol.dispose](): void;
|
|
1203
1216
|
/**
|
|
1204
|
-
*
|
|
1205
|
-
|
|
1217
|
+
* Create a `FetchedNote` with an optional [`Note`].
|
|
1218
|
+
*/
|
|
1219
|
+
constructor(note_id: NoteId, metadata: NoteMetadata, inclusion_proof: NoteInclusionProof, note?: Note | null);
|
|
1220
|
+
/**
|
|
1221
|
+
* Returns an [`InputNote`] when the fetched note is public.
|
|
1222
|
+
*
|
|
1206
1223
|
* Returns `undefined` when the note body is missing (e.g. private notes); in that case build
|
|
1207
1224
|
* an `InputNote` manually using the inclusion proof and note data obtained elsewhere.
|
|
1208
1225
|
*/
|
|
1209
1226
|
asInputNote(): InputNote | undefined;
|
|
1210
1227
|
/**
|
|
1211
|
-
*
|
|
1228
|
+
* The unique identifier of the note.
|
|
1212
1229
|
*/
|
|
1213
|
-
|
|
1230
|
+
readonly noteId: NoteId;
|
|
1214
1231
|
/**
|
|
1215
|
-
* The note's
|
|
1216
|
-
*
|
|
1217
|
-
* Contains the data required to prove inclusion of the note in the canonical chain.
|
|
1232
|
+
* The note's metadata, including sender, tag, and other properties.
|
|
1233
|
+
* Available for both private and public notes.
|
|
1218
1234
|
*/
|
|
1219
|
-
readonly
|
|
1235
|
+
readonly metadata: NoteMetadata;
|
|
1236
|
+
/**
|
|
1237
|
+
* The note's header, containing the ID and metadata.
|
|
1238
|
+
*/
|
|
1239
|
+
readonly header: NoteHeader;
|
|
1220
1240
|
/**
|
|
1221
1241
|
* The full [`Note`] data.
|
|
1222
1242
|
*
|
|
@@ -1225,18 +1245,11 @@ export class FetchedNote {
|
|
|
1225
1245
|
*/
|
|
1226
1246
|
readonly note: Note | undefined;
|
|
1227
1247
|
/**
|
|
1228
|
-
* The note's
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* The unique identifier of the note.
|
|
1233
|
-
*/
|
|
1234
|
-
readonly noteId: NoteId;
|
|
1235
|
-
/**
|
|
1236
|
-
* The note's metadata, including sender, tag, and other properties.
|
|
1237
|
-
* Available for both private and public notes.
|
|
1248
|
+
* The note's inclusion proof.
|
|
1249
|
+
*
|
|
1250
|
+
* Contains the data required to prove inclusion of the note in the canonical chain.
|
|
1238
1251
|
*/
|
|
1239
|
-
readonly
|
|
1252
|
+
readonly inclusionProof: NoteInclusionProof;
|
|
1240
1253
|
/**
|
|
1241
1254
|
* Returns whether the note is private, encrypted, or public.
|
|
1242
1255
|
*/
|
|
@@ -1246,9 +1259,9 @@ export class FlattenedU8Vec {
|
|
|
1246
1259
|
private constructor();
|
|
1247
1260
|
free(): void;
|
|
1248
1261
|
[Symbol.dispose](): void;
|
|
1249
|
-
num_inner_vecs(): number;
|
|
1250
1262
|
data(): Uint8Array;
|
|
1251
1263
|
lengths(): Uint32Array;
|
|
1264
|
+
num_inner_vecs(): number;
|
|
1252
1265
|
}
|
|
1253
1266
|
/**
|
|
1254
1267
|
* Description of a foreign account referenced by a transaction.
|
|
@@ -1258,17 +1271,17 @@ export class ForeignAccount {
|
|
|
1258
1271
|
free(): void;
|
|
1259
1272
|
[Symbol.dispose](): void;
|
|
1260
1273
|
/**
|
|
1261
|
-
*
|
|
1274
|
+
* Creates a foreign account entry for a public account with given storage requirements.
|
|
1262
1275
|
*/
|
|
1263
|
-
account_id
|
|
1276
|
+
static public(account_id: AccountId, storage_requirements: AccountStorageRequirements): ForeignAccount;
|
|
1264
1277
|
/**
|
|
1265
1278
|
* Returns the required storage slots/keys for this foreign account.
|
|
1266
1279
|
*/
|
|
1267
1280
|
storage_slot_requirements(): AccountStorageRequirements;
|
|
1268
1281
|
/**
|
|
1269
|
-
*
|
|
1282
|
+
* Returns the ID of the foreign account.
|
|
1270
1283
|
*/
|
|
1271
|
-
|
|
1284
|
+
account_id(): AccountId;
|
|
1272
1285
|
}
|
|
1273
1286
|
export class ForeignAccountArray {
|
|
1274
1287
|
/**
|
|
@@ -1281,12 +1294,12 @@ export class ForeignAccountArray {
|
|
|
1281
1294
|
toString(): string;
|
|
1282
1295
|
free(): void;
|
|
1283
1296
|
[Symbol.dispose](): void;
|
|
1284
|
-
|
|
1297
|
+
constructor(elements?: ForeignAccount[] | null);
|
|
1285
1298
|
/**
|
|
1286
1299
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
1287
1300
|
*/
|
|
1288
1301
|
get(index: number): ForeignAccount;
|
|
1289
|
-
|
|
1302
|
+
replaceAt(index: number, elem: ForeignAccount): void;
|
|
1290
1303
|
push(element: ForeignAccount): void;
|
|
1291
1304
|
length(): number;
|
|
1292
1305
|
}
|
|
@@ -1303,14 +1316,14 @@ export class FungibleAsset {
|
|
|
1303
1316
|
* Creates a fungible asset for the given faucet and amount.
|
|
1304
1317
|
*/
|
|
1305
1318
|
constructor(faucet_id: AccountId, amount: bigint);
|
|
1306
|
-
/**
|
|
1307
|
-
* Returns the amount of fungible units.
|
|
1308
|
-
*/
|
|
1309
|
-
amount(): bigint;
|
|
1310
1319
|
/**
|
|
1311
1320
|
* Returns the faucet account that minted this asset.
|
|
1312
1321
|
*/
|
|
1313
1322
|
faucetId(): AccountId;
|
|
1323
|
+
/**
|
|
1324
|
+
* Returns the amount of fungible units.
|
|
1325
|
+
*/
|
|
1326
|
+
amount(): bigint;
|
|
1314
1327
|
/**
|
|
1315
1328
|
* Encodes this asset into the word layout used in the vault.
|
|
1316
1329
|
*/
|
|
@@ -1324,29 +1337,29 @@ export class FungibleAssetDelta {
|
|
|
1324
1337
|
free(): void;
|
|
1325
1338
|
[Symbol.dispose](): void;
|
|
1326
1339
|
/**
|
|
1327
|
-
*
|
|
1340
|
+
* Serializes the fungible delta into bytes.
|
|
1328
1341
|
*/
|
|
1329
|
-
|
|
1342
|
+
serialize(): Uint8Array;
|
|
1330
1343
|
/**
|
|
1331
1344
|
* Deserializes a fungible delta from bytes.
|
|
1332
1345
|
*/
|
|
1333
1346
|
static deserialize(bytes: Uint8Array): FungibleAssetDelta;
|
|
1334
1347
|
/**
|
|
1335
|
-
* Returns
|
|
1348
|
+
* Returns true if no fungible assets are affected.
|
|
1336
1349
|
*/
|
|
1337
|
-
|
|
1350
|
+
isEmpty(): boolean;
|
|
1338
1351
|
/**
|
|
1339
|
-
* Returns
|
|
1352
|
+
* Returns the delta amount for a given faucet, if present.
|
|
1340
1353
|
*/
|
|
1341
|
-
|
|
1354
|
+
amount(faucet_id: AccountId): bigint | undefined;
|
|
1342
1355
|
/**
|
|
1343
|
-
* Returns
|
|
1356
|
+
* Returns the number of distinct fungible assets in the delta.
|
|
1344
1357
|
*/
|
|
1345
|
-
|
|
1358
|
+
numAssets(): number;
|
|
1346
1359
|
/**
|
|
1347
|
-
*
|
|
1360
|
+
* Returns all fungible asset deltas as a list.
|
|
1348
1361
|
*/
|
|
1349
|
-
|
|
1362
|
+
assets(): FungibleAssetDeltaItem[];
|
|
1350
1363
|
}
|
|
1351
1364
|
/**
|
|
1352
1365
|
* A single fungible asset change in the vault delta.
|
|
@@ -1355,14 +1368,14 @@ export class FungibleAssetDeltaItem {
|
|
|
1355
1368
|
private constructor();
|
|
1356
1369
|
free(): void;
|
|
1357
1370
|
[Symbol.dispose](): void;
|
|
1358
|
-
/**
|
|
1359
|
-
* Returns the signed amount change (positive adds assets, negative removes).
|
|
1360
|
-
*/
|
|
1361
|
-
readonly amount: bigint;
|
|
1362
1371
|
/**
|
|
1363
1372
|
* Returns the faucet ID this delta refers to.
|
|
1364
1373
|
*/
|
|
1365
1374
|
readonly faucetId: AccountId;
|
|
1375
|
+
/**
|
|
1376
|
+
* Returns the signed amount change (positive adds assets, negative removes).
|
|
1377
|
+
*/
|
|
1378
|
+
readonly amount: bigint;
|
|
1366
1379
|
}
|
|
1367
1380
|
/**
|
|
1368
1381
|
* Procedure digest paired with whether it is an auth procedure.
|
|
@@ -1387,10 +1400,6 @@ export class InputNote {
|
|
|
1387
1400
|
private constructor();
|
|
1388
1401
|
free(): void;
|
|
1389
1402
|
[Symbol.dispose](): void;
|
|
1390
|
-
/**
|
|
1391
|
-
* Returns the commitment to the note ID and metadata.
|
|
1392
|
-
*/
|
|
1393
|
-
commitment(): Word;
|
|
1394
1403
|
/**
|
|
1395
1404
|
* Creates an authenticated input note from a note and its inclusion proof.
|
|
1396
1405
|
*
|
|
@@ -1413,6 +1422,10 @@ export class InputNote {
|
|
|
1413
1422
|
* Returns the underlying note contents.
|
|
1414
1423
|
*/
|
|
1415
1424
|
note(): Note;
|
|
1425
|
+
/**
|
|
1426
|
+
* Returns the commitment to the note ID and metadata.
|
|
1427
|
+
*/
|
|
1428
|
+
commitment(): Word;
|
|
1416
1429
|
/**
|
|
1417
1430
|
* Returns the inclusion proof if the note is authenticated.
|
|
1418
1431
|
*/
|
|
@@ -1440,57 +1453,57 @@ export class InputNoteRecord {
|
|
|
1440
1453
|
free(): void;
|
|
1441
1454
|
[Symbol.dispose](): void;
|
|
1442
1455
|
/**
|
|
1443
|
-
* Returns the note
|
|
1456
|
+
* Returns the note ID.
|
|
1444
1457
|
*/
|
|
1445
|
-
|
|
1458
|
+
id(): NoteId;
|
|
1446
1459
|
/**
|
|
1447
|
-
* Returns
|
|
1460
|
+
* Returns the current processing state for this note.
|
|
1448
1461
|
*/
|
|
1449
|
-
|
|
1462
|
+
state(): InputNoteState;
|
|
1450
1463
|
/**
|
|
1451
|
-
* Returns
|
|
1464
|
+
* Returns the note details, if present.
|
|
1452
1465
|
*/
|
|
1453
|
-
|
|
1466
|
+
details(): NoteDetails;
|
|
1454
1467
|
/**
|
|
1455
|
-
*
|
|
1468
|
+
* Returns the note metadata if available.
|
|
1456
1469
|
*/
|
|
1457
|
-
|
|
1470
|
+
metadata(): NoteMetadata | undefined;
|
|
1458
1471
|
/**
|
|
1459
|
-
* Returns the
|
|
1472
|
+
* Returns the note commitment (id + metadata), if available.
|
|
1460
1473
|
*/
|
|
1461
|
-
|
|
1474
|
+
commitment(): Word | undefined;
|
|
1462
1475
|
/**
|
|
1463
|
-
* Returns
|
|
1476
|
+
* Returns the inclusion proof when the note is authenticated.
|
|
1464
1477
|
*/
|
|
1465
|
-
|
|
1478
|
+
inclusionProof(): NoteInclusionProof | undefined;
|
|
1466
1479
|
/**
|
|
1467
1480
|
* Returns the transaction ID that consumed this note, if any.
|
|
1468
1481
|
*/
|
|
1469
1482
|
consumerTransactionId(): string | undefined;
|
|
1470
1483
|
/**
|
|
1471
|
-
* Returns the note
|
|
1484
|
+
* Returns the nullifier for this note.
|
|
1472
1485
|
*/
|
|
1473
|
-
|
|
1486
|
+
nullifier(): string;
|
|
1474
1487
|
/**
|
|
1475
|
-
* Returns the
|
|
1488
|
+
* Returns true if the record contains authentication data (proof).
|
|
1476
1489
|
*/
|
|
1477
|
-
|
|
1490
|
+
isAuthenticated(): boolean;
|
|
1478
1491
|
/**
|
|
1479
|
-
* Returns the note
|
|
1492
|
+
* Returns true if the note has already been consumed.
|
|
1480
1493
|
*/
|
|
1481
|
-
|
|
1494
|
+
isConsumed(): boolean;
|
|
1482
1495
|
/**
|
|
1483
|
-
*
|
|
1496
|
+
* Returns true if the note is currently being processed.
|
|
1484
1497
|
*/
|
|
1485
|
-
|
|
1498
|
+
isProcessing(): boolean;
|
|
1486
1499
|
/**
|
|
1487
|
-
*
|
|
1500
|
+
* Converts the record into an `InputNote` (including proof when available).
|
|
1488
1501
|
*/
|
|
1489
|
-
|
|
1502
|
+
toInputNote(): InputNote;
|
|
1490
1503
|
/**
|
|
1491
|
-
*
|
|
1504
|
+
* Converts the record into a `Note` (including proof when available).
|
|
1492
1505
|
*/
|
|
1493
|
-
|
|
1506
|
+
toNote(): Note;
|
|
1494
1507
|
}
|
|
1495
1508
|
/**
|
|
1496
1509
|
* Input notes for a transaction, empty if the transaction does not consume notes.
|
|
@@ -1504,39 +1517,39 @@ export class InputNotes {
|
|
|
1504
1517
|
*/
|
|
1505
1518
|
commitment(): Word;
|
|
1506
1519
|
/**
|
|
1507
|
-
* Returns
|
|
1508
|
-
*/
|
|
1509
|
-
notes(): InputNote[];
|
|
1510
|
-
/**
|
|
1511
|
-
* Returns the input note at the specified index.
|
|
1520
|
+
* Returns the number of input notes.
|
|
1512
1521
|
*/
|
|
1513
|
-
|
|
1522
|
+
numNotes(): number;
|
|
1514
1523
|
/**
|
|
1515
1524
|
* Returns true if there are no input notes.
|
|
1516
1525
|
*/
|
|
1517
1526
|
isEmpty(): boolean;
|
|
1518
1527
|
/**
|
|
1519
|
-
* Returns the
|
|
1528
|
+
* Returns the input note at the specified index.
|
|
1520
1529
|
*/
|
|
1521
|
-
|
|
1530
|
+
getNote(index: number): InputNote;
|
|
1531
|
+
/**
|
|
1532
|
+
* Returns all input notes as a vector.
|
|
1533
|
+
*/
|
|
1534
|
+
notes(): InputNote[];
|
|
1522
1535
|
}
|
|
1523
1536
|
export class IntoUnderlyingByteSource {
|
|
1524
1537
|
private constructor();
|
|
1525
1538
|
free(): void;
|
|
1526
1539
|
[Symbol.dispose](): void;
|
|
1527
|
-
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
1528
1540
|
start(controller: ReadableByteStreamController): void;
|
|
1541
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
1529
1542
|
cancel(): void;
|
|
1530
|
-
readonly autoAllocateChunkSize: number;
|
|
1531
1543
|
readonly type: ReadableStreamType;
|
|
1544
|
+
readonly autoAllocateChunkSize: number;
|
|
1532
1545
|
}
|
|
1533
1546
|
export class IntoUnderlyingSink {
|
|
1534
1547
|
private constructor();
|
|
1535
1548
|
free(): void;
|
|
1536
1549
|
[Symbol.dispose](): void;
|
|
1537
|
-
abort(reason: any): Promise<any>;
|
|
1538
|
-
close(): Promise<any>;
|
|
1539
1550
|
write(chunk: any): Promise<any>;
|
|
1551
|
+
close(): Promise<any>;
|
|
1552
|
+
abort(reason: any): Promise<any>;
|
|
1540
1553
|
}
|
|
1541
1554
|
export class IntoUnderlyingSource {
|
|
1542
1555
|
private constructor();
|
|
@@ -1776,10 +1789,6 @@ export class MerklePath {
|
|
|
1776
1789
|
private constructor();
|
|
1777
1790
|
free(): void;
|
|
1778
1791
|
[Symbol.dispose](): void;
|
|
1779
|
-
/**
|
|
1780
|
-
* Computes the root given a leaf index and value.
|
|
1781
|
-
*/
|
|
1782
|
-
computeRoot(index: bigint, node: Word): Word;
|
|
1783
1792
|
/**
|
|
1784
1793
|
* Returns the depth of the path.
|
|
1785
1794
|
*/
|
|
@@ -1788,6 +1797,10 @@ export class MerklePath {
|
|
|
1788
1797
|
* Returns the nodes that make up the path.
|
|
1789
1798
|
*/
|
|
1790
1799
|
nodes(): Word[];
|
|
1800
|
+
/**
|
|
1801
|
+
* Computes the root given a leaf index and value.
|
|
1802
|
+
*/
|
|
1803
|
+
computeRoot(index: bigint, node: Word): Word;
|
|
1791
1804
|
/**
|
|
1792
1805
|
* Verifies the path against a root.
|
|
1793
1806
|
*/
|
|
@@ -1800,15 +1813,15 @@ export class NetworkId {
|
|
|
1800
1813
|
private constructor();
|
|
1801
1814
|
free(): void;
|
|
1802
1815
|
[Symbol.dispose](): void;
|
|
1816
|
+
static mainnet(): NetworkId;
|
|
1817
|
+
static testnet(): NetworkId;
|
|
1818
|
+
static devnet(): NetworkId;
|
|
1803
1819
|
/**
|
|
1804
1820
|
* Builds a custom network ID from a provided custom prefix.
|
|
1805
1821
|
*
|
|
1806
1822
|
* Returns an error if the prefix is invalid.
|
|
1807
1823
|
*/
|
|
1808
1824
|
static custom(custom_prefix: string): NetworkId;
|
|
1809
|
-
static devnet(): NetworkId;
|
|
1810
|
-
static mainnet(): NetworkId;
|
|
1811
|
-
static testnet(): NetworkId;
|
|
1812
1825
|
}
|
|
1813
1826
|
/**
|
|
1814
1827
|
* A note bundles public metadata with private details: assets, script, inputs, and a serial number
|
|
@@ -1821,29 +1834,33 @@ export class Note {
|
|
|
1821
1834
|
free(): void;
|
|
1822
1835
|
[Symbol.dispose](): void;
|
|
1823
1836
|
/**
|
|
1824
|
-
*
|
|
1837
|
+
* Creates a new note from the provided assets, metadata, and recipient.
|
|
1825
1838
|
*/
|
|
1826
|
-
|
|
1839
|
+
constructor(note_assets: NoteAssets, note_metadata: NoteMetadata, note_recipient: NoteRecipient);
|
|
1840
|
+
/**
|
|
1841
|
+
* Serializes the note into bytes.
|
|
1842
|
+
*/
|
|
1843
|
+
serialize(): Uint8Array;
|
|
1827
1844
|
/**
|
|
1828
1845
|
* Deserializes a note from its byte representation.
|
|
1829
1846
|
*/
|
|
1830
1847
|
static deserialize(bytes: Uint8Array): Note;
|
|
1831
1848
|
/**
|
|
1832
|
-
*
|
|
1849
|
+
* Returns the unique identifier of the note.
|
|
1833
1850
|
*/
|
|
1834
|
-
|
|
1851
|
+
id(): NoteId;
|
|
1835
1852
|
/**
|
|
1836
|
-
*
|
|
1853
|
+
* Returns the commitment to the note ID and metadata.
|
|
1837
1854
|
*/
|
|
1838
|
-
|
|
1855
|
+
commitment(): Word;
|
|
1839
1856
|
/**
|
|
1840
|
-
* Returns the
|
|
1857
|
+
* Returns the public metadata associated with the note.
|
|
1841
1858
|
*/
|
|
1842
|
-
|
|
1859
|
+
metadata(): NoteMetadata;
|
|
1843
1860
|
/**
|
|
1844
|
-
*
|
|
1861
|
+
* Returns the recipient who can consume this note.
|
|
1845
1862
|
*/
|
|
1846
|
-
|
|
1863
|
+
recipient(): NoteRecipient;
|
|
1847
1864
|
/**
|
|
1848
1865
|
* Returns the assets locked inside the note.
|
|
1849
1866
|
*/
|
|
@@ -1852,22 +1869,18 @@ export class Note {
|
|
|
1852
1869
|
* Returns the script that guards the note.
|
|
1853
1870
|
*/
|
|
1854
1871
|
script(): NoteScript;
|
|
1855
|
-
/**
|
|
1856
|
-
* Returns the public metadata associated with the note.
|
|
1857
|
-
*/
|
|
1858
|
-
metadata(): NoteMetadata;
|
|
1859
1872
|
/**
|
|
1860
1873
|
* Returns the note nullifier as a word.
|
|
1861
1874
|
*/
|
|
1862
1875
|
nullifier(): Word;
|
|
1863
1876
|
/**
|
|
1864
|
-
*
|
|
1877
|
+
* Builds a standard P2ID note that targets the specified account.
|
|
1865
1878
|
*/
|
|
1866
|
-
|
|
1879
|
+
static createP2IDNote(sender: AccountId, target: AccountId, assets: NoteAssets, note_type: NoteType, attachment: NoteAttachment): Note;
|
|
1867
1880
|
/**
|
|
1868
|
-
*
|
|
1881
|
+
* Builds a P2IDE note that can be reclaimed or timelocked based on block heights.
|
|
1869
1882
|
*/
|
|
1870
|
-
|
|
1883
|
+
static createP2IDENote(sender: AccountId, target: AccountId, assets: NoteAssets, reclaim_height: number | null | undefined, timelock_height: number | null | undefined, note_type: NoteType, attachment: NoteAttachment): Note;
|
|
1871
1884
|
}
|
|
1872
1885
|
export class NoteAndArgs {
|
|
1873
1886
|
free(): void;
|
|
@@ -1888,12 +1901,12 @@ export class NoteAndArgsArray {
|
|
|
1888
1901
|
toString(): string;
|
|
1889
1902
|
free(): void;
|
|
1890
1903
|
[Symbol.dispose](): void;
|
|
1891
|
-
|
|
1904
|
+
constructor(elements?: NoteAndArgs[] | null);
|
|
1892
1905
|
/**
|
|
1893
1906
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
1894
1907
|
*/
|
|
1895
1908
|
get(index: number): NoteAndArgs;
|
|
1896
|
-
|
|
1909
|
+
replaceAt(index: number, elem: NoteAndArgs): void;
|
|
1897
1910
|
push(element: NoteAndArgs): void;
|
|
1898
1911
|
length(): number;
|
|
1899
1912
|
}
|
|
@@ -1910,10 +1923,6 @@ export class NoteAndArgsArray {
|
|
|
1910
1923
|
export class NoteAssets {
|
|
1911
1924
|
free(): void;
|
|
1912
1925
|
[Symbol.dispose](): void;
|
|
1913
|
-
/**
|
|
1914
|
-
* Returns all fungible assets contained in the note.
|
|
1915
|
-
*/
|
|
1916
|
-
fungibleAssets(): FungibleAsset[];
|
|
1917
1926
|
/**
|
|
1918
1927
|
* Creates a new asset list for a note.
|
|
1919
1928
|
*/
|
|
@@ -1922,6 +1931,10 @@ export class NoteAssets {
|
|
|
1922
1931
|
* Adds a fungible asset to the collection.
|
|
1923
1932
|
*/
|
|
1924
1933
|
push(asset: FungibleAsset): void;
|
|
1934
|
+
/**
|
|
1935
|
+
* Returns all fungible assets contained in the note.
|
|
1936
|
+
*/
|
|
1937
|
+
fungibleAssets(): FungibleAsset[];
|
|
1925
1938
|
}
|
|
1926
1939
|
/**
|
|
1927
1940
|
* An attachment to a note.
|
|
@@ -1934,13 +1947,33 @@ export class NoteAttachment {
|
|
|
1934
1947
|
free(): void;
|
|
1935
1948
|
[Symbol.dispose](): void;
|
|
1936
1949
|
/**
|
|
1937
|
-
*
|
|
1950
|
+
* Creates a default (empty) note attachment.
|
|
1938
1951
|
*/
|
|
1939
|
-
|
|
1952
|
+
constructor();
|
|
1953
|
+
/**
|
|
1954
|
+
* Creates a new note attachment with Word content from the provided word.
|
|
1955
|
+
*/
|
|
1956
|
+
static newWord(scheme: NoteAttachmentScheme, word: Word): NoteAttachment;
|
|
1957
|
+
/**
|
|
1958
|
+
* Creates a new note attachment with Array content from the provided elements.
|
|
1959
|
+
*/
|
|
1960
|
+
static newArray(scheme: NoteAttachmentScheme, elements: FeltArray): NoteAttachment;
|
|
1940
1961
|
/**
|
|
1941
1962
|
* Returns the attachment scheme.
|
|
1942
1963
|
*/
|
|
1943
1964
|
attachmentScheme(): NoteAttachmentScheme;
|
|
1965
|
+
/**
|
|
1966
|
+
* Returns the attachment kind.
|
|
1967
|
+
*/
|
|
1968
|
+
attachmentKind(): NoteAttachmentKind;
|
|
1969
|
+
/**
|
|
1970
|
+
* Returns the content as a Word if the attachment kind is Word, otherwise None.
|
|
1971
|
+
*/
|
|
1972
|
+
asWord(): Word | undefined;
|
|
1973
|
+
/**
|
|
1974
|
+
* Returns the content as an array of Felts if the attachment kind is Array, otherwise None.
|
|
1975
|
+
*/
|
|
1976
|
+
asArray(): FeltArray | undefined;
|
|
1944
1977
|
/**
|
|
1945
1978
|
* Creates a new note attachment for a network account target.
|
|
1946
1979
|
*
|
|
@@ -1956,26 +1989,6 @@ export class NoteAttachment {
|
|
|
1956
1989
|
* Returns an error if the target account is not a network account.
|
|
1957
1990
|
*/
|
|
1958
1991
|
static newNetworkAccountTarget(target_id: AccountId, exec_hint: NoteExecutionHint): NoteAttachment;
|
|
1959
|
-
/**
|
|
1960
|
-
* Creates a default (empty) note attachment.
|
|
1961
|
-
*/
|
|
1962
|
-
constructor();
|
|
1963
|
-
/**
|
|
1964
|
-
* Returns the content as a Word if the attachment kind is Word, otherwise None.
|
|
1965
|
-
*/
|
|
1966
|
-
asWord(): Word | undefined;
|
|
1967
|
-
/**
|
|
1968
|
-
* Returns the content as an array of Felts if the attachment kind is Array, otherwise None.
|
|
1969
|
-
*/
|
|
1970
|
-
asArray(): FeltArray | undefined;
|
|
1971
|
-
/**
|
|
1972
|
-
* Creates a new note attachment with Word content from the provided word.
|
|
1973
|
-
*/
|
|
1974
|
-
static newWord(scheme: NoteAttachmentScheme, word: Word): NoteAttachment;
|
|
1975
|
-
/**
|
|
1976
|
-
* Creates a new note attachment with Array content from the provided elements.
|
|
1977
|
-
*/
|
|
1978
|
-
static newArray(scheme: NoteAttachmentScheme, elements: FeltArray): NoteAttachment;
|
|
1979
1992
|
}
|
|
1980
1993
|
/**
|
|
1981
1994
|
* Describes the type of a note attachment.
|
|
@@ -1994,14 +2007,14 @@ export class NoteAttachmentScheme {
|
|
|
1994
2007
|
* Returns the `NoteAttachmentScheme` that signals the absence of an attachment scheme.
|
|
1995
2008
|
*/
|
|
1996
2009
|
static none(): NoteAttachmentScheme;
|
|
1997
|
-
/**
|
|
1998
|
-
* Returns the note attachment scheme as a u32.
|
|
1999
|
-
*/
|
|
2000
|
-
asU32(): number;
|
|
2001
2010
|
/**
|
|
2002
2011
|
* Returns true if the attachment scheme is the reserved value that signals an absent scheme.
|
|
2003
2012
|
*/
|
|
2004
2013
|
isNone(): boolean;
|
|
2014
|
+
/**
|
|
2015
|
+
* Returns the note attachment scheme as a u32.
|
|
2016
|
+
*/
|
|
2017
|
+
asU32(): number;
|
|
2005
2018
|
}
|
|
2006
2019
|
export class NoteConsumability {
|
|
2007
2020
|
private constructor();
|
|
@@ -2028,6 +2041,10 @@ export class NoteConsumptionStatus {
|
|
|
2028
2041
|
* Constructs a `NoteConsumptionStatus` that is consumable.
|
|
2029
2042
|
*/
|
|
2030
2043
|
static consumable(): NoteConsumptionStatus;
|
|
2044
|
+
/**
|
|
2045
|
+
* Constructs a `NoteConsumptionStatus` that is consumable with authorization.
|
|
2046
|
+
*/
|
|
2047
|
+
static consumableWithAuthorization(): NoteConsumptionStatus;
|
|
2031
2048
|
/**
|
|
2032
2049
|
* Constructs a `NoteConsumptionStatus` that is consumable after a specific block height.
|
|
2033
2050
|
*/
|
|
@@ -2036,19 +2053,15 @@ export class NoteConsumptionStatus {
|
|
|
2036
2053
|
* Constructs a `NoteConsumptionStatus` that is never consumable.
|
|
2037
2054
|
*/
|
|
2038
2055
|
static neverConsumable(err: string): NoteConsumptionStatus;
|
|
2039
|
-
/**
|
|
2040
|
-
* Returns the block number at which the note can be consumed.
|
|
2041
|
-
* Returns None if the note is already consumable or never possible
|
|
2042
|
-
*/
|
|
2043
|
-
consumableAfterBlock(): number | undefined;
|
|
2044
2056
|
/**
|
|
2045
2057
|
* Constructs a `NoteConsumptionStatus` that is unconsumable due to conditions.
|
|
2046
2058
|
*/
|
|
2047
2059
|
static unconsumableConditions(): NoteConsumptionStatus;
|
|
2048
2060
|
/**
|
|
2049
|
-
*
|
|
2061
|
+
* Returns the block number at which the note can be consumed.
|
|
2062
|
+
* Returns None if the note is already consumable or never possible
|
|
2050
2063
|
*/
|
|
2051
|
-
|
|
2064
|
+
consumableAfterBlock(): number | undefined;
|
|
2052
2065
|
}
|
|
2053
2066
|
/**
|
|
2054
2067
|
* Details of a note consisting of assets, script, inputs, and a serial number.
|
|
@@ -2058,26 +2071,26 @@ export class NoteConsumptionStatus {
|
|
|
2058
2071
|
export class NoteDetails {
|
|
2059
2072
|
free(): void;
|
|
2060
2073
|
[Symbol.dispose](): void;
|
|
2061
|
-
/**
|
|
2062
|
-
* Returns the note identifier derived from these details.
|
|
2063
|
-
*/
|
|
2064
|
-
id(): NoteId;
|
|
2065
2074
|
/**
|
|
2066
2075
|
* Creates a new set of note details from the given assets and recipient.
|
|
2067
2076
|
*/
|
|
2068
2077
|
constructor(note_assets: NoteAssets, note_recipient: NoteRecipient);
|
|
2069
2078
|
/**
|
|
2070
|
-
* Returns the
|
|
2079
|
+
* Returns the note identifier derived from these details.
|
|
2071
2080
|
*/
|
|
2072
|
-
|
|
2081
|
+
id(): NoteId;
|
|
2073
2082
|
/**
|
|
2074
|
-
* Returns the
|
|
2083
|
+
* Returns the assets locked by the note.
|
|
2075
2084
|
*/
|
|
2076
|
-
|
|
2085
|
+
assets(): NoteAssets;
|
|
2077
2086
|
/**
|
|
2078
2087
|
* Returns the recipient which controls when the note can be consumed.
|
|
2079
2088
|
*/
|
|
2080
2089
|
recipient(): NoteRecipient;
|
|
2090
|
+
/**
|
|
2091
|
+
* Returns the note nullifier as a word.
|
|
2092
|
+
*/
|
|
2093
|
+
nullifier(): Word;
|
|
2081
2094
|
}
|
|
2082
2095
|
/**
|
|
2083
2096
|
* Pair of note details and tag used when declaring expected notes.
|
|
@@ -2109,12 +2122,12 @@ export class NoteDetailsAndTagArray {
|
|
|
2109
2122
|
toString(): string;
|
|
2110
2123
|
free(): void;
|
|
2111
2124
|
[Symbol.dispose](): void;
|
|
2112
|
-
|
|
2125
|
+
constructor(elements?: NoteDetailsAndTag[] | null);
|
|
2113
2126
|
/**
|
|
2114
2127
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
2115
2128
|
*/
|
|
2116
2129
|
get(index: number): NoteDetailsAndTag;
|
|
2117
|
-
|
|
2130
|
+
replaceAt(index: number, elem: NoteDetailsAndTag): void;
|
|
2118
2131
|
push(element: NoteDetailsAndTag): void;
|
|
2119
2132
|
length(): number;
|
|
2120
2133
|
}
|
|
@@ -2126,9 +2139,13 @@ export class NoteExecutionHint {
|
|
|
2126
2139
|
free(): void;
|
|
2127
2140
|
[Symbol.dispose](): void;
|
|
2128
2141
|
/**
|
|
2129
|
-
*
|
|
2142
|
+
* Creates a hint that does not specify any execution constraint.
|
|
2130
2143
|
*/
|
|
2131
|
-
static
|
|
2144
|
+
static none(): NoteExecutionHint;
|
|
2145
|
+
/**
|
|
2146
|
+
* Creates a hint indicating the note can always be consumed.
|
|
2147
|
+
*/
|
|
2148
|
+
static always(): NoteExecutionHint;
|
|
2132
2149
|
/**
|
|
2133
2150
|
* Creates a hint that activates after the given block number.
|
|
2134
2151
|
*/
|
|
@@ -2138,17 +2155,13 @@ export class NoteExecutionHint {
|
|
|
2138
2155
|
*/
|
|
2139
2156
|
static onBlockSlot(epoch_len: number, slot_len: number, slot_offset: number): NoteExecutionHint;
|
|
2140
2157
|
/**
|
|
2141
|
-
*
|
|
2142
|
-
*/
|
|
2143
|
-
canBeConsumed(block_num: number): boolean;
|
|
2144
|
-
/**
|
|
2145
|
-
* Creates a hint that does not specify any execution constraint.
|
|
2158
|
+
* Reconstructs a hint from its encoded tag and payload.
|
|
2146
2159
|
*/
|
|
2147
|
-
static
|
|
2160
|
+
static fromParts(tag: number, payload: number): NoteExecutionHint;
|
|
2148
2161
|
/**
|
|
2149
|
-
*
|
|
2162
|
+
* Returns whether the note can be consumed at the provided block height.
|
|
2150
2163
|
*/
|
|
2151
|
-
|
|
2164
|
+
canBeConsumed(block_num: number): boolean;
|
|
2152
2165
|
}
|
|
2153
2166
|
/**
|
|
2154
2167
|
* A serialized representation of a note.
|
|
@@ -2166,62 +2179,62 @@ export class NoteFile {
|
|
|
2166
2179
|
free(): void;
|
|
2167
2180
|
[Symbol.dispose](): void;
|
|
2168
2181
|
/**
|
|
2169
|
-
*
|
|
2170
|
-
* return it as a struct.
|
|
2182
|
+
* Returns this `NoteFile`'s types.
|
|
2171
2183
|
*/
|
|
2172
|
-
|
|
2184
|
+
noteType(): string;
|
|
2173
2185
|
/**
|
|
2174
|
-
*
|
|
2186
|
+
* Returns the note ID for any `NoteFile` variant.
|
|
2175
2187
|
*/
|
|
2176
|
-
|
|
2188
|
+
noteId(): NoteId;
|
|
2177
2189
|
/**
|
|
2178
2190
|
* Returns the note details if present.
|
|
2179
2191
|
*/
|
|
2180
2192
|
noteDetails(): NoteDetails | undefined;
|
|
2181
2193
|
/**
|
|
2182
|
-
* Returns the
|
|
2183
|
-
*/
|
|
2184
|
-
afterBlockNum(): number | undefined;
|
|
2185
|
-
/**
|
|
2186
|
-
* Creates a `NoteFile` from an input note, preserving proof when available.
|
|
2194
|
+
* Returns the full note when the file includes it.
|
|
2187
2195
|
*/
|
|
2188
|
-
|
|
2196
|
+
note(): Note | undefined;
|
|
2189
2197
|
/**
|
|
2190
2198
|
* Returns the inclusion proof if present.
|
|
2191
2199
|
*/
|
|
2192
2200
|
inclusionProof(): NoteInclusionProof | undefined;
|
|
2193
2201
|
/**
|
|
2194
|
-
*
|
|
2202
|
+
* Returns the after-block hint when present.
|
|
2195
2203
|
*/
|
|
2196
|
-
|
|
2204
|
+
afterBlockNum(): number | undefined;
|
|
2197
2205
|
/**
|
|
2198
|
-
*
|
|
2206
|
+
* Returns the note tag hint when present.
|
|
2199
2207
|
*/
|
|
2200
|
-
|
|
2208
|
+
noteTag(): NoteTag | undefined;
|
|
2201
2209
|
/**
|
|
2202
|
-
* Returns the
|
|
2210
|
+
* Returns the note nullifier when present.
|
|
2203
2211
|
*/
|
|
2204
|
-
|
|
2212
|
+
nullifier(): string | undefined;
|
|
2205
2213
|
/**
|
|
2206
|
-
*
|
|
2214
|
+
* Turn a notefile into its byte representation.
|
|
2207
2215
|
*/
|
|
2208
|
-
|
|
2216
|
+
serialize(): Uint8Array;
|
|
2209
2217
|
/**
|
|
2210
|
-
*
|
|
2218
|
+
* Given a valid byte representation of a `NoteFile`,
|
|
2219
|
+
* return it as a struct.
|
|
2211
2220
|
*/
|
|
2212
|
-
|
|
2221
|
+
static deserialize(bytes: Uint8Array): NoteFile;
|
|
2213
2222
|
/**
|
|
2214
|
-
*
|
|
2223
|
+
* Creates a `NoteFile` from an input note, preserving proof when available.
|
|
2215
2224
|
*/
|
|
2216
|
-
|
|
2225
|
+
static fromInputNote(note: InputNote): NoteFile;
|
|
2217
2226
|
/**
|
|
2218
|
-
*
|
|
2227
|
+
* Creates a `NoteFile` from an output note, choosing details when present.
|
|
2219
2228
|
*/
|
|
2220
|
-
|
|
2229
|
+
static fromOutputNote(note: OutputNote): NoteFile;
|
|
2221
2230
|
/**
|
|
2222
|
-
*
|
|
2231
|
+
* Creates a `NoteFile` from note details.
|
|
2223
2232
|
*/
|
|
2224
|
-
|
|
2233
|
+
static fromNoteDetails(note_details: NoteDetails): NoteFile;
|
|
2234
|
+
/**
|
|
2235
|
+
* Creates a `NoteFile` from a note ID.
|
|
2236
|
+
*/
|
|
2237
|
+
static fromNoteId(note_details: NoteId): NoteFile;
|
|
2225
2238
|
}
|
|
2226
2239
|
/**
|
|
2227
2240
|
* Filter options for querying notes from the store.
|
|
@@ -2243,10 +2256,6 @@ export class NoteHeader {
|
|
|
2243
2256
|
private constructor();
|
|
2244
2257
|
free(): void;
|
|
2245
2258
|
[Symbol.dispose](): void;
|
|
2246
|
-
/**
|
|
2247
|
-
* Returns a commitment to the note ID and metadata.
|
|
2248
|
-
*/
|
|
2249
|
-
commitment(): Word;
|
|
2250
2259
|
/**
|
|
2251
2260
|
* Returns the unique identifier for the note.
|
|
2252
2261
|
*/
|
|
@@ -2255,6 +2264,10 @@ export class NoteHeader {
|
|
|
2255
2264
|
* Returns the public metadata attached to the note.
|
|
2256
2265
|
*/
|
|
2257
2266
|
metadata(): NoteMetadata;
|
|
2267
|
+
/**
|
|
2268
|
+
* Returns a commitment to the note ID and metadata.
|
|
2269
|
+
*/
|
|
2270
|
+
commitment(): Word;
|
|
2258
2271
|
}
|
|
2259
2272
|
/**
|
|
2260
2273
|
* Returns a unique identifier of a note, which is simultaneously a commitment to the note.
|
|
@@ -2310,12 +2323,12 @@ export class NoteIdAndArgsArray {
|
|
|
2310
2323
|
toString(): string;
|
|
2311
2324
|
free(): void;
|
|
2312
2325
|
[Symbol.dispose](): void;
|
|
2313
|
-
|
|
2326
|
+
constructor(elements?: NoteIdAndArgs[] | null);
|
|
2314
2327
|
/**
|
|
2315
2328
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
2316
2329
|
*/
|
|
2317
2330
|
get(index: number): NoteIdAndArgs;
|
|
2318
|
-
|
|
2331
|
+
replaceAt(index: number, elem: NoteIdAndArgs): void;
|
|
2319
2332
|
push(element: NoteIdAndArgs): void;
|
|
2320
2333
|
length(): number;
|
|
2321
2334
|
}
|
|
@@ -2364,14 +2377,14 @@ export class NoteLocation {
|
|
|
2364
2377
|
private constructor();
|
|
2365
2378
|
free(): void;
|
|
2366
2379
|
[Symbol.dispose](): void;
|
|
2367
|
-
/**
|
|
2368
|
-
* Returns the index of the note leaf within the block's note tree.
|
|
2369
|
-
*/
|
|
2370
|
-
nodeIndexInBlock(): number;
|
|
2371
2380
|
/**
|
|
2372
2381
|
* Returns the block height containing the note.
|
|
2373
2382
|
*/
|
|
2374
2383
|
blockNum(): number;
|
|
2384
|
+
/**
|
|
2385
|
+
* Returns the index of the note leaf within the block's note tree.
|
|
2386
|
+
*/
|
|
2387
|
+
nodeIndexInBlock(): number;
|
|
2375
2388
|
}
|
|
2376
2389
|
/**
|
|
2377
2390
|
* Metadata associated with a note.
|
|
@@ -2382,30 +2395,30 @@ export class NoteLocation {
|
|
|
2382
2395
|
export class NoteMetadata {
|
|
2383
2396
|
free(): void;
|
|
2384
2397
|
[Symbol.dispose](): void;
|
|
2385
|
-
/**
|
|
2386
|
-
* Adds an attachment to this metadata and returns the updated metadata.
|
|
2387
|
-
*
|
|
2388
|
-
* Attachments provide additional context about how notes should be processed.
|
|
2389
|
-
* For example, a `NetworkAccountTarget` attachment indicates that the note
|
|
2390
|
-
* should be consumed by a specific network account.
|
|
2391
|
-
*/
|
|
2392
|
-
withAttachment(attachment: NoteAttachment): NoteMetadata;
|
|
2393
2398
|
/**
|
|
2394
2399
|
* Creates metadata for a note.
|
|
2395
2400
|
*/
|
|
2396
2401
|
constructor(sender: AccountId, note_type: NoteType, note_tag: NoteTag);
|
|
2397
|
-
/**
|
|
2398
|
-
* Returns the tag associated with the note.
|
|
2399
|
-
*/
|
|
2400
|
-
tag(): NoteTag;
|
|
2401
2402
|
/**
|
|
2402
2403
|
* Returns the account that created the note.
|
|
2403
2404
|
*/
|
|
2404
2405
|
sender(): AccountId;
|
|
2406
|
+
/**
|
|
2407
|
+
* Returns the tag associated with the note.
|
|
2408
|
+
*/
|
|
2409
|
+
tag(): NoteTag;
|
|
2405
2410
|
/**
|
|
2406
2411
|
* Returns whether the note is private, encrypted, or public.
|
|
2407
2412
|
*/
|
|
2408
2413
|
noteType(): NoteType;
|
|
2414
|
+
/**
|
|
2415
|
+
* Adds an attachment to this metadata and returns the updated metadata.
|
|
2416
|
+
*
|
|
2417
|
+
* Attachments provide additional context about how notes should be processed.
|
|
2418
|
+
* For example, a `NetworkAccountTarget` attachment indicates that the note
|
|
2419
|
+
* should be consumed by a specific network account.
|
|
2420
|
+
*/
|
|
2421
|
+
withAttachment(attachment: NoteAttachment): NoteMetadata;
|
|
2409
2422
|
}
|
|
2410
2423
|
/**
|
|
2411
2424
|
* Value that describes under which condition a note can be consumed.
|
|
@@ -2421,10 +2434,6 @@ export class NoteMetadata {
|
|
|
2421
2434
|
export class NoteRecipient {
|
|
2422
2435
|
free(): void;
|
|
2423
2436
|
[Symbol.dispose](): void;
|
|
2424
|
-
/**
|
|
2425
|
-
* Returns the serial number that prevents double spends.
|
|
2426
|
-
*/
|
|
2427
|
-
serialNum(): Word;
|
|
2428
2437
|
/**
|
|
2429
2438
|
* Creates a note recipient from its serial number, script, and inputs.
|
|
2430
2439
|
*/
|
|
@@ -2434,13 +2443,17 @@ export class NoteRecipient {
|
|
|
2434
2443
|
*/
|
|
2435
2444
|
digest(): Word;
|
|
2436
2445
|
/**
|
|
2437
|
-
* Returns the
|
|
2446
|
+
* Returns the serial number that prevents double spends.
|
|
2438
2447
|
*/
|
|
2439
|
-
|
|
2448
|
+
serialNum(): Word;
|
|
2440
2449
|
/**
|
|
2441
2450
|
* Returns the script that controls consumption.
|
|
2442
2451
|
*/
|
|
2443
2452
|
script(): NoteScript;
|
|
2453
|
+
/**
|
|
2454
|
+
* Returns the inputs provided to the script.
|
|
2455
|
+
*/
|
|
2456
|
+
inputs(): NoteInputs;
|
|
2444
2457
|
}
|
|
2445
2458
|
export class NoteRecipientArray {
|
|
2446
2459
|
/**
|
|
@@ -2453,12 +2466,12 @@ export class NoteRecipientArray {
|
|
|
2453
2466
|
toString(): string;
|
|
2454
2467
|
free(): void;
|
|
2455
2468
|
[Symbol.dispose](): void;
|
|
2456
|
-
|
|
2469
|
+
constructor(elements?: NoteRecipient[] | null);
|
|
2457
2470
|
/**
|
|
2458
2471
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
2459
2472
|
*/
|
|
2460
2473
|
get(index: number): NoteRecipient;
|
|
2461
|
-
|
|
2474
|
+
replaceAt(index: number, elem: NoteRecipient): void;
|
|
2462
2475
|
push(element: NoteRecipient): void;
|
|
2463
2476
|
length(): number;
|
|
2464
2477
|
}
|
|
@@ -2473,38 +2486,38 @@ export class NoteScript {
|
|
|
2473
2486
|
free(): void;
|
|
2474
2487
|
[Symbol.dispose](): void;
|
|
2475
2488
|
/**
|
|
2476
|
-
*
|
|
2489
|
+
* Pretty-prints the MAST source for this script.
|
|
2477
2490
|
*/
|
|
2478
|
-
|
|
2491
|
+
toString(): string;
|
|
2479
2492
|
/**
|
|
2480
|
-
*
|
|
2481
|
-
* Throws if the package is invalid.
|
|
2493
|
+
* Serializes the script into bytes.
|
|
2482
2494
|
*/
|
|
2483
|
-
|
|
2495
|
+
serialize(): Uint8Array;
|
|
2496
|
+
/**
|
|
2497
|
+
* Deserializes a script from bytes.
|
|
2498
|
+
*/
|
|
2499
|
+
static deserialize(bytes: Uint8Array): NoteScript;
|
|
2484
2500
|
/**
|
|
2485
2501
|
* Returns the well-known P2ID script.
|
|
2486
2502
|
*/
|
|
2487
2503
|
static p2id(): NoteScript;
|
|
2488
2504
|
/**
|
|
2489
|
-
* Returns the
|
|
2505
|
+
* Returns the well-known P2IDE script (P2ID with execution hint).
|
|
2490
2506
|
*/
|
|
2491
|
-
|
|
2507
|
+
static p2ide(): NoteScript;
|
|
2492
2508
|
/**
|
|
2493
2509
|
* Returns the well-known SWAP script.
|
|
2494
2510
|
*/
|
|
2495
2511
|
static swap(): NoteScript;
|
|
2496
2512
|
/**
|
|
2497
|
-
* Returns the
|
|
2498
|
-
*/
|
|
2499
|
-
static p2ide(): NoteScript;
|
|
2500
|
-
/**
|
|
2501
|
-
* Serializes the script into bytes.
|
|
2513
|
+
* Returns the MAST root of this script.
|
|
2502
2514
|
*/
|
|
2503
|
-
|
|
2515
|
+
root(): Word;
|
|
2504
2516
|
/**
|
|
2505
|
-
*
|
|
2517
|
+
* Creates a `NoteScript` from the given `Package`.
|
|
2518
|
+
* Throws if the package is invalid.
|
|
2506
2519
|
*/
|
|
2507
|
-
|
|
2520
|
+
static fromPackage(_package: Package): NoteScript;
|
|
2508
2521
|
}
|
|
2509
2522
|
/**
|
|
2510
2523
|
* Represents the response data from `syncNotes`.
|
|
@@ -2514,21 +2527,21 @@ export class NoteSyncInfo {
|
|
|
2514
2527
|
free(): void;
|
|
2515
2528
|
[Symbol.dispose](): void;
|
|
2516
2529
|
/**
|
|
2517
|
-
* Returns the block
|
|
2530
|
+
* Returns the latest block number in the chain.
|
|
2518
2531
|
*/
|
|
2519
|
-
|
|
2532
|
+
chainTip(): number;
|
|
2520
2533
|
/**
|
|
2521
|
-
* Returns the
|
|
2534
|
+
* Returns the block header associated with the matching notes.
|
|
2522
2535
|
*/
|
|
2523
|
-
|
|
2536
|
+
blockHeader(): BlockHeader;
|
|
2524
2537
|
/**
|
|
2525
2538
|
* Returns the MMR path for the block header.
|
|
2526
2539
|
*/
|
|
2527
2540
|
mmrPath(): MerklePath;
|
|
2528
2541
|
/**
|
|
2529
|
-
* Returns the
|
|
2542
|
+
* Returns the committed notes returned by the node.
|
|
2530
2543
|
*/
|
|
2531
|
-
|
|
2544
|
+
notes(): CommittedNote[];
|
|
2532
2545
|
}
|
|
2533
2546
|
/**
|
|
2534
2547
|
* Note tags are 32-bits of data that serve as best-effort filters for notes.
|
|
@@ -2539,6 +2552,10 @@ export class NoteSyncInfo {
|
|
|
2539
2552
|
export class NoteTag {
|
|
2540
2553
|
free(): void;
|
|
2541
2554
|
[Symbol.dispose](): void;
|
|
2555
|
+
/**
|
|
2556
|
+
* Creates a new `NoteTag` from an arbitrary u32.
|
|
2557
|
+
*/
|
|
2558
|
+
constructor(tag: number);
|
|
2542
2559
|
/**
|
|
2543
2560
|
* Constructs a note tag that targets the given account ID.
|
|
2544
2561
|
*/
|
|
@@ -2547,10 +2564,6 @@ export class NoteTag {
|
|
|
2547
2564
|
* Constructs a note tag that targets the given account ID with a custom tag length.
|
|
2548
2565
|
*/
|
|
2549
2566
|
static withCustomAccountTarget(account_id: AccountId, tag_len: number): NoteTag;
|
|
2550
|
-
/**
|
|
2551
|
-
* Creates a new `NoteTag` from an arbitrary u32.
|
|
2552
|
-
*/
|
|
2553
|
-
constructor(tag: number);
|
|
2554
2567
|
/**
|
|
2555
2568
|
* Returns the inner u32 value of this tag.
|
|
2556
2569
|
*/
|
|
@@ -2563,38 +2576,38 @@ export class OutputNote {
|
|
|
2563
2576
|
private constructor();
|
|
2564
2577
|
free(): void;
|
|
2565
2578
|
[Symbol.dispose](): void;
|
|
2566
|
-
/**
|
|
2567
|
-
* Returns the recipient digest if the recipient is known.
|
|
2568
|
-
*/
|
|
2569
|
-
recipientDigest(): Word | undefined;
|
|
2570
|
-
/**
|
|
2571
|
-
* Returns the note ID for this output.
|
|
2572
|
-
*/
|
|
2573
|
-
id(): NoteId;
|
|
2574
2579
|
/**
|
|
2575
2580
|
* Wraps a full note output.
|
|
2576
2581
|
*/
|
|
2577
2582
|
static full(note: Note): OutputNote;
|
|
2578
2583
|
/**
|
|
2579
|
-
*
|
|
2584
|
+
* Wraps a partial note containing assets and recipient only.
|
|
2580
2585
|
*/
|
|
2581
|
-
|
|
2586
|
+
static partial(partial_note: PartialNote): OutputNote;
|
|
2582
2587
|
/**
|
|
2583
2588
|
* Wraps only the header of a note.
|
|
2584
2589
|
*/
|
|
2585
2590
|
static header(note_header: NoteHeader): OutputNote;
|
|
2586
2591
|
/**
|
|
2587
|
-
* Returns
|
|
2592
|
+
* Returns the assets if they are present.
|
|
2588
2593
|
*/
|
|
2589
|
-
|
|
2594
|
+
assets(): NoteAssets | undefined;
|
|
2590
2595
|
/**
|
|
2591
|
-
*
|
|
2596
|
+
* Returns the note ID for this output.
|
|
2592
2597
|
*/
|
|
2593
|
-
|
|
2598
|
+
id(): NoteId;
|
|
2599
|
+
/**
|
|
2600
|
+
* Returns the recipient digest if the recipient is known.
|
|
2601
|
+
*/
|
|
2602
|
+
recipientDigest(): Word | undefined;
|
|
2594
2603
|
/**
|
|
2595
2604
|
* Returns the metadata that accompanies this output.
|
|
2596
2605
|
*/
|
|
2597
2606
|
metadata(): NoteMetadata;
|
|
2607
|
+
/**
|
|
2608
|
+
* Returns a more compact representation if possible (e.g. dropping details).
|
|
2609
|
+
*/
|
|
2610
|
+
shrink(): OutputNote;
|
|
2598
2611
|
/**
|
|
2599
2612
|
* Converts into a full note if the data is present.
|
|
2600
2613
|
*/
|
|
@@ -2611,12 +2624,12 @@ export class OutputNoteArray {
|
|
|
2611
2624
|
toString(): string;
|
|
2612
2625
|
free(): void;
|
|
2613
2626
|
[Symbol.dispose](): void;
|
|
2614
|
-
|
|
2627
|
+
constructor(elements?: OutputNote[] | null);
|
|
2615
2628
|
/**
|
|
2616
2629
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
2617
2630
|
*/
|
|
2618
2631
|
get(index: number): OutputNote;
|
|
2619
|
-
|
|
2632
|
+
replaceAt(index: number, elem: OutputNote): void;
|
|
2620
2633
|
push(element: OutputNote): void;
|
|
2621
2634
|
length(): number;
|
|
2622
2635
|
}
|
|
@@ -2627,26 +2640,6 @@ export class OutputNoteRecord {
|
|
|
2627
2640
|
private constructor();
|
|
2628
2641
|
free(): void;
|
|
2629
2642
|
[Symbol.dispose](): void;
|
|
2630
|
-
/**
|
|
2631
|
-
* Returns true if the note has been consumed on chain.
|
|
2632
|
-
*/
|
|
2633
|
-
isConsumed(): boolean;
|
|
2634
|
-
/**
|
|
2635
|
-
* Returns true if the note is committed on chain.
|
|
2636
|
-
*/
|
|
2637
|
-
isCommitted(): boolean;
|
|
2638
|
-
/**
|
|
2639
|
-
* Returns the expected block height for the note.
|
|
2640
|
-
*/
|
|
2641
|
-
expectedHeight(): number;
|
|
2642
|
-
/**
|
|
2643
|
-
* Returns the inclusion proof when the note is committed.
|
|
2644
|
-
*/
|
|
2645
|
-
inclusionProof(): NoteInclusionProof | undefined;
|
|
2646
|
-
/**
|
|
2647
|
-
* Returns the recipient digest committed for the note.
|
|
2648
|
-
*/
|
|
2649
|
-
recipientDigest(): Word;
|
|
2650
2643
|
/**
|
|
2651
2644
|
* Returns the note ID.
|
|
2652
2645
|
*/
|
|
@@ -2655,6 +2648,10 @@ export class OutputNoteRecord {
|
|
|
2655
2648
|
* Returns the current processing state for this note.
|
|
2656
2649
|
*/
|
|
2657
2650
|
state(): OutputNoteState;
|
|
2651
|
+
/**
|
|
2652
|
+
* Returns the recipient digest committed for the note.
|
|
2653
|
+
*/
|
|
2654
|
+
recipientDigest(): Word;
|
|
2658
2655
|
/**
|
|
2659
2656
|
* Returns the note assets.
|
|
2660
2657
|
*/
|
|
@@ -2664,13 +2661,29 @@ export class OutputNoteRecord {
|
|
|
2664
2661
|
*/
|
|
2665
2662
|
metadata(): NoteMetadata;
|
|
2666
2663
|
/**
|
|
2667
|
-
* Returns the
|
|
2664
|
+
* Returns the inclusion proof when the note is committed.
|
|
2668
2665
|
*/
|
|
2669
|
-
|
|
2666
|
+
inclusionProof(): NoteInclusionProof | undefined;
|
|
2670
2667
|
/**
|
|
2671
2668
|
* Returns the recipient details if available.
|
|
2672
2669
|
*/
|
|
2673
2670
|
recipient(): NoteRecipient | undefined;
|
|
2671
|
+
/**
|
|
2672
|
+
* Returns the expected block height for the note.
|
|
2673
|
+
*/
|
|
2674
|
+
expectedHeight(): number;
|
|
2675
|
+
/**
|
|
2676
|
+
* Returns the nullifier when the recipient is known.
|
|
2677
|
+
*/
|
|
2678
|
+
nullifier(): string | undefined;
|
|
2679
|
+
/**
|
|
2680
|
+
* Returns true if the note has been consumed on chain.
|
|
2681
|
+
*/
|
|
2682
|
+
isConsumed(): boolean;
|
|
2683
|
+
/**
|
|
2684
|
+
* Returns true if the note is committed on chain.
|
|
2685
|
+
*/
|
|
2686
|
+
isCommitted(): boolean;
|
|
2674
2687
|
}
|
|
2675
2688
|
/**
|
|
2676
2689
|
* Contains a list of output notes of a transaction. The list can be empty if the transaction does
|
|
@@ -2685,21 +2698,21 @@ export class OutputNotes {
|
|
|
2685
2698
|
*/
|
|
2686
2699
|
commitment(): Word;
|
|
2687
2700
|
/**
|
|
2688
|
-
* Returns
|
|
2689
|
-
*/
|
|
2690
|
-
notes(): OutputNote[];
|
|
2691
|
-
/**
|
|
2692
|
-
* Returns the output note at the specified index.
|
|
2701
|
+
* Returns the number of notes emitted.
|
|
2693
2702
|
*/
|
|
2694
|
-
|
|
2703
|
+
numNotes(): number;
|
|
2695
2704
|
/**
|
|
2696
2705
|
* Returns true if there are no output notes.
|
|
2697
2706
|
*/
|
|
2698
2707
|
isEmpty(): boolean;
|
|
2699
2708
|
/**
|
|
2700
|
-
* Returns the
|
|
2709
|
+
* Returns the output note at the specified index.
|
|
2701
2710
|
*/
|
|
2702
|
-
|
|
2711
|
+
getNote(index: number): OutputNote;
|
|
2712
|
+
/**
|
|
2713
|
+
* Returns all output notes as a vector.
|
|
2714
|
+
*/
|
|
2715
|
+
notes(): OutputNote[];
|
|
2703
2716
|
}
|
|
2704
2717
|
export class OutputNotesArray {
|
|
2705
2718
|
/**
|
|
@@ -2712,12 +2725,12 @@ export class OutputNotesArray {
|
|
|
2712
2725
|
toString(): string;
|
|
2713
2726
|
free(): void;
|
|
2714
2727
|
[Symbol.dispose](): void;
|
|
2715
|
-
|
|
2728
|
+
constructor(elements?: OutputNotes[] | null);
|
|
2716
2729
|
/**
|
|
2717
2730
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
2718
2731
|
*/
|
|
2719
2732
|
get(index: number): OutputNotes;
|
|
2720
|
-
|
|
2733
|
+
replaceAt(index: number, elem: OutputNotes): void;
|
|
2721
2734
|
push(element: OutputNotes): void;
|
|
2722
2735
|
length(): number;
|
|
2723
2736
|
}
|
|
@@ -2728,6 +2741,14 @@ export class Package {
|
|
|
2728
2741
|
private constructor();
|
|
2729
2742
|
free(): void;
|
|
2730
2743
|
[Symbol.dispose](): void;
|
|
2744
|
+
/**
|
|
2745
|
+
* Serializes the package into bytes.
|
|
2746
|
+
*/
|
|
2747
|
+
serialize(): Uint8Array;
|
|
2748
|
+
/**
|
|
2749
|
+
* Deserializes a package from bytes.
|
|
2750
|
+
*/
|
|
2751
|
+
static deserialize(bytes: Uint8Array): Package;
|
|
2731
2752
|
/**
|
|
2732
2753
|
* Returns the underlying library of a `Package`.
|
|
2733
2754
|
* Fails if the package is not a library.
|
|
@@ -2738,14 +2759,6 @@ export class Package {
|
|
|
2738
2759
|
* Fails if the package is not a program.
|
|
2739
2760
|
*/
|
|
2740
2761
|
asProgram(): Program;
|
|
2741
|
-
/**
|
|
2742
|
-
* Deserializes a package from bytes.
|
|
2743
|
-
*/
|
|
2744
|
-
static deserialize(bytes: Uint8Array): Package;
|
|
2745
|
-
/**
|
|
2746
|
-
* Serializes the package into bytes.
|
|
2747
|
-
*/
|
|
2748
|
-
serialize(): Uint8Array;
|
|
2749
2762
|
}
|
|
2750
2763
|
/**
|
|
2751
2764
|
* Partial information about a note.
|
|
@@ -2760,22 +2773,22 @@ export class PartialNote {
|
|
|
2760
2773
|
private constructor();
|
|
2761
2774
|
free(): void;
|
|
2762
2775
|
[Symbol.dispose](): void;
|
|
2763
|
-
/**
|
|
2764
|
-
* Returns the digest of the recipient information.
|
|
2765
|
-
*/
|
|
2766
|
-
recipientDigest(): Word;
|
|
2767
2776
|
/**
|
|
2768
2777
|
* Returns the identifier of the partial note.
|
|
2769
2778
|
*/
|
|
2770
2779
|
id(): NoteId;
|
|
2771
|
-
/**
|
|
2772
|
-
* Returns the assets locked in the note.
|
|
2773
|
-
*/
|
|
2774
|
-
assets(): NoteAssets;
|
|
2775
2780
|
/**
|
|
2776
2781
|
* Returns the metadata attached to the note.
|
|
2777
2782
|
*/
|
|
2778
2783
|
metadata(): NoteMetadata;
|
|
2784
|
+
/**
|
|
2785
|
+
* Returns the digest of the recipient information.
|
|
2786
|
+
*/
|
|
2787
|
+
recipientDigest(): Word;
|
|
2788
|
+
/**
|
|
2789
|
+
* Returns the assets locked in the note.
|
|
2790
|
+
*/
|
|
2791
|
+
assets(): NoteAssets;
|
|
2779
2792
|
}
|
|
2780
2793
|
export class ProcedureThreshold {
|
|
2781
2794
|
free(): void;
|
|
@@ -2798,70 +2811,70 @@ export class ProvenTransaction {
|
|
|
2798
2811
|
free(): void;
|
|
2799
2812
|
[Symbol.dispose](): void;
|
|
2800
2813
|
/**
|
|
2801
|
-
*
|
|
2802
|
-
*/
|
|
2803
|
-
accountId(): AccountId;
|
|
2804
|
-
/**
|
|
2805
|
-
* Returns the nullifiers of the consumed input notes.
|
|
2814
|
+
* Serializes the proven transaction into bytes.
|
|
2806
2815
|
*/
|
|
2807
|
-
|
|
2816
|
+
serialize(): Uint8Array;
|
|
2808
2817
|
/**
|
|
2809
2818
|
* Deserializes a proven transaction from bytes.
|
|
2810
2819
|
*/
|
|
2811
2820
|
static deserialize(bytes: Uint8Array): ProvenTransaction;
|
|
2812
2821
|
/**
|
|
2813
|
-
* Returns
|
|
2822
|
+
* Returns the transaction ID.
|
|
2814
2823
|
*/
|
|
2815
|
-
|
|
2824
|
+
id(): TransactionId;
|
|
2816
2825
|
/**
|
|
2817
|
-
* Returns the
|
|
2826
|
+
* Returns the account ID the transaction was executed against.
|
|
2818
2827
|
*/
|
|
2819
|
-
|
|
2828
|
+
accountId(): AccountId;
|
|
2820
2829
|
/**
|
|
2821
|
-
* Returns the
|
|
2830
|
+
* Returns the reference block number used during execution.
|
|
2822
2831
|
*/
|
|
2823
|
-
|
|
2832
|
+
refBlockNumber(): number;
|
|
2824
2833
|
/**
|
|
2825
2834
|
* Returns the block number at which the transaction expires.
|
|
2826
2835
|
*/
|
|
2827
2836
|
expirationBlockNumber(): number;
|
|
2828
2837
|
/**
|
|
2829
|
-
* Returns
|
|
2838
|
+
* Returns notes created by this transaction.
|
|
2830
2839
|
*/
|
|
2831
|
-
|
|
2840
|
+
outputNotes(): OutputNotes;
|
|
2832
2841
|
/**
|
|
2833
|
-
*
|
|
2842
|
+
* Returns the commitment of the reference block.
|
|
2834
2843
|
*/
|
|
2835
|
-
|
|
2844
|
+
refBlockCommitment(): Word;
|
|
2845
|
+
/**
|
|
2846
|
+
* Returns the nullifiers of the consumed input notes.
|
|
2847
|
+
*/
|
|
2848
|
+
nullifiers(): Word[];
|
|
2836
2849
|
}
|
|
2837
2850
|
export class PublicKey {
|
|
2838
2851
|
private constructor();
|
|
2839
2852
|
free(): void;
|
|
2840
2853
|
[Symbol.dispose](): void;
|
|
2841
2854
|
/**
|
|
2842
|
-
*
|
|
2855
|
+
* Serializes the public key into bytes.
|
|
2843
2856
|
*/
|
|
2844
|
-
|
|
2857
|
+
serialize(): Uint8Array;
|
|
2845
2858
|
/**
|
|
2846
|
-
*
|
|
2859
|
+
* Deserializes a public key from bytes.
|
|
2847
2860
|
*/
|
|
2848
|
-
|
|
2861
|
+
static deserialize(bytes: Uint8Array): PublicKey;
|
|
2849
2862
|
/**
|
|
2850
|
-
*
|
|
2863
|
+
* Verifies a blind message word against the signature.
|
|
2851
2864
|
*/
|
|
2852
|
-
|
|
2865
|
+
verify(message: Word, signature: Signature): boolean;
|
|
2853
2866
|
/**
|
|
2854
2867
|
* Returns the commitment corresponding to this public key.
|
|
2855
2868
|
*/
|
|
2856
2869
|
toCommitment(): Word;
|
|
2857
2870
|
/**
|
|
2858
|
-
*
|
|
2871
|
+
* Recovers a public key from a signature (only supported for `RpoFalcon512`).
|
|
2859
2872
|
*/
|
|
2860
|
-
|
|
2873
|
+
static recoverFrom(message: Word, signature: Signature): PublicKey;
|
|
2861
2874
|
/**
|
|
2862
|
-
*
|
|
2875
|
+
* Verifies a signature over arbitrary signing inputs.
|
|
2863
2876
|
*/
|
|
2864
|
-
|
|
2877
|
+
verifyData(signing_inputs: SigningInputs, signature: Signature): boolean;
|
|
2865
2878
|
}
|
|
2866
2879
|
/**
|
|
2867
2880
|
* RPC Client for interacting with Miden nodes directly.
|
|
@@ -2870,9 +2883,11 @@ export class RpcClient {
|
|
|
2870
2883
|
free(): void;
|
|
2871
2884
|
[Symbol.dispose](): void;
|
|
2872
2885
|
/**
|
|
2873
|
-
*
|
|
2886
|
+
* Creates a new RPC client instance.
|
|
2887
|
+
*
|
|
2888
|
+
* @param endpoint - Endpoint to connect to.
|
|
2874
2889
|
*/
|
|
2875
|
-
|
|
2890
|
+
constructor(endpoint: Endpoint);
|
|
2876
2891
|
/**
|
|
2877
2892
|
* Fetches notes by their IDs from the connected Miden node.
|
|
2878
2893
|
*
|
|
@@ -2883,10 +2898,6 @@ export class RpcClient {
|
|
|
2883
2898
|
* - Public notes: Returns the full `note` with `inclusionProof`, alongside its header.
|
|
2884
2899
|
*/
|
|
2885
2900
|
getNotesById(note_ids: NoteId[]): Promise<FetchedNote[]>;
|
|
2886
|
-
/**
|
|
2887
|
-
* Fetches account details for a specific account ID.
|
|
2888
|
-
*/
|
|
2889
|
-
getAccountDetails(account_id: AccountId): Promise<FetchedAccount>;
|
|
2890
2901
|
/**
|
|
2891
2902
|
* Fetches a note script by its root hash from the connected Miden node.
|
|
2892
2903
|
*
|
|
@@ -2899,15 +2910,17 @@ export class RpcClient {
|
|
|
2899
2910
|
*/
|
|
2900
2911
|
getBlockHeaderByNumber(block_num?: number | null): Promise<BlockHeader>;
|
|
2901
2912
|
/**
|
|
2902
|
-
* Fetches
|
|
2913
|
+
* Fetches account details for a specific account ID.
|
|
2903
2914
|
*/
|
|
2904
|
-
|
|
2915
|
+
getAccountDetails(account_id: AccountId): Promise<FetchedAccount>;
|
|
2905
2916
|
/**
|
|
2906
|
-
*
|
|
2907
|
-
*
|
|
2908
|
-
* @param endpoint - Endpoint to connect to.
|
|
2917
|
+
* Fetches notes matching the provided tags from the node.
|
|
2909
2918
|
*/
|
|
2910
|
-
|
|
2919
|
+
syncNotes(block_num: number, block_to: number | null | undefined, note_tags: NoteTag[]): Promise<NoteSyncInfo>;
|
|
2920
|
+
/**
|
|
2921
|
+
* Fetches the block height at which a nullifier was committed, if any.
|
|
2922
|
+
*/
|
|
2923
|
+
getNullifierCommitHeight(nullifier: Word, block_num: number): Promise<number | undefined>;
|
|
2911
2924
|
}
|
|
2912
2925
|
/**
|
|
2913
2926
|
* RPO256 hashing helpers exposed to JavaScript.
|
|
@@ -2971,6 +2984,10 @@ export class Signature {
|
|
|
2971
2984
|
private constructor();
|
|
2972
2985
|
free(): void;
|
|
2973
2986
|
[Symbol.dispose](): void;
|
|
2987
|
+
/**
|
|
2988
|
+
* Serializes the signature into bytes.
|
|
2989
|
+
*/
|
|
2990
|
+
serialize(): Uint8Array;
|
|
2974
2991
|
/**
|
|
2975
2992
|
* Deserializes a signature from bytes.
|
|
2976
2993
|
*/
|
|
@@ -2979,55 +2996,51 @@ export class Signature {
|
|
|
2979
2996
|
* Converts the signature to the prepared field elements expected by verifying code.
|
|
2980
2997
|
*/
|
|
2981
2998
|
toPreparedSignature(message: Word): Felt[];
|
|
2982
|
-
/**
|
|
2983
|
-
* Serializes the signature into bytes.
|
|
2984
|
-
*/
|
|
2985
|
-
serialize(): Uint8Array;
|
|
2986
2999
|
}
|
|
2987
3000
|
export class SigningInputs {
|
|
2988
3001
|
private constructor();
|
|
2989
3002
|
free(): void;
|
|
2990
3003
|
[Symbol.dispose](): void;
|
|
2991
3004
|
/**
|
|
2992
|
-
*
|
|
2993
|
-
*/
|
|
2994
|
-
static deserialize(bytes: Uint8Array): SigningInputs;
|
|
2995
|
-
/**
|
|
2996
|
-
* Returns the inputs as field elements.
|
|
2997
|
-
*/
|
|
2998
|
-
toElements(): FeltArray;
|
|
2999
|
-
/**
|
|
3000
|
-
* Returns the blind payload as a word.
|
|
3005
|
+
* Creates signing inputs from a transaction summary.
|
|
3001
3006
|
*/
|
|
3002
|
-
|
|
3007
|
+
static newTransactionSummary(summary: TransactionSummary): SigningInputs;
|
|
3003
3008
|
/**
|
|
3004
3009
|
* Creates signing inputs from arbitrary field elements.
|
|
3005
3010
|
*/
|
|
3006
3011
|
static newArbitrary(felts: Felt[]): SigningInputs;
|
|
3007
3012
|
/**
|
|
3008
|
-
*
|
|
3013
|
+
* Creates blind signing inputs from a single word.
|
|
3009
3014
|
*/
|
|
3010
|
-
|
|
3015
|
+
static newBlind(word: Word): SigningInputs;
|
|
3016
|
+
/**
|
|
3017
|
+
* Returns the transaction summary payload if this variant contains one.
|
|
3018
|
+
*/
|
|
3019
|
+
transactionSummaryPayload(): TransactionSummary;
|
|
3011
3020
|
/**
|
|
3012
3021
|
* Returns the arbitrary payload as an array of felts.
|
|
3013
3022
|
*/
|
|
3014
3023
|
arbitraryPayload(): FeltArray;
|
|
3015
3024
|
/**
|
|
3016
|
-
*
|
|
3025
|
+
* Returns the blind payload as a word.
|
|
3017
3026
|
*/
|
|
3018
|
-
|
|
3027
|
+
blindPayload(): Word;
|
|
3019
3028
|
/**
|
|
3020
|
-
* Returns the
|
|
3029
|
+
* Returns the commitment to these signing inputs.
|
|
3021
3030
|
*/
|
|
3022
|
-
|
|
3031
|
+
toCommitment(): Word;
|
|
3023
3032
|
/**
|
|
3024
|
-
*
|
|
3033
|
+
* Returns the inputs as field elements.
|
|
3025
3034
|
*/
|
|
3026
|
-
|
|
3035
|
+
toElements(): FeltArray;
|
|
3027
3036
|
/**
|
|
3028
3037
|
* Serializes the signing inputs into bytes.
|
|
3029
3038
|
*/
|
|
3030
3039
|
serialize(): Uint8Array;
|
|
3040
|
+
/**
|
|
3041
|
+
* Deserializes signing inputs from bytes.
|
|
3042
|
+
*/
|
|
3043
|
+
static deserialize(bytes: Uint8Array): SigningInputs;
|
|
3031
3044
|
/**
|
|
3032
3045
|
* Returns which variant these signing inputs represent.
|
|
3033
3046
|
*/
|
|
@@ -3040,17 +3053,17 @@ export class SlotAndKeys {
|
|
|
3040
3053
|
free(): void;
|
|
3041
3054
|
[Symbol.dispose](): void;
|
|
3042
3055
|
/**
|
|
3043
|
-
*
|
|
3056
|
+
* Creates a new slot-and-keys entry.
|
|
3044
3057
|
*/
|
|
3045
|
-
|
|
3058
|
+
constructor(storage_slot_name: string, storage_map_keys: Word[]);
|
|
3046
3059
|
/**
|
|
3047
3060
|
* Returns the slot name.
|
|
3048
3061
|
*/
|
|
3049
3062
|
storage_slot_name(): string;
|
|
3050
3063
|
/**
|
|
3051
|
-
*
|
|
3064
|
+
* Returns the storage map keys required for this slot.
|
|
3052
3065
|
*/
|
|
3053
|
-
|
|
3066
|
+
storage_map_keys(): Word[];
|
|
3054
3067
|
}
|
|
3055
3068
|
/**
|
|
3056
3069
|
* Represents a sparse Merkle path.
|
|
@@ -3134,12 +3147,12 @@ export class StorageSlotArray {
|
|
|
3134
3147
|
toString(): string;
|
|
3135
3148
|
free(): void;
|
|
3136
3149
|
[Symbol.dispose](): void;
|
|
3137
|
-
|
|
3150
|
+
constructor(elements?: StorageSlot[] | null);
|
|
3138
3151
|
/**
|
|
3139
3152
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
3140
3153
|
*/
|
|
3141
3154
|
get(index: number): StorageSlot;
|
|
3142
|
-
|
|
3155
|
+
replaceAt(index: number, elem: StorageSlot): void;
|
|
3143
3156
|
push(element: StorageSlot): void;
|
|
3144
3157
|
length(): number;
|
|
3145
3158
|
}
|
|
@@ -3151,33 +3164,33 @@ export class SyncSummary {
|
|
|
3151
3164
|
free(): void;
|
|
3152
3165
|
[Symbol.dispose](): void;
|
|
3153
3166
|
/**
|
|
3154
|
-
*
|
|
3155
|
-
*/
|
|
3156
|
-
static deserialize(bytes: Uint8Array): SyncSummary;
|
|
3157
|
-
/**
|
|
3158
|
-
* Returns IDs of notes that were consumed.
|
|
3167
|
+
* Returns the block height the summary is based on.
|
|
3159
3168
|
*/
|
|
3160
|
-
|
|
3169
|
+
blockNum(): number;
|
|
3161
3170
|
/**
|
|
3162
3171
|
* Returns IDs of notes committed in this sync window.
|
|
3163
3172
|
*/
|
|
3164
3173
|
committedNotes(): NoteId[];
|
|
3165
3174
|
/**
|
|
3166
|
-
* Returns
|
|
3175
|
+
* Returns IDs of notes that were consumed.
|
|
3176
|
+
*/
|
|
3177
|
+
consumedNotes(): NoteId[];
|
|
3178
|
+
/**
|
|
3179
|
+
* Returns accounts that were updated.
|
|
3167
3180
|
*/
|
|
3168
3181
|
updatedAccounts(): AccountId[];
|
|
3169
3182
|
/**
|
|
3170
3183
|
* Returns transactions that were committed.
|
|
3171
3184
|
*/
|
|
3172
3185
|
committedTransactions(): TransactionId[];
|
|
3173
|
-
/**
|
|
3174
|
-
* Returns the block height the summary is based on.
|
|
3175
|
-
*/
|
|
3176
|
-
blockNum(): number;
|
|
3177
3186
|
/**
|
|
3178
3187
|
* Serializes the sync summary into bytes.
|
|
3179
3188
|
*/
|
|
3180
3189
|
serialize(): Uint8Array;
|
|
3190
|
+
/**
|
|
3191
|
+
* Deserializes a sync summary from bytes.
|
|
3192
|
+
*/
|
|
3193
|
+
static deserialize(bytes: Uint8Array): SyncSummary;
|
|
3181
3194
|
}
|
|
3182
3195
|
export class TestUtils {
|
|
3183
3196
|
private constructor();
|
|
@@ -3220,17 +3233,17 @@ export class TransactionArgs {
|
|
|
3220
3233
|
free(): void;
|
|
3221
3234
|
[Symbol.dispose](): void;
|
|
3222
3235
|
/**
|
|
3223
|
-
* Returns
|
|
3236
|
+
* Returns the transaction script if provided.
|
|
3224
3237
|
*/
|
|
3225
|
-
|
|
3238
|
+
txScript(): TransactionScript | undefined;
|
|
3226
3239
|
/**
|
|
3227
3240
|
* Returns note-specific arguments for the given note ID.
|
|
3228
3241
|
*/
|
|
3229
3242
|
getNoteArgs(note_id: NoteId): Word | undefined;
|
|
3230
3243
|
/**
|
|
3231
|
-
* Returns
|
|
3244
|
+
* Returns advice inputs attached to the transaction.
|
|
3232
3245
|
*/
|
|
3233
|
-
|
|
3246
|
+
adviceInputs(): AdviceInputs;
|
|
3234
3247
|
}
|
|
3235
3248
|
/**
|
|
3236
3249
|
* Filter used when querying stored transactions.
|
|
@@ -3239,14 +3252,6 @@ export class TransactionFilter {
|
|
|
3239
3252
|
private constructor();
|
|
3240
3253
|
free(): void;
|
|
3241
3254
|
[Symbol.dispose](): void;
|
|
3242
|
-
/**
|
|
3243
|
-
* Matches transactions that are not yet committed.
|
|
3244
|
-
*/
|
|
3245
|
-
static uncommitted(): TransactionFilter;
|
|
3246
|
-
/**
|
|
3247
|
-
* Matches transactions that expired before the given block number.
|
|
3248
|
-
*/
|
|
3249
|
-
static expiredBefore(block_num: number): TransactionFilter;
|
|
3250
3255
|
/**
|
|
3251
3256
|
* Matches all transactions.
|
|
3252
3257
|
*/
|
|
@@ -3255,6 +3260,14 @@ export class TransactionFilter {
|
|
|
3255
3260
|
* Matches specific transaction IDs.
|
|
3256
3261
|
*/
|
|
3257
3262
|
static ids(ids: TransactionId[]): TransactionFilter;
|
|
3263
|
+
/**
|
|
3264
|
+
* Matches transactions that are not yet committed.
|
|
3265
|
+
*/
|
|
3266
|
+
static uncommitted(): TransactionFilter;
|
|
3267
|
+
/**
|
|
3268
|
+
* Matches transactions that expired before the given block number.
|
|
3269
|
+
*/
|
|
3270
|
+
static expiredBefore(block_num: number): TransactionFilter;
|
|
3258
3271
|
}
|
|
3259
3272
|
/**
|
|
3260
3273
|
* A unique identifier of a transaction.
|
|
@@ -3275,17 +3288,17 @@ export class TransactionId {
|
|
|
3275
3288
|
*/
|
|
3276
3289
|
asElements(): Felt[];
|
|
3277
3290
|
/**
|
|
3278
|
-
* Returns the
|
|
3291
|
+
* Returns the transaction ID as raw bytes.
|
|
3279
3292
|
*/
|
|
3280
|
-
|
|
3293
|
+
asBytes(): Uint8Array;
|
|
3281
3294
|
/**
|
|
3282
3295
|
* Returns the hexadecimal encoding of the transaction ID.
|
|
3283
3296
|
*/
|
|
3284
3297
|
toHex(): string;
|
|
3285
3298
|
/**
|
|
3286
|
-
* Returns the
|
|
3299
|
+
* Returns the underlying word representation.
|
|
3287
3300
|
*/
|
|
3288
|
-
|
|
3301
|
+
inner(): Word;
|
|
3289
3302
|
}
|
|
3290
3303
|
/**
|
|
3291
3304
|
* Wrapper over local or remote transaction proving backends.
|
|
@@ -3294,15 +3307,6 @@ export class TransactionProver {
|
|
|
3294
3307
|
private constructor();
|
|
3295
3308
|
free(): void;
|
|
3296
3309
|
[Symbol.dispose](): void;
|
|
3297
|
-
/**
|
|
3298
|
-
* Reconstructs a prover from its serialized descriptor.
|
|
3299
|
-
*
|
|
3300
|
-
* Parses the format produced by `serialize()`:
|
|
3301
|
-
* - `"local"` for local prover
|
|
3302
|
-
* - `"remote|{endpoint}"` for remote prover without timeout
|
|
3303
|
-
* - `"remote|{endpoint}|{timeout_ms}"` for remote prover with timeout
|
|
3304
|
-
*/
|
|
3305
|
-
static deserialize(payload: string): TransactionProver;
|
|
3306
3310
|
/**
|
|
3307
3311
|
* Creates a prover that uses the local proving backend.
|
|
3308
3312
|
*/
|
|
@@ -3315,10 +3319,6 @@ export class TransactionProver {
|
|
|
3315
3319
|
* - `timeout_ms`: The timeout in milliseconds for the remote prover.
|
|
3316
3320
|
*/
|
|
3317
3321
|
static newRemoteProver(endpoint: string, timeout_ms?: bigint | null): TransactionProver;
|
|
3318
|
-
/**
|
|
3319
|
-
* Returns the endpoint if this is a remote prover.
|
|
3320
|
-
*/
|
|
3321
|
-
endpoint(): string | undefined;
|
|
3322
3322
|
/**
|
|
3323
3323
|
* Serializes the prover configuration into a string descriptor.
|
|
3324
3324
|
*
|
|
@@ -3330,6 +3330,19 @@ export class TransactionProver {
|
|
|
3330
3330
|
* Uses `|` as delimiter since it's not a valid URL character.
|
|
3331
3331
|
*/
|
|
3332
3332
|
serialize(): string;
|
|
3333
|
+
/**
|
|
3334
|
+
* Reconstructs a prover from its serialized descriptor.
|
|
3335
|
+
*
|
|
3336
|
+
* Parses the format produced by `serialize()`:
|
|
3337
|
+
* - `"local"` for local prover
|
|
3338
|
+
* - `"remote|{endpoint}"` for remote prover without timeout
|
|
3339
|
+
* - `"remote|{endpoint}|{timeout_ms}"` for remote prover with timeout
|
|
3340
|
+
*/
|
|
3341
|
+
static deserialize(payload: string): TransactionProver;
|
|
3342
|
+
/**
|
|
3343
|
+
* Returns the endpoint if this is a remote prover.
|
|
3344
|
+
*/
|
|
3345
|
+
endpoint(): string | undefined;
|
|
3333
3346
|
}
|
|
3334
3347
|
/**
|
|
3335
3348
|
* Describes a transaction that has been executed and is being tracked on the Client.
|
|
@@ -3338,50 +3351,50 @@ export class TransactionRecord {
|
|
|
3338
3351
|
private constructor();
|
|
3339
3352
|
free(): void;
|
|
3340
3353
|
[Symbol.dispose](): void;
|
|
3354
|
+
/**
|
|
3355
|
+
* Returns the transaction ID.
|
|
3356
|
+
*/
|
|
3357
|
+
id(): TransactionId;
|
|
3341
3358
|
/**
|
|
3342
3359
|
* Returns the account this transaction was executed against.
|
|
3343
3360
|
*/
|
|
3344
3361
|
accountId(): AccountId;
|
|
3345
3362
|
/**
|
|
3346
|
-
* Returns the
|
|
3363
|
+
* Returns the initial account state commitment before execution.
|
|
3347
3364
|
*/
|
|
3348
|
-
|
|
3365
|
+
initAccountState(): Word;
|
|
3349
3366
|
/**
|
|
3350
|
-
* Returns the
|
|
3367
|
+
* Returns the final account state commitment after execution.
|
|
3351
3368
|
*/
|
|
3352
|
-
|
|
3369
|
+
finalAccountState(): Word;
|
|
3353
3370
|
/**
|
|
3354
|
-
* Returns the
|
|
3371
|
+
* Returns the nullifiers of the consumed input notes.
|
|
3355
3372
|
*/
|
|
3356
|
-
|
|
3373
|
+
inputNoteNullifiers(): Word[];
|
|
3357
3374
|
/**
|
|
3358
|
-
* Returns the
|
|
3375
|
+
* Returns the output notes created by this transaction.
|
|
3359
3376
|
*/
|
|
3360
|
-
|
|
3377
|
+
outputNotes(): OutputNotes;
|
|
3361
3378
|
/**
|
|
3362
|
-
* Returns the
|
|
3379
|
+
* Returns the block height in which the transaction was included.
|
|
3363
3380
|
*/
|
|
3364
|
-
|
|
3381
|
+
blockNum(): number;
|
|
3365
3382
|
/**
|
|
3366
|
-
* Returns the
|
|
3383
|
+
* Returns the block height at which the transaction was submitted.
|
|
3367
3384
|
*/
|
|
3368
|
-
|
|
3385
|
+
submissionHeight(): number;
|
|
3369
3386
|
/**
|
|
3370
3387
|
* Returns the expiration block height for the transaction.
|
|
3371
3388
|
*/
|
|
3372
3389
|
expirationBlockNum(): number;
|
|
3373
3390
|
/**
|
|
3374
|
-
* Returns the
|
|
3375
|
-
*/
|
|
3376
|
-
inputNoteNullifiers(): Word[];
|
|
3377
|
-
/**
|
|
3378
|
-
* Returns the transaction ID.
|
|
3391
|
+
* Returns the current status of the transaction.
|
|
3379
3392
|
*/
|
|
3380
|
-
|
|
3393
|
+
transactionStatus(): TransactionStatus;
|
|
3381
3394
|
/**
|
|
3382
|
-
* Returns the
|
|
3395
|
+
* Returns the timestamp when the record was created.
|
|
3383
3396
|
*/
|
|
3384
|
-
|
|
3397
|
+
creationTimestamp(): bigint;
|
|
3385
3398
|
}
|
|
3386
3399
|
/**
|
|
3387
3400
|
* Specifies a transaction request that can be executed by an account.
|
|
@@ -3395,29 +3408,29 @@ export class TransactionRequest {
|
|
|
3395
3408
|
free(): void;
|
|
3396
3409
|
[Symbol.dispose](): void;
|
|
3397
3410
|
/**
|
|
3398
|
-
*
|
|
3411
|
+
* Serializes the transaction request into bytes.
|
|
3399
3412
|
*/
|
|
3400
|
-
|
|
3413
|
+
serialize(): Uint8Array;
|
|
3401
3414
|
/**
|
|
3402
3415
|
* Deserializes a transaction request from bytes.
|
|
3403
3416
|
*/
|
|
3404
3417
|
static deserialize(bytes: Uint8Array): TransactionRequest;
|
|
3418
|
+
/**
|
|
3419
|
+
* Returns output notes created by the sender account.
|
|
3420
|
+
*/
|
|
3421
|
+
expectedOutputOwnNotes(): Note[];
|
|
3405
3422
|
/**
|
|
3406
3423
|
* Returns notes expected to be created in subsequent executions.
|
|
3407
3424
|
*/
|
|
3408
3425
|
expectedFutureNotes(): NoteDetailsAndTag[];
|
|
3409
3426
|
/**
|
|
3410
|
-
* Returns
|
|
3427
|
+
* Returns the transaction script argument if present.
|
|
3411
3428
|
*/
|
|
3412
|
-
|
|
3429
|
+
scriptArg(): Word | undefined;
|
|
3413
3430
|
/**
|
|
3414
3431
|
* Returns the authentication argument if present.
|
|
3415
3432
|
*/
|
|
3416
3433
|
authArg(): Word | undefined;
|
|
3417
|
-
/**
|
|
3418
|
-
* Serializes the transaction request into bytes.
|
|
3419
|
-
*/
|
|
3420
|
-
serialize(): Uint8Array;
|
|
3421
3434
|
}
|
|
3422
3435
|
/**
|
|
3423
3436
|
* A builder for a `TransactionRequest`.
|
|
@@ -3429,45 +3442,45 @@ export class TransactionRequestBuilder {
|
|
|
3429
3442
|
free(): void;
|
|
3430
3443
|
[Symbol.dispose](): void;
|
|
3431
3444
|
/**
|
|
3432
|
-
*
|
|
3433
|
-
*/
|
|
3434
|
-
withAuthArg(auth_arg: Word): TransactionRequestBuilder;
|
|
3435
|
-
/**
|
|
3436
|
-
* Adds a transaction script argument.
|
|
3445
|
+
* Creates a new empty transaction request builder.
|
|
3437
3446
|
*/
|
|
3438
|
-
|
|
3447
|
+
constructor();
|
|
3439
3448
|
/**
|
|
3440
3449
|
* Adds input notes with optional arguments.
|
|
3441
3450
|
*/
|
|
3442
3451
|
withInputNotes(notes: NoteAndArgsArray): TransactionRequestBuilder;
|
|
3443
3452
|
/**
|
|
3444
|
-
*
|
|
3453
|
+
* Adds notes created by the sender that should be emitted by the transaction.
|
|
3445
3454
|
*/
|
|
3446
|
-
|
|
3455
|
+
withOwnOutputNotes(notes: OutputNoteArray): TransactionRequestBuilder;
|
|
3447
3456
|
/**
|
|
3448
3457
|
* Attaches a custom transaction script.
|
|
3449
3458
|
*/
|
|
3450
3459
|
withCustomScript(script: TransactionScript): TransactionRequestBuilder;
|
|
3451
3460
|
/**
|
|
3452
|
-
*
|
|
3453
|
-
*/
|
|
3454
|
-
withForeignAccounts(foreign_accounts: ForeignAccountArray): TransactionRequestBuilder;
|
|
3455
|
-
/**
|
|
3456
|
-
* Adds notes created by the sender that should be emitted by the transaction.
|
|
3461
|
+
* Declares expected output recipients (used for verification).
|
|
3457
3462
|
*/
|
|
3458
|
-
|
|
3463
|
+
withExpectedOutputRecipients(recipients: NoteRecipientArray): TransactionRequestBuilder;
|
|
3459
3464
|
/**
|
|
3460
3465
|
* Declares notes expected to be created in follow-up executions.
|
|
3461
3466
|
*/
|
|
3462
3467
|
withExpectedFutureNotes(note_details_and_tag: NoteDetailsAndTagArray): TransactionRequestBuilder;
|
|
3463
3468
|
/**
|
|
3464
|
-
*
|
|
3469
|
+
* Merges an advice map to be available during script execution.
|
|
3465
3470
|
*/
|
|
3466
|
-
|
|
3471
|
+
extendAdviceMap(advice_map: AdviceMap): TransactionRequestBuilder;
|
|
3467
3472
|
/**
|
|
3468
|
-
*
|
|
3473
|
+
* Registers foreign accounts referenced by the transaction.
|
|
3469
3474
|
*/
|
|
3470
|
-
|
|
3475
|
+
withForeignAccounts(foreign_accounts: ForeignAccountArray): TransactionRequestBuilder;
|
|
3476
|
+
/**
|
|
3477
|
+
* Adds a transaction script argument.
|
|
3478
|
+
*/
|
|
3479
|
+
withScriptArg(script_arg: Word): TransactionRequestBuilder;
|
|
3480
|
+
/**
|
|
3481
|
+
* Adds an authentication argument.
|
|
3482
|
+
*/
|
|
3483
|
+
withAuthArg(auth_arg: Word): TransactionRequestBuilder;
|
|
3471
3484
|
/**
|
|
3472
3485
|
* Finalizes the builder into a `TransactionRequest`.
|
|
3473
3486
|
*/
|
|
@@ -3484,25 +3497,25 @@ export class TransactionResult {
|
|
|
3484
3497
|
free(): void;
|
|
3485
3498
|
[Symbol.dispose](): void;
|
|
3486
3499
|
/**
|
|
3487
|
-
*
|
|
3488
|
-
*/
|
|
3489
|
-
static deserialize(bytes: Uint8Array): TransactionResult;
|
|
3490
|
-
/**
|
|
3491
|
-
* Returns notes that are expected to be created as a result of follow-up executions.
|
|
3500
|
+
* Returns the ID of the transaction.
|
|
3492
3501
|
*/
|
|
3493
|
-
|
|
3502
|
+
id(): TransactionId;
|
|
3494
3503
|
/**
|
|
3495
3504
|
* Returns the executed transaction.
|
|
3496
3505
|
*/
|
|
3497
3506
|
executedTransaction(): ExecutedTransaction;
|
|
3498
3507
|
/**
|
|
3499
|
-
* Returns
|
|
3508
|
+
* Returns notes that are expected to be created as a result of follow-up executions.
|
|
3500
3509
|
*/
|
|
3501
|
-
|
|
3510
|
+
futureNotes(): NoteDetailsAndTag[];
|
|
3502
3511
|
/**
|
|
3503
3512
|
* Serializes the transaction result into bytes.
|
|
3504
3513
|
*/
|
|
3505
3514
|
serialize(): Uint8Array;
|
|
3515
|
+
/**
|
|
3516
|
+
* Deserializes a transaction result from bytes.
|
|
3517
|
+
*/
|
|
3518
|
+
static deserialize(bytes: Uint8Array): TransactionResult;
|
|
3506
3519
|
}
|
|
3507
3520
|
/**
|
|
3508
3521
|
* A transaction script is a program that is executed in a transaction after all input notes have
|
|
@@ -3517,15 +3530,15 @@ export class TransactionScript {
|
|
|
3517
3530
|
private constructor();
|
|
3518
3531
|
free(): void;
|
|
3519
3532
|
[Symbol.dispose](): void;
|
|
3533
|
+
/**
|
|
3534
|
+
* Returns the MAST root commitment of the transaction script.
|
|
3535
|
+
*/
|
|
3536
|
+
root(): Word;
|
|
3520
3537
|
/**
|
|
3521
3538
|
* Creates a `NoteScript` from the given `Package`.
|
|
3522
3539
|
* Throws if the package is invalid.
|
|
3523
3540
|
*/
|
|
3524
3541
|
static fromPackage(_package: Package): TransactionScript;
|
|
3525
|
-
/**
|
|
3526
|
-
* Returns the MAST root commitment of the transaction script.
|
|
3527
|
-
*/
|
|
3528
|
-
root(): Word;
|
|
3529
3542
|
}
|
|
3530
3543
|
/**
|
|
3531
3544
|
* A script argument represented as a word plus additional felts.
|
|
@@ -3557,12 +3570,12 @@ export class TransactionScriptInputPairArray {
|
|
|
3557
3570
|
toString(): string;
|
|
3558
3571
|
free(): void;
|
|
3559
3572
|
[Symbol.dispose](): void;
|
|
3560
|
-
|
|
3573
|
+
constructor(elements?: TransactionScriptInputPair[] | null);
|
|
3561
3574
|
/**
|
|
3562
3575
|
* Get element at index, will always return a clone to avoid aliasing issues.
|
|
3563
3576
|
*/
|
|
3564
3577
|
get(index: number): TransactionScriptInputPair;
|
|
3565
|
-
|
|
3578
|
+
replaceAt(index: number, elem: TransactionScriptInputPair): void;
|
|
3566
3579
|
push(element: TransactionScriptInputPair): void;
|
|
3567
3580
|
length(): number;
|
|
3568
3581
|
}
|
|
@@ -3573,6 +3586,18 @@ export class TransactionStatus {
|
|
|
3573
3586
|
private constructor();
|
|
3574
3587
|
free(): void;
|
|
3575
3588
|
[Symbol.dispose](): void;
|
|
3589
|
+
/**
|
|
3590
|
+
* Creates a pending transaction status.
|
|
3591
|
+
*/
|
|
3592
|
+
static pending(): TransactionStatus;
|
|
3593
|
+
/**
|
|
3594
|
+
* Creates a committed status with block number and timestamp.
|
|
3595
|
+
*/
|
|
3596
|
+
static committed(block_num: number, commit_timestamp: bigint): TransactionStatus;
|
|
3597
|
+
/**
|
|
3598
|
+
* Creates a discarded status from a discard cause string.
|
|
3599
|
+
*/
|
|
3600
|
+
static discarded(cause: string): TransactionStatus;
|
|
3576
3601
|
/**
|
|
3577
3602
|
* Returns true if the transaction is still pending.
|
|
3578
3603
|
*/
|
|
@@ -3593,18 +3618,6 @@ export class TransactionStatus {
|
|
|
3593
3618
|
* Returns the commit timestamp if the transaction was committed.
|
|
3594
3619
|
*/
|
|
3595
3620
|
getCommitTimestamp(): bigint | undefined;
|
|
3596
|
-
/**
|
|
3597
|
-
* Creates a pending transaction status.
|
|
3598
|
-
*/
|
|
3599
|
-
static pending(): TransactionStatus;
|
|
3600
|
-
/**
|
|
3601
|
-
* Creates a committed status with block number and timestamp.
|
|
3602
|
-
*/
|
|
3603
|
-
static committed(block_num: number, commit_timestamp: bigint): TransactionStatus;
|
|
3604
|
-
/**
|
|
3605
|
-
* Creates a discarded status from a discard cause string.
|
|
3606
|
-
*/
|
|
3607
|
-
static discarded(cause: string): TransactionStatus;
|
|
3608
3621
|
}
|
|
3609
3622
|
/**
|
|
3610
3623
|
* Represents the changes that need to be applied to the client store as a result of a transaction
|
|
@@ -3615,33 +3628,33 @@ export class TransactionStoreUpdate {
|
|
|
3615
3628
|
free(): void;
|
|
3616
3629
|
[Symbol.dispose](): void;
|
|
3617
3630
|
/**
|
|
3618
|
-
*
|
|
3619
|
-
*/
|
|
3620
|
-
static deserialize(bytes: Uint8Array): TransactionStoreUpdate;
|
|
3621
|
-
/**
|
|
3622
|
-
* Returns notes expected to be created in follow-up executions.
|
|
3631
|
+
* Returns the executed transaction associated with this update.
|
|
3623
3632
|
*/
|
|
3624
|
-
|
|
3633
|
+
executedTransaction(): ExecutedTransaction;
|
|
3625
3634
|
/**
|
|
3626
|
-
* Returns the
|
|
3635
|
+
* Returns the block height at which the transaction was submitted.
|
|
3627
3636
|
*/
|
|
3628
|
-
|
|
3637
|
+
submissionHeight(): number;
|
|
3629
3638
|
/**
|
|
3630
3639
|
* Returns the notes created by the transaction.
|
|
3631
3640
|
*/
|
|
3632
3641
|
createdNotes(): OutputNotes;
|
|
3633
3642
|
/**
|
|
3634
|
-
* Returns the
|
|
3643
|
+
* Returns the account delta applied by the transaction.
|
|
3635
3644
|
*/
|
|
3636
|
-
|
|
3645
|
+
accountDelta(): AccountDelta;
|
|
3637
3646
|
/**
|
|
3638
|
-
* Returns
|
|
3647
|
+
* Returns notes expected to be created in follow-up executions.
|
|
3639
3648
|
*/
|
|
3640
|
-
|
|
3649
|
+
futureNotes(): NoteDetailsAndTag[];
|
|
3641
3650
|
/**
|
|
3642
3651
|
* Serializes the update into bytes.
|
|
3643
3652
|
*/
|
|
3644
3653
|
serialize(): Uint8Array;
|
|
3654
|
+
/**
|
|
3655
|
+
* Deserializes an update from bytes.
|
|
3656
|
+
*/
|
|
3657
|
+
static deserialize(bytes: Uint8Array): TransactionStoreUpdate;
|
|
3645
3658
|
}
|
|
3646
3659
|
/**
|
|
3647
3660
|
* Represents a transaction summary.
|
|
@@ -3650,10 +3663,18 @@ export class TransactionSummary {
|
|
|
3650
3663
|
private constructor();
|
|
3651
3664
|
free(): void;
|
|
3652
3665
|
[Symbol.dispose](): void;
|
|
3666
|
+
/**
|
|
3667
|
+
* Serializes the summary into bytes.
|
|
3668
|
+
*/
|
|
3669
|
+
serialize(): Uint8Array;
|
|
3653
3670
|
/**
|
|
3654
3671
|
* Deserializes a summary from bytes.
|
|
3655
3672
|
*/
|
|
3656
3673
|
static deserialize(bytes: Uint8Array): TransactionSummary;
|
|
3674
|
+
/**
|
|
3675
|
+
* Returns the account delta described by the summary.
|
|
3676
|
+
*/
|
|
3677
|
+
accountDelta(): AccountDelta;
|
|
3657
3678
|
/**
|
|
3658
3679
|
* Returns the input notes referenced by the summary.
|
|
3659
3680
|
*/
|
|
@@ -3662,77 +3683,68 @@ export class TransactionSummary {
|
|
|
3662
3683
|
* Returns the output notes referenced by the summary.
|
|
3663
3684
|
*/
|
|
3664
3685
|
outputNotes(): OutputNotes;
|
|
3665
|
-
/**
|
|
3666
|
-
* Returns the account delta described by the summary.
|
|
3667
|
-
*/
|
|
3668
|
-
accountDelta(): AccountDelta;
|
|
3669
|
-
/**
|
|
3670
|
-
* Computes the commitment to this `TransactionSummary`.
|
|
3671
|
-
*/
|
|
3672
|
-
toCommitment(): Word;
|
|
3673
3686
|
/**
|
|
3674
3687
|
* Returns the random salt mixed into the summary commitment.
|
|
3675
3688
|
*/
|
|
3676
3689
|
salt(): Word;
|
|
3677
3690
|
/**
|
|
3678
|
-
*
|
|
3691
|
+
* Computes the commitment to this `TransactionSummary`.
|
|
3679
3692
|
*/
|
|
3680
|
-
|
|
3693
|
+
toCommitment(): Word;
|
|
3681
3694
|
}
|
|
3682
3695
|
export class WebClient {
|
|
3683
3696
|
free(): void;
|
|
3684
3697
|
[Symbol.dispose](): void;
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
newAccount(account: Account, overwrite: boolean): Promise<void>;
|
|
3688
|
-
addAccountSecretKeyToWebStore(account_id: AccountId, secret_key: AuthSecretKey): Promise<void>;
|
|
3689
|
-
getTransactions(transaction_filter: TransactionFilter): Promise<TransactionRecord[]>;
|
|
3698
|
+
getAccounts(): Promise<AccountHeader[]>;
|
|
3699
|
+
getAccount(account_id: AccountId): Promise<Account | undefined>;
|
|
3690
3700
|
/**
|
|
3691
|
-
*
|
|
3701
|
+
* Retrieves an authentication secret key from the keystore given a public key commitment.
|
|
3702
|
+
*
|
|
3703
|
+
* The public key commitment should correspond to one of the keys tracked by the keystore.
|
|
3704
|
+
* Returns the associated [`AuthSecretKey`] if found, or an error if not found.
|
|
3692
3705
|
*/
|
|
3693
|
-
|
|
3706
|
+
getAccountAuthByPubKeyCommitment(pub_key_commitment: Word): Promise<AuthSecretKey>;
|
|
3694
3707
|
/**
|
|
3695
|
-
*
|
|
3708
|
+
* Returns all public key commitments associated with the given account ID.
|
|
3696
3709
|
*
|
|
3697
|
-
*
|
|
3710
|
+
* These commitments can be used with [`getAccountAuthByPubKeyCommitment`]
|
|
3711
|
+
* to retrieve the corresponding secret keys from the keystore.
|
|
3698
3712
|
*/
|
|
3699
|
-
|
|
3713
|
+
getPublicKeyCommitmentsOfAccount(account_id: AccountId): Promise<Word[]>;
|
|
3714
|
+
insertAccountAddress(account_id: AccountId, address: Address): Promise<void>;
|
|
3715
|
+
removeAccountAddress(account_id: AccountId, address: Address): Promise<void>;
|
|
3716
|
+
exportNoteFile(note_id: string, export_type: string): Promise<NoteFile>;
|
|
3700
3717
|
/**
|
|
3701
|
-
*
|
|
3718
|
+
* Retrieves the entire underlying web store and returns it as a `JsValue`
|
|
3702
3719
|
*
|
|
3703
|
-
*
|
|
3704
|
-
* Prefer using [`WebClient::fetch_private_notes`] for a more efficient, on-going,
|
|
3705
|
-
* fetching mechanism.
|
|
3720
|
+
* Meant to be used in conjunction with the `force_import_store` method
|
|
3706
3721
|
*/
|
|
3707
|
-
|
|
3708
|
-
|
|
3722
|
+
exportStore(): Promise<any>;
|
|
3723
|
+
exportAccountFile(account_id: AccountId): Promise<AccountFile>;
|
|
3724
|
+
importAccountFile(account_file: AccountFile): Promise<any>;
|
|
3725
|
+
importPublicAccountFromSeed(init_seed: Uint8Array, mutable: boolean, auth_scheme: AuthScheme): Promise<Account>;
|
|
3726
|
+
importAccountById(account_id: AccountId): Promise<any>;
|
|
3727
|
+
importNoteFile(note_file: NoteFile): Promise<NoteId>;
|
|
3728
|
+
forceImportStore(store_dump: any, _store_name: string): Promise<any>;
|
|
3709
3729
|
/**
|
|
3710
|
-
*
|
|
3711
|
-
*
|
|
3730
|
+
* Creates a new client with a mock RPC API. Useful for testing purposes and proof-of-concept
|
|
3731
|
+
* applications as it uses a mock chain that simulates the behavior of a real node.
|
|
3712
3732
|
*/
|
|
3713
|
-
|
|
3733
|
+
createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise<any>;
|
|
3714
3734
|
/**
|
|
3715
|
-
*
|
|
3716
|
-
*
|
|
3717
|
-
* If the transaction is unauthorized (auth script emits the unauthorized event),
|
|
3718
|
-
* returns the summary from the error. If the transaction succeeds, constructs
|
|
3719
|
-
* a summary from the executed transaction using the `auth_arg` from the transaction
|
|
3720
|
-
* request as the salt (or a zero salt if not provided).
|
|
3721
|
-
*
|
|
3722
|
-
* # Errors
|
|
3723
|
-
* - If there is an internal failure during execution.
|
|
3735
|
+
* Returns the inner serialized mock chain if it exists.
|
|
3724
3736
|
*/
|
|
3725
|
-
|
|
3737
|
+
serializeMockChain(): Uint8Array;
|
|
3726
3738
|
/**
|
|
3727
|
-
*
|
|
3728
|
-
* submit it to the network nor update the local database. The returned [`TransactionResult`]
|
|
3729
|
-
* retains the execution artifacts needed to continue with the transaction lifecycle.
|
|
3730
|
-
*
|
|
3731
|
-
* If the transaction utilizes foreign account data, there is a chance that the client doesn't
|
|
3732
|
-
* have the required block header in the local database. In these scenarios, a sync to
|
|
3733
|
-
* the chain tip is performed, and the required block header is retrieved.
|
|
3739
|
+
* Returns the inner serialized mock note transport node if it exists.
|
|
3734
3740
|
*/
|
|
3735
|
-
|
|
3741
|
+
serializeMockNoteTransportNode(): Uint8Array;
|
|
3742
|
+
proveBlock(): void;
|
|
3743
|
+
usesMockChain(): boolean;
|
|
3744
|
+
newWallet(storage_mode: AccountStorageMode, mutable: boolean, auth_scheme: AuthScheme, init_seed?: Uint8Array | null): Promise<Account>;
|
|
3745
|
+
newFaucet(storage_mode: AccountStorageMode, non_fungible: boolean, token_symbol: string, decimals: number, max_supply: bigint, auth_scheme: AuthScheme): Promise<Account>;
|
|
3746
|
+
newAccount(account: Account, overwrite: boolean): Promise<void>;
|
|
3747
|
+
addAccountSecretKeyToWebStore(account_id: AccountId, secret_key: AuthSecretKey): Promise<void>;
|
|
3736
3748
|
/**
|
|
3737
3749
|
* Executes a transaction specified by the request against the specified account,
|
|
3738
3750
|
* proves it, submits it to the network, and updates the local database.
|
|
@@ -3744,11 +3756,6 @@ export class WebClient {
|
|
|
3744
3756
|
* the chain tip is performed, and the required block header is retrieved.
|
|
3745
3757
|
*/
|
|
3746
3758
|
submitNewTransaction(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionId>;
|
|
3747
|
-
submitProvenTransaction(proven_transaction: ProvenTransaction, transaction_result: TransactionResult): Promise<number>;
|
|
3748
|
-
newMintTransactionRequest(target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint): TransactionRequest;
|
|
3749
|
-
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;
|
|
3750
|
-
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;
|
|
3751
|
-
newConsumeTransactionRequest(list_of_notes: Note[]): TransactionRequest;
|
|
3752
3759
|
/**
|
|
3753
3760
|
* Executes a transaction specified by the request against the specified account, proves it
|
|
3754
3761
|
* with the user provided prover, submits it to the network, and updates the local database.
|
|
@@ -3758,72 +3765,62 @@ export class WebClient {
|
|
|
3758
3765
|
* chain tip is performed, and the required block header is retrieved.
|
|
3759
3766
|
*/
|
|
3760
3767
|
submitNewTransactionWithProver(account_id: AccountId, transaction_request: TransactionRequest, prover: TransactionProver): Promise<TransactionId>;
|
|
3761
|
-
proveBlock(): void;
|
|
3762
|
-
usesMockChain(): boolean;
|
|
3763
|
-
/**
|
|
3764
|
-
* Creates a new client with a mock RPC API. Useful for testing purposes and proof-of-concept
|
|
3765
|
-
* applications as it uses a mock chain that simulates the behavior of a real node.
|
|
3766
|
-
*/
|
|
3767
|
-
createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise<any>;
|
|
3768
3768
|
/**
|
|
3769
|
-
*
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
*
|
|
3769
|
+
* Executes a transaction specified by the request against the specified account but does not
|
|
3770
|
+
* submit it to the network nor update the local database. The returned [`TransactionResult`]
|
|
3771
|
+
* retains the execution artifacts needed to continue with the transaction lifecycle.
|
|
3772
|
+
*
|
|
3773
|
+
* If the transaction utilizes foreign account data, there is a chance that the client doesn't
|
|
3774
|
+
* have the required block header in the local database. In these scenarios, a sync to
|
|
3775
|
+
* the chain tip is performed, and the required block header is retrieved.
|
|
3774
3776
|
*/
|
|
3775
|
-
|
|
3776
|
-
static buildSwapTag(note_type: NoteType, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint): NoteTag;
|
|
3777
|
-
getSyncHeight(): Promise<number>;
|
|
3777
|
+
executeTransaction(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionResult>;
|
|
3778
3778
|
/**
|
|
3779
|
-
*
|
|
3779
|
+
* Executes a transaction and returns the `TransactionSummary`.
|
|
3780
3780
|
*
|
|
3781
|
-
*
|
|
3782
|
-
*
|
|
3781
|
+
* If the transaction is unauthorized (auth script emits the unauthorized event),
|
|
3782
|
+
* returns the summary from the error. If the transaction succeeds, constructs
|
|
3783
|
+
* a summary from the executed transaction using the `auth_arg` from the transaction
|
|
3784
|
+
* request as the salt (or a zero salt if not provided).
|
|
3783
3785
|
*
|
|
3784
|
-
*
|
|
3785
|
-
*
|
|
3786
|
+
* # Errors
|
|
3787
|
+
* - If there is an internal failure during execution.
|
|
3786
3788
|
*/
|
|
3787
|
-
|
|
3788
|
-
removeTag(tag: string): Promise<void>;
|
|
3789
|
-
addTag(tag: string): Promise<void>;
|
|
3790
|
-
listTags(): Promise<any>;
|
|
3791
|
-
getInputNote(note_id: string): Promise<InputNoteRecord | undefined>;
|
|
3792
|
-
getInputNotes(filter: NoteFilter): Promise<InputNoteRecord[]>;
|
|
3793
|
-
getOutputNote(note_id: string): Promise<OutputNoteRecord>;
|
|
3794
|
-
getOutputNotes(filter: NoteFilter): Promise<OutputNoteRecord[]>;
|
|
3795
|
-
getConsumableNotes(account_id?: AccountId | null): Promise<ConsumableNoteRecord[]>;
|
|
3789
|
+
executeForSummary(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionSummary>;
|
|
3796
3790
|
/**
|
|
3797
|
-
*
|
|
3798
|
-
*
|
|
3799
|
-
* Meant to be used in conjunction with the `force_import_store` method
|
|
3791
|
+
* Generates a transaction proof using either the provided prover or the client's default
|
|
3792
|
+
* prover if none is supplied.
|
|
3800
3793
|
*/
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
importPublicAccountFromSeed(init_seed: Uint8Array, mutable: boolean, auth_scheme: AuthScheme): Promise<Account>;
|
|
3809
|
-
getAccount(account_id: AccountId): Promise<Account | undefined>;
|
|
3810
|
-
getAccounts(): Promise<AccountHeader[]>;
|
|
3811
|
-
insertAccountAddress(account_id: AccountId, address: Address): Promise<void>;
|
|
3812
|
-
removeAccountAddress(account_id: AccountId, address: Address): Promise<void>;
|
|
3794
|
+
proveTransaction(transaction_result: TransactionResult, prover?: TransactionProver | null): Promise<ProvenTransaction>;
|
|
3795
|
+
submitProvenTransaction(proven_transaction: ProvenTransaction, transaction_result: TransactionResult): Promise<number>;
|
|
3796
|
+
applyTransaction(transaction_result: TransactionResult, submission_height: number): Promise<TransactionStoreUpdate>;
|
|
3797
|
+
newMintTransactionRequest(target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint): TransactionRequest;
|
|
3798
|
+
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;
|
|
3799
|
+
newConsumeTransactionRequest(list_of_notes: Note[]): TransactionRequest;
|
|
3800
|
+
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;
|
|
3813
3801
|
/**
|
|
3814
|
-
*
|
|
3802
|
+
* Send a private note via the note transport layer
|
|
3803
|
+
*/
|
|
3804
|
+
sendPrivateNote(note: Note, address: Address): Promise<void>;
|
|
3805
|
+
/**
|
|
3806
|
+
* Fetch private notes from the note transport layer
|
|
3815
3807
|
*
|
|
3816
|
-
*
|
|
3817
|
-
* to retrieve the corresponding secret keys from the keystore.
|
|
3808
|
+
* Uses an internal pagination mechanism to avoid fetching duplicate notes.
|
|
3818
3809
|
*/
|
|
3819
|
-
|
|
3810
|
+
fetchPrivateNotes(): Promise<void>;
|
|
3820
3811
|
/**
|
|
3821
|
-
*
|
|
3812
|
+
* Fetch all private notes from the note transport layer
|
|
3822
3813
|
*
|
|
3823
|
-
*
|
|
3824
|
-
*
|
|
3814
|
+
* Fetches all notes stored in the transport layer, with no pagination.
|
|
3815
|
+
* Prefer using [`WebClient::fetch_private_notes`] for a more efficient, on-going,
|
|
3816
|
+
* fetching mechanism.
|
|
3825
3817
|
*/
|
|
3826
|
-
|
|
3818
|
+
fetchAllPrivateNotes(): Promise<void>;
|
|
3819
|
+
getInputNotes(filter: NoteFilter): Promise<InputNoteRecord[]>;
|
|
3820
|
+
getInputNote(note_id: string): Promise<InputNoteRecord | undefined>;
|
|
3821
|
+
getOutputNotes(filter: NoteFilter): Promise<OutputNoteRecord[]>;
|
|
3822
|
+
getOutputNote(note_id: string): Promise<OutputNoteRecord>;
|
|
3823
|
+
getConsumableNotes(account_id?: AccountId | null): Promise<ConsumableNoteRecord[]>;
|
|
3827
3824
|
/**
|
|
3828
3825
|
* Retrieves the setting value for `key`, or `None` if it hasn’t been set.
|
|
3829
3826
|
*/
|
|
@@ -3841,17 +3838,22 @@ export class WebClient {
|
|
|
3841
3838
|
*/
|
|
3842
3839
|
listSettingKeys(): Promise<string[]>;
|
|
3843
3840
|
/**
|
|
3844
|
-
*
|
|
3841
|
+
* Internal implementation of `sync_state`.
|
|
3845
3842
|
*
|
|
3846
|
-
*
|
|
3847
|
-
*
|
|
3848
|
-
*
|
|
3849
|
-
*
|
|
3850
|
-
*
|
|
3851
|
-
* `MidenClientDB_{network_id}`, where `network_id` is derived from the `node_url`.
|
|
3852
|
-
* Explicitly setting this allows for creating multiple isolated clients.
|
|
3843
|
+
* This method performs the actual sync operation. Concurrent call coordination
|
|
3844
|
+
* is handled at the JavaScript layer using the Web Locks API.
|
|
3845
|
+
*
|
|
3846
|
+
* **Note:** Do not call this method directly. Use `syncState()` from JavaScript instead,
|
|
3847
|
+
* which provides proper coordination for concurrent calls.
|
|
3853
3848
|
*/
|
|
3854
|
-
|
|
3849
|
+
syncStateImpl(): Promise<SyncSummary>;
|
|
3850
|
+
getSyncHeight(): Promise<number>;
|
|
3851
|
+
static buildSwapTag(note_type: NoteType, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint): NoteTag;
|
|
3852
|
+
addTag(tag: string): Promise<void>;
|
|
3853
|
+
removeTag(tag: string): Promise<void>;
|
|
3854
|
+
listTags(): Promise<any>;
|
|
3855
|
+
getTransactions(transaction_filter: TransactionFilter): Promise<TransactionRecord[]>;
|
|
3856
|
+
constructor();
|
|
3855
3857
|
/**
|
|
3856
3858
|
* Sets the debug mode for transaction execution.
|
|
3857
3859
|
*
|
|
@@ -3862,7 +3864,18 @@ export class WebClient {
|
|
|
3862
3864
|
* Must be called before `createClient`.
|
|
3863
3865
|
*/
|
|
3864
3866
|
setDebugMode(enabled: boolean): void;
|
|
3865
|
-
|
|
3867
|
+
/**
|
|
3868
|
+
* Creates a new `WebClient` instance with the specified configuration.
|
|
3869
|
+
*
|
|
3870
|
+
* # Arguments
|
|
3871
|
+
* * `node_url`: The URL of the node RPC endpoint. If `None`, defaults to the testnet endpoint.
|
|
3872
|
+
* * `node_note_transport_url`: Optional URL of the note transport service.
|
|
3873
|
+
* * `seed`: Optional seed for account initialization.
|
|
3874
|
+
* * `store_name`: Optional name for the web store. If `None`, the store name defaults to
|
|
3875
|
+
* `MidenClientDB_{network_id}`, where `network_id` is derived from the `node_url`.
|
|
3876
|
+
* Explicitly setting this allows for creating multiple isolated clients.
|
|
3877
|
+
*/
|
|
3878
|
+
createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null): Promise<any>;
|
|
3866
3879
|
/**
|
|
3867
3880
|
* Creates a new `WebClient` instance with external keystore callbacks.
|
|
3868
3881
|
*
|
|
@@ -3878,42 +3891,42 @@ export class WebClient {
|
|
|
3878
3891
|
* * `sign_cb`: Callback to produce serialized signature bytes for the provided inputs.
|
|
3879
3892
|
*/
|
|
3880
3893
|
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): Promise<any>;
|
|
3881
|
-
|
|
3894
|
+
createCodeBuilder(): CodeBuilder;
|
|
3882
3895
|
}
|
|
3883
3896
|
export class Word {
|
|
3884
3897
|
free(): void;
|
|
3885
3898
|
[Symbol.dispose](): void;
|
|
3886
3899
|
/**
|
|
3887
|
-
*
|
|
3900
|
+
* Creates a word from four u64 values.
|
|
3888
3901
|
*/
|
|
3889
|
-
|
|
3902
|
+
constructor(u64_vec: BigUint64Array);
|
|
3890
3903
|
/**
|
|
3891
|
-
* Creates a
|
|
3904
|
+
* Creates a Word from a hex string.
|
|
3905
|
+
* Fails if the provided string is not a valid hex representation of a Word.
|
|
3892
3906
|
*/
|
|
3893
|
-
static
|
|
3907
|
+
static fromHex(hex: string): Word;
|
|
3894
3908
|
/**
|
|
3895
|
-
* Creates a word from four
|
|
3909
|
+
* Creates a word from four field elements.
|
|
3896
3910
|
*/
|
|
3897
|
-
|
|
3911
|
+
static newFromFelts(felt_vec: Felt[]): Word;
|
|
3898
3912
|
/**
|
|
3899
3913
|
* Returns the hex representation of the word.
|
|
3900
3914
|
*/
|
|
3901
3915
|
toHex(): string;
|
|
3902
3916
|
/**
|
|
3903
|
-
*
|
|
3917
|
+
* Serializes the word into bytes.
|
|
3904
3918
|
*/
|
|
3905
|
-
|
|
3919
|
+
serialize(): Uint8Array;
|
|
3906
3920
|
/**
|
|
3907
|
-
*
|
|
3908
|
-
* Fails if the provided string is not a valid hex representation of a Word.
|
|
3921
|
+
* Deserializes a word from bytes.
|
|
3909
3922
|
*/
|
|
3910
|
-
static
|
|
3923
|
+
static deserialize(bytes: Uint8Array): Word;
|
|
3911
3924
|
/**
|
|
3912
|
-
* Returns the word as an array of
|
|
3925
|
+
* Returns the word as an array of u64 values.
|
|
3913
3926
|
*/
|
|
3914
|
-
|
|
3927
|
+
toU64s(): BigUint64Array;
|
|
3915
3928
|
/**
|
|
3916
|
-
*
|
|
3929
|
+
* Returns the word as an array of field elements.
|
|
3917
3930
|
*/
|
|
3918
|
-
|
|
3931
|
+
toFelts(): Felt[];
|
|
3919
3932
|
}
|