@puzzlehq/aleo-wasm-web 0.6.8 → 0.6.9
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 +148 -628
- package/aleo_wasm.js +475 -1230
- package/aleo_wasm_bg.wasm +0 -0
- package/package.json +4 -3
- package/snippets/aleo-wasm-91297d530eb26bda/inline0.js +27 -0
package/aleo_wasm.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
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
|
+
/**
|
|
4
13
|
* Verify an execution with a single function and a single transition. Executions with multiple
|
|
5
14
|
* transitions or functions will fail to verify. Also, this does not verify that the state root of
|
|
6
15
|
* the execution is included in the Aleo Network ledger.
|
|
@@ -18,8 +27,9 @@
|
|
|
18
27
|
*/
|
|
19
28
|
export function verifyFunctionExecution(execution: Execution, verifying_key: VerifyingKey, program: Program, function_id: string): boolean;
|
|
20
29
|
/**
|
|
30
|
+
* @param {number} receiver
|
|
21
31
|
*/
|
|
22
|
-
export function
|
|
32
|
+
export function runRayonThread(receiver: number): void;
|
|
23
33
|
/**
|
|
24
34
|
* Public address of an Aleo account
|
|
25
35
|
*/
|
|
@@ -72,7 +82,7 @@ export class Address {
|
|
|
72
82
|
verify(message: Uint8Array, signature: Signature): boolean;
|
|
73
83
|
}
|
|
74
84
|
/**
|
|
75
|
-
*
|
|
85
|
+
* A program that can be executed on the Aleo blockchain.
|
|
76
86
|
*/
|
|
77
87
|
export class Execution {
|
|
78
88
|
free(): void;
|
|
@@ -104,57 +114,21 @@ export class ExecutionResponse {
|
|
|
104
114
|
*/
|
|
105
115
|
getOutputs(): Array<any>;
|
|
106
116
|
/**
|
|
107
|
-
* Returns the execution object if present, null if otherwise.
|
|
117
|
+
* Returns the execution object if present, null if otherwise. Please note that this function
|
|
118
|
+
* removes the WebAssembly object from the response object and will return null if called a
|
|
119
|
+
* second time.
|
|
108
120
|
*
|
|
109
|
-
* @returns {Execution
|
|
121
|
+
* @returns {Execution} The execution object if present, null if otherwise
|
|
110
122
|
* @returns {Execution | undefined}
|
|
111
123
|
*/
|
|
112
124
|
getExecution(): Execution | undefined;
|
|
113
125
|
/**
|
|
114
126
|
* Returns the program keys if present
|
|
127
|
+
* @param {string} program_id
|
|
128
|
+
* @param {string} function_name
|
|
115
129
|
* @returns {KeyPair}
|
|
116
130
|
*/
|
|
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;
|
|
131
|
+
getKeys(program_id: string, function_name: string): KeyPair;
|
|
158
132
|
}
|
|
159
133
|
/**
|
|
160
134
|
*/
|
|
@@ -176,7 +150,6 @@ export class JsField {
|
|
|
176
150
|
static generate_message_clients(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): string;
|
|
177
151
|
}
|
|
178
152
|
/**
|
|
179
|
-
* Key pair object containing both the function proving and verifying keys
|
|
180
153
|
*/
|
|
181
154
|
export class KeyPair {
|
|
182
155
|
free(): void;
|
|
@@ -206,38 +179,6 @@ export class KeyPair {
|
|
|
206
179
|
verifyingKey(): VerifyingKey;
|
|
207
180
|
}
|
|
208
181
|
/**
|
|
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
|
-
/**
|
|
241
182
|
* Private key of an Aleo account
|
|
242
183
|
*/
|
|
243
184
|
export class PrivateKey {
|
|
@@ -383,6 +324,10 @@ export class PrivateKeyCiphertext {
|
|
|
383
324
|
}
|
|
384
325
|
/**
|
|
385
326
|
* Webassembly Representation of an Aleo program
|
|
327
|
+
*
|
|
328
|
+
* This object is required to create an Execution or Deployment transaction. It includes several
|
|
329
|
+
* convenience methods for enumerating available functions and each functions' inputs in a
|
|
330
|
+
* javascript object for usage in creation of web forms for input capture.
|
|
386
331
|
*/
|
|
387
332
|
export class Program {
|
|
388
333
|
free(): void;
|
|
@@ -634,6 +579,34 @@ export class Program {
|
|
|
634
579
|
export class ProgramManager {
|
|
635
580
|
free(): void;
|
|
636
581
|
/**
|
|
582
|
+
* Join two records together to create a new record with an amount of credits equal to the sum
|
|
583
|
+
* of the credits of the two original records
|
|
584
|
+
*
|
|
585
|
+
* @param private_key The private key of the sender
|
|
586
|
+
* @param record_1 The first record to combine
|
|
587
|
+
* @param record_2 The second record to combine
|
|
588
|
+
* @param fee_credits The amount of credits to pay as a fee
|
|
589
|
+
* @param fee_record The record to spend the fee from
|
|
590
|
+
* @param url The url of the Aleo network node to send the transaction to
|
|
591
|
+
* @param join_proving_key (optional) Provide a proving key to use for the join function
|
|
592
|
+
* @param join_verifying_key (optional) Provide a verifying key to use for the join function
|
|
593
|
+
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
594
|
+
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
595
|
+
* @returns {Transaction | Error} Transaction object
|
|
596
|
+
* @param {PrivateKey} private_key
|
|
597
|
+
* @param {RecordPlaintext} record_1
|
|
598
|
+
* @param {RecordPlaintext} record_2
|
|
599
|
+
* @param {number} fee_credits
|
|
600
|
+
* @param {RecordPlaintext | undefined} fee_record
|
|
601
|
+
* @param {string} url
|
|
602
|
+
* @param {ProvingKey | undefined} join_proving_key
|
|
603
|
+
* @param {VerifyingKey | undefined} join_verifying_key
|
|
604
|
+
* @param {ProvingKey | undefined} fee_proving_key
|
|
605
|
+
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
606
|
+
* @returns {Promise<Transaction>}
|
|
607
|
+
*/
|
|
608
|
+
static buildJoinTransaction(private_key: PrivateKey, record_1: RecordPlaintext, record_2: RecordPlaintext, fee_credits: number, fee_record: RecordPlaintext | undefined, url: string, join_proving_key?: ProvingKey, join_verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey): Promise<Transaction>;
|
|
609
|
+
/**
|
|
637
610
|
* Split an Aleo credits record into two separate records. This function does not require a fee.
|
|
638
611
|
*
|
|
639
612
|
* @param private_key The private key of the sender
|
|
@@ -647,13 +620,12 @@ export class ProgramManager {
|
|
|
647
620
|
* @param {PrivateKey} private_key
|
|
648
621
|
* @param {number} split_amount
|
|
649
622
|
* @param {RecordPlaintext} amount_record
|
|
650
|
-
* @param {string
|
|
623
|
+
* @param {string} url
|
|
651
624
|
* @param {ProvingKey | undefined} split_proving_key
|
|
652
625
|
* @param {VerifyingKey | undefined} split_verifying_key
|
|
653
|
-
* @param {OfflineQuery | undefined} offline_query
|
|
654
626
|
* @returns {Promise<Transaction>}
|
|
655
627
|
*/
|
|
656
|
-
static buildSplitTransaction(private_key: PrivateKey, split_amount: number, amount_record: RecordPlaintext, url
|
|
628
|
+
static buildSplitTransaction(private_key: PrivateKey, split_amount: number, amount_record: RecordPlaintext, url: string, split_proving_key?: ProvingKey, split_verifying_key?: VerifyingKey): Promise<Transaction>;
|
|
657
629
|
/**
|
|
658
630
|
* Deploy an Aleo program
|
|
659
631
|
*
|
|
@@ -676,14 +648,13 @@ export class ProgramManager {
|
|
|
676
648
|
* @param {string} program
|
|
677
649
|
* @param {number} fee_credits
|
|
678
650
|
* @param {RecordPlaintext | undefined} fee_record
|
|
679
|
-
* @param {string
|
|
651
|
+
* @param {string} url
|
|
680
652
|
* @param {object | undefined} imports
|
|
681
653
|
* @param {ProvingKey | undefined} fee_proving_key
|
|
682
654
|
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
683
|
-
* @param {OfflineQuery | undefined} offline_query
|
|
684
655
|
* @returns {Promise<Transaction>}
|
|
685
656
|
*/
|
|
686
|
-
static buildDeploymentTransaction(private_key: PrivateKey, program: string, fee_credits: number, fee_record
|
|
657
|
+
static buildDeploymentTransaction(private_key: PrivateKey, program: string, fee_credits: number, fee_record: RecordPlaintext | undefined, url: string, imports?: object, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey): Promise<Transaction>;
|
|
687
658
|
/**
|
|
688
659
|
* Estimate the fee for a program deployment
|
|
689
660
|
*
|
|
@@ -713,6 +684,15 @@ export class ProgramManager {
|
|
|
713
684
|
*/
|
|
714
685
|
static estimateProgramNameCost(name: string): bigint;
|
|
715
686
|
/**
|
|
687
|
+
* @param {string} program
|
|
688
|
+
* @param {string} function_id
|
|
689
|
+
* @param {Array<any>} inputs_str
|
|
690
|
+
* @param {string} private_key
|
|
691
|
+
* @param {object | undefined} imports
|
|
692
|
+
* @returns {Promise<string>}
|
|
693
|
+
*/
|
|
694
|
+
static authExecute(program: string, function_id: string, inputs_str: Array<any>, private_key: string, imports?: object): Promise<string>;
|
|
695
|
+
/**
|
|
716
696
|
* Execute an arbitrary function locally
|
|
717
697
|
*
|
|
718
698
|
* @param {PrivateKey} private_key The private key of the sender
|
|
@@ -740,11 +720,9 @@ export class ProgramManager {
|
|
|
740
720
|
* @param {object | undefined} imports
|
|
741
721
|
* @param {ProvingKey | undefined} proving_key
|
|
742
722
|
* @param {VerifyingKey | undefined} verifying_key
|
|
743
|
-
* @param {string | undefined} url
|
|
744
|
-
* @param {OfflineQuery | undefined} offline_query
|
|
745
723
|
* @returns {Promise<ExecutionResponse>}
|
|
746
724
|
*/
|
|
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
|
|
725
|
+
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): Promise<ExecutionResponse>;
|
|
748
726
|
/**
|
|
749
727
|
* Execute Aleo function and create an Aleo execution transaction
|
|
750
728
|
*
|
|
@@ -773,16 +751,15 @@ export class ProgramManager {
|
|
|
773
751
|
* @param {Array<any>} inputs
|
|
774
752
|
* @param {number} fee_credits
|
|
775
753
|
* @param {RecordPlaintext | undefined} fee_record
|
|
776
|
-
* @param {string
|
|
754
|
+
* @param {string} url
|
|
777
755
|
* @param {object | undefined} imports
|
|
778
756
|
* @param {ProvingKey | undefined} proving_key
|
|
779
757
|
* @param {VerifyingKey | undefined} verifying_key
|
|
780
758
|
* @param {ProvingKey | undefined} fee_proving_key
|
|
781
759
|
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
782
|
-
* @param {OfflineQuery | undefined} offline_query
|
|
783
760
|
* @returns {Promise<Transaction>}
|
|
784
761
|
*/
|
|
785
|
-
static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, fee_credits: number, fee_record
|
|
762
|
+
static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, fee_credits: number, fee_record: RecordPlaintext | undefined, url: string, imports?: object, proving_key?: ProvingKey, verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey): Promise<Transaction>;
|
|
786
763
|
/**
|
|
787
764
|
* Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
|
|
788
765
|
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
@@ -805,14 +782,13 @@ export class ProgramManager {
|
|
|
805
782
|
* @param {string} program
|
|
806
783
|
* @param {string} _function
|
|
807
784
|
* @param {Array<any>} inputs
|
|
808
|
-
* @param {string
|
|
785
|
+
* @param {string} url
|
|
809
786
|
* @param {object | undefined} imports
|
|
810
787
|
* @param {ProvingKey | undefined} proving_key
|
|
811
788
|
* @param {VerifyingKey | undefined} verifying_key
|
|
812
|
-
* @param {OfflineQuery | undefined} offline_query
|
|
813
789
|
* @returns {Promise<bigint>}
|
|
814
790
|
*/
|
|
815
|
-
static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url
|
|
791
|
+
static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url: string, imports?: object, proving_key?: ProvingKey, verifying_key?: VerifyingKey): Promise<bigint>;
|
|
816
792
|
/**
|
|
817
793
|
* Estimate the finalize fee component for executing a function. This fee is additional to the
|
|
818
794
|
* size of the execution of the program in bytes. If the function does not have a finalize
|
|
@@ -851,15 +827,14 @@ export class ProgramManager {
|
|
|
851
827
|
* @param {RecordPlaintext | undefined} amount_record
|
|
852
828
|
* @param {number} fee_credits
|
|
853
829
|
* @param {RecordPlaintext | undefined} fee_record
|
|
854
|
-
* @param {string
|
|
830
|
+
* @param {string} url
|
|
855
831
|
* @param {ProvingKey | undefined} transfer_proving_key
|
|
856
832
|
* @param {VerifyingKey | undefined} transfer_verifying_key
|
|
857
833
|
* @param {ProvingKey | undefined} fee_proving_key
|
|
858
834
|
* @param {VerifyingKey | undefined} fee_verifying_key
|
|
859
|
-
* @param {OfflineQuery | undefined} offline_query
|
|
860
835
|
* @returns {Promise<Transaction>}
|
|
861
836
|
*/
|
|
862
|
-
static buildTransferTransaction(private_key: PrivateKey, amount_credits: number, recipient: string, transfer_type: string, amount_record: RecordPlaintext | undefined, fee_credits: number, fee_record
|
|
837
|
+
static buildTransferTransaction(private_key: PrivateKey, amount_credits: number, recipient: string, transfer_type: string, amount_record: RecordPlaintext | undefined, fee_credits: number, fee_record: RecordPlaintext | undefined, url: string, transfer_proving_key?: ProvingKey, transfer_verifying_key?: VerifyingKey, fee_proving_key?: ProvingKey, fee_verifying_key?: VerifyingKey): Promise<Transaction>;
|
|
863
838
|
/**
|
|
864
839
|
* Synthesize proving and verifying keys for a program
|
|
865
840
|
*
|
|
@@ -875,35 +850,6 @@ export class ProgramManager {
|
|
|
875
850
|
* @returns {Promise<KeyPair>}
|
|
876
851
|
*/
|
|
877
852
|
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
|
|
904
|
-
* @returns {Promise<Transaction>}
|
|
905
|
-
*/
|
|
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>;
|
|
907
853
|
}
|
|
908
854
|
/**
|
|
909
855
|
* Proving key for a function within an Aleo program
|
|
@@ -911,20 +857,6 @@ export class ProgramManager {
|
|
|
911
857
|
export class ProvingKey {
|
|
912
858
|
free(): void;
|
|
913
859
|
/**
|
|
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
|
-
/**
|
|
928
860
|
* Construct a new proving key from a byte array
|
|
929
861
|
*
|
|
930
862
|
* @param {Uint8Array} bytes Byte array representation of a proving key
|
|
@@ -934,14 +866,6 @@ export class ProvingKey {
|
|
|
934
866
|
*/
|
|
935
867
|
static fromBytes(bytes: Uint8Array): ProvingKey;
|
|
936
868
|
/**
|
|
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
|
-
/**
|
|
945
869
|
* Return the byte representation of a proving key
|
|
946
870
|
*
|
|
947
871
|
* @returns {Uint8Array | Error} Byte array representation of a proving key
|
|
@@ -949,166 +873,12 @@ export class ProvingKey {
|
|
|
949
873
|
*/
|
|
950
874
|
toBytes(): Uint8Array;
|
|
951
875
|
/**
|
|
952
|
-
*
|
|
953
|
-
*
|
|
954
|
-
* @returns {string} String representation of the proving key
|
|
955
|
-
* @returns {string}
|
|
956
|
-
*/
|
|
957
|
-
toString(): string;
|
|
958
|
-
/**
|
|
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}
|
|
967
|
-
*/
|
|
968
|
-
isBondPublicProver(): boolean;
|
|
969
|
-
/**
|
|
970
|
-
* Verify if the proving key is for the claim_unbond function
|
|
971
|
-
*
|
|
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}
|
|
978
|
-
*/
|
|
979
|
-
isClaimUnbondPublicProver(): boolean;
|
|
980
|
-
/**
|
|
981
|
-
* Verify if the proving key is for the fee_private function
|
|
982
|
-
*
|
|
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}
|
|
989
|
-
*/
|
|
990
|
-
isFeePrivateProver(): boolean;
|
|
991
|
-
/**
|
|
992
|
-
* Verify if the proving key is for the fee_public function
|
|
993
|
-
*
|
|
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}
|
|
1000
|
-
*/
|
|
1001
|
-
isFeePublicProver(): boolean;
|
|
1002
|
-
/**
|
|
1003
|
-
* Verify if the proving key is for the inclusion function
|
|
1004
|
-
*
|
|
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
|
|
1010
|
-
* @returns {boolean}
|
|
1011
|
-
*/
|
|
1012
|
-
isInclusionProver(): boolean;
|
|
1013
|
-
/**
|
|
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}
|
|
1022
|
-
*/
|
|
1023
|
-
isJoinProver(): boolean;
|
|
1024
|
-
/**
|
|
1025
|
-
* Verify if the proving key is for the set_validator_state function
|
|
1026
|
-
*
|
|
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}
|
|
1033
|
-
*/
|
|
1034
|
-
isSetValidatorStateProver(): boolean;
|
|
1035
|
-
/**
|
|
1036
|
-
* Verify if the proving key is for the split function
|
|
1037
|
-
*
|
|
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}
|
|
1044
|
-
*/
|
|
1045
|
-
isSplitProver(): boolean;
|
|
1046
|
-
/**
|
|
1047
|
-
* Verify if the proving key is for the transfer_private function
|
|
1048
|
-
*
|
|
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}
|
|
1055
|
-
*/
|
|
1056
|
-
isTransferPrivateProver(): boolean;
|
|
1057
|
-
/**
|
|
1058
|
-
* Verify if the proving key is for the transfer_private_to_public function
|
|
1059
|
-
*
|
|
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");
|
|
876
|
+
* Create a copy of the proving key
|
|
1107
877
|
*
|
|
1108
|
-
* @returns {
|
|
1109
|
-
* @returns {
|
|
878
|
+
* @returns {ProvingKey} A copy of the proving key
|
|
879
|
+
* @returns {ProvingKey}
|
|
1110
880
|
*/
|
|
1111
|
-
|
|
881
|
+
copy(): ProvingKey;
|
|
1112
882
|
}
|
|
1113
883
|
/**
|
|
1114
884
|
* Encrypted Aleo record
|
|
@@ -1157,12 +927,6 @@ export class RecordCiphertext {
|
|
|
1157
927
|
export class RecordPlaintext {
|
|
1158
928
|
free(): void;
|
|
1159
929
|
/**
|
|
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
930
|
* Return a record plaintext from a string.
|
|
1167
931
|
*
|
|
1168
932
|
* @param {string} record String representation of a plaintext representation of an Aleo record
|
|
@@ -1230,6 +994,11 @@ export class Signature {
|
|
|
1230
994
|
*/
|
|
1231
995
|
static sign_message(private_key: PrivateKey, message: Uint8Array, seed: Uint8Array): Signature;
|
|
1232
996
|
/**
|
|
997
|
+
* Ignore the mess below -- me testing things
|
|
998
|
+
* Turn a message into bits
|
|
999
|
+
*
|
|
1000
|
+
* @param {Uint8Array} message Byte representation of the message to sign
|
|
1001
|
+
* @returns {Vec<bool>} Vec of bool of the message
|
|
1233
1002
|
* Verify a signature of a message with an address
|
|
1234
1003
|
*
|
|
1235
1004
|
* @param {Address} address The address to verify the signature with
|
|
@@ -1307,216 +1076,6 @@ export class Transaction {
|
|
|
1307
1076
|
export class VerifyingKey {
|
|
1308
1077
|
free(): void;
|
|
1309
1078
|
/**
|
|
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
|
-
/**
|
|
1520
1079
|
* Construct a new verifying key from a byte array
|
|
1521
1080
|
*
|
|
1522
1081
|
* @param {Uint8Array} bytes Byte representation of a verifying key
|
|
@@ -1526,6 +1085,13 @@ export class VerifyingKey {
|
|
|
1526
1085
|
*/
|
|
1527
1086
|
static fromBytes(bytes: Uint8Array): VerifyingKey;
|
|
1528
1087
|
/**
|
|
1088
|
+
* Create a byte array from a verifying key
|
|
1089
|
+
*
|
|
1090
|
+
* @returns {Uint8Array | Error} Byte representation of a verifying key
|
|
1091
|
+
* @returns {Uint8Array}
|
|
1092
|
+
*/
|
|
1093
|
+
toBytes(): Uint8Array;
|
|
1094
|
+
/**
|
|
1529
1095
|
* Create a verifying key from string
|
|
1530
1096
|
*
|
|
1531
1097
|
* @param {String} string String representation of a verifying key
|
|
@@ -1535,19 +1101,19 @@ export class VerifyingKey {
|
|
|
1535
1101
|
*/
|
|
1536
1102
|
static fromString(string: string): VerifyingKey;
|
|
1537
1103
|
/**
|
|
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
|
-
/**
|
|
1545
1104
|
* Get a string representation of the verifying key
|
|
1546
1105
|
*
|
|
1547
1106
|
* @returns {String} String representation of the verifying key
|
|
1548
1107
|
* @returns {string}
|
|
1549
1108
|
*/
|
|
1550
1109
|
toString(): string;
|
|
1110
|
+
/**
|
|
1111
|
+
* Create a copy of the verifying key
|
|
1112
|
+
*
|
|
1113
|
+
* @returns {VerifyingKey} A copy of the verifying key
|
|
1114
|
+
* @returns {VerifyingKey}
|
|
1115
|
+
*/
|
|
1116
|
+
copy(): VerifyingKey;
|
|
1551
1117
|
}
|
|
1552
1118
|
/**
|
|
1553
1119
|
*/
|
|
@@ -1594,6 +1160,15 @@ export class ViewKey {
|
|
|
1594
1160
|
* @returns {string}
|
|
1595
1161
|
*/
|
|
1596
1162
|
decrypt(ciphertext: string): string;
|
|
1163
|
+
/**
|
|
1164
|
+
* @param {string} ciphertext
|
|
1165
|
+
* @param {string} tpk
|
|
1166
|
+
* @param {string} program_name
|
|
1167
|
+
* @param {string} function_name
|
|
1168
|
+
* @param {number} index
|
|
1169
|
+
* @returns {string}
|
|
1170
|
+
*/
|
|
1171
|
+
decrypt_ciphertext(ciphertext: string, tpk: string, program_name: string, function_name: string, index: number): string;
|
|
1597
1172
|
}
|
|
1598
1173
|
|
|
1599
1174
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -1617,69 +1192,49 @@ export interface InitOutput {
|
|
|
1617
1192
|
readonly privatekey_newEncrypted: (a: number, b: number, c: number) => void;
|
|
1618
1193
|
readonly privatekey_toCiphertext: (a: number, b: number, c: number, d: number) => void;
|
|
1619
1194
|
readonly privatekey_fromPrivateKeyCiphertext: (a: number, b: number, c: number, d: number) => void;
|
|
1195
|
+
readonly __wbg_viewkey_free: (a: number) => void;
|
|
1196
|
+
readonly viewkey_from_string: (a: number, b: number) => number;
|
|
1197
|
+
readonly viewkey_to_string: (a: number, b: number) => void;
|
|
1198
|
+
readonly viewkey_decrypt: (a: number, b: number, c: number, d: number) => void;
|
|
1199
|
+
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;
|
|
1200
|
+
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) => number;
|
|
1201
|
+
readonly __wbg_verifyingkey_free: (a: number) => void;
|
|
1202
|
+
readonly verifyingkey_fromBytes: (a: number, b: number, c: number) => void;
|
|
1203
|
+
readonly verifyingkey_toBytes: (a: number, b: number) => void;
|
|
1204
|
+
readonly verifyingkey_fromString: (a: number, b: number, c: number) => void;
|
|
1205
|
+
readonly verifyingkey_toString: (a: number, b: number) => void;
|
|
1206
|
+
readonly verifyingkey_copy: (a: number) => number;
|
|
1207
|
+
readonly viewkey_from_private_key: (a: number) => number;
|
|
1208
|
+
readonly viewkey_to_address: (a: number) => number;
|
|
1620
1209
|
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;
|
|
1640
1210
|
readonly __wbg_recordciphertext_free: (a: number) => void;
|
|
1641
1211
|
readonly recordciphertext_fromString: (a: number, b: number, c: number) => void;
|
|
1642
1212
|
readonly recordciphertext_toString: (a: number, b: number) => void;
|
|
1643
1213
|
readonly recordciphertext_decrypt: (a: number, b: number, c: number) => void;
|
|
1644
1214
|
readonly recordciphertext_isOwner: (a: number, b: number) => number;
|
|
1215
|
+
readonly __wbg_keypair_free: (a: number) => void;
|
|
1216
|
+
readonly keypair_new: (a: number, b: number) => number;
|
|
1217
|
+
readonly keypair_provingKey: (a: number, b: number) => void;
|
|
1218
|
+
readonly keypair_verifyingKey: (a: number, b: number) => void;
|
|
1219
|
+
readonly initThreadPool: (a: number, b: number) => number;
|
|
1220
|
+
readonly init_panic_hook: () => void;
|
|
1645
1221
|
readonly __wbg_jsfield_free: (a: number) => void;
|
|
1646
1222
|
readonly jsfield_generate_message_leo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1647
1223
|
readonly jsfield_generate_message_clients: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1648
|
-
readonly programmanager_buildSplitTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: 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;
|
|
1224
|
+
readonly programmanager_buildSplitTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
1675
1225
|
readonly __wbg_privatekeyciphertext_free: (a: number) => void;
|
|
1676
1226
|
readonly privatekeyciphertext_encryptPrivateKey: (a: number, b: number, c: number, d: number) => void;
|
|
1677
1227
|
readonly privatekeyciphertext_decryptToPrivateKey: (a: number, b: number, c: number, d: number) => void;
|
|
1678
1228
|
readonly privatekeyciphertext_toString: (a: number, b: number) => void;
|
|
1679
1229
|
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
|
|
1230
|
+
readonly programmanager_buildDeploymentTransaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
1681
1231
|
readonly programmanager_estimateDeploymentFee: (a: number, b: number, c: number) => number;
|
|
1682
1232
|
readonly programmanager_estimateProgramNameCost: (a: number, b: number, c: number) => void;
|
|
1233
|
+
readonly programmanager_authExecute: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
1234
|
+
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) => number;
|
|
1235
|
+
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) => number;
|
|
1236
|
+
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) => number;
|
|
1237
|
+
readonly programmanager_estimateFinalizeFee: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1683
1238
|
readonly __wbg_program_free: (a: number) => void;
|
|
1684
1239
|
readonly program_fromString: (a: number, b: number, c: number) => void;
|
|
1685
1240
|
readonly program_toString: (a: number, b: number) => void;
|
|
@@ -1693,68 +1248,33 @@ export interface InitOutput {
|
|
|
1693
1248
|
readonly program_id: (a: number, b: number) => void;
|
|
1694
1249
|
readonly program_isEqual: (a: number, b: number) => number;
|
|
1695
1250
|
readonly program_getImports: (a: number) => number;
|
|
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;
|
|
1738
|
-
readonly viewkey_from_private_key: (a: number) => number;
|
|
1739
|
-
readonly viewkey_from_string: (a: number, b: number) => number;
|
|
1740
|
-
readonly viewkey_to_string: (a: number, b: number) => void;
|
|
1741
|
-
readonly viewkey_to_address: (a: number) => number;
|
|
1742
|
-
readonly viewkey_decrypt: (a: number, b: number, c: number, d: number) => void;
|
|
1743
1251
|
readonly __wbg_execution_free: (a: number) => void;
|
|
1744
1252
|
readonly execution_toString: (a: number, b: number) => void;
|
|
1745
1253
|
readonly execution_fromString: (a: number, b: number, c: number) => void;
|
|
1746
1254
|
readonly verifyFunctionExecution: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1747
|
-
readonly
|
|
1255
|
+
readonly __wbg_provingkey_free: (a: number) => void;
|
|
1256
|
+
readonly provingkey_fromBytes: (a: number, b: number, c: number) => void;
|
|
1257
|
+
readonly provingkey_toBytes: (a: number, b: number) => void;
|
|
1258
|
+
readonly provingkey_copy: (a: number) => number;
|
|
1259
|
+
readonly __wbg_recordplaintext_free: (a: number) => void;
|
|
1260
|
+
readonly recordplaintext_fromString: (a: number, b: number, c: number) => void;
|
|
1261
|
+
readonly recordplaintext_toString: (a: number, b: number) => void;
|
|
1262
|
+
readonly recordplaintext_microcredits: (a: number) => number;
|
|
1263
|
+
readonly recordplaintext_nonce: (a: number, b: number) => void;
|
|
1264
|
+
readonly recordplaintext_serialNumberString: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1265
|
+
readonly runRayonThread: (a: number) => void;
|
|
1266
|
+
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) => number;
|
|
1267
|
+
readonly programmanager_synthesizeKeyPair: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
1748
1268
|
readonly __wbg_transaction_free: (a: number) => void;
|
|
1749
1269
|
readonly transaction_fromString: (a: number, b: number, c: number) => void;
|
|
1750
1270
|
readonly transaction_toString: (a: number, b: number) => void;
|
|
1751
1271
|
readonly transaction_transactionId: (a: number, b: number) => void;
|
|
1752
1272
|
readonly transaction_transactionType: (a: number, b: number) => void;
|
|
1753
|
-
readonly
|
|
1754
|
-
readonly
|
|
1755
|
-
readonly
|
|
1756
|
-
readonly
|
|
1757
|
-
readonly
|
|
1273
|
+
readonly __wbg_programmanager_free: (a: number) => void;
|
|
1274
|
+
readonly __wbg_executionresponse_free: (a: number) => void;
|
|
1275
|
+
readonly executionresponse_getOutputs: (a: number) => number;
|
|
1276
|
+
readonly executionresponse_getExecution: (a: number) => number;
|
|
1277
|
+
readonly executionresponse_getKeys: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1758
1278
|
readonly __wbg_signature_free: (a: number) => void;
|
|
1759
1279
|
readonly signature_sign: (a: number, b: number, c: number) => number;
|
|
1760
1280
|
readonly signature_sign_message: (a: number, b: number, c: number, d: number, e: number) => number;
|