@provablehq/wasm 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mainnet/aleo_wasm.d.ts +92 -20
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +287 -56
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +287 -55
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +92 -20
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +287 -56
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +287 -55
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/mainnet/index.js
CHANGED
|
@@ -264,6 +264,26 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Set test consensus version heights for testing.
|
|
269
|
+
*
|
|
270
|
+
* @param {string | undefined} heights The block heights at which each consensus version applies. This input should be a simple csv list of block heights and there should be one number for each consensus version. If left undefined, the default test heights will be applied.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* import { getOrInitConsensusVersionHeights } from @provablehq/sdk;
|
|
274
|
+
*
|
|
275
|
+
* Set the consensus version heights.
|
|
276
|
+
* getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9");
|
|
277
|
+
* @param {string | null} [heights]
|
|
278
|
+
* @returns {Array<any>}
|
|
279
|
+
*/
|
|
280
|
+
function getOrInitConsensusVersionTestHeights(heights) {
|
|
281
|
+
var ptr0 = isLikeNone(heights) ? 0 : passStringToWasm0(heights, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
282
|
+
var len0 = WASM_VECTOR_LEN;
|
|
283
|
+
const ret = wasm.getOrInitConsensusVersionTestHeights(ptr0, len0);
|
|
284
|
+
return takeObject(ret);
|
|
285
|
+
}
|
|
286
|
+
|
|
267
287
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
268
288
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
269
289
|
const mem = getDataViewMemory0();
|
|
@@ -283,12 +303,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
283
303
|
}
|
|
284
304
|
return result;
|
|
285
305
|
}
|
|
286
|
-
function __wbg_adapter_40(arg0, arg1
|
|
287
|
-
wasm.__wbindgen_export_6(arg0, arg1
|
|
306
|
+
function __wbg_adapter_40(arg0, arg1) {
|
|
307
|
+
wasm.__wbindgen_export_6(arg0, arg1);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function __wbg_adapter_43(arg0, arg1, arg2) {
|
|
311
|
+
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
|
|
288
312
|
}
|
|
289
313
|
|
|
290
|
-
function
|
|
291
|
-
wasm.
|
|
314
|
+
function __wbg_adapter_873(arg0, arg1, arg2, arg3) {
|
|
315
|
+
wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
292
316
|
}
|
|
293
317
|
|
|
294
318
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -666,6 +690,36 @@ class Authorization {
|
|
|
666
690
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
667
691
|
}
|
|
668
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* Get the function name.
|
|
695
|
+
*
|
|
696
|
+
* @returns {string} The function name.
|
|
697
|
+
* @returns {string}
|
|
698
|
+
*/
|
|
699
|
+
functionName() {
|
|
700
|
+
let deferred2_0;
|
|
701
|
+
let deferred2_1;
|
|
702
|
+
try {
|
|
703
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
704
|
+
wasm.authorization_functionName(retptr, this.__wbg_ptr);
|
|
705
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
706
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
707
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
708
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
709
|
+
var ptr1 = r0;
|
|
710
|
+
var len1 = r1;
|
|
711
|
+
if (r3) {
|
|
712
|
+
ptr1 = 0; len1 = 0;
|
|
713
|
+
throw takeObject(r2);
|
|
714
|
+
}
|
|
715
|
+
deferred2_0 = ptr1;
|
|
716
|
+
deferred2_1 = len1;
|
|
717
|
+
return getStringFromWasm0(ptr1, len1);
|
|
718
|
+
} finally {
|
|
719
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
720
|
+
wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
669
723
|
/**
|
|
670
724
|
* Returns `true` if the Authorization is for `credits.aleo/fee_public`.
|
|
671
725
|
* @returns {boolean}
|
|
@@ -2996,6 +3050,17 @@ class Field {
|
|
|
2996
3050
|
heap[stack_pointer++] = undefined;
|
|
2997
3051
|
}
|
|
2998
3052
|
}
|
|
3053
|
+
/**
|
|
3054
|
+
* Initializes a new field as a domain separator.
|
|
3055
|
+
* @param {string} domain
|
|
3056
|
+
* @returns {Field}
|
|
3057
|
+
*/
|
|
3058
|
+
static newDomainSeparator(domain) {
|
|
3059
|
+
const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
3060
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3061
|
+
const ret = wasm.field_newDomainSeparator(ptr0, len0);
|
|
3062
|
+
return Field.__wrap(ret);
|
|
3063
|
+
}
|
|
2999
3064
|
/**
|
|
3000
3065
|
* Add two field elements.
|
|
3001
3066
|
* @param {Field} other
|
|
@@ -5895,9 +5960,9 @@ class Plaintext {
|
|
|
5895
5960
|
wasm.__wbg_plaintext_free(ptr, 0);
|
|
5896
5961
|
}
|
|
5897
5962
|
/**
|
|
5898
|
-
* Get the
|
|
5963
|
+
* Get the little endian boolean array representation of the bits of the plaintext.
|
|
5899
5964
|
*
|
|
5900
|
-
* @returns {Array} The
|
|
5965
|
+
* @returns {Array} The little endian boolean array representation of the bits of the plaintext.
|
|
5901
5966
|
* @returns {Array<any>}
|
|
5902
5967
|
*/
|
|
5903
5968
|
toBitsLe() {
|
|
@@ -5955,9 +6020,9 @@ class Plaintext {
|
|
|
5955
6020
|
}
|
|
5956
6021
|
}
|
|
5957
6022
|
/**
|
|
5958
|
-
* Get the
|
|
6023
|
+
* Get the little endian byte array representation of the plaintext.
|
|
5959
6024
|
*
|
|
5960
|
-
* @returns {Uint8Array} The
|
|
6025
|
+
* @returns {Uint8Array} The little endian byte array representation of the plaintext.
|
|
5961
6026
|
* @returns {Uint8Array}
|
|
5962
6027
|
*/
|
|
5963
6028
|
toBytesLe() {
|
|
@@ -5978,7 +6043,7 @@ class Plaintext {
|
|
|
5978
6043
|
/**
|
|
5979
6044
|
* Get a plaintext object from a series of bits represented as a boolean array.
|
|
5980
6045
|
*
|
|
5981
|
-
* @param {Array} bits A
|
|
6046
|
+
* @param {Array} bits A little endian boolean array representing the bits plaintext.
|
|
5982
6047
|
*
|
|
5983
6048
|
* @returns {Plaintext} The plaintext object.
|
|
5984
6049
|
* @param {Array<any>} bits
|
|
@@ -6002,7 +6067,7 @@ class Plaintext {
|
|
|
6002
6067
|
/**
|
|
6003
6068
|
* Get a plaintext object from a series of bytes.
|
|
6004
6069
|
*
|
|
6005
|
-
* @param {Uint8Array} bytes A
|
|
6070
|
+
* @param {Uint8Array} bytes A little endian byte array representing the plaintext.
|
|
6006
6071
|
*
|
|
6007
6072
|
* @returns {Plaintext} The plaintext object.
|
|
6008
6073
|
* @param {Uint8Array} bytes
|
|
@@ -6023,6 +6088,27 @@ class Plaintext {
|
|
|
6023
6088
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6024
6089
|
}
|
|
6025
6090
|
}
|
|
6091
|
+
/**
|
|
6092
|
+
* Get the raw field array representation of the plaintext.
|
|
6093
|
+
*
|
|
6094
|
+
* @returns {Array} The raw field array representation of the plaintext.
|
|
6095
|
+
* @returns {Array<any>}
|
|
6096
|
+
*/
|
|
6097
|
+
toFieldsRaw() {
|
|
6098
|
+
try {
|
|
6099
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6100
|
+
wasm.plaintext_toFieldsRaw(retptr, this.__wbg_ptr);
|
|
6101
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6102
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6103
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6104
|
+
if (r2) {
|
|
6105
|
+
throw takeObject(r1);
|
|
6106
|
+
}
|
|
6107
|
+
return takeObject(r0);
|
|
6108
|
+
} finally {
|
|
6109
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6110
|
+
}
|
|
6111
|
+
}
|
|
6026
6112
|
/**
|
|
6027
6113
|
* Gives the type of the plaintext.
|
|
6028
6114
|
*
|
|
@@ -6045,6 +6131,68 @@ class Plaintext {
|
|
|
6045
6131
|
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
6046
6132
|
}
|
|
6047
6133
|
}
|
|
6134
|
+
/**
|
|
6135
|
+
* Get the raw big endian boolean array representation of the bits of the plaintext.
|
|
6136
|
+
*
|
|
6137
|
+
* @returns {Array} The raw big endian boolean array representation of the bits of the plaintext.
|
|
6138
|
+
* @returns {Array<any>}
|
|
6139
|
+
*/
|
|
6140
|
+
toBitsRawBe() {
|
|
6141
|
+
const ret = wasm.plaintext_toBitsRawBe(this.__wbg_ptr);
|
|
6142
|
+
return takeObject(ret);
|
|
6143
|
+
}
|
|
6144
|
+
/**
|
|
6145
|
+
* Get the raw little endian boolean array representation of the bits of the plaintext.
|
|
6146
|
+
*
|
|
6147
|
+
* @returns {Array} The raw little endian boolean array representation of the bits of the plaintext.
|
|
6148
|
+
* @returns {Array<any>}
|
|
6149
|
+
*/
|
|
6150
|
+
toBitsRawLe() {
|
|
6151
|
+
const ret = wasm.plaintext_toBitsRawLe(this.__wbg_ptr);
|
|
6152
|
+
return takeObject(ret);
|
|
6153
|
+
}
|
|
6154
|
+
/**
|
|
6155
|
+
* Get the raw big endian byte array representation of the plaintext.
|
|
6156
|
+
*
|
|
6157
|
+
* @returns {Uint8Array} The raw big endian byte array representation of the plaintext.
|
|
6158
|
+
* @returns {Uint8Array}
|
|
6159
|
+
*/
|
|
6160
|
+
toBytesRawBe() {
|
|
6161
|
+
try {
|
|
6162
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6163
|
+
wasm.plaintext_toBytesRawBe(retptr, this.__wbg_ptr);
|
|
6164
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6165
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6166
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6167
|
+
if (r2) {
|
|
6168
|
+
throw takeObject(r1);
|
|
6169
|
+
}
|
|
6170
|
+
return takeObject(r0);
|
|
6171
|
+
} finally {
|
|
6172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6173
|
+
}
|
|
6174
|
+
}
|
|
6175
|
+
/**
|
|
6176
|
+
* Get the raw little endian byte array representation of the plaintext.
|
|
6177
|
+
*
|
|
6178
|
+
* @returns {Uint8Array} The raw little endian byte array representation of the plaintext.
|
|
6179
|
+
* @returns {Uint8Array}
|
|
6180
|
+
*/
|
|
6181
|
+
toBytesRawLe() {
|
|
6182
|
+
try {
|
|
6183
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6184
|
+
wasm.plaintext_toBytesRawLe(retptr, this.__wbg_ptr);
|
|
6185
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6186
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6187
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6188
|
+
if (r2) {
|
|
6189
|
+
throw takeObject(r1);
|
|
6190
|
+
}
|
|
6191
|
+
return takeObject(r0);
|
|
6192
|
+
} finally {
|
|
6193
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6194
|
+
}
|
|
6195
|
+
}
|
|
6048
6196
|
/**
|
|
6049
6197
|
* Encrypt a plaintext with a transition view key.
|
|
6050
6198
|
*
|
|
@@ -7419,10 +7567,10 @@ class ProgramManager {
|
|
|
7419
7567
|
/**
|
|
7420
7568
|
* Synthesize proving and verifying keys for a program
|
|
7421
7569
|
*
|
|
7422
|
-
* @param
|
|
7423
|
-
* @param
|
|
7424
|
-
* @param
|
|
7425
|
-
* @param
|
|
7570
|
+
* @param {string} program The program source code of the program to synthesize keys for
|
|
7571
|
+
* @param {string} function_id The function to synthesize keys for
|
|
7572
|
+
* @param {Array} inputs The inputs to the function
|
|
7573
|
+
* @param {Object | undefined} imports The imports for the program
|
|
7426
7574
|
* @param {PrivateKey} private_key
|
|
7427
7575
|
* @param {string} program
|
|
7428
7576
|
* @param {string} function_id
|
|
@@ -7440,6 +7588,14 @@ class ProgramManager {
|
|
|
7440
7588
|
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7441
7589
|
return takeObject(ret);
|
|
7442
7590
|
}
|
|
7591
|
+
/**
|
|
7592
|
+
* @param {ProvingKey} proving_key
|
|
7593
|
+
*/
|
|
7594
|
+
static loadInclusionProver(proving_key) {
|
|
7595
|
+
_assertClass(proving_key, ProvingKey);
|
|
7596
|
+
var ptr0 = proving_key.__destroy_into_raw();
|
|
7597
|
+
wasm.programmanager_loadInclusionProver(ptr0);
|
|
7598
|
+
}
|
|
7443
7599
|
/**
|
|
7444
7600
|
* Create a `ProvingRequest` object. This object creates authorizations for the top level
|
|
7445
7601
|
* function and associated fee function. This object can be sent directly to a remote prover
|
|
@@ -7737,43 +7893,36 @@ class ProgramManager {
|
|
|
7737
7893
|
}
|
|
7738
7894
|
}
|
|
7739
7895
|
/**
|
|
7740
|
-
*
|
|
7741
|
-
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
7742
|
-
* program executions.
|
|
7896
|
+
* Execute an authorization.
|
|
7743
7897
|
*
|
|
7744
|
-
*
|
|
7745
|
-
*
|
|
7746
|
-
* @param
|
|
7747
|
-
* @param
|
|
7748
|
-
* @param
|
|
7749
|
-
* @param
|
|
7750
|
-
* @param
|
|
7751
|
-
* @param
|
|
7752
|
-
* form of a javascript object where the keys are a string of the program name and the values
|
|
7753
|
-
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
7754
|
-
* @param proving_key (optional) Provide a verifying key to use for the fee estimation
|
|
7755
|
-
* @param verifying_key (optional) Provide a verifying key to use for the fee estimation
|
|
7756
|
-
* @returns {u64} Fee in microcredits
|
|
7757
|
-
* @param {PrivateKey} private_key
|
|
7898
|
+
* @param authorization The authorization to execute.
|
|
7899
|
+
* @param fee_authorization The fee authorization to execute.
|
|
7900
|
+
* @param program The program authorized to be executed.
|
|
7901
|
+
* @param imports The imports of the program being executed.
|
|
7902
|
+
* @param url The url to get the inclusion proving information from.
|
|
7903
|
+
* @param offline_query Optional offline query object if building a Transaction offline.
|
|
7904
|
+
* @param {Authorization} authorization
|
|
7905
|
+
* @param {Authorization | null | undefined} fee_authorization
|
|
7758
7906
|
* @param {string} program
|
|
7759
|
-
* @param {string} _function
|
|
7760
|
-
* @param {Array<any>} inputs
|
|
7761
|
-
* @param {string | null} [url]
|
|
7762
|
-
* @param {object | null} [imports]
|
|
7763
7907
|
* @param {ProvingKey | null} [proving_key]
|
|
7764
7908
|
* @param {VerifyingKey | null} [verifying_key]
|
|
7909
|
+
* @param {ProvingKey | null} [fee_proving_key]
|
|
7910
|
+
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
7911
|
+
* @param {object | null} [imports]
|
|
7912
|
+
* @param {string | null} [url]
|
|
7765
7913
|
* @param {OfflineQuery | null} [offline_query]
|
|
7766
|
-
* @
|
|
7767
|
-
* @returns {Promise<bigint>}
|
|
7914
|
+
* @returns {Promise<Transaction>}
|
|
7768
7915
|
*/
|
|
7769
|
-
static
|
|
7770
|
-
_assertClass(
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7916
|
+
static executeAuthorization(authorization, fee_authorization, program, proving_key, verifying_key, fee_proving_key, fee_verifying_key, imports, url, offline_query) {
|
|
7917
|
+
_assertClass(authorization, Authorization);
|
|
7918
|
+
var ptr0 = authorization.__destroy_into_raw();
|
|
7919
|
+
let ptr1 = 0;
|
|
7920
|
+
if (!isLikeNone(fee_authorization)) {
|
|
7921
|
+
_assertClass(fee_authorization, Authorization);
|
|
7922
|
+
ptr1 = fee_authorization.__destroy_into_raw();
|
|
7923
|
+
}
|
|
7924
|
+
const ptr2 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7925
|
+
const len2 = WASM_VECTOR_LEN;
|
|
7777
7926
|
let ptr3 = 0;
|
|
7778
7927
|
if (!isLikeNone(proving_key)) {
|
|
7779
7928
|
_assertClass(proving_key, ProvingKey);
|
|
@@ -7785,11 +7934,49 @@ class ProgramManager {
|
|
|
7785
7934
|
ptr4 = verifying_key.__destroy_into_raw();
|
|
7786
7935
|
}
|
|
7787
7936
|
let ptr5 = 0;
|
|
7937
|
+
if (!isLikeNone(fee_proving_key)) {
|
|
7938
|
+
_assertClass(fee_proving_key, ProvingKey);
|
|
7939
|
+
ptr5 = fee_proving_key.__destroy_into_raw();
|
|
7940
|
+
}
|
|
7941
|
+
let ptr6 = 0;
|
|
7942
|
+
if (!isLikeNone(fee_verifying_key)) {
|
|
7943
|
+
_assertClass(fee_verifying_key, VerifyingKey);
|
|
7944
|
+
ptr6 = fee_verifying_key.__destroy_into_raw();
|
|
7945
|
+
}
|
|
7946
|
+
var ptr7 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7947
|
+
var len7 = WASM_VECTOR_LEN;
|
|
7948
|
+
let ptr8 = 0;
|
|
7788
7949
|
if (!isLikeNone(offline_query)) {
|
|
7789
7950
|
_assertClass(offline_query, OfflineQuery);
|
|
7790
|
-
|
|
7951
|
+
ptr8 = offline_query.__destroy_into_raw();
|
|
7791
7952
|
}
|
|
7792
|
-
const ret = wasm.
|
|
7953
|
+
const ret = wasm.programmanager_executeAuthorization(ptr0, ptr1, ptr2, len2, ptr3, ptr4, ptr5, ptr6, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr7, len7, ptr8);
|
|
7954
|
+
return takeObject(ret);
|
|
7955
|
+
}
|
|
7956
|
+
/**
|
|
7957
|
+
* Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
|
|
7958
|
+
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
7959
|
+
* program executions.
|
|
7960
|
+
*
|
|
7961
|
+
* @param program The source code of the program to estimate the execution fee for.
|
|
7962
|
+
* @param function The name of the function to estimate the execution fee for.
|
|
7963
|
+
* @param imports (optional) Provide a list of imports to use for the fee estimation in the
|
|
7964
|
+
* form of a javascript object where the keys are a string of the program name and the values
|
|
7965
|
+
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
7966
|
+
* @param edition {
|
|
7967
|
+
* @returns {u64} Fee in microcredits
|
|
7968
|
+
* @param {string} program
|
|
7969
|
+
* @param {string} _function
|
|
7970
|
+
* @param {object | null} [imports]
|
|
7971
|
+
* @param {number | null} [edition]
|
|
7972
|
+
* @returns {Promise<bigint>}
|
|
7973
|
+
*/
|
|
7974
|
+
static estimateExecutionFee(program, _function, imports, edition) {
|
|
7975
|
+
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7976
|
+
const len0 = WASM_VECTOR_LEN;
|
|
7977
|
+
const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7978
|
+
const len1 = WASM_VECTOR_LEN;
|
|
7979
|
+
const ret = wasm.programmanager_estimateExecutionFee(ptr0, len0, ptr1, len1, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7793
7980
|
return takeObject(ret);
|
|
7794
7981
|
}
|
|
7795
7982
|
/**
|
|
@@ -7851,6 +8038,31 @@ class ProgramManager {
|
|
|
7851
8038
|
const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7852
8039
|
return takeObject(ret);
|
|
7853
8040
|
}
|
|
8041
|
+
/**
|
|
8042
|
+
* Estimate Fee for an Authorization.
|
|
8043
|
+
*
|
|
8044
|
+
* @param authorization Authorization to estimate the fee for.
|
|
8045
|
+
* @param program The program the Authorization is for.
|
|
8046
|
+
* @param imports Provide a list of imports to use for the fee estimation in the
|
|
8047
|
+
* form of a javascript object where the keys are a string of the program name and the values
|
|
8048
|
+
* are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
|
|
8049
|
+
* @param offline_query The offline query object used to insert the global state root and state paths needed to create
|
|
8050
|
+
* a valid inclusion proof offline.
|
|
8051
|
+
* @param edition: Optional edition to estimate the fee for.
|
|
8052
|
+
* @returns {u64} Fee in microcredits
|
|
8053
|
+
* @param {Authorization} authorization
|
|
8054
|
+
* @param {string} program
|
|
8055
|
+
* @param {object | null} [imports]
|
|
8056
|
+
* @param {number | null} [edition]
|
|
8057
|
+
* @returns {Promise<bigint>}
|
|
8058
|
+
*/
|
|
8059
|
+
static estimateFeeForAuthorization(authorization, program, imports, edition) {
|
|
8060
|
+
_assertClass(authorization, Authorization);
|
|
8061
|
+
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
8062
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8063
|
+
const ret = wasm.programmanager_estimateFeeForAuthorization(authorization.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
8064
|
+
return takeObject(ret);
|
|
8065
|
+
}
|
|
7854
8066
|
/**
|
|
7855
8067
|
* Execute Aleo function and create an Aleo execution transaction
|
|
7856
8068
|
*
|
|
@@ -12888,6 +13100,9 @@ async function __wbg_load(module, imports) {
|
|
|
12888
13100
|
function __wbg_get_imports() {
|
|
12889
13101
|
const imports = {};
|
|
12890
13102
|
imports.wbg = {};
|
|
13103
|
+
imports.wbg.__wbg_abort_410ec47a64ac6117 = function(arg0, arg1) {
|
|
13104
|
+
getObject(arg0).abort(getObject(arg1));
|
|
13105
|
+
};
|
|
12891
13106
|
imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
|
|
12892
13107
|
getObject(arg0).abort();
|
|
12893
13108
|
};
|
|
@@ -12926,6 +13141,10 @@ function __wbg_get_imports() {
|
|
|
12926
13141
|
const ret = Ciphertext.__wrap(arg0);
|
|
12927
13142
|
return addHeapObject(ret);
|
|
12928
13143
|
};
|
|
13144
|
+
imports.wbg.__wbg_clearTimeout_86721db0036bea98 = function(arg0) {
|
|
13145
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
13146
|
+
return addHeapObject(ret);
|
|
13147
|
+
};
|
|
12929
13148
|
imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
12930
13149
|
const ret = getObject(arg0).crypto;
|
|
12931
13150
|
return addHeapObject(ret);
|
|
@@ -12957,6 +13176,10 @@ function __wbg_get_imports() {
|
|
|
12957
13176
|
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
12958
13177
|
return addHeapObject(ret);
|
|
12959
13178
|
};
|
|
13179
|
+
imports.wbg.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
|
|
13180
|
+
const ret = fetch(getObject(arg0));
|
|
13181
|
+
return addHeapObject(ret);
|
|
13182
|
+
};
|
|
12960
13183
|
imports.wbg.__wbg_fetch_f1856afdb49415d1 = function(arg0) {
|
|
12961
13184
|
const ret = fetch(getObject(arg0));
|
|
12962
13185
|
return addHeapObject(ret);
|
|
@@ -13022,7 +13245,7 @@ function __wbg_get_imports() {
|
|
|
13022
13245
|
const ret = getObject(arg0).length;
|
|
13023
13246
|
return ret;
|
|
13024
13247
|
};
|
|
13025
|
-
imports.wbg.
|
|
13248
|
+
imports.wbg.__wbg_log_3d00345a85838c37 = function(arg0, arg1) {
|
|
13026
13249
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
13027
13250
|
};
|
|
13028
13251
|
imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
@@ -13040,7 +13263,7 @@ function __wbg_get_imports() {
|
|
|
13040
13263
|
const a = state0.a;
|
|
13041
13264
|
state0.a = 0;
|
|
13042
13265
|
try {
|
|
13043
|
-
return
|
|
13266
|
+
return __wbg_adapter_873(a, state0.b, arg0, arg1);
|
|
13044
13267
|
} finally {
|
|
13045
13268
|
state0.a = a;
|
|
13046
13269
|
}
|
|
@@ -13188,6 +13411,10 @@ function __wbg_get_imports() {
|
|
|
13188
13411
|
imports.wbg.__wbg_send_40a47636ff90f64d = function() { return handleError(function (arg0) {
|
|
13189
13412
|
getObject(arg0).send();
|
|
13190
13413
|
}, arguments) };
|
|
13414
|
+
imports.wbg.__wbg_setTimeout_2e707715f8cc9497 = function(arg0, arg1) {
|
|
13415
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
13416
|
+
return addHeapObject(ret);
|
|
13417
|
+
};
|
|
13191
13418
|
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
13192
13419
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
13193
13420
|
};
|
|
@@ -13227,7 +13454,7 @@ function __wbg_get_imports() {
|
|
|
13227
13454
|
const ret = Signature.__wrap(arg0);
|
|
13228
13455
|
return addHeapObject(ret);
|
|
13229
13456
|
};
|
|
13230
|
-
imports.wbg.
|
|
13457
|
+
imports.wbg.__wbg_spawnWorker_11a3cff24c5879d7 = function(arg0, arg1, arg2, arg3) {
|
|
13231
13458
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
13232
13459
|
return addHeapObject(ret);
|
|
13233
13460
|
};
|
|
@@ -13347,12 +13574,16 @@ function __wbg_get_imports() {
|
|
|
13347
13574
|
const ret = false;
|
|
13348
13575
|
return ret;
|
|
13349
13576
|
};
|
|
13350
|
-
imports.wbg.
|
|
13351
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13577
|
+
imports.wbg.__wbindgen_closure_wrapper7312 = function(arg0, arg1, arg2) {
|
|
13578
|
+
const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_40);
|
|
13579
|
+
return addHeapObject(ret);
|
|
13580
|
+
};
|
|
13581
|
+
imports.wbg.__wbindgen_closure_wrapper7964 = function(arg0, arg1, arg2) {
|
|
13582
|
+
const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_43);
|
|
13352
13583
|
return addHeapObject(ret);
|
|
13353
13584
|
};
|
|
13354
|
-
imports.wbg.
|
|
13355
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13585
|
+
imports.wbg.__wbindgen_closure_wrapper7968 = function(arg0, arg1, arg2) {
|
|
13586
|
+
const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_43);
|
|
13356
13587
|
return addHeapObject(ret);
|
|
13357
13588
|
};
|
|
13358
13589
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
@@ -13428,7 +13659,7 @@ function __wbg_get_imports() {
|
|
|
13428
13659
|
}
|
|
13429
13660
|
|
|
13430
13661
|
function __wbg_init_memory(imports, memory) {
|
|
13431
|
-
imports.wbg.memory = memory || new WebAssembly.Memory({initial:
|
|
13662
|
+
imports.wbg.memory = memory || new WebAssembly.Memory({initial:167,maximum:65536,shared:true});
|
|
13432
13663
|
}
|
|
13433
13664
|
|
|
13434
13665
|
function __wbg_finalize_init(instance, module, thread_stack_size) {
|
|
@@ -13507,5 +13738,5 @@ async function initThreadPool(threads) {
|
|
|
13507
13738
|
await initThreadPool$1(new URL("worker.js", import.meta.url), threads);
|
|
13508
13739
|
}
|
|
13509
13740
|
|
|
13510
|
-
export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, Ciphertext, ComputeKey, EncryptionToolkit, Execution, ExecutionRequest, ExecutionResponse, Field, GraphKey, Group, I128, I16, I32, I64, I8, KeyPair, Metadata, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, VerifyingKey, ViewKey, initSync, initThreadPool, runRayonThread, verifyFunctionExecution };
|
|
13741
|
+
export { Address, Authorization, BHP1024, BHP256, BHP512, BHP768, Boolean, Ciphertext, ComputeKey, EncryptionToolkit, Execution, ExecutionRequest, ExecutionResponse, Field, GraphKey, Group, I128, I16, I32, I64, I8, KeyPair, Metadata, OfflineQuery, Pedersen128, Pedersen64, Plaintext, Poseidon2, Poseidon4, Poseidon8, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, ProvingKey, ProvingRequest, RecordCiphertext, RecordPlaintext, Scalar, Signature, Transaction, Transition, U128, U16, U32, U64, U8, VerifyingKey, ViewKey, getOrInitConsensusVersionTestHeights, initSync, initThreadPool, runRayonThread, verifyFunctionExecution };
|
|
13511
13742
|
//# sourceMappingURL=index.js.map
|