@puzzlehq/aleo-wasm-web 0.6.12 → 0.6.13

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/aleo_wasm.d.ts DELETED
@@ -1,1854 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * @param {number} receiver
5
- */
6
- export function runRayonThread(receiver: number): void;
7
- /**
8
- */
9
- export function init_panic_hook(): void;
10
- /**
11
- * @param {URL} url
12
- * @param {number} num_threads
13
- * @returns {Promise<void>}
14
- */
15
- export function initThreadPool(url: URL, num_threads: number): Promise<void>;
16
- /**
17
- * Verify an execution with a single function and a single transition. Executions with multiple
18
- * transitions or functions will fail to verify. Also, this does not verify that the state root of
19
- * the execution is included in the Aleo Network ledger.
20
- *
21
- * @param {Execution} execution The function execution to verify
22
- * @param {VerifyingKey} verifying_key The verifying key for the function
23
- * @param {Program} program The program that the function execution belongs to
24
- * @param {String} function_id The name of the function that was executed
25
- * @returns {boolean} True if the execution is valid, false otherwise
26
- * @param {Execution} execution
27
- * @param {VerifyingKey} verifying_key
28
- * @param {Program} program
29
- * @param {string} function_id
30
- * @returns {boolean}
31
- */
32
- export function verifyFunctionExecution(execution: Execution, verifying_key: VerifyingKey, program: Program, function_id: string): boolean;
33
- /**
34
- * Public address of an Aleo account
35
- */
36
- export class Address {
37
- free(): void;
38
- /**
39
- * Derive an Aleo address from a private key
40
- *
41
- * @param {PrivateKey} private_key The private key to derive the address from
42
- * @returns {Address} Address corresponding to the private key
43
- * @param {PrivateKey} private_key
44
- * @returns {Address}
45
- */
46
- static from_private_key(private_key: PrivateKey): Address;
47
- /**
48
- * Derive an Aleo address from a view key
49
- *
50
- * @param {ViewKey} view_key The view key to derive the address from
51
- * @returns {Address} Address corresponding to the view key
52
- * @param {ViewKey} view_key
53
- * @returns {Address}
54
- */
55
- static from_view_key(view_key: ViewKey): Address;
56
- /**
57
- * Create an aleo address object from a string representation of an address
58
- *
59
- * @param {string} address String representation of an addressm
60
- * @returns {Address} Address
61
- * @param {string} address
62
- * @returns {Address}
63
- */
64
- static from_string(address: string): Address;
65
- /**
66
- * Get a string representation of an Aleo address object
67
- *
68
- * @param {Address} Address
69
- * @returns {string} String representation of the address
70
- * @returns {string}
71
- */
72
- to_string(): string;
73
- /**
74
- * Verify a signature for a message signed by the address
75
- *
76
- * @param {Uint8Array} Byte array representing a message signed by the address
77
- * @returns {boolean} Boolean representing whether or not the signature is valid
78
- * @param {Uint8Array} message
79
- * @param {Signature} signature
80
- * @returns {boolean}
81
- */
82
- verify(message: Uint8Array, signature: Signature): boolean;
83
- }
84
- /**
85
- */
86
- export class AuthorizationResponse {
87
- free(): void;
88
- /**
89
- */
90
- readonly authorization: string;
91
- /**
92
- */
93
- readonly fee_authorization: string;
94
- }
95
- /**
96
- * Execution of an Aleo program.
97
- */
98
- export class Execution {
99
- free(): void;
100
- /**
101
- * Returns the string representation of the execution.
102
- * @returns {string}
103
- */
104
- toString(): string;
105
- /**
106
- * Creates an execution object from a string representation of an execution.
107
- * @param {string} execution
108
- * @returns {Execution}
109
- */
110
- static fromString(execution: string): Execution;
111
- }
112
- /**
113
- * Webassembly Representation of an Aleo function execution response
114
- *
115
- * This object is returned by the execution of an Aleo function off-chain. It provides methods for
116
- * retrieving the outputs of the function execution.
117
- */
118
- export class ExecutionResponse {
119
- free(): void;
120
- /**
121
- * Get the outputs of the executed function
122
- *
123
- * @returns {Array} Array of strings representing the outputs of the function
124
- * @returns {Array<any>}
125
- */
126
- getOutputs(): Array<any>;
127
- /**
128
- * Returns the execution object if present, null if otherwise.
129
- *
130
- * @returns {Execution | undefined} The execution object if present, null if otherwise
131
- * @returns {Execution | undefined}
132
- */
133
- getExecution(): Execution | undefined;
134
- /**
135
- * Returns the program keys if present
136
- * @returns {KeyPair}
137
- */
138
- getKeys(): KeyPair;
139
- /**
140
- * Returns the proving_key if the proving key was cached in the Execution response.
141
- * Note the proving key is removed from the response object after the first call to this
142
- * function. Subsequent calls will return null.
143
- *
144
- * @returns {ProvingKey | undefined} The proving key
145
- * @returns {ProvingKey | undefined}
146
- */
147
- getProvingKey(): ProvingKey | undefined;
148
- /**
149
- * Returns the verifying_key associated with the program
150
- *
151
- * @returns {VerifyingKey} The verifying key
152
- * @returns {VerifyingKey}
153
- */
154
- getVerifyingKey(): VerifyingKey;
155
- /**
156
- * Returns the function identifier
157
- * @returns {string}
158
- */
159
- getFunctionId(): string;
160
- /**
161
- * Returns the program
162
- * @returns {Program}
163
- */
164
- getProgram(): Program;
165
- }
166
- /**
167
- */
168
- export class Field {
169
- free(): void;
170
- /**
171
- * @returns {string}
172
- */
173
- toString(): string;
174
- /**
175
- * @param {string} field
176
- * @returns {Field}
177
- */
178
- static fromString(field: string): Field;
179
- }
180
- /**
181
- */
182
- export class JsField {
183
- free(): void;
184
- /**
185
- * @param {PrivateKey} private_key
186
- * @param {Uint8Array} message
187
- * @param {Uint8Array} seed
188
- * @returns {string}
189
- */
190
- static generate_message_leo(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): string;
191
- /**
192
- * @param {PrivateKey} private_key
193
- * @param {Uint8Array} message
194
- * @param {Uint8Array} seed
195
- * @returns {string}
196
- */
197
- static generate_message_clients(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): string;
198
- }
199
- /**
200
- * Key pair object containing both the function proving and verifying keys
201
- */
202
- export class KeyPair {
203
- free(): void;
204
- /**
205
- * Create new key pair from proving and verifying keys
206
- *
207
- * @param {ProvingKey} proving_key Proving key corresponding to a function in an Aleo program
208
- * @param {VerifyingKey} verifying_key Verifying key corresponding to a function in an Aleo program
209
- * @returns {KeyPair} Key pair object containing both the function proving and verifying keys
210
- * @param {ProvingKey} proving_key
211
- * @param {VerifyingKey} verifying_key
212
- */
213
- constructor(proving_key: ProvingKey, verifying_key: VerifyingKey);
214
- /**
215
- * Get the proving key. This method will remove the proving key from the key pair
216
- *
217
- * @returns {ProvingKey | Error}
218
- * @returns {ProvingKey}
219
- */
220
- provingKey(): ProvingKey;
221
- /**
222
- * Get the verifying key. This method will remove the verifying key from the key pair
223
- *
224
- * @returns {VerifyingKey | Error}
225
- * @returns {VerifyingKey}
226
- */
227
- verifyingKey(): VerifyingKey;
228
- }
229
- /**
230
- * An offline query object used to insert the global state root and state paths needed to create
231
- * a valid inclusion proof offline.
232
- */
233
- export class OfflineQuery {
234
- free(): void;
235
- /**
236
- * Creates a new offline query object. The state root is required to be passed in as a string
237
- * @param {string} state_root
238
- */
239
- constructor(state_root: string);
240
- /**
241
- * Add a new state path to the offline query object.
242
- *
243
- * @param {string} commitment: The commitment corresponding to a record inpout
244
- * @param {string} state_path: The state path corresponding to the commitment
245
- * @param {string} commitment
246
- * @param {string} state_path
247
- */
248
- addStatePath(commitment: string, state_path: string): void;
249
- /**
250
- * Get a json string representation of the offline query object
251
- * @returns {string}
252
- */
253
- toString(): string;
254
- /**
255
- * Create an offline query object from a json string representation
256
- * @param {string} s
257
- * @returns {OfflineQuery}
258
- */
259
- static fromString(s: string): OfflineQuery;
260
- }
261
- /**
262
- * Private key of an Aleo account
263
- */
264
- export class PrivateKey {
265
- free(): void;
266
- /**
267
- * Generate a new private key using a cryptographically secure random number generator
268
- *
269
- * @returns {PrivateKey}
270
- */
271
- constructor();
272
- /**
273
- * Get a private key from a series of unchecked bytes
274
- *
275
- * @param {Uint8Array} seed Unchecked 32 byte long Uint8Array acting as the seed for the private key
276
- * @returns {PrivateKey}
277
- * @param {Uint8Array} seed
278
- * @returns {PrivateKey}
279
- */
280
- static from_seed_unchecked(seed: Uint8Array): PrivateKey;
281
- /**
282
- * Get a private key from a string representation of a private key
283
- *
284
- * @param {string} seed String representation of a private key
285
- * @returns {PrivateKey}
286
- * @param {string} private_key
287
- * @returns {PrivateKey}
288
- */
289
- static from_string(private_key: string): PrivateKey;
290
- /**
291
- * Get a string representation of the private key. This function should be used very carefully
292
- * as it exposes the private key plaintext
293
- *
294
- * @returns {string} String representation of a private key
295
- * @returns {string}
296
- */
297
- to_string(): string;
298
- /**
299
- * Get a string representation of the seed. This function should be used very carefully
300
- * as it exposes the private key seed
301
- *
302
- * @returns {string} String representation of a private key seed
303
- * @returns {string}
304
- */
305
- to_seed(): string;
306
- /**
307
- * Get the view key corresponding to the private key
308
- *
309
- * @returns {ViewKey}
310
- * @returns {ViewKey}
311
- */
312
- to_view_key(): ViewKey;
313
- /**
314
- * Get the address corresponding to the private key
315
- *
316
- * @returns {Address}
317
- * @returns {Address}
318
- */
319
- to_address(): Address;
320
- /**
321
- * Sign a message with the private key
322
- *
323
- * @param {Uint8Array} Byte array representing a message signed by the address
324
- * @returns {Signature} Signature generated by signing the message with the address
325
- * @param {Uint8Array} message
326
- * @returns {Signature}
327
- */
328
- sign(message: Uint8Array): Signature;
329
- /**
330
- * Get a new randomly generated private key ciphertext using a secret. The secret is sensitive
331
- * and will be needed to decrypt the private key later, so it should be stored securely
332
- *
333
- * @param {string} secret Secret used to encrypt the private key
334
- * @returns {PrivateKeyCiphertext | Error} Ciphertext representation of the private key
335
- * @param {string} secret
336
- * @returns {PrivateKeyCiphertext}
337
- */
338
- static newEncrypted(secret: string): PrivateKeyCiphertext;
339
- /**
340
- * Encrypt an existing private key with a secret. The secret is sensitive and will be needed to
341
- * decrypt the private key later, so it should be stored securely
342
- *
343
- * @param {string} secret Secret used to encrypt the private key
344
- * @returns {PrivateKeyCiphertext | Error} Ciphertext representation of the private key
345
- * @param {string} secret
346
- * @returns {PrivateKeyCiphertext}
347
- */
348
- toCiphertext(secret: string): PrivateKeyCiphertext;
349
- /**
350
- * Get private key from a private key ciphertext and secret originally used to encrypt it
351
- *
352
- * @param {PrivateKeyCiphertext} ciphertext Ciphertext representation of the private key
353
- * @param {string} secret Secret originally used to encrypt the private key
354
- * @returns {PrivateKey | Error} Private key
355
- * @param {PrivateKeyCiphertext} ciphertext
356
- * @param {string} secret
357
- * @returns {PrivateKey}
358
- */
359
- static fromPrivateKeyCiphertext(ciphertext: PrivateKeyCiphertext, secret: string): PrivateKey;
360
- }
361
- /**
362
- * Private Key in ciphertext form
363
- */
364
- export class PrivateKeyCiphertext {
365
- free(): void;
366
- /**
367
- * Encrypt a private key using a secret string. The secret is sensitive and will be needed to
368
- * decrypt the private key later, so it should be stored securely
369
- *
370
- * @param {PrivateKey} private_key Private key to encrypt
371
- * @param {string} secret Secret to encrypt the private key with
372
- * @returns {PrivateKeyCiphertext | Error} Private key ciphertext
373
- * @param {PrivateKey} private_key
374
- * @param {string} secret
375
- * @returns {PrivateKeyCiphertext}
376
- */
377
- static encryptPrivateKey(private_key: PrivateKey, secret: string): PrivateKeyCiphertext;
378
- /**
379
- * Decrypts a private ciphertext using a secret string. This must be the same secret used to
380
- * encrypt the private key
381
- *
382
- * @param {string} secret Secret used to encrypt the private key
383
- * @returns {PrivateKey | Error} Private key
384
- * @param {string} secret
385
- * @returns {PrivateKey}
386
- */
387
- decryptToPrivateKey(secret: string): PrivateKey;
388
- /**
389
- * Returns the ciphertext string
390
- *
391
- * @returns {string} Ciphertext string
392
- * @returns {string}
393
- */
394
- toString(): string;
395
- /**
396
- * Creates a PrivateKeyCiphertext from a string
397
- *
398
- * @param {string} ciphertext Ciphertext string
399
- * @returns {PrivateKeyCiphertext | Error} Private key ciphertext
400
- * @param {string} ciphertext
401
- * @returns {PrivateKeyCiphertext}
402
- */
403
- static fromString(ciphertext: string): PrivateKeyCiphertext;
404
- }
405
- /**
406
- * Webassembly Representation of an Aleo program
407
- */
408
- export class Program {
409
- free(): void;
410
- /**
411
- * Create a program from a program string
412
- *
413
- * @param {string} program Aleo program source code
414
- * @returns {Program | Error} Program object
415
- * @param {string} program
416
- * @returns {Program}
417
- */
418
- static fromString(program: string): Program;
419
- /**
420
- * Get a string representation of the program
421
- *
422
- * @returns {string} String containing the program source code
423
- * @returns {string}
424
- */
425
- toString(): string;
426
- /**
427
- * Determine if a function is present in the program
428
- *
429
- * @param {string} functionName Name of the function to check for
430
- * @returns {boolean} True if the program is valid, false otherwise
431
- * @param {string} function_name
432
- * @returns {boolean}
433
- */
434
- hasFunction(function_name: string): boolean;
435
- /**
436
- * Get javascript array of functions names in the program
437
- *
438
- * @returns {Array} Array of all function names present in the program
439
- *
440
- * @example
441
- * const expected_functions = [
442
- * "mint",
443
- * "transfer_private",
444
- * "transfer_private_to_public",
445
- * "transfer_public",
446
- * "transfer_public_to_private",
447
- * "join",
448
- * "split",
449
- * "fee"
450
- * ]
451
- *
452
- * const credits_program = aleo_wasm.Program.getCreditsProgram();
453
- * const credits_functions = credits_program.getFunctions();
454
- * console.log(credits_functions === expected_functions); // Output should be "true"
455
- * @returns {Array<any>}
456
- */
457
- getFunctions(): Array<any>;
458
- /**
459
- * Get a javascript object representation of the function inputs and types. This can be used
460
- * to generate a web form to capture user inputs for an execution of a function.
461
- *
462
- * @param {string} function_name Name of the function to get inputs for
463
- * @returns {Array | Error} Array of function inputs
464
- *
465
- * @example
466
- * const expected_inputs = [
467
- * {
468
- * type:"record",
469
- * visibility:"private",
470
- * record:"credits",
471
- * members:[
472
- * {
473
- * name:"microcredits",
474
- * type:"u64",
475
- * visibility:"private"
476
- * }
477
- * ],
478
- * register:"r0"
479
- * },
480
- * {
481
- * type:"address",
482
- * visibility:"private",
483
- * register:"r1"
484
- * },
485
- * {
486
- * type:"u64",
487
- * visibility:"private",
488
- * register:"r2"
489
- * }
490
- * ];
491
- *
492
- * const credits_program = aleo_wasm.Program.getCreditsProgram();
493
- * const transfer_function_inputs = credits_program.getFunctionInputs("transfer_private");
494
- * console.log(transfer_function_inputs === expected_inputs); // Output should be "true"
495
- * @param {string} function_name
496
- * @returns {Array<any>}
497
- */
498
- getFunctionInputs(function_name: string): Array<any>;
499
- /**
500
- * Get a the list of a program's mappings and the names/types of their keys and values.
501
- *
502
- * @returns {Array | Error} - An array of objects representing the mappings in the program
503
- * @example
504
- * const expected_mappings = [
505
- * {
506
- * name: "account",
507
- * key_name: "owner",
508
- * key_type: "address",
509
- * value_name: "microcredits",
510
- * value_type: "u64"
511
- * }
512
- * ]
513
- *
514
- * const credits_program = aleo_wasm.Program.getCreditsProgram();
515
- * const credits_mappings = credits_program.getMappings();
516
- * console.log(credits_mappings === expected_mappings); // Output should be "true"
517
- * @returns {Array<any>}
518
- */
519
- getMappings(): Array<any>;
520
- /**
521
- * Get a javascript object representation of a program record and its types
522
- *
523
- * @param {string} record_name Name of the record to get members for
524
- * @returns {Object | Error} Object containing the record name, type, and members
525
- *
526
- * @example
527
- *
528
- * const expected_record = {
529
- * type: "record",
530
- * record: "Credits",
531
- * members: [
532
- * {
533
- * name: "owner",
534
- * type: "address",
535
- * visibility: "private"
536
- * },
537
- * {
538
- * name: "microcredits",
539
- * type: "u64",
540
- * visibility: "private"
541
- * }
542
- * ];
543
- * };
544
- *
545
- * const credits_program = aleo_wasm.Program.getCreditsProgram();
546
- * const credits_record = credits_program.getRecordMembers("Credits");
547
- * console.log(credits_record === expected_record); // Output should be "true"
548
- * @param {string} record_name
549
- * @returns {object}
550
- */
551
- getRecordMembers(record_name: string): object;
552
- /**
553
- * Get a javascript object representation of a program struct and its types
554
- *
555
- * @param {string} struct_name Name of the struct to get members for
556
- * @returns {Array | Error} Array containing the struct members
557
- *
558
- * @example
559
- *
560
- * const STRUCT_PROGRAM = "program token_issue.aleo;
561
- *
562
- * struct token_metadata:
563
- * network as u32;
564
- * version as u32;
565
- *
566
- * struct token:
567
- * token_id as u32;
568
- * metadata as token_metadata;
569
- *
570
- * function no_op:
571
- * input r0 as u64;
572
- * output r0 as u64;"
573
- *
574
- * const expected_struct_members = [
575
- * {
576
- * name: "token_id",
577
- * type: "u32",
578
- * },
579
- * {
580
- * name: "metadata",
581
- * type: "struct",
582
- * struct_id: "token_metadata",
583
- * members: [
584
- * {
585
- * name: "network",
586
- * type: "u32",
587
- * }
588
- * {
589
- * name: "version",
590
- * type: "u32",
591
- * }
592
- * ]
593
- * }
594
- * ];
595
- *
596
- * const program = aleo_wasm.Program.fromString(STRUCT_PROGRAM);
597
- * const struct_members = program.getStructMembers("token");
598
- * console.log(struct_members === expected_struct_members); // Output should be "true"
599
- * @param {string} struct_name
600
- * @returns {Array<any>}
601
- */
602
- getStructMembers(struct_name: string): Array<any>;
603
- /**
604
- * Get the credits.aleo program
605
- *
606
- * @returns {Program} The credits.aleo program
607
- * @returns {Program}
608
- */
609
- static getCreditsProgram(): Program;
610
- /**
611
- * Get the id of the program
612
- *
613
- * @returns {string} The id of the program
614
- * @returns {string}
615
- */
616
- id(): string;
617
- /**
618
- * Get a unique address of the program
619
- *
620
- * @returns {Address} The address of the program
621
- * @returns {Address}
622
- */
623
- address(): Address;
624
- /**
625
- * Determine equality with another program
626
- *
627
- * @param {Program} other The other program to compare
628
- * @returns {boolean} True if the programs are equal, false otherwise
629
- * @param {Program} other
630
- * @returns {boolean}
631
- */
632
- isEqual(other: Program): boolean;
633
- /**
634
- * Get program_imports
635
- *
636
- * @returns {Array} The program imports
637
- *
638
- * @example
639
- *
640
- * const DOUBLE_TEST = "import multiply_test.aleo;
641
- *
642
- * program double_test.aleo;
643
- *
644
- * function double_it:
645
- * input r0 as u32.private;
646
- * call multiply_test.aleo/multiply 2u32 r0 into r1;
647
- * output r1 as u32.private;";
648
- *
649
- * const expected_imports = [
650
- * "multiply_test.aleo"
651
- * ];
652
- *
653
- * const program = aleo_wasm.Program.fromString(DOUBLE_TEST_PROGRAM);
654
- * const imports = program.getImports();
655
- * console.log(imports === expected_imports); // Output should be "true"
656
- * @returns {Array<any>}
657
- */
658
- getImports(): Array<any>;
659
- }
660
- /**
661
- */
662
- export class ProgramManager {
663
- free(): void;
664
- /**
665
- * @param {string} program
666
- * @param {string} function_id
667
- * @param {Array<any>} inputs_str
668
- * @param {string} private_key
669
- * @param {object | undefined} imports
670
- * @param {bigint} fee_microcredits
671
- * @param {string | undefined} [fee_record]
672
- * @returns {Promise<AuthorizationResponse>}
673
- */
674
- static authExecute(program: string, function_id: string, inputs_str: Array<any>, private_key: string, imports: object | undefined, fee_microcredits: bigint, fee_record?: string): Promise<AuthorizationResponse>;
675
- /**
676
- * Execute an arbitrary function locally
677
- *
678
- * @param {PrivateKey} private_key The private key of the sender
679
- * @param {string} program The source code of the program being executed
680
- * @param {string} function The name of the function to execute
681
- * @param {Array} inputs A javascript array of inputs to the function
682
- * @param {boolean} prove_execution If true, the execution will be proven and an execution object
683
- * containing the proof and the encrypted inputs and outputs needed to verify the proof offline
684
- * will be returned.
685
- * @param {boolean} cache Cache the proving and verifying keys in the Execution response.
686
- * If this is set to 'true' the keys synthesized will be stored in the Execution Response
687
- * and the `ProvingKey` and `VerifyingKey` can be retrieved from the response via the `.getKeys()`
688
- * method.
689
- * @param {Object | undefined} imports (optional) Provide a list of imports to use for the function execution in the
690
- * form of a javascript object where the keys are a string of the program name and the values
691
- * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
692
- * @param {ProvingKey | undefined} proving_key (optional) Provide a verifying key to use for the function execution
693
- * @param {VerifyingKey | undefined} verifying_key (optional) Provide a verifying key to use for the function execution
694
- * @param {PrivateKey} private_key
695
- * @param {string} program
696
- * @param {string} _function
697
- * @param {Array<any>} inputs
698
- * @param {boolean} prove_execution
699
- * @param {boolean} cache
700
- * @param {object | undefined} [imports]
701
- * @param {ProvingKey | undefined} [proving_key]
702
- * @param {VerifyingKey | undefined} [verifying_key]
703
- * @param {string | undefined} [url]
704
- * @param {OfflineQuery | undefined} [offline_query]
705
- * @returns {Promise<ExecutionResponse>}
706
- */
707
- static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object, proving_key?: ProvingKey, verifying_key?: VerifyingKey, url?: string, offline_query?: OfflineQuery): Promise<ExecutionResponse>;
708
- /**
709
- * Execute Aleo function and create an Aleo execution transaction
710
- *
711
- * @param private_key The private key of the sender
712
- * @param program The source code of the program being executed
713
- * @param function The name of the function to execute
714
- * @param inputs A javascript array of inputs to the function
715
- * @param fee_credits The amount of credits to pay as a fee
716
- * @param fee_record The record to spend the fee from
717
- * @param url The url of the Aleo network node to send the transaction to
718
- * If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
719
- * `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
720
- * and used for subsequent transactions. If this is set to 'false' the proving and verifying
721
- * keys will be deallocated from memory after the transaction is executed.
722
- * @param imports (optional) Provide a list of imports to use for the function execution in the
723
- * form of a javascript object where the keys are a string of the program name and the values
724
- * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
725
- * @param proving_key (optional) Provide a verifying key to use for the function execution
726
- * @param verifying_key (optional) Provide a verifying key to use for the function execution
727
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
728
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
729
- * @returns {Transaction | Error}
730
- * @param {PrivateKey} private_key
731
- * @param {string} program
732
- * @param {string} _function
733
- * @param {Array<any>} inputs
734
- * @param {number} fee_credits
735
- * @param {RecordPlaintext | undefined} [fee_record]
736
- * @param {string | undefined} [url]
737
- * @param {object | undefined} [imports]
738
- * @param {ProvingKey | undefined} [proving_key]
739
- * @param {VerifyingKey | undefined} [verifying_key]
740
- * @param {ProvingKey | undefined} [fee_proving_key]
741
- * @param {VerifyingKey | undefined} [fee_verifying_key]
742
- * @param {OfflineQuery | undefined} [offline_query]
743
- * @returns {Promise<Transaction>}
744
- */
745
- static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, fee_credits: number, fee_record?: RecordPlaintext, url?: string, imports?: object, proving_key?: ProvingKey, verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey, offline_query?: OfflineQuery): Promise<Transaction>;
746
- /**
747
- * Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
748
- * verifying keys will be stored in the ProgramManager's memory and used for subsequent
749
- * program executions.
750
- *
751
- * Disclaimer: Fee estimation is experimental and may not represent a correct estimate on any current or future network
752
- *
753
- * @param private_key The private key of the sender
754
- * @param program The source code of the program to estimate the execution fee for
755
- * @param function The name of the function to execute
756
- * @param inputs A javascript array of inputs to the function
757
- * @param url The url of the Aleo network node to send the transaction to
758
- * @param imports (optional) Provide a list of imports to use for the fee estimation in the
759
- * form of a javascript object where the keys are a string of the program name and the values
760
- * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
761
- * @param proving_key (optional) Provide a verifying key to use for the fee estimation
762
- * @param verifying_key (optional) Provide a verifying key to use for the fee estimation
763
- * @returns {u64 | Error} Fee in microcredits
764
- * @param {PrivateKey} private_key
765
- * @param {string} program
766
- * @param {string} _function
767
- * @param {Array<any>} inputs
768
- * @param {string | undefined} [url]
769
- * @param {object | undefined} [imports]
770
- * @param {ProvingKey | undefined} [proving_key]
771
- * @param {VerifyingKey | undefined} [verifying_key]
772
- * @param {OfflineQuery | undefined} [offline_query]
773
- * @returns {Promise<bigint>}
774
- */
775
- static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url?: string, imports?: object, proving_key?: ProvingKey, verifying_key?: VerifyingKey, offline_query?: OfflineQuery): Promise<bigint>;
776
- /**
777
- * Estimate the finalize fee component for executing a function. This fee is additional to the
778
- * size of the execution of the program in bytes. If the function does not have a finalize
779
- * step, then the finalize fee is 0.
780
- *
781
- * Disclaimer: Fee estimation is experimental and may not represent a correct estimate on any current or future network
782
- *
783
- * @param program The program containing the function to estimate the finalize fee for
784
- * @param function The function to estimate the finalize fee for
785
- * @returns {u64 | Error} Fee in microcredits
786
- * @param {string} program
787
- * @param {string} _function
788
- * @returns {bigint}
789
- */
790
- static estimateFinalizeFee(program: string, _function: string): bigint;
791
- /**
792
- * Deploy an Aleo program
793
- *
794
- * @param private_key The private key of the sender
795
- * @param program The source code of the program being deployed
796
- * @param imports A javascript object holding the source code of any imported programs in the
797
- * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
798
- * Note that all imported programs must be deployed on chain before the main program in order
799
- * for the deployment to succeed
800
- * @param fee_credits The amount of credits to pay as a fee
801
- * @param fee_record The record to spend the fee from
802
- * @param url The url of the Aleo network node to send the transaction to
803
- * @param imports (optional) Provide a list of imports to use for the program deployment in the
804
- * form of a javascript object where the keys are a string of the program name and the values
805
- * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
806
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
807
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
808
- * @returns {Transaction | Error}
809
- * @param {PrivateKey} private_key
810
- * @param {string} program
811
- * @param {number} fee_credits
812
- * @param {RecordPlaintext | undefined} [fee_record]
813
- * @param {string | undefined} [url]
814
- * @param {object | undefined} [imports]
815
- * @param {ProvingKey | undefined} [fee_proving_key]
816
- * @param {VerifyingKey | undefined} [fee_verifying_key]
817
- * @param {OfflineQuery | undefined} [offline_query]
818
- * @returns {Promise<Transaction>}
819
- */
820
- static buildDeploymentTransaction(private_key: PrivateKey, program: string, fee_credits: number, fee_record?: RecordPlaintext, url?: string, imports?: object, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey, offline_query?: OfflineQuery): Promise<Transaction>;
821
- /**
822
- * Estimate the fee for a program deployment
823
- *
824
- * Disclaimer: Fee estimation is experimental and may not represent a correct estimate on any current or future network
825
- *
826
- * @param program The source code of the program being deployed
827
- * @param imports (optional) Provide a list of imports to use for the deployment fee estimation
828
- * in the form of a javascript object where the keys are a string of the program name and the values
829
- * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
830
- * @returns {u64 | Error}
831
- * @param {string} program
832
- * @param {object | undefined} [imports]
833
- * @returns {Promise<bigint>}
834
- */
835
- static estimateDeploymentFee(program: string, imports?: object): Promise<bigint>;
836
- /**
837
- * Estimate the component of the deployment cost which comes from the fee for the program name.
838
- * Note that this cost does not represent the entire cost of deployment. It is additional to
839
- * the cost of the size (in bytes) of the deployment.
840
- *
841
- * Disclaimer: Fee estimation is experimental and may not represent a correct estimate on any current or future network
842
- *
843
- * @param name The name of the program to be deployed
844
- * @returns {u64 | Error}
845
- * @param {string} name
846
- * @returns {bigint}
847
- */
848
- static estimateProgramNameCost(name: string): bigint;
849
- /**
850
- * Split an Aleo credits record into two separate records. This function does not require a fee.
851
- *
852
- * @param private_key The private key of the sender
853
- * @param split_amount The amount of the credit split. This amount will be subtracted from the
854
- * value of the record and two new records will be created with the split amount and the remainder
855
- * @param amount_record The record to split
856
- * @param url The url of the Aleo network node to send the transaction to
857
- * @param split_proving_key (optional) Provide a proving key to use for the split function
858
- * @param split_verifying_key (optional) Provide a verifying key to use for the split function
859
- * @returns {Transaction | Error} Transaction object
860
- * @param {PrivateKey} private_key
861
- * @param {number} split_amount
862
- * @param {RecordPlaintext} amount_record
863
- * @param {string | undefined} [url]
864
- * @param {ProvingKey | undefined} [split_proving_key]
865
- * @param {VerifyingKey | undefined} [split_verifying_key]
866
- * @param {OfflineQuery | undefined} [offline_query]
867
- * @returns {Promise<Transaction>}
868
- */
869
- static buildSplitTransaction(private_key: PrivateKey, split_amount: number, amount_record: RecordPlaintext, url?: string, split_proving_key?: ProvingKey, split_verifying_key?: VerifyingKey, offline_query?: OfflineQuery): Promise<Transaction>;
870
- /**
871
- * Join two records together to create a new record with an amount of credits equal to the sum
872
- * of the credits of the two original records
873
- *
874
- * @param private_key The private key of the sender
875
- * @param record_1 The first record to combine
876
- * @param record_2 The second record to combine
877
- * @param fee_credits The amount of credits to pay as a fee
878
- * @param fee_record The record to spend the fee from
879
- * @param url The url of the Aleo network node to send the transaction to
880
- * @param join_proving_key (optional) Provide a proving key to use for the join function
881
- * @param join_verifying_key (optional) Provide a verifying key to use for the join function
882
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
883
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
884
- * @returns {Transaction | Error} Transaction object
885
- * @param {PrivateKey} private_key
886
- * @param {RecordPlaintext} record_1
887
- * @param {RecordPlaintext} record_2
888
- * @param {number} fee_credits
889
- * @param {RecordPlaintext | undefined} [fee_record]
890
- * @param {string | undefined} [url]
891
- * @param {ProvingKey | undefined} [join_proving_key]
892
- * @param {VerifyingKey | undefined} [join_verifying_key]
893
- * @param {ProvingKey | undefined} [fee_proving_key]
894
- * @param {VerifyingKey | undefined} [fee_verifying_key]
895
- * @param {OfflineQuery | undefined} [offline_query]
896
- * @returns {Promise<Transaction>}
897
- */
898
- static buildJoinTransaction(private_key: PrivateKey, record_1: RecordPlaintext, record_2: RecordPlaintext, fee_credits: number, fee_record?: RecordPlaintext, url?: string, join_proving_key?: ProvingKey, join_verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey, offline_query?: OfflineQuery): Promise<Transaction>;
899
- /**
900
- * Send credits from one Aleo account to another
901
- *
902
- * @param private_key The private key of the sender
903
- * @param amount_credits The amount of credits to send
904
- * @param recipient The recipient of the transaction
905
- * @param transfer_type The type of the transfer (options: "private", "public", "private_to_public", "public_to_private")
906
- * @param amount_record The record to fund the amount from
907
- * @param fee_credits The amount of credits to pay as a fee
908
- * @param fee_record The record to spend the fee from
909
- * @param url The url of the Aleo network node to send the transaction to
910
- * @param transfer_verifying_key (optional) Provide a verifying key to use for the transfer
911
- * function
912
- * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
913
- * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
914
- * @returns {Transaction | Error}
915
- * @param {PrivateKey} private_key
916
- * @param {number} amount_credits
917
- * @param {string} recipient
918
- * @param {string} transfer_type
919
- * @param {RecordPlaintext | undefined} amount_record
920
- * @param {number} fee_credits
921
- * @param {RecordPlaintext | undefined} [fee_record]
922
- * @param {string | undefined} [url]
923
- * @param {ProvingKey | undefined} [transfer_proving_key]
924
- * @param {VerifyingKey | undefined} [transfer_verifying_key]
925
- * @param {ProvingKey | undefined} [fee_proving_key]
926
- * @param {VerifyingKey | undefined} [fee_verifying_key]
927
- * @param {OfflineQuery | undefined} [offline_query]
928
- * @returns {Promise<Transaction>}
929
- */
930
- static buildTransferTransaction(private_key: PrivateKey, amount_credits: number, recipient: string, transfer_type: string, amount_record: RecordPlaintext | undefined, fee_credits: number, fee_record?: RecordPlaintext, url?: string, transfer_proving_key?: ProvingKey, transfer_verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey, offline_query?: OfflineQuery): Promise<Transaction>;
931
- /**
932
- * Synthesize proving and verifying keys for a program
933
- *
934
- * @param program {string} The program source code of the program to synthesize keys for
935
- * @param function_id {string} The function to synthesize keys for
936
- * @param inputs {Array} The inputs to the function
937
- * @param imports {Object | undefined} The imports for the program
938
- * @param {PrivateKey} private_key
939
- * @param {string} program
940
- * @param {string} function_id
941
- * @param {Array<any>} inputs
942
- * @param {object | undefined} [imports]
943
- * @returns {Promise<KeyPair>}
944
- */
945
- static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object): Promise<KeyPair>;
946
- }
947
- /**
948
- * Proving key for a function within an Aleo program
949
- */
950
- export class ProvingKey {
951
- free(): void;
952
- /**
953
- * Verify if the proving key is for the bond_public function
954
- *
955
- * @example
956
- * const provingKey = ProvingKey.fromBytes("bond_public_proving_key.bin");
957
- * provingKey.isBondPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
958
- *
959
- * @returns {boolean} returns true if the proving key is for the bond_public function, false if otherwise
960
- * @returns {boolean}
961
- */
962
- isBondPublicProver(): boolean;
963
- /**
964
- * Verify if the proving key is for the claim_unbond function
965
- *
966
- * @example
967
- * const provingKey = ProvingKey.fromBytes("claim_unbond_proving_key.bin");
968
- * provingKey.isClaimUnbondProver() ? console.log("Key verified") : throw new Error("Invalid key");
969
- *
970
- * @returns {boolean} returns true if the proving key is for the claim_unbond function, false if otherwise
971
- * @returns {boolean}
972
- */
973
- isClaimUnbondPublicProver(): boolean;
974
- /**
975
- * Verify if the proving key is for the fee_private function
976
- *
977
- * @example
978
- * const provingKey = ProvingKey.fromBytes("fee_private_proving_key.bin");
979
- * provingKey.isFeePrivateProver() ? console.log("Key verified") : throw new Error("Invalid key");
980
- *
981
- * @returns {boolean} returns true if the proving key is for the fee_private function, false if otherwise
982
- * @returns {boolean}
983
- */
984
- isFeePrivateProver(): boolean;
985
- /**
986
- * Verify if the proving key is for the fee_public function
987
- *
988
- * @example
989
- * const provingKey = ProvingKey.fromBytes("fee_public_proving_key.bin");
990
- * provingKey.isFeePublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
991
- *
992
- * @returns {boolean} returns true if the proving key is for the fee_public function, false if otherwise
993
- * @returns {boolean}
994
- */
995
- isFeePublicProver(): boolean;
996
- /**
997
- * Verify if the proving key is for the inclusion function
998
- *
999
- * @example
1000
- * const provingKey = ProvingKey.fromBytes("inclusion_proving_key.bin");
1001
- * provingKey.isInclusionProver() ? console.log("Key verified") : throw new Error("Invalid key");
1002
- *
1003
- * @returns {boolean} returns true if the proving key is for the inclusion function, false if otherwise
1004
- * @returns {boolean}
1005
- */
1006
- isInclusionProver(): boolean;
1007
- /**
1008
- * Verify if the proving key is for the join function
1009
- *
1010
- * @example
1011
- * const provingKey = ProvingKey.fromBytes("join_proving_key.bin");
1012
- * provingKey.isJoinProver() ? console.log("Key verified") : throw new Error("Invalid key");
1013
- *
1014
- * @returns {boolean} returns true if the proving key is for the join function, false if otherwise
1015
- * @returns {boolean}
1016
- */
1017
- isJoinProver(): boolean;
1018
- /**
1019
- * Verify if the proving key is for the set_validator_state function
1020
- *
1021
- * @example
1022
- * const provingKey = ProvingKey.fromBytes("set_validator_set_proving_key.bin");
1023
- * provingKey.isSetValidatorStateProver() ? console.log("Key verified") : throw new Error("Invalid key");
1024
- *
1025
- * @returns {boolean} returns true if the proving key is for the set_validator_state function, false if otherwise
1026
- * @returns {boolean}
1027
- */
1028
- isSetValidatorStateProver(): boolean;
1029
- /**
1030
- * Verify if the proving key is for the split function
1031
- *
1032
- * @example
1033
- * const provingKey = ProvingKey.fromBytes("split_proving_key.bin");
1034
- * provingKey.isSplitProver() ? console.log("Key verified") : throw new Error("Invalid key");
1035
- *
1036
- * @returns {boolean} returns true if the proving key is for the split function, false if otherwise
1037
- * @returns {boolean}
1038
- */
1039
- isSplitProver(): boolean;
1040
- /**
1041
- * Verify if the proving key is for the transfer_private function
1042
- *
1043
- * @example
1044
- * const provingKey = ProvingKey.fromBytes("transfer_private_proving_key.bin");
1045
- * provingKey.isTransferPrivateProver() ? console.log("Key verified") : throw new Error("Invalid key");
1046
- *
1047
- * @returns {boolean} returns true if the proving key is for the transfer_private function, false if otherwise
1048
- * @returns {boolean}
1049
- */
1050
- isTransferPrivateProver(): boolean;
1051
- /**
1052
- * Verify if the proving key is for the transfer_private_to_public function
1053
- *
1054
- * @example
1055
- * const provingKey = ProvingKey.fromBytes("transfer_private_to_public_proving_key.bin");
1056
- * provingKey.isTransferPrivateToPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
1057
- *
1058
- * @returns {boolean} returns true if the proving key is for the transfer_private_to_public function, false if otherwise
1059
- * @returns {boolean}
1060
- */
1061
- isTransferPrivateToPublicProver(): boolean;
1062
- /**
1063
- * Verify if the proving key is for the transfer_public function
1064
- *
1065
- * @example
1066
- * const provingKey = ProvingKey.fromBytes("transfer_public_proving_key.bin");
1067
- * provingKey.isTransferPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
1068
- *
1069
- * @returns {boolean} returns true if the proving key is for the transfer_public function, false if otherwise
1070
- * @returns {boolean}
1071
- */
1072
- isTransferPublicProver(): boolean;
1073
- /**
1074
- * Verify if the proving key is for the transfer_public_to_private function
1075
- *
1076
- * @example
1077
- * const provingKey = ProvingKey.fromBytes("transfer_public_to_private_proving_key.bin");
1078
- * provingKey.isTransferPublicToPrivateProver() ? console.log("Key verified") : throw new Error("Invalid key");
1079
- *
1080
- * @returns {boolean} returns true if the proving key is for the transfer_public_to_private function, false if otherwise
1081
- * @returns {boolean}
1082
- */
1083
- isTransferPublicToPrivateProver(): boolean;
1084
- /**
1085
- * Verify if the proving key is for the unbond_delegator_as_validator function
1086
- *
1087
- * @example
1088
- * const provingKey = ProvingKey.fromBytes("unbond_delegator_as_validator_proving_key.bin");
1089
- * provingKey.isUnbondDelegatorAsValidatorProver() ? console.log("Key verified") : throw new Error("Invalid key");
1090
- *
1091
- * @returns {boolean} returns true if the proving key is for the unbond_delegator_as_validator function, false if otherwise
1092
- * @returns {boolean}
1093
- */
1094
- isUnbondDelegatorAsValidatorProver(): boolean;
1095
- /**
1096
- * Verify if the proving key is for the unbond_delegator_as_delegator function
1097
- *
1098
- * @example
1099
- * const provingKey = ProvingKey.fromBytes("unbond_delegator_as_delegator_proving_key.bin");
1100
- * provingKey.isUnbondDelegatorAsDelegatorProver() ? console.log("Key verified") : throw new Error("Invalid key");
1101
- *
1102
- * @returns {boolean} returns true if the proving key is for the unbond_delegator_as_delegator function, false if otherwise
1103
- * @returns {boolean}
1104
- */
1105
- isUnbondPublicProver(): boolean;
1106
- /**
1107
- * Return the checksum of the proving key
1108
- *
1109
- * @returns {string} Checksum of the proving key
1110
- * @returns {string}
1111
- */
1112
- checksum(): string;
1113
- /**
1114
- * Create a copy of the proving key
1115
- *
1116
- * @returns {ProvingKey} A copy of the proving key
1117
- * @returns {ProvingKey}
1118
- */
1119
- copy(): ProvingKey;
1120
- /**
1121
- * Construct a new proving key from a byte array
1122
- *
1123
- * @param {Uint8Array} bytes Byte array representation of a proving key
1124
- * @returns {ProvingKey | Error}
1125
- * @param {Uint8Array} bytes
1126
- * @returns {ProvingKey}
1127
- */
1128
- static fromBytes(bytes: Uint8Array): ProvingKey;
1129
- /**
1130
- * Create a proving key from string
1131
- *
1132
- * @param {string | Error} String representation of the proving key
1133
- * @param {string} string
1134
- * @returns {ProvingKey}
1135
- */
1136
- static fromString(string: string): ProvingKey;
1137
- /**
1138
- * Return the byte representation of a proving key
1139
- *
1140
- * @returns {Uint8Array | Error} Byte array representation of a proving key
1141
- * @returns {Uint8Array}
1142
- */
1143
- toBytes(): Uint8Array;
1144
- /**
1145
- * Get a string representation of the proving key
1146
- *
1147
- * @returns {string} String representation of the proving key
1148
- * @returns {string}
1149
- */
1150
- toString(): string;
1151
- }
1152
- /**
1153
- * Encrypted Aleo record
1154
- */
1155
- export class RecordCiphertext {
1156
- free(): void;
1157
- /**
1158
- * Create a record ciphertext from a string
1159
- *
1160
- * @param {string} record String representation of a record ciphertext
1161
- * @returns {RecordCiphertext | Error} Record ciphertext
1162
- * @param {string} record
1163
- * @returns {RecordCiphertext}
1164
- */
1165
- static fromString(record: string): RecordCiphertext;
1166
- /**
1167
- * Return the string reprensentation of the record ciphertext
1168
- *
1169
- * @returns {string} String representation of the record ciphertext
1170
- * @returns {string}
1171
- */
1172
- toString(): string;
1173
- /**
1174
- * Decrypt the record ciphertext into plaintext using the view key. The record will only
1175
- * decrypt if the record was encrypted by the account corresponding to the view key
1176
- *
1177
- * @param {ViewKey} view_key View key used to decrypt the ciphertext
1178
- * @returns {RecordPlaintext | Error} Record plaintext object
1179
- * @param {ViewKey} view_key
1180
- * @returns {RecordPlaintext}
1181
- */
1182
- decrypt(view_key: ViewKey): RecordPlaintext;
1183
- /**
1184
- * Determines if the account corresponding to the view key is the owner of the record
1185
- *
1186
- * @param {ViewKey} view_key View key used to decrypt the ciphertext
1187
- * @returns {boolean}
1188
- * @param {ViewKey} view_key
1189
- * @returns {boolean}
1190
- */
1191
- isOwner(view_key: ViewKey): boolean;
1192
- }
1193
- /**
1194
- * Plaintext representation of an Aleo record
1195
- */
1196
- export class RecordPlaintext {
1197
- free(): void;
1198
- /**
1199
- * @param {string} program_id
1200
- * @param {string} record_name
1201
- * @returns {Field}
1202
- */
1203
- commitment(program_id: string, record_name: string): Field;
1204
- /**
1205
- * Return a record plaintext from a string.
1206
- *
1207
- * @param {string} record String representation of a plaintext representation of an Aleo record
1208
- * @returns {RecordPlaintext | Error} Record plaintext
1209
- * @param {string} record
1210
- * @returns {RecordPlaintext}
1211
- */
1212
- static fromString(record: string): RecordPlaintext;
1213
- /**
1214
- * Returns the record plaintext string
1215
- *
1216
- * @returns {string} String representation of the record plaintext
1217
- * @returns {string}
1218
- */
1219
- toString(): string;
1220
- /**
1221
- * Returns the amount of microcredits in the record
1222
- *
1223
- * @returns {u64} Amount of microcredits in the record
1224
- * @returns {bigint}
1225
- */
1226
- microcredits(): bigint;
1227
- /**
1228
- * Returns the nonce of the record. This can be used to uniquely identify a record.
1229
- *
1230
- * @returns {string} Nonce of the record
1231
- * @returns {string}
1232
- */
1233
- nonce(): string;
1234
- /**
1235
- * Attempt to get the serial number of a record to determine whether or not is has been spent
1236
- *
1237
- * @param {PrivateKey} private_key Private key of the account that owns the record
1238
- * @param {string} program_id Program ID of the program that the record is associated with
1239
- * @param {string} record_name Name of the record
1240
- * @returns {string | Error} Serial number of the record
1241
- * @param {PrivateKey} private_key
1242
- * @param {string} program_id
1243
- * @param {string} record_name
1244
- * @returns {string}
1245
- */
1246
- serialNumberString(private_key: PrivateKey, program_id: string, record_name: string): string;
1247
- }
1248
- /**
1249
- * Cryptographic signature of a message signed by an Aleo account
1250
- */
1251
- export class Signature {
1252
- free(): void;
1253
- /**
1254
- * Sign a message with a private key
1255
- *
1256
- * @param {PrivateKey} private_key The private key to sign the message with
1257
- * @param {Uint8Array} message Byte representation of the message to sign
1258
- * @returns {Signature} Signature of the message
1259
- * @param {PrivateKey} private_key
1260
- * @param {Uint8Array} message
1261
- * @returns {Signature}
1262
- */
1263
- static sign(private_key: PrivateKey, message: Uint8Array): Signature;
1264
- /**
1265
- * @param {PrivateKey} private_key
1266
- * @param {Uint8Array} message
1267
- * @param {Uint8Array} seed
1268
- * @returns {Signature}
1269
- */
1270
- static sign_message(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): Signature;
1271
- /**
1272
- * Ignore the mess below -- me testing things
1273
- * Turn a message into bits
1274
- *
1275
- * @param {Uint8Array} message Byte representation of the message to sign
1276
- * @returns {Vec<bool>} Vec of bool of the message
1277
- * Verify a signature of a message with an address
1278
- *
1279
- * @param {Address} address The address to verify the signature with
1280
- * @param {Uint8Array} message Byte representation of the message to verify
1281
- * @returns {boolean} True if the signature is valid, false otherwise
1282
- * @param {Address} address
1283
- * @param {Uint8Array} message
1284
- * @returns {boolean}
1285
- */
1286
- verify(address: Address, message: Uint8Array): boolean;
1287
- /**
1288
- * Get a signature from a string representation of a signature
1289
- *
1290
- * @param {string} signature String representation of a signature
1291
- * @returns {Signature} Signature
1292
- * @param {string} signature
1293
- * @returns {Signature}
1294
- */
1295
- static from_string(signature: string): Signature;
1296
- /**
1297
- * Get a string representation of a signature
1298
- *
1299
- * @returns {string} String representation of a signature
1300
- * @returns {string}
1301
- */
1302
- to_string(): string;
1303
- }
1304
- /**
1305
- * Webassembly Representation of an Aleo transaction
1306
- *
1307
- * This object is created when generating an on-chain function deployment or execution and is the
1308
- * object that should be submitted to the Aleo Network in order to deploy or execute a function.
1309
- */
1310
- export class Transaction {
1311
- free(): void;
1312
- /**
1313
- * Create a transaction from a string
1314
- *
1315
- * @param {string} transaction String representation of a transaction
1316
- * @returns {Transaction | Error}
1317
- * @param {string} transaction
1318
- * @returns {Transaction}
1319
- */
1320
- static fromString(transaction: string): Transaction;
1321
- /**
1322
- * Get the transaction as a string. If you want to submit this transaction to the Aleo Network
1323
- * this function will create the string that should be submitted in the `POST` data.
1324
- *
1325
- * @returns {string} String representation of the transaction
1326
- * @returns {string}
1327
- */
1328
- toString(): string;
1329
- /**
1330
- * Get the id of the transaction. This is the merkle root of the transaction's inclusion proof.
1331
- *
1332
- * This value can be used to query the status of the transaction on the Aleo Network to see
1333
- * if it was successful. If successful, the transaction will be included in a block and this
1334
- * value can be used to lookup the transaction data on-chain.
1335
- *
1336
- * @returns {string} Transaction id
1337
- * @returns {string}
1338
- */
1339
- transactionId(): string;
1340
- /**
1341
- * Get the type of the transaction (will return "deploy" or "execute")
1342
- *
1343
- * @returns {string} Transaction type
1344
- * @returns {string}
1345
- */
1346
- transactionType(): string;
1347
- }
1348
- /**
1349
- * Verifying key for a function within an Aleo program
1350
- */
1351
- export class VerifyingKey {
1352
- free(): void;
1353
- /**
1354
- * Get the checksum of the verifying key
1355
- *
1356
- * @returns {string} Checksum of the verifying key
1357
- * @returns {string}
1358
- */
1359
- checksum(): string;
1360
- /**
1361
- * Create a copy of the verifying key
1362
- *
1363
- * @returns {VerifyingKey} A copy of the verifying key
1364
- * @returns {VerifyingKey}
1365
- */
1366
- copy(): VerifyingKey;
1367
- /**
1368
- * Construct a new verifying key from a byte array
1369
- *
1370
- * @param {Uint8Array} bytes Byte representation of a verifying key
1371
- * @returns {VerifyingKey | Error}
1372
- * @param {Uint8Array} bytes
1373
- * @returns {VerifyingKey}
1374
- */
1375
- static fromBytes(bytes: Uint8Array): VerifyingKey;
1376
- /**
1377
- * Create a verifying key from string
1378
- *
1379
- * @param {String} string String representation of a verifying key
1380
- * @returns {VerifyingKey | Error}
1381
- * @param {string} string
1382
- * @returns {VerifyingKey}
1383
- */
1384
- static fromString(string: string): VerifyingKey;
1385
- /**
1386
- * Create a byte array from a verifying key
1387
- *
1388
- * @returns {Uint8Array | Error} Byte representation of a verifying key
1389
- * @returns {Uint8Array}
1390
- */
1391
- toBytes(): Uint8Array;
1392
- /**
1393
- * Get a string representation of the verifying key
1394
- *
1395
- * @returns {String} String representation of the verifying key
1396
- * @returns {string}
1397
- */
1398
- toString(): string;
1399
- /**
1400
- * Returns the verifying key for the bond_public function
1401
- *
1402
- * @returns {VerifyingKey} Verifying key for the bond_public function
1403
- * @returns {VerifyingKey}
1404
- */
1405
- static bondPublicVerifier(): VerifyingKey;
1406
- /**
1407
- * Returns the verifying key for the claim_delegator function
1408
- *
1409
- * @returns {VerifyingKey} Verifying key for the claim_unbond_public function
1410
- * @returns {VerifyingKey}
1411
- */
1412
- static claimUnbondPublicVerifier(): VerifyingKey;
1413
- /**
1414
- * Returns the verifying key for the fee_private function
1415
- *
1416
- * @returns {VerifyingKey} Verifying key for the fee_private function
1417
- * @returns {VerifyingKey}
1418
- */
1419
- static feePrivateVerifier(): VerifyingKey;
1420
- /**
1421
- * Returns the verifying key for the fee_public function
1422
- *
1423
- * @returns {VerifyingKey} Verifying key for the fee_public function
1424
- * @returns {VerifyingKey}
1425
- */
1426
- static feePublicVerifier(): VerifyingKey;
1427
- /**
1428
- * Returns the verifying key for the inclusion function
1429
- *
1430
- * @returns {VerifyingKey} Verifying key for the inclusion function
1431
- * @returns {VerifyingKey}
1432
- */
1433
- static inclusionVerifier(): VerifyingKey;
1434
- /**
1435
- * Returns the verifying key for the join function
1436
- *
1437
- * @returns {VerifyingKey} Verifying key for the join function
1438
- * @returns {VerifyingKey}
1439
- */
1440
- static joinVerifier(): VerifyingKey;
1441
- /**
1442
- * Returns the verifying key for the set_validator_state function
1443
- *
1444
- * @returns {VerifyingKey} Verifying key for the set_validator_state function
1445
- * @returns {VerifyingKey}
1446
- */
1447
- static setValidatorStateVerifier(): VerifyingKey;
1448
- /**
1449
- * Returns the verifying key for the split function
1450
- *
1451
- * @returns {VerifyingKey} Verifying key for the split function
1452
- * @returns {VerifyingKey}
1453
- */
1454
- static splitVerifier(): VerifyingKey;
1455
- /**
1456
- * Returns the verifying key for the transfer_private function
1457
- *
1458
- * @returns {VerifyingKey} Verifying key for the transfer_private function
1459
- * @returns {VerifyingKey}
1460
- */
1461
- static transferPrivateVerifier(): VerifyingKey;
1462
- /**
1463
- * Returns the verifying key for the transfer_private_to_public function
1464
- *
1465
- * @returns {VerifyingKey} Verifying key for the transfer_private_to_public function
1466
- * @returns {VerifyingKey}
1467
- */
1468
- static transferPrivateToPublicVerifier(): VerifyingKey;
1469
- /**
1470
- * Returns the verifying key for the transfer_public function
1471
- *
1472
- * @returns {VerifyingKey} Verifying key for the transfer_public function
1473
- * @returns {VerifyingKey}
1474
- */
1475
- static transferPublicVerifier(): VerifyingKey;
1476
- /**
1477
- * Returns the verifying key for the transfer_public_to_private function
1478
- *
1479
- * @returns {VerifyingKey} Verifying key for the transfer_public_to_private function
1480
- * @returns {VerifyingKey}
1481
- */
1482
- static transferPublicToPrivateVerifier(): VerifyingKey;
1483
- /**
1484
- * Returns the verifying key for the unbond_delegator_as_delegator function
1485
- *
1486
- * @returns {VerifyingKey} Verifying key for the unbond_delegator_as_delegator function
1487
- * @returns {VerifyingKey}
1488
- */
1489
- static unbondDelegatorAsValidatorVerifier(): VerifyingKey;
1490
- /**
1491
- * Returns the verifying key for the unbond_delegator_as_delegator function
1492
- *
1493
- * @returns {VerifyingKey} Verifying key for the unbond_delegator_as_delegator function
1494
- * @returns {VerifyingKey}
1495
- */
1496
- static unbondPublicVerifier(): VerifyingKey;
1497
- /**
1498
- * Returns the verifying key for the bond_public function
1499
- *
1500
- * @returns {VerifyingKey} Verifying key for the bond_public function
1501
- * @returns {boolean}
1502
- */
1503
- isBondPublicVerifier(): boolean;
1504
- /**
1505
- * Verifies the verifying key is for the claim_delegator function
1506
- *
1507
- * @returns {bool}
1508
- * @returns {boolean}
1509
- */
1510
- isClaimUnbondPublicVerifier(): boolean;
1511
- /**
1512
- * Verifies the verifying key is for the fee_private function
1513
- *
1514
- * @returns {bool}
1515
- * @returns {boolean}
1516
- */
1517
- isFeePrivateVerifier(): boolean;
1518
- /**
1519
- * Verifies the verifying key is for the fee_public function
1520
- *
1521
- * @returns {bool}
1522
- * @returns {boolean}
1523
- */
1524
- isFeePublicVerifier(): boolean;
1525
- /**
1526
- * Verifies the verifying key is for the inclusion function
1527
- *
1528
- * @returns {bool}
1529
- * @returns {boolean}
1530
- */
1531
- isInclusionVerifier(): boolean;
1532
- /**
1533
- * Verifies the verifying key is for the join function
1534
- *
1535
- * @returns {bool}
1536
- * @returns {boolean}
1537
- */
1538
- isJoinVerifier(): boolean;
1539
- /**
1540
- * Verifies the verifying key is for the set_validator_state function
1541
- *
1542
- * @returns {bool}
1543
- * @returns {boolean}
1544
- */
1545
- isSetValidatorStateVerifier(): boolean;
1546
- /**
1547
- * Verifies the verifying key is for the split function
1548
- *
1549
- * @returns {bool}
1550
- * @returns {boolean}
1551
- */
1552
- isSplitVerifier(): boolean;
1553
- /**
1554
- * Verifies the verifying key is for the transfer_private function
1555
- *
1556
- * @returns {bool}
1557
- * @returns {boolean}
1558
- */
1559
- isTransferPrivateVerifier(): boolean;
1560
- /**
1561
- * Verifies the verifying key is for the transfer_private_to_public function
1562
- *
1563
- * @returns {bool}
1564
- * @returns {boolean}
1565
- */
1566
- isTransferPrivateToPublicVerifier(): boolean;
1567
- /**
1568
- * Verifies the verifying key is for the transfer_public function
1569
- *
1570
- * @returns {bool}
1571
- * @returns {boolean}
1572
- */
1573
- isTransferPublicVerifier(): boolean;
1574
- /**
1575
- * Verifies the verifying key is for the transfer_public_to_private function
1576
- *
1577
- * @returns {bool}
1578
- * @returns {boolean}
1579
- */
1580
- isTransferPublicToPrivateVerifier(): boolean;
1581
- /**
1582
- * Verifies the verifying key is for the unbond_delegator_as_delegator function
1583
- *
1584
- * @returns {bool}
1585
- * @returns {boolean}
1586
- */
1587
- isUnbondDelegatorAsValidatorVerifier(): boolean;
1588
- /**
1589
- * Verifies the verifying key is for the unbond_public function
1590
- *
1591
- * @returns {bool}
1592
- * @returns {boolean}
1593
- */
1594
- isUnbondPublicVerifier(): boolean;
1595
- }
1596
- /**
1597
- */
1598
- export class ViewKey {
1599
- free(): void;
1600
- /**
1601
- * Create a new view key from a private key
1602
- *
1603
- * @param {PrivateKey} private_key Private key
1604
- * @returns {ViewKey} View key
1605
- * @param {PrivateKey} private_key
1606
- * @returns {ViewKey}
1607
- */
1608
- static from_private_key(private_key: PrivateKey): ViewKey;
1609
- /**
1610
- * Create a new view key from a string representation of a view key
1611
- *
1612
- * @param {string} view_key String representation of a view key
1613
- * @returns {ViewKey} View key
1614
- * @param {string} view_key
1615
- * @returns {ViewKey}
1616
- */
1617
- static from_string(view_key: string): ViewKey;
1618
- /**
1619
- * Get a string representation of a view key
1620
- *
1621
- * @returns {string} String representation of a view key
1622
- * @returns {string}
1623
- */
1624
- to_string(): string;
1625
- /**
1626
- * Get the address corresponding to a view key
1627
- *
1628
- * @returns {Address} Address
1629
- * @returns {Address}
1630
- */
1631
- to_address(): Address;
1632
- /**
1633
- * Decrypt a record ciphertext with a view key
1634
- *
1635
- * @param {string} ciphertext String representation of a record ciphertext
1636
- * @returns {string} String representation of a record plaintext
1637
- * @param {string} ciphertext
1638
- * @returns {string}
1639
- */
1640
- decrypt(ciphertext: string): string;
1641
- /**
1642
- * @param {string} ciphertext
1643
- * @param {string} tpk
1644
- * @param {string} program_name
1645
- * @param {string} function_name
1646
- * @param {number} index
1647
- * @returns {string}
1648
- */
1649
- decrypt_ciphertext(ciphertext: string, tpk: string, program_name: string, function_name: string, index: number): string;
1650
- }
1651
-
1652
- export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
1653
-
1654
- export interface InitOutput {
1655
- readonly memory: WebAssembly.Memory;
1656
- readonly __wbg_address_free: (a: number) => void;
1657
- readonly address_from_private_key: (a: number) => number;
1658
- readonly address_from_view_key: (a: number) => number;
1659
- readonly address_from_string: (a: number, b: number) => number;
1660
- readonly address_to_string: (a: number, b: number) => void;
1661
- readonly address_verify: (a: number, b: number, c: number, d: number) => number;
1662
- readonly __wbg_keypair_free: (a: number) => void;
1663
- readonly keypair_new: (a: number, b: number) => number;
1664
- readonly keypair_provingKey: (a: number, b: number) => void;
1665
- readonly keypair_verifyingKey: (a: number, b: number) => void;
1666
- readonly __wbg_authorizationresponse_free: (a: number) => void;
1667
- readonly authorizationresponse_authorization: (a: number, b: number) => void;
1668
- readonly authorizationresponse_fee_authorization: (a: number, b: number) => void;
1669
- readonly programmanager_authExecute: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
1670
- readonly programmanager_executeFunctionOffline: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => number;
1671
- readonly programmanager_buildExecutionTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => number;
1672
- readonly programmanager_estimateExecutionFee: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number;
1673
- readonly programmanager_estimateFinalizeFee: (a: number, b: number, c: number, d: number, e: number) => void;
1674
- readonly provingkey_isBondPublicProver: (a: number) => number;
1675
- readonly provingkey_isClaimUnbondPublicProver: (a: number) => number;
1676
- readonly provingkey_isFeePrivateProver: (a: number) => number;
1677
- readonly provingkey_isFeePublicProver: (a: number) => number;
1678
- readonly provingkey_isInclusionProver: (a: number) => number;
1679
- readonly provingkey_isJoinProver: (a: number) => number;
1680
- readonly provingkey_isSetValidatorStateProver: (a: number) => number;
1681
- readonly provingkey_isSplitProver: (a: number) => number;
1682
- readonly provingkey_isTransferPrivateProver: (a: number) => number;
1683
- readonly provingkey_isTransferPrivateToPublicProver: (a: number) => number;
1684
- readonly provingkey_isTransferPublicProver: (a: number) => number;
1685
- readonly provingkey_isTransferPublicToPrivateProver: (a: number) => number;
1686
- readonly provingkey_isUnbondDelegatorAsValidatorProver: (a: number) => number;
1687
- readonly provingkey_isUnbondPublicProver: (a: number) => number;
1688
- readonly __wbg_provingkey_free: (a: number) => void;
1689
- readonly provingkey_checksum: (a: number, b: number) => void;
1690
- readonly provingkey_copy: (a: number) => number;
1691
- readonly provingkey_fromBytes: (a: number, b: number, c: number) => void;
1692
- readonly provingkey_fromString: (a: number, b: number, c: number) => void;
1693
- readonly provingkey_toBytes: (a: number, b: number) => void;
1694
- readonly provingkey_toString: (a: number, b: number) => void;
1695
- readonly __wbg_transaction_free: (a: number) => void;
1696
- readonly transaction_fromString: (a: number, b: number, c: number) => void;
1697
- readonly transaction_toString: (a: number, b: number) => void;
1698
- readonly transaction_transactionId: (a: number, b: number) => void;
1699
- readonly transaction_transactionType: (a: number, b: number) => void;
1700
- readonly __wbg_recordciphertext_free: (a: number) => void;
1701
- readonly recordciphertext_fromString: (a: number, b: number, c: number) => void;
1702
- readonly recordciphertext_toString: (a: number, b: number) => void;
1703
- readonly recordciphertext_decrypt: (a: number, b: number, c: number) => void;
1704
- readonly recordciphertext_isOwner: (a: number, b: number) => number;
1705
- readonly runRayonThread: (a: number) => void;
1706
- readonly __wbg_privatekey_free: (a: number) => void;
1707
- readonly privatekey_new: () => number;
1708
- readonly privatekey_from_seed_unchecked: (a: number, b: number) => number;
1709
- readonly privatekey_from_string: (a: number, b: number, c: number) => void;
1710
- readonly privatekey_to_string: (a: number, b: number) => void;
1711
- readonly privatekey_to_seed: (a: number, b: number) => void;
1712
- readonly privatekey_to_view_key: (a: number) => number;
1713
- readonly privatekey_to_address: (a: number) => number;
1714
- readonly privatekey_sign: (a: number, b: number, c: number) => number;
1715
- readonly privatekey_newEncrypted: (a: number, b: number, c: number) => void;
1716
- readonly privatekey_toCiphertext: (a: number, b: number, c: number, d: number) => void;
1717
- readonly privatekey_fromPrivateKeyCiphertext: (a: number, b: number, c: number, d: number) => void;
1718
- readonly __wbg_viewkey_free: (a: number) => void;
1719
- readonly viewkey_from_private_key: (a: number) => number;
1720
- readonly viewkey_from_string: (a: number, b: number) => number;
1721
- readonly viewkey_to_string: (a: number, b: number) => void;
1722
- readonly viewkey_to_address: (a: number) => number;
1723
- readonly viewkey_decrypt: (a: number, b: number, c: number, d: number) => void;
1724
- readonly viewkey_decrypt_ciphertext: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
1725
- readonly __wbg_field_free: (a: number) => void;
1726
- readonly field_toString: (a: number, b: number) => void;
1727
- readonly field_fromString: (a: number, b: number, c: number) => void;
1728
- readonly programmanager_buildDeploymentTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
1729
- readonly programmanager_estimateDeploymentFee: (a: number, b: number, c: number) => number;
1730
- readonly programmanager_estimateProgramNameCost: (a: number, b: number, c: number) => void;
1731
- readonly initThreadPool: (a: number, b: number) => number;
1732
- readonly init_panic_hook: () => void;
1733
- readonly __wbg_privatekeyciphertext_free: (a: number) => void;
1734
- readonly privatekeyciphertext_encryptPrivateKey: (a: number, b: number, c: number, d: number) => void;
1735
- readonly privatekeyciphertext_decryptToPrivateKey: (a: number, b: number, c: number, d: number) => void;
1736
- readonly privatekeyciphertext_toString: (a: number, b: number) => void;
1737
- readonly privatekeyciphertext_fromString: (a: number, b: number, c: number) => void;
1738
- readonly programmanager_buildSplitTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
1739
- readonly __wbg_verifyingkey_free: (a: number) => void;
1740
- readonly verifyingkey_checksum: (a: number, b: number) => void;
1741
- readonly verifyingkey_copy: (a: number) => number;
1742
- readonly verifyingkey_fromBytes: (a: number, b: number, c: number) => void;
1743
- readonly verifyingkey_fromString: (a: number, b: number, c: number) => void;
1744
- readonly verifyingkey_toBytes: (a: number, b: number) => void;
1745
- readonly verifyingkey_toString: (a: number, b: number) => void;
1746
- readonly __wbg_execution_free: (a: number) => void;
1747
- readonly execution_toString: (a: number, b: number) => void;
1748
- readonly execution_fromString: (a: number, b: number, c: number) => void;
1749
- readonly verifyFunctionExecution: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1750
- readonly __wbg_offlinequery_free: (a: number) => void;
1751
- readonly offlinequery_new: (a: number, b: number, c: number) => void;
1752
- readonly offlinequery_addStatePath: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1753
- readonly offlinequery_toString: (a: number, b: number) => void;
1754
- readonly offlinequery_fromString: (a: number, b: number, c: number) => void;
1755
- readonly __wbg_program_free: (a: number) => void;
1756
- readonly program_fromString: (a: number, b: number, c: number) => void;
1757
- readonly program_toString: (a: number, b: number) => void;
1758
- readonly program_hasFunction: (a: number, b: number, c: number) => number;
1759
- readonly program_getFunctions: (a: number) => number;
1760
- readonly program_getFunctionInputs: (a: number, b: number, c: number, d: number) => void;
1761
- readonly program_getMappings: (a: number, b: number) => void;
1762
- readonly program_getRecordMembers: (a: number, b: number, c: number, d: number) => void;
1763
- readonly program_getStructMembers: (a: number, b: number, c: number, d: number) => void;
1764
- readonly program_getCreditsProgram: () => number;
1765
- readonly program_id: (a: number, b: number) => void;
1766
- readonly program_address: (a: number, b: number) => void;
1767
- readonly program_isEqual: (a: number, b: number) => number;
1768
- readonly program_getImports: (a: number) => number;
1769
- readonly verifyingkey_bondPublicVerifier: () => number;
1770
- readonly verifyingkey_claimUnbondPublicVerifier: () => number;
1771
- readonly verifyingkey_feePrivateVerifier: () => number;
1772
- readonly verifyingkey_feePublicVerifier: () => number;
1773
- readonly verifyingkey_inclusionVerifier: () => number;
1774
- readonly verifyingkey_joinVerifier: () => number;
1775
- readonly verifyingkey_setValidatorStateVerifier: () => number;
1776
- readonly verifyingkey_splitVerifier: () => number;
1777
- readonly verifyingkey_transferPrivateVerifier: () => number;
1778
- readonly verifyingkey_transferPrivateToPublicVerifier: () => number;
1779
- readonly verifyingkey_transferPublicVerifier: () => number;
1780
- readonly verifyingkey_transferPublicToPrivateVerifier: () => number;
1781
- readonly verifyingkey_unbondDelegatorAsValidatorVerifier: () => number;
1782
- readonly verifyingkey_unbondPublicVerifier: () => number;
1783
- readonly verifyingkey_isBondPublicVerifier: (a: number) => number;
1784
- readonly verifyingkey_isClaimUnbondPublicVerifier: (a: number) => number;
1785
- readonly verifyingkey_isFeePrivateVerifier: (a: number) => number;
1786
- readonly verifyingkey_isFeePublicVerifier: (a: number) => number;
1787
- readonly verifyingkey_isInclusionVerifier: (a: number) => number;
1788
- readonly verifyingkey_isJoinVerifier: (a: number) => number;
1789
- readonly verifyingkey_isSetValidatorStateVerifier: (a: number) => number;
1790
- readonly verifyingkey_isSplitVerifier: (a: number) => number;
1791
- readonly verifyingkey_isTransferPrivateVerifier: (a: number) => number;
1792
- readonly verifyingkey_isTransferPrivateToPublicVerifier: (a: number) => number;
1793
- readonly verifyingkey_isTransferPublicVerifier: (a: number) => number;
1794
- readonly verifyingkey_isTransferPublicToPrivateVerifier: (a: number) => number;
1795
- readonly verifyingkey_isUnbondDelegatorAsValidatorVerifier: (a: number) => number;
1796
- readonly verifyingkey_isUnbondPublicVerifier: (a: number) => number;
1797
- readonly __wbg_jsfield_free: (a: number) => void;
1798
- readonly jsfield_generate_message_leo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1799
- readonly jsfield_generate_message_clients: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1800
- readonly __wbg_signature_free: (a: number) => void;
1801
- readonly signature_sign: (a: number, b: number, c: number) => number;
1802
- readonly signature_sign_message: (a: number, b: number, c: number, d: number, e: number) => number;
1803
- readonly signature_verify: (a: number, b: number, c: number, d: number) => number;
1804
- readonly signature_from_string: (a: number, b: number) => number;
1805
- readonly signature_to_string: (a: number, b: number) => void;
1806
- readonly programmanager_buildJoinTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number;
1807
- readonly programmanager_buildTransferTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => number;
1808
- readonly programmanager_synthesizeKeyPair: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
1809
- readonly __wbg_executionresponse_free: (a: number) => void;
1810
- readonly executionresponse_getOutputs: (a: number) => number;
1811
- readonly executionresponse_getExecution: (a: number) => number;
1812
- readonly executionresponse_getKeys: (a: number, b: number) => void;
1813
- readonly executionresponse_getProvingKey: (a: number) => number;
1814
- readonly executionresponse_getVerifyingKey: (a: number) => number;
1815
- readonly executionresponse_getFunctionId: (a: number, b: number) => void;
1816
- readonly executionresponse_getProgram: (a: number) => number;
1817
- readonly __wbg_recordplaintext_free: (a: number) => void;
1818
- readonly recordplaintext_commitment: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1819
- readonly recordplaintext_fromString: (a: number, b: number, c: number) => void;
1820
- readonly recordplaintext_toString: (a: number, b: number) => void;
1821
- readonly recordplaintext_microcredits: (a: number) => number;
1822
- readonly recordplaintext_nonce: (a: number, b: number) => void;
1823
- readonly recordplaintext_serialNumberString: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1824
- readonly __wbg_programmanager_free: (a: number) => void;
1825
- readonly __wbindgen_malloc: (a: number, b: number) => number;
1826
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
1827
- readonly __wbindgen_export_2: WebAssembly.Table;
1828
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdf1d9b89567002b9: (a: number, b: number, c: number) => void;
1829
- readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
1830
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
1831
- readonly __wbindgen_exn_store: (a: number) => void;
1832
- readonly wasm_bindgen__convert__closures__invoke2_mut__h69b3d6b389ddc7fb: (a: number, b: number, c: number, d: number) => void;
1833
- }
1834
-
1835
- export type SyncInitInput = BufferSource | WebAssembly.Module;
1836
- /**
1837
- * Instantiates the given `module`, which can either be bytes or
1838
- * a precompiled `WebAssembly.Module`.
1839
- *
1840
- * @param {SyncInitInput} module
1841
- *
1842
- * @returns {InitOutput}
1843
- */
1844
- export function initSync(module: SyncInitInput): InitOutput;
1845
-
1846
- /**
1847
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
1848
- * for everything else, calls `WebAssembly.instantiate` directly.
1849
- *
1850
- * @param {InitInput | Promise<InitInput>} module_or_path
1851
- *
1852
- * @returns {Promise<InitOutput>}
1853
- */
1854
- export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;