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