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