@puzzlehq/aleo-wasm-web 0.6.1 → 0.6.8
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 +741 -303
- package/aleo_wasm.js +1462 -756
- package/aleo_wasm_bg.wasm +0 -0
- package/package.json +3 -4
- package/snippets/aleo-wasm-a66b35edae11a8af/inline0.js +0 -27
package/aleo_wasm.d.ts
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*/
|
|
5
|
-
export function init_panic_hook(): void;
|
|
6
|
-
/**
|
|
7
|
-
* @param {URL} url
|
|
8
|
-
* @param {number} num_threads
|
|
9
|
-
* @returns {Promise<void>}
|
|
10
|
-
*/
|
|
11
|
-
export function initThreadPool(url: URL, num_threads: number): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* @param {number} receiver
|
|
14
|
-
*/
|
|
15
|
-
export function runRayonThread(receiver: number): void;
|
|
16
|
-
/**
|
|
17
4
|
* Verify an execution with a single function and a single transition. Executions with multiple
|
|
18
5
|
* transitions or functions will fail to verify. Also, this does not verify that the state root of
|
|
19
6
|
* the execution is included in the Aleo Network ledger.
|
|
@@ -31,6 +18,9 @@ export function runRayonThread(receiver: number): void;
|
|
|
31
18
|
*/
|
|
32
19
|
export function verifyFunctionExecution(execution: Execution, verifying_key: VerifyingKey, program: Program, function_id: string): boolean;
|
|
33
20
|
/**
|
|
21
|
+
*/
|
|
22
|
+
export function init_panic_hook(): void;
|
|
23
|
+
/**
|
|
34
24
|
* Public address of an Aleo account
|
|
35
25
|
*/
|
|
36
26
|
export class Address {
|
|
@@ -82,7 +72,7 @@ export class Address {
|
|
|
82
72
|
verify(message: Uint8Array, signature: Signature): boolean;
|
|
83
73
|
}
|
|
84
74
|
/**
|
|
85
|
-
*
|
|
75
|
+
* Execution of an Aleo program.
|
|
86
76
|
*/
|
|
87
77
|
export class Execution {
|
|
88
78
|
free(): void;
|
|
@@ -114,14 +104,57 @@ export class ExecutionResponse {
|
|
|
114
104
|
*/
|
|
115
105
|
getOutputs(): Array<any>;
|
|
116
106
|
/**
|
|
117
|
-
* Returns the execution object if present, null if otherwise.
|
|
118
|
-
* removes the WebAssembly object from the response object and will return null if called a
|
|
119
|
-
* second time.
|
|
107
|
+
* Returns the execution object if present, null if otherwise.
|
|
120
108
|
*
|
|
121
|
-
* @returns {Execution} The execution object if present, null if otherwise
|
|
109
|
+
* @returns {Execution | undefined} The execution object if present, null if otherwise
|
|
122
110
|
* @returns {Execution | undefined}
|
|
123
111
|
*/
|
|
124
112
|
getExecution(): Execution | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the program keys if present
|
|
115
|
+
* @returns {KeyPair}
|
|
116
|
+
*/
|
|
117
|
+
getKeys(): KeyPair;
|
|
118
|
+
/**
|
|
119
|
+
* Returns the proving_key if the proving key was cached in the Execution response.
|
|
120
|
+
* Note the proving key is removed from the response object after the first call to this
|
|
121
|
+
* function. Subsequent calls will return null.
|
|
122
|
+
*
|
|
123
|
+
* @returns {ProvingKey | undefined} The proving key
|
|
124
|
+
* @returns {ProvingKey | undefined}
|
|
125
|
+
*/
|
|
126
|
+
getProvingKey(): ProvingKey | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the verifying_key associated with the program
|
|
129
|
+
*
|
|
130
|
+
* @returns {VerifyingKey} The verifying key
|
|
131
|
+
* @returns {VerifyingKey}
|
|
132
|
+
*/
|
|
133
|
+
getVerifyingKey(): VerifyingKey;
|
|
134
|
+
/**
|
|
135
|
+
* Returns the function identifier
|
|
136
|
+
* @returns {string}
|
|
137
|
+
*/
|
|
138
|
+
getFunctionId(): string;
|
|
139
|
+
/**
|
|
140
|
+
* Returns the program
|
|
141
|
+
* @returns {Program}
|
|
142
|
+
*/
|
|
143
|
+
getProgram(): Program;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
*/
|
|
147
|
+
export class Field {
|
|
148
|
+
free(): void;
|
|
149
|
+
/**
|
|
150
|
+
* @returns {string}
|
|
151
|
+
*/
|
|
152
|
+
toString(): string;
|
|
153
|
+
/**
|
|
154
|
+
* @param {string} field
|
|
155
|
+
* @returns {Field}
|
|
156
|
+
*/
|
|
157
|
+
static fromString(field: string): Field;
|
|
125
158
|
}
|
|
126
159
|
/**
|
|
127
160
|
*/
|
|
@@ -143,6 +176,7 @@ export class JsField {
|
|
|
143
176
|
static generate_message_clients(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): string;
|
|
144
177
|
}
|
|
145
178
|
/**
|
|
179
|
+
* Key pair object containing both the function proving and verifying keys
|
|
146
180
|
*/
|
|
147
181
|
export class KeyPair {
|
|
148
182
|
free(): void;
|
|
@@ -172,6 +206,38 @@ export class KeyPair {
|
|
|
172
206
|
verifyingKey(): VerifyingKey;
|
|
173
207
|
}
|
|
174
208
|
/**
|
|
209
|
+
* An offline query object used to insert the global state root and state paths needed to create
|
|
210
|
+
* a valid inclusion proof offline.
|
|
211
|
+
*/
|
|
212
|
+
export class OfflineQuery {
|
|
213
|
+
free(): void;
|
|
214
|
+
/**
|
|
215
|
+
* Creates a new offline query object. The state root is required to be passed in as a string
|
|
216
|
+
* @param {string} state_root
|
|
217
|
+
*/
|
|
218
|
+
constructor(state_root: string);
|
|
219
|
+
/**
|
|
220
|
+
* Add a new state path to the offline query object.
|
|
221
|
+
*
|
|
222
|
+
* @param {string} commitment: The commitment corresponding to a record inpout
|
|
223
|
+
* @param {string} state_path: The state path corresponding to the commitment
|
|
224
|
+
* @param {string} commitment
|
|
225
|
+
* @param {string} state_path
|
|
226
|
+
*/
|
|
227
|
+
addStatePath(commitment: string, state_path: string): void;
|
|
228
|
+
/**
|
|
229
|
+
* Get a json string representation of the offline query object
|
|
230
|
+
* @returns {string}
|
|
231
|
+
*/
|
|
232
|
+
toString(): string;
|
|
233
|
+
/**
|
|
234
|
+
* Create an offline query object from a json string representation
|
|
235
|
+
* @param {string} s
|
|
236
|
+
* @returns {OfflineQuery}
|
|
237
|
+
*/
|
|
238
|
+
static fromString(s: string): OfflineQuery;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
175
241
|
* Private key of an Aleo account
|
|
176
242
|
*/
|
|
177
243
|
export class PrivateKey {
|
|
@@ -209,6 +275,14 @@ export class PrivateKey {
|
|
|
209
275
|
*/
|
|
210
276
|
to_string(): string;
|
|
211
277
|
/**
|
|
278
|
+
* Get a string representation of the seed. This function should be used very carefully
|
|
279
|
+
* as it exposes the private key seed
|
|
280
|
+
*
|
|
281
|
+
* @returns {string} String representation of a private key seed
|
|
282
|
+
* @returns {string}
|
|
283
|
+
*/
|
|
284
|
+
to_seed(): string;
|
|
285
|
+
/**
|
|
212
286
|
* Get the view key corresponding to the private key
|
|
213
287
|
*
|
|
214
288
|
* @returns {ViewKey}
|
|
@@ -309,10 +383,6 @@ export class PrivateKeyCiphertext {
|
|
|
309
383
|
}
|
|
310
384
|
/**
|
|
311
385
|
* Webassembly Representation of an Aleo program
|
|
312
|
-
*
|
|
313
|
-
* This object is required to create an Execution or Deployment transaction. It includes several
|
|
314
|
-
* convenience methods for enumerating available functions and each functions' inputs in a
|
|
315
|
-
* javascript object for usage in creation of web forms for input capture.
|
|
316
386
|
*/
|
|
317
387
|
export class Program {
|
|
318
388
|
free(): void;
|
|
@@ -564,100 +634,6 @@ export class Program {
|
|
|
564
634
|
export class ProgramManager {
|
|
565
635
|
free(): void;
|
|
566
636
|
/**
|
|
567
|
-
* Join two records together to create a new record with an amount of credits equal to the sum
|
|
568
|
-
* of the credits of the two original records
|
|
569
|
-
*
|
|
570
|
-
* @param private_key The private key of the sender
|
|
571
|
-
* @param record_1 The first record to combine
|
|
572
|
-
* @param record_2 The second record to combine
|
|
573
|
-
* @param fee_credits The amount of credits to pay as a fee
|
|
574
|
-
* @param fee_record The record to spend the fee from
|
|
575
|
-
* @param url The url of the Aleo network node to send the transaction to
|
|
576
|
-
* @param cache Cache the proving and verifying keys in the ProgramManager memory. If this is
|
|
577
|
-
* set to `true` the keys synthesized (or passed in as optional parameters via the
|
|
578
|
-
* `join_proving_key` and `join_verifying_key` arguments) will be stored in the
|
|
579
|
-
* ProgramManager's memory and used for subsequent transactions. If this is set to `false` the
|
|
580
|
-
* proving and verifying keys will be deallocated from memory after the transaction is executed
|
|
581
|
-
* @param join_proving_key (optional) Provide a proving key to use for the join function
|
|
582
|
-
* @param join_verifying_key (optional) Provide a verifying key to use for the join function
|
|
583
|
-
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
584
|
-
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
585
|
-
* @returns {Transaction | Error} Transaction object
|
|
586
|
-
* @param {PrivateKey} private_key
|
|
587
|
-
* @param {RecordPlaintext} record_1
|
|
588
|
-
* @param {RecordPlaintext} record_2
|
|
589
|
-
* @param {number} fee_credits
|
|
590
|
-
* @param {RecordPlaintext | undefined} fee_record
|
|
591
|
-
* @param {string} url
|
|
592
|
-
* @param {boolean} cache
|
|
593
|
-
* @param {ProvingKey | undefined} join_proving_key
|
|
594
|
-
* @param {VerifyingKey | undefined} join_verifying_key
|
|
595
|
-
* @param {ProvingKey | undefined} fee_proving_key
|
|
596
|
-
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
597
|
-
* @returns {Promise<Transaction>}
|
|
598
|
-
*/
|
|
599
|
-
buildJoinTransaction(private_key: PrivateKey, record_1: RecordPlaintext, record_2: RecordPlaintext, fee_credits: number, fee_record: RecordPlaintext | undefined, url: string, cache: boolean, join_proving_key?: ProvingKey, join_verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey): Promise<Transaction>;
|
|
600
|
-
/**
|
|
601
|
-
*/
|
|
602
|
-
constructor();
|
|
603
|
-
/**
|
|
604
|
-
* Cache the proving and verifying keys for a program function in WASM memory. This method
|
|
605
|
-
* will take a verifying and proving key and store them in the program manager's internal
|
|
606
|
-
* in-memory cache. This memory is allocated in WebAssembly, so it is important to be mindful
|
|
607
|
-
* of the amount of memory being used. This method will return an error if the keys are already
|
|
608
|
-
* cached in memory.
|
|
609
|
-
*
|
|
610
|
-
* @param program_id The name of the program containing the desired function
|
|
611
|
-
* @param function The name of the function to store the keys for
|
|
612
|
-
* @param proving_key The proving key of the function
|
|
613
|
-
* @param verifying_key The verifying key of the function
|
|
614
|
-
* @param {string} program
|
|
615
|
-
* @param {string} _function
|
|
616
|
-
* @param {ProvingKey} proving_key
|
|
617
|
-
* @param {VerifyingKey} verifying_key
|
|
618
|
-
*/
|
|
619
|
-
cacheKeypairInWasmMemory(program: string, _function: string, proving_key: ProvingKey, verifying_key: VerifyingKey): void;
|
|
620
|
-
/**
|
|
621
|
-
* Get the proving & verifying keys cached in WASM memory for a specific function
|
|
622
|
-
*
|
|
623
|
-
* @param program_id The name of the program containing the desired function
|
|
624
|
-
* @param function_id The name of the function to retrieve the keys for
|
|
625
|
-
* @param {string} program_id
|
|
626
|
-
* @param {string} _function
|
|
627
|
-
* @returns {KeyPair}
|
|
628
|
-
*/
|
|
629
|
-
getCachedKeypair(program_id: string, _function: string): KeyPair;
|
|
630
|
-
/**
|
|
631
|
-
* Synthesize a proving and verifying key for a program function. This method should be used
|
|
632
|
-
* when there is a need to pre-synthesize keys (i.e. for caching purposes, etc.)
|
|
633
|
-
*
|
|
634
|
-
* @param program The source code of the program containing the desired function
|
|
635
|
-
* @param function The name of the function to synthesize the key for
|
|
636
|
-
* @param {string} program
|
|
637
|
-
* @param {string} _function
|
|
638
|
-
* @returns {KeyPair}
|
|
639
|
-
*/
|
|
640
|
-
synthesizeKeypair(program: string, _function: string): KeyPair;
|
|
641
|
-
/**
|
|
642
|
-
* Clear key cache in wasm memory.
|
|
643
|
-
*
|
|
644
|
-
* This method will clear the key cache in wasm memory. It is important to note that this will
|
|
645
|
-
* not DE-allocate the memory assigned to wasm as wasm memory cannot be shrunk. The total
|
|
646
|
-
* memory allocated to wasm will remain constant but will be available for other usage after
|
|
647
|
-
* calling this method.
|
|
648
|
-
*/
|
|
649
|
-
clearKeyCache(): void;
|
|
650
|
-
/**
|
|
651
|
-
* Check if the cache contains a keypair for a specific function
|
|
652
|
-
*
|
|
653
|
-
* @param program_id The name of the program containing the desired function
|
|
654
|
-
* @param function_id The name of the function to retrieve the keys for
|
|
655
|
-
* @param {string} program_id
|
|
656
|
-
* @param {string} function_id
|
|
657
|
-
* @returns {boolean}
|
|
658
|
-
*/
|
|
659
|
-
keyExists(program_id: string, function_id: string): boolean;
|
|
660
|
-
/**
|
|
661
637
|
* Split an Aleo credits record into two separate records. This function does not require a fee.
|
|
662
638
|
*
|
|
663
639
|
* @param private_key The private key of the sender
|
|
@@ -665,24 +641,19 @@ export class ProgramManager {
|
|
|
665
641
|
* value of the record and two new records will be created with the split amount and the remainder
|
|
666
642
|
* @param amount_record The record to split
|
|
667
643
|
* @param url The url of the Aleo network node to send the transaction to
|
|
668
|
-
* @param cache Cache the proving and verifying keys in the ProgramManager memory. If this is
|
|
669
|
-
* set to `true` the keys synthesized (or passed in as optional parameters via the
|
|
670
|
-
* `split_proving_key` and `split_verifying_key` arguments) will be stored in the
|
|
671
|
-
* ProgramManager's memory and used for subsequent transactions. If this is set to `false` the
|
|
672
|
-
* proving and verifying keys will be deallocated from memory after the transaction is executed
|
|
673
644
|
* @param split_proving_key (optional) Provide a proving key to use for the split function
|
|
674
645
|
* @param split_verifying_key (optional) Provide a verifying key to use for the split function
|
|
675
646
|
* @returns {Transaction | Error} Transaction object
|
|
676
647
|
* @param {PrivateKey} private_key
|
|
677
648
|
* @param {number} split_amount
|
|
678
649
|
* @param {RecordPlaintext} amount_record
|
|
679
|
-
* @param {string} url
|
|
680
|
-
* @param {boolean} cache
|
|
650
|
+
* @param {string | undefined} url
|
|
681
651
|
* @param {ProvingKey | undefined} split_proving_key
|
|
682
652
|
* @param {VerifyingKey | undefined} split_verifying_key
|
|
653
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
683
654
|
* @returns {Promise<Transaction>}
|
|
684
655
|
*/
|
|
685
|
-
buildSplitTransaction(private_key: PrivateKey, split_amount: number, amount_record: RecordPlaintext, url
|
|
656
|
+
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>;
|
|
686
657
|
/**
|
|
687
658
|
* Deploy an Aleo program
|
|
688
659
|
*
|
|
@@ -695,7 +666,6 @@ export class ProgramManager {
|
|
|
695
666
|
* @param fee_credits The amount of credits to pay as a fee
|
|
696
667
|
* @param fee_record The record to spend the fee from
|
|
697
668
|
* @param url The url of the Aleo network node to send the transaction to
|
|
698
|
-
* @param cache Cache the synthesized keys for future use
|
|
699
669
|
* @param imports (optional) Provide a list of imports to use for the program deployment in the
|
|
700
670
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
701
671
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
@@ -706,31 +676,29 @@ export class ProgramManager {
|
|
|
706
676
|
* @param {string} program
|
|
707
677
|
* @param {number} fee_credits
|
|
708
678
|
* @param {RecordPlaintext | undefined} fee_record
|
|
709
|
-
* @param {string} url
|
|
710
|
-
* @param {boolean} cache
|
|
679
|
+
* @param {string | undefined} url
|
|
711
680
|
* @param {object | undefined} imports
|
|
712
681
|
* @param {ProvingKey | undefined} fee_proving_key
|
|
713
682
|
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
683
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
714
684
|
* @returns {Promise<Transaction>}
|
|
715
685
|
*/
|
|
716
|
-
buildDeploymentTransaction(private_key: PrivateKey, program: string, fee_credits: number, fee_record
|
|
686
|
+
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>;
|
|
717
687
|
/**
|
|
718
688
|
* Estimate the fee for a program deployment
|
|
719
689
|
*
|
|
720
690
|
* Disclaimer: Fee estimation is experimental and may not represent a correct estimate on any current or future network
|
|
721
691
|
*
|
|
722
692
|
* @param program The source code of the program being deployed
|
|
723
|
-
* @param cache Cache the synthesized keys for future use
|
|
724
693
|
* @param imports (optional) Provide a list of imports to use for the deployment fee estimation
|
|
725
694
|
* in the form of a javascript object where the keys are a string of the program name and the values
|
|
726
695
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
727
696
|
* @returns {u64 | Error}
|
|
728
697
|
* @param {string} program
|
|
729
|
-
* @param {boolean} cache
|
|
730
698
|
* @param {object | undefined} imports
|
|
731
699
|
* @returns {Promise<bigint>}
|
|
732
700
|
*/
|
|
733
|
-
estimateDeploymentFee(program: string,
|
|
701
|
+
static estimateDeploymentFee(program: string, imports?: object): Promise<bigint>;
|
|
734
702
|
/**
|
|
735
703
|
* Estimate the component of the deployment cost which comes from the fee for the program name.
|
|
736
704
|
* Note that this cost does not represent the entire cost of deployment. It is additional to
|
|
@@ -743,7 +711,7 @@ export class ProgramManager {
|
|
|
743
711
|
* @param {string} name
|
|
744
712
|
* @returns {bigint}
|
|
745
713
|
*/
|
|
746
|
-
estimateProgramNameCost(name: string): bigint;
|
|
714
|
+
static estimateProgramNameCost(name: string): bigint;
|
|
747
715
|
/**
|
|
748
716
|
* Execute an arbitrary function locally
|
|
749
717
|
*
|
|
@@ -754,11 +722,10 @@ export class ProgramManager {
|
|
|
754
722
|
* @param {boolean} prove_execution If true, the execution will be proven and an execution object
|
|
755
723
|
* containing the proof and the encrypted inputs and outputs needed to verify the proof offline
|
|
756
724
|
* will be returned.
|
|
757
|
-
* @param {boolean} cache Cache the proving and verifying keys in the
|
|
758
|
-
* If this is set to 'true' the keys synthesized
|
|
759
|
-
* `
|
|
760
|
-
*
|
|
761
|
-
* keys will be deallocated from memory after the transaction is executed.
|
|
725
|
+
* @param {boolean} cache Cache the proving and verifying keys in the Execution response.
|
|
726
|
+
* If this is set to 'true' the keys synthesized will be stored in the Execution Response
|
|
727
|
+
* and the `ProvingKey` and `VerifyingKey` can be retrieved from the response via the `.getKeys()`
|
|
728
|
+
* method.
|
|
762
729
|
* @param {Object | undefined} imports (optional) Provide a list of imports to use for the function execution in the
|
|
763
730
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
764
731
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
@@ -773,9 +740,11 @@ export class ProgramManager {
|
|
|
773
740
|
* @param {object | undefined} imports
|
|
774
741
|
* @param {ProvingKey | undefined} proving_key
|
|
775
742
|
* @param {VerifyingKey | undefined} verifying_key
|
|
743
|
+
* @param {string | undefined} url
|
|
744
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
776
745
|
* @returns {Promise<ExecutionResponse>}
|
|
777
746
|
*/
|
|
778
|
-
executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object, proving_key?: ProvingKey, verifying_key?: VerifyingKey): Promise<ExecutionResponse>;
|
|
747
|
+
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>;
|
|
779
748
|
/**
|
|
780
749
|
* Execute Aleo function and create an Aleo execution transaction
|
|
781
750
|
*
|
|
@@ -786,7 +755,6 @@ export class ProgramManager {
|
|
|
786
755
|
* @param fee_credits The amount of credits to pay as a fee
|
|
787
756
|
* @param fee_record The record to spend the fee from
|
|
788
757
|
* @param url The url of the Aleo network node to send the transaction to
|
|
789
|
-
* @param cache Cache the proving and verifying keys in the ProgramManager's memory.
|
|
790
758
|
* If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
|
|
791
759
|
* `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
|
|
792
760
|
* and used for subsequent transactions. If this is set to 'false' the proving and verifying
|
|
@@ -805,16 +773,16 @@ export class ProgramManager {
|
|
|
805
773
|
* @param {Array<any>} inputs
|
|
806
774
|
* @param {number} fee_credits
|
|
807
775
|
* @param {RecordPlaintext | undefined} fee_record
|
|
808
|
-
* @param {string} url
|
|
809
|
-
* @param {boolean} cache
|
|
776
|
+
* @param {string | undefined} url
|
|
810
777
|
* @param {object | undefined} imports
|
|
811
778
|
* @param {ProvingKey | undefined} proving_key
|
|
812
779
|
* @param {VerifyingKey | undefined} verifying_key
|
|
813
780
|
* @param {ProvingKey | undefined} fee_proving_key
|
|
814
781
|
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
782
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
815
783
|
* @returns {Promise<Transaction>}
|
|
816
784
|
*/
|
|
817
|
-
buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, fee_credits: number, fee_record
|
|
785
|
+
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>;
|
|
818
786
|
/**
|
|
819
787
|
* Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
|
|
820
788
|
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
@@ -827,7 +795,6 @@ export class ProgramManager {
|
|
|
827
795
|
* @param function The name of the function to execute
|
|
828
796
|
* @param inputs A javascript array of inputs to the function
|
|
829
797
|
* @param url The url of the Aleo network node to send the transaction to
|
|
830
|
-
* @param cache Cache the proving and verifying keys in the ProgramManager's memory.
|
|
831
798
|
* @param imports (optional) Provide a list of imports to use for the fee estimation in the
|
|
832
799
|
* form of a javascript object where the keys are a string of the program name and the values
|
|
833
800
|
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
@@ -838,14 +805,14 @@ export class ProgramManager {
|
|
|
838
805
|
* @param {string} program
|
|
839
806
|
* @param {string} _function
|
|
840
807
|
* @param {Array<any>} inputs
|
|
841
|
-
* @param {string} url
|
|
842
|
-
* @param {boolean} cache
|
|
808
|
+
* @param {string | undefined} url
|
|
843
809
|
* @param {object | undefined} imports
|
|
844
810
|
* @param {ProvingKey | undefined} proving_key
|
|
845
811
|
* @param {VerifyingKey | undefined} verifying_key
|
|
812
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
846
813
|
* @returns {Promise<bigint>}
|
|
847
814
|
*/
|
|
848
|
-
estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url
|
|
815
|
+
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>;
|
|
849
816
|
/**
|
|
850
817
|
* Estimate the finalize fee component for executing a function. This fee is additional to the
|
|
851
818
|
* size of the execution of the program in bytes. If the function does not have a finalize
|
|
@@ -860,7 +827,7 @@ export class ProgramManager {
|
|
|
860
827
|
* @param {string} _function
|
|
861
828
|
* @returns {bigint}
|
|
862
829
|
*/
|
|
863
|
-
estimateFinalizeFee(program: string, _function: string): bigint;
|
|
830
|
+
static estimateFinalizeFee(program: string, _function: string): bigint;
|
|
864
831
|
/**
|
|
865
832
|
* Send credits from one Aleo account to another
|
|
866
833
|
*
|
|
@@ -872,13 +839,6 @@ export class ProgramManager {
|
|
|
872
839
|
* @param fee_credits The amount of credits to pay as a fee
|
|
873
840
|
* @param fee_record The record to spend the fee from
|
|
874
841
|
* @param url The url of the Aleo network node to send the transaction to
|
|
875
|
-
* @param cache Cache the proving and verifying keys in the ProgramManager memory. If this is
|
|
876
|
-
* set to `true` the keys synthesized (or passed in as optional parameters via the
|
|
877
|
-
* `transfer_proving_key` and `transfer_verifying_key` arguments) will be stored in the
|
|
878
|
-
* ProgramManager's memory and used for subsequent transactions. If this is set to `false` the
|
|
879
|
-
* proving and verifying keys will be deallocated from memory after the transaction is executed
|
|
880
|
-
* @param transfer_proving_key (optional) Provide a proving key to use for the transfer
|
|
881
|
-
* function
|
|
882
842
|
* @param transfer_verifying_key (optional) Provide a verifying key to use for the transfer
|
|
883
843
|
* function
|
|
884
844
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
@@ -891,15 +851,59 @@ export class ProgramManager {
|
|
|
891
851
|
* @param {RecordPlaintext | undefined} amount_record
|
|
892
852
|
* @param {number} fee_credits
|
|
893
853
|
* @param {RecordPlaintext | undefined} fee_record
|
|
894
|
-
* @param {string} url
|
|
895
|
-
* @param {boolean} cache
|
|
854
|
+
* @param {string | undefined} url
|
|
896
855
|
* @param {ProvingKey | undefined} transfer_proving_key
|
|
897
856
|
* @param {VerifyingKey | undefined} transfer_verifying_key
|
|
898
857
|
* @param {ProvingKey | undefined} fee_proving_key
|
|
899
858
|
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
859
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
860
|
+
* @returns {Promise<Transaction>}
|
|
861
|
+
*/
|
|
862
|
+
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>;
|
|
863
|
+
/**
|
|
864
|
+
* Synthesize proving and verifying keys for a program
|
|
865
|
+
*
|
|
866
|
+
* @param program {string} The program source code of the program to synthesize keys for
|
|
867
|
+
* @param function_id {string} The function to synthesize keys for
|
|
868
|
+
* @param inputs {Array} The inputs to the function
|
|
869
|
+
* @param imports {Object | undefined} The imports for the program
|
|
870
|
+
* @param {PrivateKey} private_key
|
|
871
|
+
* @param {string} program
|
|
872
|
+
* @param {string} function_id
|
|
873
|
+
* @param {Array<any>} inputs
|
|
874
|
+
* @param {object | undefined} imports
|
|
875
|
+
* @returns {Promise<KeyPair>}
|
|
876
|
+
*/
|
|
877
|
+
static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object): Promise<KeyPair>;
|
|
878
|
+
/**
|
|
879
|
+
* Join two records together to create a new record with an amount of credits equal to the sum
|
|
880
|
+
* of the credits of the two original records
|
|
881
|
+
*
|
|
882
|
+
* @param private_key The private key of the sender
|
|
883
|
+
* @param record_1 The first record to combine
|
|
884
|
+
* @param record_2 The second record to combine
|
|
885
|
+
* @param fee_credits The amount of credits to pay as a fee
|
|
886
|
+
* @param fee_record The record to spend the fee from
|
|
887
|
+
* @param url The url of the Aleo network node to send the transaction to
|
|
888
|
+
* @param join_proving_key (optional) Provide a proving key to use for the join function
|
|
889
|
+
* @param join_verifying_key (optional) Provide a verifying key to use for the join function
|
|
890
|
+
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
891
|
+
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
892
|
+
* @returns {Transaction | Error} Transaction object
|
|
893
|
+
* @param {PrivateKey} private_key
|
|
894
|
+
* @param {RecordPlaintext} record_1
|
|
895
|
+
* @param {RecordPlaintext} record_2
|
|
896
|
+
* @param {number} fee_credits
|
|
897
|
+
* @param {RecordPlaintext | undefined} fee_record
|
|
898
|
+
* @param {string | undefined} url
|
|
899
|
+
* @param {ProvingKey | undefined} join_proving_key
|
|
900
|
+
* @param {VerifyingKey | undefined} join_verifying_key
|
|
901
|
+
* @param {ProvingKey | undefined} fee_proving_key
|
|
902
|
+
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
903
|
+
* @param {OfflineQuery | undefined} offline_query
|
|
900
904
|
* @returns {Promise<Transaction>}
|
|
901
905
|
*/
|
|
902
|
-
|
|
906
|
+
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>;
|
|
903
907
|
}
|
|
904
908
|
/**
|
|
905
909
|
* Proving key for a function within an Aleo program
|
|
@@ -907,6 +911,20 @@ export class ProgramManager {
|
|
|
907
911
|
export class ProvingKey {
|
|
908
912
|
free(): void;
|
|
909
913
|
/**
|
|
914
|
+
* Return the checksum of the proving key
|
|
915
|
+
*
|
|
916
|
+
* @returns {string} Checksum of the proving key
|
|
917
|
+
* @returns {string}
|
|
918
|
+
*/
|
|
919
|
+
checksum(): string;
|
|
920
|
+
/**
|
|
921
|
+
* Create a copy of the proving key
|
|
922
|
+
*
|
|
923
|
+
* @returns {ProvingKey} A copy of the proving key
|
|
924
|
+
* @returns {ProvingKey}
|
|
925
|
+
*/
|
|
926
|
+
copy(): ProvingKey;
|
|
927
|
+
/**
|
|
910
928
|
* Construct a new proving key from a byte array
|
|
911
929
|
*
|
|
912
930
|
* @param {Uint8Array} bytes Byte array representation of a proving key
|
|
@@ -916,6 +934,14 @@ export class ProvingKey {
|
|
|
916
934
|
*/
|
|
917
935
|
static fromBytes(bytes: Uint8Array): ProvingKey;
|
|
918
936
|
/**
|
|
937
|
+
* Create a proving key from string
|
|
938
|
+
*
|
|
939
|
+
* @param {string | Error} String representation of the proving key
|
|
940
|
+
* @param {string} string
|
|
941
|
+
* @returns {ProvingKey}
|
|
942
|
+
*/
|
|
943
|
+
static fromString(string: string): ProvingKey;
|
|
944
|
+
/**
|
|
919
945
|
* Return the byte representation of a proving key
|
|
920
946
|
*
|
|
921
947
|
* @returns {Uint8Array | Error} Byte array representation of a proving key
|
|
@@ -923,87 +949,247 @@ export class ProvingKey {
|
|
|
923
949
|
*/
|
|
924
950
|
toBytes(): Uint8Array;
|
|
925
951
|
/**
|
|
926
|
-
*
|
|
952
|
+
* Get a string representation of the proving key
|
|
927
953
|
*
|
|
928
|
-
* @returns {
|
|
929
|
-
* @returns {
|
|
954
|
+
* @returns {string} String representation of the proving key
|
|
955
|
+
* @returns {string}
|
|
930
956
|
*/
|
|
931
|
-
|
|
932
|
-
}
|
|
957
|
+
toString(): string;
|
|
933
958
|
/**
|
|
934
|
-
*
|
|
959
|
+
* Verify if the proving key is for the bond_public function
|
|
960
|
+
*
|
|
961
|
+
* @example
|
|
962
|
+
* const provingKey = ProvingKey.fromBytes("bond_public_proving_key.bin");
|
|
963
|
+
* provingKey.isBondPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
964
|
+
*
|
|
965
|
+
* @returns {boolean} returns true if the proving key is for the bond_public function, false if otherwise
|
|
966
|
+
* @returns {boolean}
|
|
935
967
|
*/
|
|
936
|
-
|
|
937
|
-
free(): void;
|
|
968
|
+
isBondPublicProver(): boolean;
|
|
938
969
|
/**
|
|
939
|
-
*
|
|
970
|
+
* Verify if the proving key is for the claim_unbond function
|
|
940
971
|
*
|
|
941
|
-
* @
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
972
|
+
* @example
|
|
973
|
+
* const provingKey = ProvingKey.fromBytes("claim_unbond_proving_key.bin");
|
|
974
|
+
* provingKey.isClaimUnbondProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
975
|
+
*
|
|
976
|
+
* @returns {boolean} returns true if the proving key is for the claim_unbond function, false if otherwise
|
|
977
|
+
* @returns {boolean}
|
|
945
978
|
*/
|
|
946
|
-
|
|
979
|
+
isClaimUnbondPublicProver(): boolean;
|
|
947
980
|
/**
|
|
948
|
-
*
|
|
981
|
+
* Verify if the proving key is for the fee_private function
|
|
949
982
|
*
|
|
950
|
-
* @
|
|
951
|
-
*
|
|
983
|
+
* @example
|
|
984
|
+
* const provingKey = ProvingKey.fromBytes("fee_private_proving_key.bin");
|
|
985
|
+
* provingKey.isFeePrivateProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
986
|
+
*
|
|
987
|
+
* @returns {boolean} returns true if the proving key is for the fee_private function, false if otherwise
|
|
988
|
+
* @returns {boolean}
|
|
952
989
|
*/
|
|
953
|
-
|
|
990
|
+
isFeePrivateProver(): boolean;
|
|
954
991
|
/**
|
|
955
|
-
*
|
|
956
|
-
* decrypt if the record was encrypted by the account corresponding to the view key
|
|
992
|
+
* Verify if the proving key is for the fee_public function
|
|
957
993
|
*
|
|
958
|
-
* @
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
994
|
+
* @example
|
|
995
|
+
* const provingKey = ProvingKey.fromBytes("fee_public_proving_key.bin");
|
|
996
|
+
* provingKey.isFeePublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
997
|
+
*
|
|
998
|
+
* @returns {boolean} returns true if the proving key is for the fee_public function, false if otherwise
|
|
999
|
+
* @returns {boolean}
|
|
962
1000
|
*/
|
|
963
|
-
|
|
1001
|
+
isFeePublicProver(): boolean;
|
|
964
1002
|
/**
|
|
965
|
-
*
|
|
1003
|
+
* Verify if the proving key is for the inclusion function
|
|
966
1004
|
*
|
|
967
|
-
* @
|
|
968
|
-
*
|
|
969
|
-
*
|
|
1005
|
+
* @example
|
|
1006
|
+
* const provingKey = ProvingKey.fromBytes("inclusion_proving_key.bin");
|
|
1007
|
+
* provingKey.isInclusionProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1008
|
+
*
|
|
1009
|
+
* @returns {boolean} returns true if the proving key is for the inclusion function, false if otherwise
|
|
970
1010
|
* @returns {boolean}
|
|
971
1011
|
*/
|
|
972
|
-
|
|
973
|
-
}
|
|
1012
|
+
isInclusionProver(): boolean;
|
|
974
1013
|
/**
|
|
975
|
-
*
|
|
1014
|
+
* Verify if the proving key is for the join function
|
|
1015
|
+
*
|
|
1016
|
+
* @example
|
|
1017
|
+
* const provingKey = ProvingKey.fromBytes("join_proving_key.bin");
|
|
1018
|
+
* provingKey.isJoinProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1019
|
+
*
|
|
1020
|
+
* @returns {boolean} returns true if the proving key is for the join function, false if otherwise
|
|
1021
|
+
* @returns {boolean}
|
|
976
1022
|
*/
|
|
977
|
-
|
|
978
|
-
free(): void;
|
|
1023
|
+
isJoinProver(): boolean;
|
|
979
1024
|
/**
|
|
980
|
-
*
|
|
1025
|
+
* Verify if the proving key is for the set_validator_state function
|
|
981
1026
|
*
|
|
982
|
-
* @
|
|
983
|
-
*
|
|
984
|
-
*
|
|
985
|
-
*
|
|
1027
|
+
* @example
|
|
1028
|
+
* const provingKey = ProvingKey.fromBytes("set_validator_set_proving_key.bin");
|
|
1029
|
+
* provingKey.isSetValidatorStateProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1030
|
+
*
|
|
1031
|
+
* @returns {boolean} returns true if the proving key is for the set_validator_state function, false if otherwise
|
|
1032
|
+
* @returns {boolean}
|
|
986
1033
|
*/
|
|
987
|
-
|
|
1034
|
+
isSetValidatorStateProver(): boolean;
|
|
988
1035
|
/**
|
|
989
|
-
*
|
|
1036
|
+
* Verify if the proving key is for the split function
|
|
990
1037
|
*
|
|
991
|
-
* @
|
|
992
|
-
*
|
|
1038
|
+
* @example
|
|
1039
|
+
* const provingKey = ProvingKey.fromBytes("split_proving_key.bin");
|
|
1040
|
+
* provingKey.isSplitProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1041
|
+
*
|
|
1042
|
+
* @returns {boolean} returns true if the proving key is for the split function, false if otherwise
|
|
1043
|
+
* @returns {boolean}
|
|
993
1044
|
*/
|
|
994
|
-
|
|
1045
|
+
isSplitProver(): boolean;
|
|
995
1046
|
/**
|
|
996
|
-
*
|
|
1047
|
+
* Verify if the proving key is for the transfer_private function
|
|
997
1048
|
*
|
|
998
|
-
* @
|
|
999
|
-
*
|
|
1049
|
+
* @example
|
|
1050
|
+
* const provingKey = ProvingKey.fromBytes("transfer_private_proving_key.bin");
|
|
1051
|
+
* provingKey.isTransferPrivateProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1052
|
+
*
|
|
1053
|
+
* @returns {boolean} returns true if the proving key is for the transfer_private function, false if otherwise
|
|
1054
|
+
* @returns {boolean}
|
|
1000
1055
|
*/
|
|
1001
|
-
|
|
1056
|
+
isTransferPrivateProver(): boolean;
|
|
1002
1057
|
/**
|
|
1003
|
-
*
|
|
1058
|
+
* Verify if the proving key is for the transfer_private_to_public function
|
|
1004
1059
|
*
|
|
1005
|
-
* @
|
|
1006
|
-
*
|
|
1060
|
+
* @example
|
|
1061
|
+
* const provingKey = ProvingKey.fromBytes("transfer_private_to_public_proving_key.bin");
|
|
1062
|
+
* provingKey.isTransferPrivateToPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1063
|
+
*
|
|
1064
|
+
* @returns {boolean} returns true if the proving key is for the transfer_private_to_public function, false if otherwise
|
|
1065
|
+
* @returns {boolean}
|
|
1066
|
+
*/
|
|
1067
|
+
isTransferPrivateToPublicProver(): boolean;
|
|
1068
|
+
/**
|
|
1069
|
+
* Verify if the proving key is for the transfer_public function
|
|
1070
|
+
*
|
|
1071
|
+
* @example
|
|
1072
|
+
* const provingKey = ProvingKey.fromBytes("transfer_public_proving_key.bin");
|
|
1073
|
+
* provingKey.isTransferPublicProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1074
|
+
*
|
|
1075
|
+
* @returns {boolean} returns true if the proving key is for the transfer_public function, false if otherwise
|
|
1076
|
+
* @returns {boolean}
|
|
1077
|
+
*/
|
|
1078
|
+
isTransferPublicProver(): boolean;
|
|
1079
|
+
/**
|
|
1080
|
+
* Verify if the proving key is for the transfer_public_to_private function
|
|
1081
|
+
*
|
|
1082
|
+
* @example
|
|
1083
|
+
* const provingKey = ProvingKey.fromBytes("transfer_public_to_private_proving_key.bin");
|
|
1084
|
+
* provingKey.isTransferPublicToPrivateProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1085
|
+
*
|
|
1086
|
+
* @returns {boolean} returns true if the proving key is for the transfer_public_to_private function, false if otherwise
|
|
1087
|
+
* @returns {boolean}
|
|
1088
|
+
*/
|
|
1089
|
+
isTransferPublicToPrivateProver(): boolean;
|
|
1090
|
+
/**
|
|
1091
|
+
* Verify if the proving key is for the unbond_delegator_as_validator function
|
|
1092
|
+
*
|
|
1093
|
+
* @example
|
|
1094
|
+
* const provingKey = ProvingKey.fromBytes("unbond_delegator_as_validator_proving_key.bin");
|
|
1095
|
+
* provingKey.isUnbondDelegatorAsValidatorProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1096
|
+
*
|
|
1097
|
+
* @returns {boolean} returns true if the proving key is for the unbond_delegator_as_validator function, false if otherwise
|
|
1098
|
+
* @returns {boolean}
|
|
1099
|
+
*/
|
|
1100
|
+
isUnbondDelegatorAsValidatorProver(): boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Verify if the proving key is for the unbond_delegator_as_delegator function
|
|
1103
|
+
*
|
|
1104
|
+
* @example
|
|
1105
|
+
* const provingKey = ProvingKey.fromBytes("unbond_delegator_as_delegator_proving_key.bin");
|
|
1106
|
+
* provingKey.isUnbondDelegatorAsDelegatorProver() ? console.log("Key verified") : throw new Error("Invalid key");
|
|
1107
|
+
*
|
|
1108
|
+
* @returns {boolean} returns true if the proving key is for the unbond_delegator_as_delegator function, false if otherwise
|
|
1109
|
+
* @returns {boolean}
|
|
1110
|
+
*/
|
|
1111
|
+
isUnbondPublicProver(): boolean;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Encrypted Aleo record
|
|
1115
|
+
*/
|
|
1116
|
+
export class RecordCiphertext {
|
|
1117
|
+
free(): void;
|
|
1118
|
+
/**
|
|
1119
|
+
* Create a record ciphertext from a string
|
|
1120
|
+
*
|
|
1121
|
+
* @param {string} record String representation of a record ciphertext
|
|
1122
|
+
* @returns {RecordCiphertext | Error} Record ciphertext
|
|
1123
|
+
* @param {string} record
|
|
1124
|
+
* @returns {RecordCiphertext}
|
|
1125
|
+
*/
|
|
1126
|
+
static fromString(record: string): RecordCiphertext;
|
|
1127
|
+
/**
|
|
1128
|
+
* Return the string reprensentation of the record ciphertext
|
|
1129
|
+
*
|
|
1130
|
+
* @returns {string} String representation of the record ciphertext
|
|
1131
|
+
* @returns {string}
|
|
1132
|
+
*/
|
|
1133
|
+
toString(): string;
|
|
1134
|
+
/**
|
|
1135
|
+
* Decrypt the record ciphertext into plaintext using the view key. The record will only
|
|
1136
|
+
* decrypt if the record was encrypted by the account corresponding to the view key
|
|
1137
|
+
*
|
|
1138
|
+
* @param {ViewKey} view_key View key used to decrypt the ciphertext
|
|
1139
|
+
* @returns {RecordPlaintext | Error} Record plaintext object
|
|
1140
|
+
* @param {ViewKey} view_key
|
|
1141
|
+
* @returns {RecordPlaintext}
|
|
1142
|
+
*/
|
|
1143
|
+
decrypt(view_key: ViewKey): RecordPlaintext;
|
|
1144
|
+
/**
|
|
1145
|
+
* Determines if the account corresponding to the view key is the owner of the record
|
|
1146
|
+
*
|
|
1147
|
+
* @param {ViewKey} view_key View key used to decrypt the ciphertext
|
|
1148
|
+
* @returns {boolean}
|
|
1149
|
+
* @param {ViewKey} view_key
|
|
1150
|
+
* @returns {boolean}
|
|
1151
|
+
*/
|
|
1152
|
+
isOwner(view_key: ViewKey): boolean;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Plaintext representation of an Aleo record
|
|
1156
|
+
*/
|
|
1157
|
+
export class RecordPlaintext {
|
|
1158
|
+
free(): void;
|
|
1159
|
+
/**
|
|
1160
|
+
* @param {string} program_id
|
|
1161
|
+
* @param {string} record_name
|
|
1162
|
+
* @returns {Field}
|
|
1163
|
+
*/
|
|
1164
|
+
commitment(program_id: string, record_name: string): Field;
|
|
1165
|
+
/**
|
|
1166
|
+
* Return a record plaintext from a string.
|
|
1167
|
+
*
|
|
1168
|
+
* @param {string} record String representation of a plaintext representation of an Aleo record
|
|
1169
|
+
* @returns {RecordPlaintext | Error} Record plaintext
|
|
1170
|
+
* @param {string} record
|
|
1171
|
+
* @returns {RecordPlaintext}
|
|
1172
|
+
*/
|
|
1173
|
+
static fromString(record: string): RecordPlaintext;
|
|
1174
|
+
/**
|
|
1175
|
+
* Returns the record plaintext string
|
|
1176
|
+
*
|
|
1177
|
+
* @returns {string} String representation of the record plaintext
|
|
1178
|
+
* @returns {string}
|
|
1179
|
+
*/
|
|
1180
|
+
toString(): string;
|
|
1181
|
+
/**
|
|
1182
|
+
* Returns the amount of microcredits in the record
|
|
1183
|
+
*
|
|
1184
|
+
* @returns {u64} Amount of microcredits in the record
|
|
1185
|
+
* @returns {bigint}
|
|
1186
|
+
*/
|
|
1187
|
+
microcredits(): bigint;
|
|
1188
|
+
/**
|
|
1189
|
+
* Returns the nonce of the record. This can be used to uniquely identify a record.
|
|
1190
|
+
*
|
|
1191
|
+
* @returns {string} Nonce of the record
|
|
1192
|
+
* @returns {string}
|
|
1007
1193
|
*/
|
|
1008
1194
|
nonce(): string;
|
|
1009
1195
|
/**
|
|
@@ -1044,11 +1230,6 @@ export class Signature {
|
|
|
1044
1230
|
*/
|
|
1045
1231
|
static sign_message(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): Signature;
|
|
1046
1232
|
/**
|
|
1047
|
-
* Ignore the mess below -- me testing things
|
|
1048
|
-
* Turn a message into bits
|
|
1049
|
-
*
|
|
1050
|
-
* @param {Uint8Array} message Byte representation of the message to sign
|
|
1051
|
-
* @returns {Vec<bool>} Vec of bool of the message
|
|
1052
1233
|
* Verify a signature of a message with an address
|
|
1053
1234
|
*
|
|
1054
1235
|
* @param {Address} address The address to verify the signature with
|
|
@@ -1126,6 +1307,216 @@ export class Transaction {
|
|
|
1126
1307
|
export class VerifyingKey {
|
|
1127
1308
|
free(): void;
|
|
1128
1309
|
/**
|
|
1310
|
+
* Returns the verifying key for the bond_public function
|
|
1311
|
+
*
|
|
1312
|
+
* @returns {VerifyingKey} Verifying key for the bond_public function
|
|
1313
|
+
* @returns {VerifyingKey}
|
|
1314
|
+
*/
|
|
1315
|
+
static bondPublicVerifier(): VerifyingKey;
|
|
1316
|
+
/**
|
|
1317
|
+
* Returns the verifying key for the claim_delegator function
|
|
1318
|
+
*
|
|
1319
|
+
* @returns {VerifyingKey} Verifying key for the claim_unbond_public function
|
|
1320
|
+
* @returns {VerifyingKey}
|
|
1321
|
+
*/
|
|
1322
|
+
static claimUnbondPublicVerifier(): VerifyingKey;
|
|
1323
|
+
/**
|
|
1324
|
+
* Returns the verifying key for the fee_private function
|
|
1325
|
+
*
|
|
1326
|
+
* @returns {VerifyingKey} Verifying key for the fee_private function
|
|
1327
|
+
* @returns {VerifyingKey}
|
|
1328
|
+
*/
|
|
1329
|
+
static feePrivateVerifier(): VerifyingKey;
|
|
1330
|
+
/**
|
|
1331
|
+
* Returns the verifying key for the fee_public function
|
|
1332
|
+
*
|
|
1333
|
+
* @returns {VerifyingKey} Verifying key for the fee_public function
|
|
1334
|
+
* @returns {VerifyingKey}
|
|
1335
|
+
*/
|
|
1336
|
+
static feePublicVerifier(): VerifyingKey;
|
|
1337
|
+
/**
|
|
1338
|
+
* Returns the verifying key for the inclusion function
|
|
1339
|
+
*
|
|
1340
|
+
* @returns {VerifyingKey} Verifying key for the inclusion function
|
|
1341
|
+
* @returns {VerifyingKey}
|
|
1342
|
+
*/
|
|
1343
|
+
static inclusionVerifier(): VerifyingKey;
|
|
1344
|
+
/**
|
|
1345
|
+
* Returns the verifying key for the join function
|
|
1346
|
+
*
|
|
1347
|
+
* @returns {VerifyingKey} Verifying key for the join function
|
|
1348
|
+
* @returns {VerifyingKey}
|
|
1349
|
+
*/
|
|
1350
|
+
static joinVerifier(): VerifyingKey;
|
|
1351
|
+
/**
|
|
1352
|
+
* Returns the verifying key for the set_validator_state function
|
|
1353
|
+
*
|
|
1354
|
+
* @returns {VerifyingKey} Verifying key for the set_validator_state function
|
|
1355
|
+
* @returns {VerifyingKey}
|
|
1356
|
+
*/
|
|
1357
|
+
static setValidatorStateVerifier(): VerifyingKey;
|
|
1358
|
+
/**
|
|
1359
|
+
* Returns the verifying key for the split function
|
|
1360
|
+
*
|
|
1361
|
+
* @returns {VerifyingKey} Verifying key for the split function
|
|
1362
|
+
* @returns {VerifyingKey}
|
|
1363
|
+
*/
|
|
1364
|
+
static splitVerifier(): VerifyingKey;
|
|
1365
|
+
/**
|
|
1366
|
+
* Returns the verifying key for the transfer_private function
|
|
1367
|
+
*
|
|
1368
|
+
* @returns {VerifyingKey} Verifying key for the transfer_private function
|
|
1369
|
+
* @returns {VerifyingKey}
|
|
1370
|
+
*/
|
|
1371
|
+
static transferPrivateVerifier(): VerifyingKey;
|
|
1372
|
+
/**
|
|
1373
|
+
* Returns the verifying key for the transfer_private_to_public function
|
|
1374
|
+
*
|
|
1375
|
+
* @returns {VerifyingKey} Verifying key for the transfer_private_to_public function
|
|
1376
|
+
* @returns {VerifyingKey}
|
|
1377
|
+
*/
|
|
1378
|
+
static transferPrivateToPublicVerifier(): VerifyingKey;
|
|
1379
|
+
/**
|
|
1380
|
+
* Returns the verifying key for the transfer_public function
|
|
1381
|
+
*
|
|
1382
|
+
* @returns {VerifyingKey} Verifying key for the transfer_public function
|
|
1383
|
+
* @returns {VerifyingKey}
|
|
1384
|
+
*/
|
|
1385
|
+
static transferPublicVerifier(): VerifyingKey;
|
|
1386
|
+
/**
|
|
1387
|
+
* Returns the verifying key for the transfer_public_to_private function
|
|
1388
|
+
*
|
|
1389
|
+
* @returns {VerifyingKey} Verifying key for the transfer_public_to_private function
|
|
1390
|
+
* @returns {VerifyingKey}
|
|
1391
|
+
*/
|
|
1392
|
+
static transferPublicToPrivateVerifier(): VerifyingKey;
|
|
1393
|
+
/**
|
|
1394
|
+
* Returns the verifying key for the unbond_delegator_as_delegator function
|
|
1395
|
+
*
|
|
1396
|
+
* @returns {VerifyingKey} Verifying key for the unbond_delegator_as_delegator function
|
|
1397
|
+
* @returns {VerifyingKey}
|
|
1398
|
+
*/
|
|
1399
|
+
static unbondDelegatorAsValidatorVerifier(): VerifyingKey;
|
|
1400
|
+
/**
|
|
1401
|
+
* Returns the verifying key for the unbond_delegator_as_delegator function
|
|
1402
|
+
*
|
|
1403
|
+
* @returns {VerifyingKey} Verifying key for the unbond_delegator_as_delegator function
|
|
1404
|
+
* @returns {VerifyingKey}
|
|
1405
|
+
*/
|
|
1406
|
+
static unbondPublicVerifier(): VerifyingKey;
|
|
1407
|
+
/**
|
|
1408
|
+
* Returns the verifying key for the bond_public function
|
|
1409
|
+
*
|
|
1410
|
+
* @returns {VerifyingKey} Verifying key for the bond_public function
|
|
1411
|
+
* @returns {boolean}
|
|
1412
|
+
*/
|
|
1413
|
+
isBondPublicVerifier(): boolean;
|
|
1414
|
+
/**
|
|
1415
|
+
* Verifies the verifying key is for the claim_delegator function
|
|
1416
|
+
*
|
|
1417
|
+
* @returns {bool}
|
|
1418
|
+
* @returns {boolean}
|
|
1419
|
+
*/
|
|
1420
|
+
isClaimUnbondPublicVerifier(): boolean;
|
|
1421
|
+
/**
|
|
1422
|
+
* Verifies the verifying key is for the fee_private function
|
|
1423
|
+
*
|
|
1424
|
+
* @returns {bool}
|
|
1425
|
+
* @returns {boolean}
|
|
1426
|
+
*/
|
|
1427
|
+
isFeePrivateVerifier(): boolean;
|
|
1428
|
+
/**
|
|
1429
|
+
* Verifies the verifying key is for the fee_public function
|
|
1430
|
+
*
|
|
1431
|
+
* @returns {bool}
|
|
1432
|
+
* @returns {boolean}
|
|
1433
|
+
*/
|
|
1434
|
+
isFeePublicVerifier(): boolean;
|
|
1435
|
+
/**
|
|
1436
|
+
* Verifies the verifying key is for the inclusion function
|
|
1437
|
+
*
|
|
1438
|
+
* @returns {bool}
|
|
1439
|
+
* @returns {boolean}
|
|
1440
|
+
*/
|
|
1441
|
+
isInclusionVerifier(): boolean;
|
|
1442
|
+
/**
|
|
1443
|
+
* Verifies the verifying key is for the join function
|
|
1444
|
+
*
|
|
1445
|
+
* @returns {bool}
|
|
1446
|
+
* @returns {boolean}
|
|
1447
|
+
*/
|
|
1448
|
+
isJoinVerifier(): boolean;
|
|
1449
|
+
/**
|
|
1450
|
+
* Verifies the verifying key is for the set_validator_state function
|
|
1451
|
+
*
|
|
1452
|
+
* @returns {bool}
|
|
1453
|
+
* @returns {boolean}
|
|
1454
|
+
*/
|
|
1455
|
+
isSetValidatorStateVerifier(): boolean;
|
|
1456
|
+
/**
|
|
1457
|
+
* Verifies the verifying key is for the split function
|
|
1458
|
+
*
|
|
1459
|
+
* @returns {bool}
|
|
1460
|
+
* @returns {boolean}
|
|
1461
|
+
*/
|
|
1462
|
+
isSplitVerifier(): boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
* Verifies the verifying key is for the transfer_private function
|
|
1465
|
+
*
|
|
1466
|
+
* @returns {bool}
|
|
1467
|
+
* @returns {boolean}
|
|
1468
|
+
*/
|
|
1469
|
+
isTransferPrivateVerifier(): boolean;
|
|
1470
|
+
/**
|
|
1471
|
+
* Verifies the verifying key is for the transfer_private_to_public function
|
|
1472
|
+
*
|
|
1473
|
+
* @returns {bool}
|
|
1474
|
+
* @returns {boolean}
|
|
1475
|
+
*/
|
|
1476
|
+
isTransferPrivateToPublicVerifier(): boolean;
|
|
1477
|
+
/**
|
|
1478
|
+
* Verifies the verifying key is for the transfer_public function
|
|
1479
|
+
*
|
|
1480
|
+
* @returns {bool}
|
|
1481
|
+
* @returns {boolean}
|
|
1482
|
+
*/
|
|
1483
|
+
isTransferPublicVerifier(): boolean;
|
|
1484
|
+
/**
|
|
1485
|
+
* Verifies the verifying key is for the transfer_public_to_private function
|
|
1486
|
+
*
|
|
1487
|
+
* @returns {bool}
|
|
1488
|
+
* @returns {boolean}
|
|
1489
|
+
*/
|
|
1490
|
+
isTransferPublicToPrivateVerifier(): boolean;
|
|
1491
|
+
/**
|
|
1492
|
+
* Verifies the verifying key is for the unbond_delegator_as_delegator function
|
|
1493
|
+
*
|
|
1494
|
+
* @returns {bool}
|
|
1495
|
+
* @returns {boolean}
|
|
1496
|
+
*/
|
|
1497
|
+
isUnbondDelegatorAsValidatorVerifier(): boolean;
|
|
1498
|
+
/**
|
|
1499
|
+
* Verifies the verifying key is for the unbond_public function
|
|
1500
|
+
*
|
|
1501
|
+
* @returns {bool}
|
|
1502
|
+
* @returns {boolean}
|
|
1503
|
+
*/
|
|
1504
|
+
isUnbondPublicVerifier(): boolean;
|
|
1505
|
+
/**
|
|
1506
|
+
* Get the checksum of the verifying key
|
|
1507
|
+
*
|
|
1508
|
+
* @returns {string} Checksum of the verifying key
|
|
1509
|
+
* @returns {string}
|
|
1510
|
+
*/
|
|
1511
|
+
checksum(): string;
|
|
1512
|
+
/**
|
|
1513
|
+
* Create a copy of the verifying key
|
|
1514
|
+
*
|
|
1515
|
+
* @returns {VerifyingKey} A copy of the verifying key
|
|
1516
|
+
* @returns {VerifyingKey}
|
|
1517
|
+
*/
|
|
1518
|
+
copy(): VerifyingKey;
|
|
1519
|
+
/**
|
|
1129
1520
|
* Construct a new verifying key from a byte array
|
|
1130
1521
|
*
|
|
1131
1522
|
* @param {Uint8Array} bytes Byte representation of a verifying key
|
|
@@ -1135,13 +1526,6 @@ export class VerifyingKey {
|
|
|
1135
1526
|
*/
|
|
1136
1527
|
static fromBytes(bytes: Uint8Array): VerifyingKey;
|
|
1137
1528
|
/**
|
|
1138
|
-
* Create a byte array from a verifying key
|
|
1139
|
-
*
|
|
1140
|
-
* @returns {Uint8Array | Error} Byte representation of a verifying key
|
|
1141
|
-
* @returns {Uint8Array}
|
|
1142
|
-
*/
|
|
1143
|
-
toBytes(): Uint8Array;
|
|
1144
|
-
/**
|
|
1145
1529
|
* Create a verifying key from string
|
|
1146
1530
|
*
|
|
1147
1531
|
* @param {String} string String representation of a verifying key
|
|
@@ -1151,19 +1535,19 @@ export class VerifyingKey {
|
|
|
1151
1535
|
*/
|
|
1152
1536
|
static fromString(string: string): VerifyingKey;
|
|
1153
1537
|
/**
|
|
1538
|
+
* Create a byte array from a verifying key
|
|
1539
|
+
*
|
|
1540
|
+
* @returns {Uint8Array | Error} Byte representation of a verifying key
|
|
1541
|
+
* @returns {Uint8Array}
|
|
1542
|
+
*/
|
|
1543
|
+
toBytes(): Uint8Array;
|
|
1544
|
+
/**
|
|
1154
1545
|
* Get a string representation of the verifying key
|
|
1155
1546
|
*
|
|
1156
1547
|
* @returns {String} String representation of the verifying key
|
|
1157
1548
|
* @returns {string}
|
|
1158
1549
|
*/
|
|
1159
1550
|
toString(): string;
|
|
1160
|
-
/**
|
|
1161
|
-
* Create a copy of the verifying key
|
|
1162
|
-
*
|
|
1163
|
-
* @returns {VerifyingKey} A copy of the verifying key
|
|
1164
|
-
* @returns {VerifyingKey}
|
|
1165
|
-
*/
|
|
1166
|
-
copy(): VerifyingKey;
|
|
1167
1551
|
}
|
|
1168
1552
|
/**
|
|
1169
1553
|
*/
|
|
@@ -1216,37 +1600,86 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
1216
1600
|
|
|
1217
1601
|
export interface InitOutput {
|
|
1218
1602
|
readonly memory: WebAssembly.Memory;
|
|
1219
|
-
readonly
|
|
1220
|
-
readonly
|
|
1221
|
-
readonly
|
|
1222
|
-
readonly
|
|
1223
|
-
readonly
|
|
1224
|
-
readonly
|
|
1225
|
-
readonly
|
|
1226
|
-
readonly
|
|
1603
|
+
readonly __wbg_address_free: (a: number) => void;
|
|
1604
|
+
readonly address_from_private_key: (a: number) => number;
|
|
1605
|
+
readonly address_from_view_key: (a: number) => number;
|
|
1606
|
+
readonly address_from_string: (a: number, b: number) => number;
|
|
1607
|
+
readonly address_to_string: (a: number, b: number) => void;
|
|
1608
|
+
readonly address_verify: (a: number, b: number, c: number, d: number) => number;
|
|
1609
|
+
readonly __wbg_privatekey_free: (a: number) => void;
|
|
1610
|
+
readonly privatekey_new: () => number;
|
|
1611
|
+
readonly privatekey_from_seed_unchecked: (a: number, b: number) => number;
|
|
1612
|
+
readonly privatekey_from_string: (a: number, b: number, c: number) => void;
|
|
1613
|
+
readonly privatekey_to_string: (a: number, b: number) => void;
|
|
1614
|
+
readonly privatekey_to_seed: (a: number, b: number) => void;
|
|
1615
|
+
readonly privatekey_to_view_key: (a: number) => number;
|
|
1616
|
+
readonly privatekey_sign: (a: number, b: number, c: number) => number;
|
|
1617
|
+
readonly privatekey_newEncrypted: (a: number, b: number, c: number) => void;
|
|
1618
|
+
readonly privatekey_toCiphertext: (a: number, b: number, c: number, d: number) => void;
|
|
1619
|
+
readonly privatekey_fromPrivateKeyCiphertext: (a: number, b: number, c: number, d: number) => void;
|
|
1620
|
+
readonly privatekey_to_address: (a: number) => number;
|
|
1621
|
+
readonly __wbg_provingkey_free: (a: number) => void;
|
|
1622
|
+
readonly provingkey_checksum: (a: number, b: number) => void;
|
|
1623
|
+
readonly provingkey_copy: (a: number) => number;
|
|
1624
|
+
readonly provingkey_fromBytes: (a: number, b: number, c: number) => void;
|
|
1625
|
+
readonly provingkey_fromString: (a: number, b: number, c: number) => void;
|
|
1626
|
+
readonly provingkey_toBytes: (a: number, b: number) => void;
|
|
1627
|
+
readonly provingkey_toString: (a: number, b: number) => void;
|
|
1628
|
+
readonly __wbg_keypair_free: (a: number) => void;
|
|
1629
|
+
readonly keypair_new: (a: number, b: number) => number;
|
|
1630
|
+
readonly keypair_provingKey: (a: number, b: number) => void;
|
|
1631
|
+
readonly keypair_verifyingKey: (a: number, b: number) => void;
|
|
1632
|
+
readonly __wbg_executionresponse_free: (a: number) => void;
|
|
1633
|
+
readonly executionresponse_getOutputs: (a: number) => number;
|
|
1634
|
+
readonly executionresponse_getExecution: (a: number) => number;
|
|
1635
|
+
readonly executionresponse_getKeys: (a: number, b: number) => void;
|
|
1636
|
+
readonly executionresponse_getProvingKey: (a: number) => number;
|
|
1637
|
+
readonly executionresponse_getVerifyingKey: (a: number) => number;
|
|
1638
|
+
readonly executionresponse_getFunctionId: (a: number, b: number) => void;
|
|
1639
|
+
readonly executionresponse_getProgram: (a: number) => number;
|
|
1227
1640
|
readonly __wbg_recordciphertext_free: (a: number) => void;
|
|
1228
1641
|
readonly recordciphertext_fromString: (a: number, b: number, c: number) => void;
|
|
1229
1642
|
readonly recordciphertext_toString: (a: number, b: number) => void;
|
|
1230
1643
|
readonly recordciphertext_decrypt: (a: number, b: number, c: number) => void;
|
|
1231
1644
|
readonly recordciphertext_isOwner: (a: number, b: number) => number;
|
|
1232
|
-
readonly initThreadPool: (a: number, b: number) => number;
|
|
1233
|
-
readonly init_panic_hook: () => void;
|
|
1234
|
-
readonly __wbg_keypair_free: (a: number) => void;
|
|
1235
|
-
readonly keypair_new: (a: number, b: number) => number;
|
|
1236
|
-
readonly keypair_provingKey: (a: number, b: number) => void;
|
|
1237
|
-
readonly keypair_verifyingKey: (a: number, b: number) => void;
|
|
1238
1645
|
readonly __wbg_jsfield_free: (a: number) => void;
|
|
1239
1646
|
readonly jsfield_generate_message_leo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1240
1647
|
readonly jsfield_generate_message_clients: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1241
|
-
readonly programmanager_buildSplitTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
1242
|
-
readonly
|
|
1243
|
-
readonly
|
|
1244
|
-
readonly
|
|
1245
|
-
readonly
|
|
1246
|
-
readonly
|
|
1247
|
-
readonly
|
|
1248
|
-
readonly
|
|
1249
|
-
readonly
|
|
1648
|
+
readonly programmanager_buildSplitTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
1649
|
+
readonly __wbg_recordplaintext_free: (a: number) => void;
|
|
1650
|
+
readonly recordplaintext_commitment: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1651
|
+
readonly recordplaintext_fromString: (a: number, b: number, c: number) => void;
|
|
1652
|
+
readonly recordplaintext_toString: (a: number, b: number) => void;
|
|
1653
|
+
readonly recordplaintext_microcredits: (a: number) => number;
|
|
1654
|
+
readonly recordplaintext_nonce: (a: number, b: number) => void;
|
|
1655
|
+
readonly recordplaintext_serialNumberString: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1656
|
+
readonly __wbg_offlinequery_free: (a: number) => void;
|
|
1657
|
+
readonly offlinequery_new: (a: number, b: number, c: number) => void;
|
|
1658
|
+
readonly offlinequery_addStatePath: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1659
|
+
readonly offlinequery_toString: (a: number, b: number) => void;
|
|
1660
|
+
readonly offlinequery_fromString: (a: number, b: number, c: number) => void;
|
|
1661
|
+
readonly provingkey_isBondPublicProver: (a: number) => number;
|
|
1662
|
+
readonly provingkey_isClaimUnbondPublicProver: (a: number) => number;
|
|
1663
|
+
readonly provingkey_isFeePrivateProver: (a: number) => number;
|
|
1664
|
+
readonly provingkey_isFeePublicProver: (a: number) => number;
|
|
1665
|
+
readonly provingkey_isInclusionProver: (a: number) => number;
|
|
1666
|
+
readonly provingkey_isJoinProver: (a: number) => number;
|
|
1667
|
+
readonly provingkey_isSetValidatorStateProver: (a: number) => number;
|
|
1668
|
+
readonly provingkey_isSplitProver: (a: number) => number;
|
|
1669
|
+
readonly provingkey_isTransferPrivateProver: (a: number) => number;
|
|
1670
|
+
readonly provingkey_isTransferPrivateToPublicProver: (a: number) => number;
|
|
1671
|
+
readonly provingkey_isTransferPublicProver: (a: number) => number;
|
|
1672
|
+
readonly provingkey_isTransferPublicToPrivateProver: (a: number) => number;
|
|
1673
|
+
readonly provingkey_isUnbondDelegatorAsValidatorProver: (a: number) => number;
|
|
1674
|
+
readonly provingkey_isUnbondPublicProver: (a: number) => number;
|
|
1675
|
+
readonly __wbg_privatekeyciphertext_free: (a: number) => void;
|
|
1676
|
+
readonly privatekeyciphertext_encryptPrivateKey: (a: number, b: number, c: number, d: number) => void;
|
|
1677
|
+
readonly privatekeyciphertext_decryptToPrivateKey: (a: number, b: number, c: number, d: number) => void;
|
|
1678
|
+
readonly privatekeyciphertext_toString: (a: number, b: number) => void;
|
|
1679
|
+
readonly privatekeyciphertext_fromString: (a: number, b: number, c: number) => void;
|
|
1680
|
+
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;
|
|
1681
|
+
readonly programmanager_estimateDeploymentFee: (a: number, b: number, c: number) => number;
|
|
1682
|
+
readonly programmanager_estimateProgramNameCost: (a: number, b: number, c: number) => void;
|
|
1250
1683
|
readonly __wbg_program_free: (a: number) => void;
|
|
1251
1684
|
readonly program_fromString: (a: number, b: number, c: number) => void;
|
|
1252
1685
|
readonly program_toString: (a: number, b: number) => void;
|
|
@@ -1260,69 +1693,74 @@ export interface InitOutput {
|
|
|
1260
1693
|
readonly program_id: (a: number, b: number) => void;
|
|
1261
1694
|
readonly program_isEqual: (a: number, b: number) => number;
|
|
1262
1695
|
readonly program_getImports: (a: number) => number;
|
|
1263
|
-
readonly
|
|
1264
|
-
readonly
|
|
1265
|
-
readonly
|
|
1266
|
-
readonly
|
|
1267
|
-
readonly
|
|
1268
|
-
readonly
|
|
1269
|
-
readonly
|
|
1270
|
-
readonly
|
|
1271
|
-
readonly
|
|
1272
|
-
readonly
|
|
1273
|
-
readonly
|
|
1274
|
-
readonly
|
|
1275
|
-
readonly
|
|
1276
|
-
readonly
|
|
1277
|
-
readonly
|
|
1278
|
-
readonly
|
|
1279
|
-
readonly
|
|
1280
|
-
readonly
|
|
1281
|
-
readonly
|
|
1282
|
-
readonly
|
|
1283
|
-
readonly
|
|
1284
|
-
readonly
|
|
1285
|
-
readonly
|
|
1286
|
-
readonly
|
|
1287
|
-
readonly
|
|
1696
|
+
readonly verifyingkey_bondPublicVerifier: () => number;
|
|
1697
|
+
readonly verifyingkey_claimUnbondPublicVerifier: () => number;
|
|
1698
|
+
readonly verifyingkey_feePrivateVerifier: () => number;
|
|
1699
|
+
readonly verifyingkey_feePublicVerifier: () => number;
|
|
1700
|
+
readonly verifyingkey_inclusionVerifier: () => number;
|
|
1701
|
+
readonly verifyingkey_joinVerifier: () => number;
|
|
1702
|
+
readonly verifyingkey_setValidatorStateVerifier: () => number;
|
|
1703
|
+
readonly verifyingkey_splitVerifier: () => number;
|
|
1704
|
+
readonly verifyingkey_transferPrivateVerifier: () => number;
|
|
1705
|
+
readonly verifyingkey_transferPrivateToPublicVerifier: () => number;
|
|
1706
|
+
readonly verifyingkey_transferPublicVerifier: () => number;
|
|
1707
|
+
readonly verifyingkey_transferPublicToPrivateVerifier: () => number;
|
|
1708
|
+
readonly verifyingkey_unbondDelegatorAsValidatorVerifier: () => number;
|
|
1709
|
+
readonly verifyingkey_unbondPublicVerifier: () => number;
|
|
1710
|
+
readonly verifyingkey_isBondPublicVerifier: (a: number) => number;
|
|
1711
|
+
readonly verifyingkey_isClaimUnbondPublicVerifier: (a: number) => number;
|
|
1712
|
+
readonly verifyingkey_isFeePrivateVerifier: (a: number) => number;
|
|
1713
|
+
readonly verifyingkey_isFeePublicVerifier: (a: number) => number;
|
|
1714
|
+
readonly verifyingkey_isInclusionVerifier: (a: number) => number;
|
|
1715
|
+
readonly verifyingkey_isJoinVerifier: (a: number) => number;
|
|
1716
|
+
readonly verifyingkey_isSetValidatorStateVerifier: (a: number) => number;
|
|
1717
|
+
readonly verifyingkey_isSplitVerifier: (a: number) => number;
|
|
1718
|
+
readonly verifyingkey_isTransferPrivateVerifier: (a: number) => number;
|
|
1719
|
+
readonly verifyingkey_isTransferPrivateToPublicVerifier: (a: number) => number;
|
|
1720
|
+
readonly verifyingkey_isTransferPublicVerifier: (a: number) => number;
|
|
1721
|
+
readonly verifyingkey_isTransferPublicToPrivateVerifier: (a: number) => number;
|
|
1722
|
+
readonly verifyingkey_isUnbondDelegatorAsValidatorVerifier: (a: number) => number;
|
|
1723
|
+
readonly verifyingkey_isUnbondPublicVerifier: (a: number) => number;
|
|
1724
|
+
readonly __wbg_verifyingkey_free: (a: number) => void;
|
|
1725
|
+
readonly verifyingkey_checksum: (a: number, b: number) => void;
|
|
1726
|
+
readonly verifyingkey_copy: (a: number) => number;
|
|
1727
|
+
readonly verifyingkey_fromBytes: (a: number, b: number, c: number) => void;
|
|
1728
|
+
readonly verifyingkey_fromString: (a: number, b: number, c: number) => void;
|
|
1729
|
+
readonly verifyingkey_toBytes: (a: number, b: number) => void;
|
|
1730
|
+
readonly verifyingkey_toString: (a: number, b: number) => void;
|
|
1731
|
+
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;
|
|
1732
|
+
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;
|
|
1733
|
+
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;
|
|
1734
|
+
readonly programmanager_estimateFinalizeFee: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1735
|
+
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;
|
|
1736
|
+
readonly programmanager_synthesizeKeyPair: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
1737
|
+
readonly __wbg_programmanager_free: (a: number) => void;
|
|
1288
1738
|
readonly viewkey_from_private_key: (a: number) => number;
|
|
1289
1739
|
readonly viewkey_from_string: (a: number, b: number) => number;
|
|
1290
1740
|
readonly viewkey_to_string: (a: number, b: number) => void;
|
|
1291
1741
|
readonly viewkey_to_address: (a: number) => number;
|
|
1292
1742
|
readonly viewkey_decrypt: (a: number, b: number, c: number, d: number) => void;
|
|
1743
|
+
readonly __wbg_execution_free: (a: number) => void;
|
|
1744
|
+
readonly execution_toString: (a: number, b: number) => void;
|
|
1745
|
+
readonly execution_fromString: (a: number, b: number, c: number) => void;
|
|
1746
|
+
readonly verifyFunctionExecution: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1747
|
+
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;
|
|
1293
1748
|
readonly __wbg_transaction_free: (a: number) => void;
|
|
1294
1749
|
readonly transaction_fromString: (a: number, b: number, c: number) => void;
|
|
1295
1750
|
readonly transaction_toString: (a: number, b: number) => void;
|
|
1296
1751
|
readonly transaction_transactionId: (a: number, b: number) => void;
|
|
1297
1752
|
readonly transaction_transactionType: (a: number, b: number) => void;
|
|
1298
|
-
readonly
|
|
1299
|
-
readonly
|
|
1300
|
-
readonly
|
|
1301
|
-
readonly
|
|
1302
|
-
readonly
|
|
1303
|
-
readonly
|
|
1304
|
-
readonly
|
|
1305
|
-
readonly
|
|
1306
|
-
readonly
|
|
1307
|
-
readonly
|
|
1308
|
-
readonly
|
|
1309
|
-
readonly __wbg_verifyingkey_free: (a: number) => void;
|
|
1310
|
-
readonly verifyingkey_fromBytes: (a: number, b: number, c: number) => void;
|
|
1311
|
-
readonly verifyingkey_toBytes: (a: number, b: number) => void;
|
|
1312
|
-
readonly verifyingkey_fromString: (a: number, b: number, c: number) => void;
|
|
1313
|
-
readonly verifyingkey_toString: (a: number, b: number) => void;
|
|
1314
|
-
readonly verifyingkey_copy: (a: number) => number;
|
|
1315
|
-
readonly __wbg_privatekey_free: (a: number) => void;
|
|
1316
|
-
readonly privatekey_new: () => number;
|
|
1317
|
-
readonly privatekey_from_seed_unchecked: (a: number, b: number) => number;
|
|
1318
|
-
readonly privatekey_from_string: (a: number, b: number, c: number) => void;
|
|
1319
|
-
readonly privatekey_to_string: (a: number, b: number) => void;
|
|
1320
|
-
readonly privatekey_to_view_key: (a: number) => number;
|
|
1321
|
-
readonly privatekey_to_address: (a: number) => number;
|
|
1322
|
-
readonly privatekey_sign: (a: number, b: number, c: number) => number;
|
|
1323
|
-
readonly privatekey_newEncrypted: (a: number, b: number, c: number) => void;
|
|
1324
|
-
readonly privatekey_toCiphertext: (a: number, b: number, c: number, d: number) => void;
|
|
1325
|
-
readonly privatekey_fromPrivateKeyCiphertext: (a: number, b: number, c: number, d: number) => void;
|
|
1753
|
+
readonly __wbg_field_free: (a: number) => void;
|
|
1754
|
+
readonly field_toString: (a: number, b: number) => void;
|
|
1755
|
+
readonly field_fromString: (a: number, b: number, c: number) => void;
|
|
1756
|
+
readonly init_panic_hook: () => void;
|
|
1757
|
+
readonly __wbg_viewkey_free: (a: number) => void;
|
|
1758
|
+
readonly __wbg_signature_free: (a: number) => void;
|
|
1759
|
+
readonly signature_sign: (a: number, b: number, c: number) => number;
|
|
1760
|
+
readonly signature_sign_message: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1761
|
+
readonly signature_verify: (a: number, b: number, c: number, d: number) => number;
|
|
1762
|
+
readonly signature_from_string: (a: number, b: number) => number;
|
|
1763
|
+
readonly signature_to_string: (a: number, b: number) => void;
|
|
1326
1764
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
1327
1765
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
1328
1766
|
readonly __wbindgen_export_2: WebAssembly.Table;
|