@provablehq/wasm 0.9.5 → 0.9.7
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 +235 -219
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +311 -238
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +311 -238
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +235 -219
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +311 -238
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +311 -238
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -700,14 +700,14 @@ export class ExecutionRequest {
|
|
|
700
700
|
* @param {Field | undefined} root_tvk The tvk of the function at the top of the call graph. This is undefined if this request is built for the top-level call or if there is only one function in the call graph.
|
|
701
701
|
* @param {boolean} is_root Flag to indicate if this is the top level function in the call graph.
|
|
702
702
|
*/
|
|
703
|
-
static sign(private_key: PrivateKey, program_id: string, function_name: string, inputs: Array<any>, input_types: Array<any>, root_tvk: Field | null | undefined, is_root: boolean): ExecutionRequest;
|
|
703
|
+
static sign(private_key: PrivateKey, program_id: string, function_name: string, inputs: Array<any>, input_types: Array<any>, root_tvk: Field | null | undefined, program_checksum: Field | null | undefined, is_root: boolean): ExecutionRequest;
|
|
704
704
|
/**
|
|
705
705
|
* Verify the input types within a request.
|
|
706
706
|
*
|
|
707
707
|
* @param {string[]} The input_types within the request.
|
|
708
708
|
* @param {boolean} Flag to indicate whether this request is the first function in the call graph.
|
|
709
709
|
*/
|
|
710
|
-
verify(input_types: Array<any>, is_root: boolean): boolean;
|
|
710
|
+
verify(input_types: Array<any>, is_root: boolean, program_checksum?: Field | null): boolean;
|
|
711
711
|
}
|
|
712
712
|
/**
|
|
713
713
|
* Webassembly Representation of an Aleo function execution response
|
|
@@ -956,27 +956,27 @@ export class I128 {
|
|
|
956
956
|
private constructor();
|
|
957
957
|
free(): void;
|
|
958
958
|
/**
|
|
959
|
-
*
|
|
959
|
+
* Construct an integer from a string representation.
|
|
960
960
|
*/
|
|
961
961
|
static fromString(s: string): I128;
|
|
962
962
|
/**
|
|
963
|
-
*
|
|
963
|
+
* Get the string representation of the integer.
|
|
964
964
|
*/
|
|
965
965
|
toString(): string;
|
|
966
966
|
/**
|
|
967
|
-
*
|
|
967
|
+
* Get the byte array representation of the integer.
|
|
968
968
|
*/
|
|
969
969
|
static fromBytesLe(bytes: Uint8Array): I128;
|
|
970
970
|
/**
|
|
971
|
-
*
|
|
971
|
+
* Construct an integer from a byte array representation.
|
|
972
972
|
*/
|
|
973
973
|
toBytesLe(): Uint8Array;
|
|
974
974
|
/**
|
|
975
|
-
*
|
|
975
|
+
* Construct an integer from a boolean array representation.
|
|
976
976
|
*/
|
|
977
977
|
static fromBitsLe(bits: Array<any>): I128;
|
|
978
978
|
/**
|
|
979
|
-
*
|
|
979
|
+
* Get the boolean array representation of the integer.
|
|
980
980
|
*/
|
|
981
981
|
toBitsLe(): Array<any>;
|
|
982
982
|
/**
|
|
@@ -988,15 +988,15 @@ export class I128 {
|
|
|
988
988
|
*/
|
|
989
989
|
absWrapped(): I128;
|
|
990
990
|
/**
|
|
991
|
-
* Wrapped addition.
|
|
991
|
+
* Wrapped addition with another integer.
|
|
992
992
|
*/
|
|
993
993
|
addWrapped(other: I128): I128;
|
|
994
994
|
/**
|
|
995
|
-
* Wrapped subtraction.
|
|
995
|
+
* Wrapped subtraction with another integer.
|
|
996
996
|
*/
|
|
997
997
|
subWrapped(other: I128): I128;
|
|
998
998
|
/**
|
|
999
|
-
* Wrapped multiplication.
|
|
999
|
+
* Wrapped multiplication with another integer.
|
|
1000
1000
|
*/
|
|
1001
1001
|
mulWrapped(other: I128): I128;
|
|
1002
1002
|
/**
|
|
@@ -1004,51 +1004,51 @@ export class I128 {
|
|
|
1004
1004
|
*/
|
|
1005
1005
|
divWrapped(other: I128): I128;
|
|
1006
1006
|
/**
|
|
1007
|
-
*
|
|
1007
|
+
* Exponentiate the integer with a u8 exponent.
|
|
1008
1008
|
*/
|
|
1009
1009
|
powU8(exponent: U8): I128;
|
|
1010
1010
|
/**
|
|
1011
|
-
*
|
|
1011
|
+
* Exponentiate the integer with a u16 exponent.
|
|
1012
1012
|
*/
|
|
1013
1013
|
powU16(exponent: U16): I128;
|
|
1014
1014
|
/**
|
|
1015
|
-
*
|
|
1015
|
+
* Exponentiate the integer with a u32 exponent.
|
|
1016
1016
|
*/
|
|
1017
1017
|
powU32(exponent: U32): I128;
|
|
1018
1018
|
/**
|
|
1019
|
-
*
|
|
1019
|
+
* Negate the integer (e.g., 5 → -5).
|
|
1020
1020
|
*/
|
|
1021
1021
|
neg(): I128;
|
|
1022
1022
|
/**
|
|
1023
|
-
*
|
|
1023
|
+
* Check equality with another integer.
|
|
1024
1024
|
*/
|
|
1025
1025
|
equals(other: I128): boolean;
|
|
1026
1026
|
/**
|
|
1027
|
-
*
|
|
1027
|
+
* Get the remainder from integer division.
|
|
1028
1028
|
*/
|
|
1029
1029
|
rem(other: I128): I128;
|
|
1030
1030
|
/**
|
|
1031
|
-
*
|
|
1031
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
1032
1032
|
*/
|
|
1033
1033
|
remWrapped(other: I128): I128;
|
|
1034
1034
|
/**
|
|
1035
|
-
* Convert to Scalar.
|
|
1035
|
+
* Convert the integer to a Scalar value.
|
|
1036
1036
|
*/
|
|
1037
1037
|
toScalar(): Scalar;
|
|
1038
1038
|
/**
|
|
1039
|
-
* Convert to
|
|
1039
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
1040
1040
|
*/
|
|
1041
1041
|
toPlaintext(): Plaintext;
|
|
1042
1042
|
/**
|
|
1043
|
-
*
|
|
1043
|
+
* Attempt to construct the integer from a field element.
|
|
1044
1044
|
*/
|
|
1045
1045
|
static fromField(field: Field): I128;
|
|
1046
1046
|
/**
|
|
1047
|
-
*
|
|
1047
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
1048
1048
|
*/
|
|
1049
1049
|
static fromFields(fields: Array<any>): I128;
|
|
1050
1050
|
/**
|
|
1051
|
-
* Clone.
|
|
1051
|
+
* Clone the integer in wasm memory.
|
|
1052
1052
|
*/
|
|
1053
1053
|
clone(): I128;
|
|
1054
1054
|
}
|
|
@@ -1056,27 +1056,27 @@ export class I16 {
|
|
|
1056
1056
|
private constructor();
|
|
1057
1057
|
free(): void;
|
|
1058
1058
|
/**
|
|
1059
|
-
*
|
|
1059
|
+
* Construct an integer from a string representation.
|
|
1060
1060
|
*/
|
|
1061
1061
|
static fromString(s: string): I16;
|
|
1062
1062
|
/**
|
|
1063
|
-
*
|
|
1063
|
+
* Get the string representation of the integer.
|
|
1064
1064
|
*/
|
|
1065
1065
|
toString(): string;
|
|
1066
1066
|
/**
|
|
1067
|
-
*
|
|
1067
|
+
* Get the byte array representation of the integer.
|
|
1068
1068
|
*/
|
|
1069
1069
|
static fromBytesLe(bytes: Uint8Array): I16;
|
|
1070
1070
|
/**
|
|
1071
|
-
*
|
|
1071
|
+
* Construct an integer from a byte array representation.
|
|
1072
1072
|
*/
|
|
1073
1073
|
toBytesLe(): Uint8Array;
|
|
1074
1074
|
/**
|
|
1075
|
-
*
|
|
1075
|
+
* Construct an integer from a boolean array representation.
|
|
1076
1076
|
*/
|
|
1077
1077
|
static fromBitsLe(bits: Array<any>): I16;
|
|
1078
1078
|
/**
|
|
1079
|
-
*
|
|
1079
|
+
* Get the boolean array representation of the integer.
|
|
1080
1080
|
*/
|
|
1081
1081
|
toBitsLe(): Array<any>;
|
|
1082
1082
|
/**
|
|
@@ -1088,15 +1088,15 @@ export class I16 {
|
|
|
1088
1088
|
*/
|
|
1089
1089
|
absWrapped(): I16;
|
|
1090
1090
|
/**
|
|
1091
|
-
* Wrapped addition.
|
|
1091
|
+
* Wrapped addition with another integer.
|
|
1092
1092
|
*/
|
|
1093
1093
|
addWrapped(other: I16): I16;
|
|
1094
1094
|
/**
|
|
1095
|
-
* Wrapped subtraction.
|
|
1095
|
+
* Wrapped subtraction with another integer.
|
|
1096
1096
|
*/
|
|
1097
1097
|
subWrapped(other: I16): I16;
|
|
1098
1098
|
/**
|
|
1099
|
-
* Wrapped multiplication.
|
|
1099
|
+
* Wrapped multiplication with another integer.
|
|
1100
1100
|
*/
|
|
1101
1101
|
mulWrapped(other: I16): I16;
|
|
1102
1102
|
/**
|
|
@@ -1104,51 +1104,51 @@ export class I16 {
|
|
|
1104
1104
|
*/
|
|
1105
1105
|
divWrapped(other: I16): I16;
|
|
1106
1106
|
/**
|
|
1107
|
-
*
|
|
1107
|
+
* Exponentiate the integer with a u8 exponent.
|
|
1108
1108
|
*/
|
|
1109
1109
|
powU8(exponent: U8): I16;
|
|
1110
1110
|
/**
|
|
1111
|
-
*
|
|
1111
|
+
* Exponentiate the integer with a u16 exponent.
|
|
1112
1112
|
*/
|
|
1113
1113
|
powU16(exponent: U16): I16;
|
|
1114
1114
|
/**
|
|
1115
|
-
*
|
|
1115
|
+
* Exponentiate the integer with a u32 exponent.
|
|
1116
1116
|
*/
|
|
1117
1117
|
powU32(exponent: U32): I16;
|
|
1118
1118
|
/**
|
|
1119
|
-
*
|
|
1119
|
+
* Negate the integer (e.g., 5 → -5).
|
|
1120
1120
|
*/
|
|
1121
1121
|
neg(): I16;
|
|
1122
1122
|
/**
|
|
1123
|
-
*
|
|
1123
|
+
* Check equality with another integer.
|
|
1124
1124
|
*/
|
|
1125
1125
|
equals(other: I16): boolean;
|
|
1126
1126
|
/**
|
|
1127
|
-
*
|
|
1127
|
+
* Get the remainder from integer division.
|
|
1128
1128
|
*/
|
|
1129
1129
|
rem(other: I16): I16;
|
|
1130
1130
|
/**
|
|
1131
|
-
*
|
|
1131
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
1132
1132
|
*/
|
|
1133
1133
|
remWrapped(other: I16): I16;
|
|
1134
1134
|
/**
|
|
1135
|
-
* Convert to Scalar.
|
|
1135
|
+
* Convert the integer to a Scalar value.
|
|
1136
1136
|
*/
|
|
1137
1137
|
toScalar(): Scalar;
|
|
1138
1138
|
/**
|
|
1139
|
-
* Convert to
|
|
1139
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
1140
1140
|
*/
|
|
1141
1141
|
toPlaintext(): Plaintext;
|
|
1142
1142
|
/**
|
|
1143
|
-
*
|
|
1143
|
+
* Attempt to construct the integer from a field element.
|
|
1144
1144
|
*/
|
|
1145
1145
|
static fromField(field: Field): I16;
|
|
1146
1146
|
/**
|
|
1147
|
-
*
|
|
1147
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
1148
1148
|
*/
|
|
1149
1149
|
static fromFields(fields: Array<any>): I16;
|
|
1150
1150
|
/**
|
|
1151
|
-
* Clone.
|
|
1151
|
+
* Clone the integer in wasm memory.
|
|
1152
1152
|
*/
|
|
1153
1153
|
clone(): I16;
|
|
1154
1154
|
}
|
|
@@ -1156,27 +1156,27 @@ export class I32 {
|
|
|
1156
1156
|
private constructor();
|
|
1157
1157
|
free(): void;
|
|
1158
1158
|
/**
|
|
1159
|
-
*
|
|
1159
|
+
* Construct an integer from a string representation.
|
|
1160
1160
|
*/
|
|
1161
1161
|
static fromString(s: string): I32;
|
|
1162
1162
|
/**
|
|
1163
|
-
*
|
|
1163
|
+
* Get the string representation of the integer.
|
|
1164
1164
|
*/
|
|
1165
1165
|
toString(): string;
|
|
1166
1166
|
/**
|
|
1167
|
-
*
|
|
1167
|
+
* Get the byte array representation of the integer.
|
|
1168
1168
|
*/
|
|
1169
1169
|
static fromBytesLe(bytes: Uint8Array): I32;
|
|
1170
1170
|
/**
|
|
1171
|
-
*
|
|
1171
|
+
* Construct an integer from a byte array representation.
|
|
1172
1172
|
*/
|
|
1173
1173
|
toBytesLe(): Uint8Array;
|
|
1174
1174
|
/**
|
|
1175
|
-
*
|
|
1175
|
+
* Construct an integer from a boolean array representation.
|
|
1176
1176
|
*/
|
|
1177
1177
|
static fromBitsLe(bits: Array<any>): I32;
|
|
1178
1178
|
/**
|
|
1179
|
-
*
|
|
1179
|
+
* Get the boolean array representation of the integer.
|
|
1180
1180
|
*/
|
|
1181
1181
|
toBitsLe(): Array<any>;
|
|
1182
1182
|
/**
|
|
@@ -1188,15 +1188,15 @@ export class I32 {
|
|
|
1188
1188
|
*/
|
|
1189
1189
|
absWrapped(): I32;
|
|
1190
1190
|
/**
|
|
1191
|
-
* Wrapped addition.
|
|
1191
|
+
* Wrapped addition with another integer.
|
|
1192
1192
|
*/
|
|
1193
1193
|
addWrapped(other: I32): I32;
|
|
1194
1194
|
/**
|
|
1195
|
-
* Wrapped subtraction.
|
|
1195
|
+
* Wrapped subtraction with another integer.
|
|
1196
1196
|
*/
|
|
1197
1197
|
subWrapped(other: I32): I32;
|
|
1198
1198
|
/**
|
|
1199
|
-
* Wrapped multiplication.
|
|
1199
|
+
* Wrapped multiplication with another integer.
|
|
1200
1200
|
*/
|
|
1201
1201
|
mulWrapped(other: I32): I32;
|
|
1202
1202
|
/**
|
|
@@ -1204,51 +1204,51 @@ export class I32 {
|
|
|
1204
1204
|
*/
|
|
1205
1205
|
divWrapped(other: I32): I32;
|
|
1206
1206
|
/**
|
|
1207
|
-
*
|
|
1207
|
+
* Exponentiate the integer with a u8 exponent.
|
|
1208
1208
|
*/
|
|
1209
1209
|
powU8(exponent: U8): I32;
|
|
1210
1210
|
/**
|
|
1211
|
-
*
|
|
1211
|
+
* Exponentiate the integer with a u16 exponent.
|
|
1212
1212
|
*/
|
|
1213
1213
|
powU16(exponent: U16): I32;
|
|
1214
1214
|
/**
|
|
1215
|
-
*
|
|
1215
|
+
* Exponentiate the integer with a u32 exponent.
|
|
1216
1216
|
*/
|
|
1217
1217
|
powU32(exponent: U32): I32;
|
|
1218
1218
|
/**
|
|
1219
|
-
*
|
|
1219
|
+
* Negate the integer (e.g., 5 → -5).
|
|
1220
1220
|
*/
|
|
1221
1221
|
neg(): I32;
|
|
1222
1222
|
/**
|
|
1223
|
-
*
|
|
1223
|
+
* Check equality with another integer.
|
|
1224
1224
|
*/
|
|
1225
1225
|
equals(other: I32): boolean;
|
|
1226
1226
|
/**
|
|
1227
|
-
*
|
|
1227
|
+
* Get the remainder from integer division.
|
|
1228
1228
|
*/
|
|
1229
1229
|
rem(other: I32): I32;
|
|
1230
1230
|
/**
|
|
1231
|
-
*
|
|
1231
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
1232
1232
|
*/
|
|
1233
1233
|
remWrapped(other: I32): I32;
|
|
1234
1234
|
/**
|
|
1235
|
-
* Convert to Scalar.
|
|
1235
|
+
* Convert the integer to a Scalar value.
|
|
1236
1236
|
*/
|
|
1237
1237
|
toScalar(): Scalar;
|
|
1238
1238
|
/**
|
|
1239
|
-
* Convert to
|
|
1239
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
1240
1240
|
*/
|
|
1241
1241
|
toPlaintext(): Plaintext;
|
|
1242
1242
|
/**
|
|
1243
|
-
*
|
|
1243
|
+
* Attempt to construct the integer from a field element.
|
|
1244
1244
|
*/
|
|
1245
1245
|
static fromField(field: Field): I32;
|
|
1246
1246
|
/**
|
|
1247
|
-
*
|
|
1247
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
1248
1248
|
*/
|
|
1249
1249
|
static fromFields(fields: Array<any>): I32;
|
|
1250
1250
|
/**
|
|
1251
|
-
* Clone.
|
|
1251
|
+
* Clone the integer in wasm memory.
|
|
1252
1252
|
*/
|
|
1253
1253
|
clone(): I32;
|
|
1254
1254
|
}
|
|
@@ -1256,27 +1256,27 @@ export class I64 {
|
|
|
1256
1256
|
private constructor();
|
|
1257
1257
|
free(): void;
|
|
1258
1258
|
/**
|
|
1259
|
-
*
|
|
1259
|
+
* Construct an integer from a string representation.
|
|
1260
1260
|
*/
|
|
1261
1261
|
static fromString(s: string): I64;
|
|
1262
1262
|
/**
|
|
1263
|
-
*
|
|
1263
|
+
* Get the string representation of the integer.
|
|
1264
1264
|
*/
|
|
1265
1265
|
toString(): string;
|
|
1266
1266
|
/**
|
|
1267
|
-
*
|
|
1267
|
+
* Get the byte array representation of the integer.
|
|
1268
1268
|
*/
|
|
1269
1269
|
static fromBytesLe(bytes: Uint8Array): I64;
|
|
1270
1270
|
/**
|
|
1271
|
-
*
|
|
1271
|
+
* Construct an integer from a byte array representation.
|
|
1272
1272
|
*/
|
|
1273
1273
|
toBytesLe(): Uint8Array;
|
|
1274
1274
|
/**
|
|
1275
|
-
*
|
|
1275
|
+
* Construct an integer from a boolean array representation.
|
|
1276
1276
|
*/
|
|
1277
1277
|
static fromBitsLe(bits: Array<any>): I64;
|
|
1278
1278
|
/**
|
|
1279
|
-
*
|
|
1279
|
+
* Get the boolean array representation of the integer.
|
|
1280
1280
|
*/
|
|
1281
1281
|
toBitsLe(): Array<any>;
|
|
1282
1282
|
/**
|
|
@@ -1288,15 +1288,15 @@ export class I64 {
|
|
|
1288
1288
|
*/
|
|
1289
1289
|
absWrapped(): I64;
|
|
1290
1290
|
/**
|
|
1291
|
-
* Wrapped addition.
|
|
1291
|
+
* Wrapped addition with another integer.
|
|
1292
1292
|
*/
|
|
1293
1293
|
addWrapped(other: I64): I64;
|
|
1294
1294
|
/**
|
|
1295
|
-
* Wrapped subtraction.
|
|
1295
|
+
* Wrapped subtraction with another integer.
|
|
1296
1296
|
*/
|
|
1297
1297
|
subWrapped(other: I64): I64;
|
|
1298
1298
|
/**
|
|
1299
|
-
* Wrapped multiplication.
|
|
1299
|
+
* Wrapped multiplication with another integer.
|
|
1300
1300
|
*/
|
|
1301
1301
|
mulWrapped(other: I64): I64;
|
|
1302
1302
|
/**
|
|
@@ -1304,51 +1304,51 @@ export class I64 {
|
|
|
1304
1304
|
*/
|
|
1305
1305
|
divWrapped(other: I64): I64;
|
|
1306
1306
|
/**
|
|
1307
|
-
*
|
|
1307
|
+
* Exponentiate the integer with a u8 exponent.
|
|
1308
1308
|
*/
|
|
1309
1309
|
powU8(exponent: U8): I64;
|
|
1310
1310
|
/**
|
|
1311
|
-
*
|
|
1311
|
+
* Exponentiate the integer with a u16 exponent.
|
|
1312
1312
|
*/
|
|
1313
1313
|
powU16(exponent: U16): I64;
|
|
1314
1314
|
/**
|
|
1315
|
-
*
|
|
1315
|
+
* Exponentiate the integer with a u32 exponent.
|
|
1316
1316
|
*/
|
|
1317
1317
|
powU32(exponent: U32): I64;
|
|
1318
1318
|
/**
|
|
1319
|
-
*
|
|
1319
|
+
* Negate the integer (e.g., 5 → -5).
|
|
1320
1320
|
*/
|
|
1321
1321
|
neg(): I64;
|
|
1322
1322
|
/**
|
|
1323
|
-
*
|
|
1323
|
+
* Check equality with another integer.
|
|
1324
1324
|
*/
|
|
1325
1325
|
equals(other: I64): boolean;
|
|
1326
1326
|
/**
|
|
1327
|
-
*
|
|
1327
|
+
* Get the remainder from integer division.
|
|
1328
1328
|
*/
|
|
1329
1329
|
rem(other: I64): I64;
|
|
1330
1330
|
/**
|
|
1331
|
-
*
|
|
1331
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
1332
1332
|
*/
|
|
1333
1333
|
remWrapped(other: I64): I64;
|
|
1334
1334
|
/**
|
|
1335
|
-
* Convert to Scalar.
|
|
1335
|
+
* Convert the integer to a Scalar value.
|
|
1336
1336
|
*/
|
|
1337
1337
|
toScalar(): Scalar;
|
|
1338
1338
|
/**
|
|
1339
|
-
* Convert to
|
|
1339
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
1340
1340
|
*/
|
|
1341
1341
|
toPlaintext(): Plaintext;
|
|
1342
1342
|
/**
|
|
1343
|
-
*
|
|
1343
|
+
* Attempt to construct the integer from a field element.
|
|
1344
1344
|
*/
|
|
1345
1345
|
static fromField(field: Field): I64;
|
|
1346
1346
|
/**
|
|
1347
|
-
*
|
|
1347
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
1348
1348
|
*/
|
|
1349
1349
|
static fromFields(fields: Array<any>): I64;
|
|
1350
1350
|
/**
|
|
1351
|
-
* Clone.
|
|
1351
|
+
* Clone the integer in wasm memory.
|
|
1352
1352
|
*/
|
|
1353
1353
|
clone(): I64;
|
|
1354
1354
|
}
|
|
@@ -1356,27 +1356,27 @@ export class I8 {
|
|
|
1356
1356
|
private constructor();
|
|
1357
1357
|
free(): void;
|
|
1358
1358
|
/**
|
|
1359
|
-
*
|
|
1359
|
+
* Construct an integer from a string representation.
|
|
1360
1360
|
*/
|
|
1361
1361
|
static fromString(s: string): I8;
|
|
1362
1362
|
/**
|
|
1363
|
-
*
|
|
1363
|
+
* Get the string representation of the integer.
|
|
1364
1364
|
*/
|
|
1365
1365
|
toString(): string;
|
|
1366
1366
|
/**
|
|
1367
|
-
*
|
|
1367
|
+
* Get the byte array representation of the integer.
|
|
1368
1368
|
*/
|
|
1369
1369
|
static fromBytesLe(bytes: Uint8Array): I8;
|
|
1370
1370
|
/**
|
|
1371
|
-
*
|
|
1371
|
+
* Construct an integer from a byte array representation.
|
|
1372
1372
|
*/
|
|
1373
1373
|
toBytesLe(): Uint8Array;
|
|
1374
1374
|
/**
|
|
1375
|
-
*
|
|
1375
|
+
* Construct an integer from a boolean array representation.
|
|
1376
1376
|
*/
|
|
1377
1377
|
static fromBitsLe(bits: Array<any>): I8;
|
|
1378
1378
|
/**
|
|
1379
|
-
*
|
|
1379
|
+
* Get the boolean array representation of the integer.
|
|
1380
1380
|
*/
|
|
1381
1381
|
toBitsLe(): Array<any>;
|
|
1382
1382
|
/**
|
|
@@ -1388,15 +1388,15 @@ export class I8 {
|
|
|
1388
1388
|
*/
|
|
1389
1389
|
absWrapped(): I8;
|
|
1390
1390
|
/**
|
|
1391
|
-
* Wrapped addition.
|
|
1391
|
+
* Wrapped addition with another integer.
|
|
1392
1392
|
*/
|
|
1393
1393
|
addWrapped(other: I8): I8;
|
|
1394
1394
|
/**
|
|
1395
|
-
* Wrapped subtraction.
|
|
1395
|
+
* Wrapped subtraction with another integer.
|
|
1396
1396
|
*/
|
|
1397
1397
|
subWrapped(other: I8): I8;
|
|
1398
1398
|
/**
|
|
1399
|
-
* Wrapped multiplication.
|
|
1399
|
+
* Wrapped multiplication with another integer.
|
|
1400
1400
|
*/
|
|
1401
1401
|
mulWrapped(other: I8): I8;
|
|
1402
1402
|
/**
|
|
@@ -1404,51 +1404,51 @@ export class I8 {
|
|
|
1404
1404
|
*/
|
|
1405
1405
|
divWrapped(other: I8): I8;
|
|
1406
1406
|
/**
|
|
1407
|
-
*
|
|
1407
|
+
* Exponentiate the integer with a u8 exponent.
|
|
1408
1408
|
*/
|
|
1409
1409
|
powU8(exponent: U8): I8;
|
|
1410
1410
|
/**
|
|
1411
|
-
*
|
|
1411
|
+
* Exponentiate the integer with a u16 exponent.
|
|
1412
1412
|
*/
|
|
1413
1413
|
powU16(exponent: U16): I8;
|
|
1414
1414
|
/**
|
|
1415
|
-
*
|
|
1415
|
+
* Exponentiate the integer with a u32 exponent.
|
|
1416
1416
|
*/
|
|
1417
1417
|
powU32(exponent: U32): I8;
|
|
1418
1418
|
/**
|
|
1419
|
-
*
|
|
1419
|
+
* Negate the integer (e.g., 5 → -5).
|
|
1420
1420
|
*/
|
|
1421
1421
|
neg(): I8;
|
|
1422
1422
|
/**
|
|
1423
|
-
*
|
|
1423
|
+
* Check equality with another integer.
|
|
1424
1424
|
*/
|
|
1425
1425
|
equals(other: I8): boolean;
|
|
1426
1426
|
/**
|
|
1427
|
-
*
|
|
1427
|
+
* Get the remainder from integer division.
|
|
1428
1428
|
*/
|
|
1429
1429
|
rem(other: I8): I8;
|
|
1430
1430
|
/**
|
|
1431
|
-
*
|
|
1431
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
1432
1432
|
*/
|
|
1433
1433
|
remWrapped(other: I8): I8;
|
|
1434
1434
|
/**
|
|
1435
|
-
* Convert to Scalar.
|
|
1435
|
+
* Convert the integer to a Scalar value.
|
|
1436
1436
|
*/
|
|
1437
1437
|
toScalar(): Scalar;
|
|
1438
1438
|
/**
|
|
1439
|
-
* Convert to
|
|
1439
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
1440
1440
|
*/
|
|
1441
1441
|
toPlaintext(): Plaintext;
|
|
1442
1442
|
/**
|
|
1443
|
-
*
|
|
1443
|
+
* Attempt to construct the integer from a field element.
|
|
1444
1444
|
*/
|
|
1445
1445
|
static fromField(field: Field): I8;
|
|
1446
1446
|
/**
|
|
1447
|
-
*
|
|
1447
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
1448
1448
|
*/
|
|
1449
1449
|
static fromFields(fields: Array<any>): I8;
|
|
1450
1450
|
/**
|
|
1451
|
-
* Clone.
|
|
1451
|
+
* Clone the integer in wasm memory.
|
|
1452
1452
|
*/
|
|
1453
1453
|
clone(): I8;
|
|
1454
1454
|
}
|
|
@@ -2152,7 +2152,7 @@ export class ProgramManager {
|
|
|
2152
2152
|
* @param inputs A javascript array of inputs to the function.
|
|
2153
2153
|
* @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
|
|
2154
2154
|
*/
|
|
2155
|
-
static authorize(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null): Promise<Authorization>;
|
|
2155
|
+
static authorize(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<Authorization>;
|
|
2156
2156
|
/**
|
|
2157
2157
|
* Create an execution `Authorization` without generating a circuit. Use this function when
|
|
2158
2158
|
* fast delegated proving is needed.
|
|
@@ -2163,7 +2163,7 @@ export class ProgramManager {
|
|
|
2163
2163
|
* @param inputs A javascript array of inputs to the function.
|
|
2164
2164
|
* @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
|
|
2165
2165
|
*/
|
|
2166
|
-
static buildAuthorizationUnchecked(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null): Promise<Authorization>;
|
|
2166
|
+
static buildAuthorizationUnchecked(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<Authorization>;
|
|
2167
2167
|
/**
|
|
2168
2168
|
* Create an `Authorization` for `credits.aleo/fee_public` or `credits.aleo/fee_private`.
|
|
2169
2169
|
* This object requires an associated execution or deployment ID. This can be gained from
|
|
@@ -2240,7 +2240,7 @@ export class ProgramManager {
|
|
|
2240
2240
|
* @param {ProvingKey | undefined} proving_key (optional) Provide a verifying key to use for the function execution
|
|
2241
2241
|
* @param {VerifyingKey | undefined} verifying_key (optional) Provide a verifying key to use for the function execution
|
|
2242
2242
|
*/
|
|
2243
|
-
static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, url?: string | null, offline_query?: OfflineQuery | null): Promise<ExecutionResponse>;
|
|
2243
|
+
static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, url?: string | null, offline_query?: OfflineQuery | null, edition?: number | null): Promise<ExecutionResponse>;
|
|
2244
2244
|
/**
|
|
2245
2245
|
* Execute Aleo function and create an Aleo execution transaction
|
|
2246
2246
|
*
|
|
@@ -2262,9 +2262,11 @@ export class ProgramManager {
|
|
|
2262
2262
|
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
2263
2263
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
2264
2264
|
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
2265
|
+
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
2266
|
+
* @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
|
|
2265
2267
|
* @returns {Transaction}
|
|
2266
2268
|
*/
|
|
2267
|
-
static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
|
|
2269
|
+
static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null, edition?: number | null): Promise<Transaction>;
|
|
2268
2270
|
/**
|
|
2269
2271
|
* Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
|
|
2270
2272
|
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
@@ -2284,7 +2286,7 @@ export class ProgramManager {
|
|
|
2284
2286
|
* @param verifying_key (optional) Provide a verifying key to use for the fee estimation
|
|
2285
2287
|
* @returns {u64} Fee in microcredits
|
|
2286
2288
|
*/
|
|
2287
|
-
static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<bigint>;
|
|
2289
|
+
static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null, edition?: number | null): Promise<bigint>;
|
|
2288
2290
|
/**
|
|
2289
2291
|
* Estimate the finalize fee component for executing a function. This fee is additional to the
|
|
2290
2292
|
* size of the execution of the program in bytes. If the function does not have a finalize
|
|
@@ -2331,7 +2333,7 @@ export class ProgramManager {
|
|
|
2331
2333
|
* @param broadcast (optional) Flag to indicate if the transaction should be broadcast
|
|
2332
2334
|
* @returns {Authorization}
|
|
2333
2335
|
*/
|
|
2334
|
-
static buildProvingRequest(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, base_fee_credits: number, priority_fee_credits: number, fee_record: RecordPlaintext | null | undefined, imports: object | null | undefined, broadcast: boolean, unchecked: boolean): Promise<ProvingRequest>;
|
|
2336
|
+
static buildProvingRequest(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, base_fee_credits: number, priority_fee_credits: number, fee_record: RecordPlaintext | null | undefined, imports: object | null | undefined, broadcast: boolean, unchecked: boolean, edition?: number | null): Promise<ProvingRequest>;
|
|
2335
2337
|
/**
|
|
2336
2338
|
* Split an Aleo credits record into two separate records. This function does not require a fee.
|
|
2337
2339
|
*
|
|
@@ -2371,7 +2373,7 @@ export class ProgramManager {
|
|
|
2371
2373
|
* @param inputs {Array} The inputs to the function
|
|
2372
2374
|
* @param imports {Object | undefined} The imports for the program
|
|
2373
2375
|
*/
|
|
2374
|
-
static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object | null): Promise<KeyPair>;
|
|
2376
|
+
static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<KeyPair>;
|
|
2375
2377
|
}
|
|
2376
2378
|
/**
|
|
2377
2379
|
* Proving key for a function within an Aleo program
|
|
@@ -2905,6 +2907,10 @@ export class Scalar {
|
|
|
2905
2907
|
* Create a plaintext element from a scalar element.
|
|
2906
2908
|
*/
|
|
2907
2909
|
toPlaintext(): Plaintext;
|
|
2910
|
+
/**
|
|
2911
|
+
* Cast the scalar element to a field element.
|
|
2912
|
+
*/
|
|
2913
|
+
toField(): Field;
|
|
2908
2914
|
/**
|
|
2909
2915
|
* Clone the scalar element.
|
|
2910
2916
|
*/
|
|
@@ -3324,27 +3330,27 @@ export class U128 {
|
|
|
3324
3330
|
private constructor();
|
|
3325
3331
|
free(): void;
|
|
3326
3332
|
/**
|
|
3327
|
-
*
|
|
3333
|
+
* Construct an integer from a string representation.
|
|
3328
3334
|
*/
|
|
3329
3335
|
static fromString(s: string): U128;
|
|
3330
3336
|
/**
|
|
3331
|
-
*
|
|
3337
|
+
* Get the string representation of the integer.
|
|
3332
3338
|
*/
|
|
3333
3339
|
toString(): string;
|
|
3334
3340
|
/**
|
|
3335
|
-
*
|
|
3341
|
+
* Get the byte array representation of the integer.
|
|
3336
3342
|
*/
|
|
3337
3343
|
static fromBytesLe(bytes: Uint8Array): U128;
|
|
3338
3344
|
/**
|
|
3339
|
-
*
|
|
3345
|
+
* Construct an integer from a byte array representation.
|
|
3340
3346
|
*/
|
|
3341
3347
|
toBytesLe(): Uint8Array;
|
|
3342
3348
|
/**
|
|
3343
|
-
*
|
|
3349
|
+
* Construct an integer from a boolean array representation.
|
|
3344
3350
|
*/
|
|
3345
3351
|
static fromBitsLe(bits: Array<any>): U128;
|
|
3346
3352
|
/**
|
|
3347
|
-
*
|
|
3353
|
+
* Get the boolean array representation of the integer.
|
|
3348
3354
|
*/
|
|
3349
3355
|
toBitsLe(): Array<any>;
|
|
3350
3356
|
/**
|
|
@@ -3356,15 +3362,15 @@ export class U128 {
|
|
|
3356
3362
|
*/
|
|
3357
3363
|
absWrapped(): U128;
|
|
3358
3364
|
/**
|
|
3359
|
-
* Wrapped addition.
|
|
3365
|
+
* Wrapped addition with another integer.
|
|
3360
3366
|
*/
|
|
3361
3367
|
addWrapped(other: U128): U128;
|
|
3362
3368
|
/**
|
|
3363
|
-
* Wrapped subtraction.
|
|
3369
|
+
* Wrapped subtraction with another integer.
|
|
3364
3370
|
*/
|
|
3365
3371
|
subWrapped(other: U128): U128;
|
|
3366
3372
|
/**
|
|
3367
|
-
* Wrapped multiplication.
|
|
3373
|
+
* Wrapped multiplication with another integer.
|
|
3368
3374
|
*/
|
|
3369
3375
|
mulWrapped(other: U128): U128;
|
|
3370
3376
|
/**
|
|
@@ -3372,51 +3378,51 @@ export class U128 {
|
|
|
3372
3378
|
*/
|
|
3373
3379
|
divWrapped(other: U128): U128;
|
|
3374
3380
|
/**
|
|
3375
|
-
*
|
|
3381
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3376
3382
|
*/
|
|
3377
3383
|
powU8(exponent: U8): U128;
|
|
3378
3384
|
/**
|
|
3379
|
-
*
|
|
3385
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3380
3386
|
*/
|
|
3381
3387
|
powU16(exponent: U16): U128;
|
|
3382
3388
|
/**
|
|
3383
|
-
*
|
|
3389
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3384
3390
|
*/
|
|
3385
3391
|
powU32(exponent: U32): U128;
|
|
3386
3392
|
/**
|
|
3387
|
-
*
|
|
3393
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3388
3394
|
*/
|
|
3389
3395
|
neg(): U128;
|
|
3390
3396
|
/**
|
|
3391
|
-
*
|
|
3397
|
+
* Check equality with another integer.
|
|
3392
3398
|
*/
|
|
3393
3399
|
equals(other: U128): boolean;
|
|
3394
3400
|
/**
|
|
3395
|
-
*
|
|
3401
|
+
* Get the remainder from integer division.
|
|
3396
3402
|
*/
|
|
3397
3403
|
rem(other: U128): U128;
|
|
3398
3404
|
/**
|
|
3399
|
-
*
|
|
3405
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3400
3406
|
*/
|
|
3401
3407
|
remWrapped(other: U128): U128;
|
|
3402
3408
|
/**
|
|
3403
|
-
* Convert to Scalar.
|
|
3409
|
+
* Convert the integer to a Scalar value.
|
|
3404
3410
|
*/
|
|
3405
3411
|
toScalar(): Scalar;
|
|
3406
3412
|
/**
|
|
3407
|
-
* Convert to
|
|
3413
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
3408
3414
|
*/
|
|
3409
3415
|
toPlaintext(): Plaintext;
|
|
3410
3416
|
/**
|
|
3411
|
-
*
|
|
3417
|
+
* Attempt to construct the integer from a field element.
|
|
3412
3418
|
*/
|
|
3413
3419
|
static fromField(field: Field): U128;
|
|
3414
3420
|
/**
|
|
3415
|
-
*
|
|
3421
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
3416
3422
|
*/
|
|
3417
3423
|
static fromFields(fields: Array<any>): U128;
|
|
3418
3424
|
/**
|
|
3419
|
-
* Clone.
|
|
3425
|
+
* Clone the integer in wasm memory.
|
|
3420
3426
|
*/
|
|
3421
3427
|
clone(): U128;
|
|
3422
3428
|
}
|
|
@@ -3424,27 +3430,27 @@ export class U16 {
|
|
|
3424
3430
|
private constructor();
|
|
3425
3431
|
free(): void;
|
|
3426
3432
|
/**
|
|
3427
|
-
*
|
|
3433
|
+
* Construct an integer from a string representation.
|
|
3428
3434
|
*/
|
|
3429
3435
|
static fromString(s: string): U16;
|
|
3430
3436
|
/**
|
|
3431
|
-
*
|
|
3437
|
+
* Get the string representation of the integer.
|
|
3432
3438
|
*/
|
|
3433
3439
|
toString(): string;
|
|
3434
3440
|
/**
|
|
3435
|
-
*
|
|
3441
|
+
* Get the byte array representation of the integer.
|
|
3436
3442
|
*/
|
|
3437
3443
|
static fromBytesLe(bytes: Uint8Array): U16;
|
|
3438
3444
|
/**
|
|
3439
|
-
*
|
|
3445
|
+
* Construct an integer from a byte array representation.
|
|
3440
3446
|
*/
|
|
3441
3447
|
toBytesLe(): Uint8Array;
|
|
3442
3448
|
/**
|
|
3443
|
-
*
|
|
3449
|
+
* Construct an integer from a boolean array representation.
|
|
3444
3450
|
*/
|
|
3445
3451
|
static fromBitsLe(bits: Array<any>): U16;
|
|
3446
3452
|
/**
|
|
3447
|
-
*
|
|
3453
|
+
* Get the boolean array representation of the integer.
|
|
3448
3454
|
*/
|
|
3449
3455
|
toBitsLe(): Array<any>;
|
|
3450
3456
|
/**
|
|
@@ -3456,15 +3462,15 @@ export class U16 {
|
|
|
3456
3462
|
*/
|
|
3457
3463
|
absWrapped(): U16;
|
|
3458
3464
|
/**
|
|
3459
|
-
* Wrapped addition.
|
|
3465
|
+
* Wrapped addition with another integer.
|
|
3460
3466
|
*/
|
|
3461
3467
|
addWrapped(other: U16): U16;
|
|
3462
3468
|
/**
|
|
3463
|
-
* Wrapped subtraction.
|
|
3469
|
+
* Wrapped subtraction with another integer.
|
|
3464
3470
|
*/
|
|
3465
3471
|
subWrapped(other: U16): U16;
|
|
3466
3472
|
/**
|
|
3467
|
-
* Wrapped multiplication.
|
|
3473
|
+
* Wrapped multiplication with another integer.
|
|
3468
3474
|
*/
|
|
3469
3475
|
mulWrapped(other: U16): U16;
|
|
3470
3476
|
/**
|
|
@@ -3472,51 +3478,51 @@ export class U16 {
|
|
|
3472
3478
|
*/
|
|
3473
3479
|
divWrapped(other: U16): U16;
|
|
3474
3480
|
/**
|
|
3475
|
-
*
|
|
3481
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3476
3482
|
*/
|
|
3477
3483
|
powU8(exponent: U8): U16;
|
|
3478
3484
|
/**
|
|
3479
|
-
*
|
|
3485
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3480
3486
|
*/
|
|
3481
3487
|
powU16(exponent: U16): U16;
|
|
3482
3488
|
/**
|
|
3483
|
-
*
|
|
3489
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3484
3490
|
*/
|
|
3485
3491
|
powU32(exponent: U32): U16;
|
|
3486
3492
|
/**
|
|
3487
|
-
*
|
|
3493
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3488
3494
|
*/
|
|
3489
3495
|
neg(): U16;
|
|
3490
3496
|
/**
|
|
3491
|
-
*
|
|
3497
|
+
* Check equality with another integer.
|
|
3492
3498
|
*/
|
|
3493
3499
|
equals(other: U16): boolean;
|
|
3494
3500
|
/**
|
|
3495
|
-
*
|
|
3501
|
+
* Get the remainder from integer division.
|
|
3496
3502
|
*/
|
|
3497
3503
|
rem(other: U16): U16;
|
|
3498
3504
|
/**
|
|
3499
|
-
*
|
|
3505
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3500
3506
|
*/
|
|
3501
3507
|
remWrapped(other: U16): U16;
|
|
3502
3508
|
/**
|
|
3503
|
-
* Convert to Scalar.
|
|
3509
|
+
* Convert the integer to a Scalar value.
|
|
3504
3510
|
*/
|
|
3505
3511
|
toScalar(): Scalar;
|
|
3506
3512
|
/**
|
|
3507
|
-
* Convert to
|
|
3513
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
3508
3514
|
*/
|
|
3509
3515
|
toPlaintext(): Plaintext;
|
|
3510
3516
|
/**
|
|
3511
|
-
*
|
|
3517
|
+
* Attempt to construct the integer from a field element.
|
|
3512
3518
|
*/
|
|
3513
3519
|
static fromField(field: Field): U16;
|
|
3514
3520
|
/**
|
|
3515
|
-
*
|
|
3521
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
3516
3522
|
*/
|
|
3517
3523
|
static fromFields(fields: Array<any>): U16;
|
|
3518
3524
|
/**
|
|
3519
|
-
* Clone.
|
|
3525
|
+
* Clone the integer in wasm memory.
|
|
3520
3526
|
*/
|
|
3521
3527
|
clone(): U16;
|
|
3522
3528
|
}
|
|
@@ -3524,27 +3530,27 @@ export class U32 {
|
|
|
3524
3530
|
private constructor();
|
|
3525
3531
|
free(): void;
|
|
3526
3532
|
/**
|
|
3527
|
-
*
|
|
3533
|
+
* Construct an integer from a string representation.
|
|
3528
3534
|
*/
|
|
3529
3535
|
static fromString(s: string): U32;
|
|
3530
3536
|
/**
|
|
3531
|
-
*
|
|
3537
|
+
* Get the string representation of the integer.
|
|
3532
3538
|
*/
|
|
3533
3539
|
toString(): string;
|
|
3534
3540
|
/**
|
|
3535
|
-
*
|
|
3541
|
+
* Get the byte array representation of the integer.
|
|
3536
3542
|
*/
|
|
3537
3543
|
static fromBytesLe(bytes: Uint8Array): U32;
|
|
3538
3544
|
/**
|
|
3539
|
-
*
|
|
3545
|
+
* Construct an integer from a byte array representation.
|
|
3540
3546
|
*/
|
|
3541
3547
|
toBytesLe(): Uint8Array;
|
|
3542
3548
|
/**
|
|
3543
|
-
*
|
|
3549
|
+
* Construct an integer from a boolean array representation.
|
|
3544
3550
|
*/
|
|
3545
3551
|
static fromBitsLe(bits: Array<any>): U32;
|
|
3546
3552
|
/**
|
|
3547
|
-
*
|
|
3553
|
+
* Get the boolean array representation of the integer.
|
|
3548
3554
|
*/
|
|
3549
3555
|
toBitsLe(): Array<any>;
|
|
3550
3556
|
/**
|
|
@@ -3556,15 +3562,15 @@ export class U32 {
|
|
|
3556
3562
|
*/
|
|
3557
3563
|
absWrapped(): U32;
|
|
3558
3564
|
/**
|
|
3559
|
-
* Wrapped addition.
|
|
3565
|
+
* Wrapped addition with another integer.
|
|
3560
3566
|
*/
|
|
3561
3567
|
addWrapped(other: U32): U32;
|
|
3562
3568
|
/**
|
|
3563
|
-
* Wrapped subtraction.
|
|
3569
|
+
* Wrapped subtraction with another integer.
|
|
3564
3570
|
*/
|
|
3565
3571
|
subWrapped(other: U32): U32;
|
|
3566
3572
|
/**
|
|
3567
|
-
* Wrapped multiplication.
|
|
3573
|
+
* Wrapped multiplication with another integer.
|
|
3568
3574
|
*/
|
|
3569
3575
|
mulWrapped(other: U32): U32;
|
|
3570
3576
|
/**
|
|
@@ -3572,51 +3578,51 @@ export class U32 {
|
|
|
3572
3578
|
*/
|
|
3573
3579
|
divWrapped(other: U32): U32;
|
|
3574
3580
|
/**
|
|
3575
|
-
*
|
|
3581
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3576
3582
|
*/
|
|
3577
3583
|
powU8(exponent: U8): U32;
|
|
3578
3584
|
/**
|
|
3579
|
-
*
|
|
3585
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3580
3586
|
*/
|
|
3581
3587
|
powU16(exponent: U16): U32;
|
|
3582
3588
|
/**
|
|
3583
|
-
*
|
|
3589
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3584
3590
|
*/
|
|
3585
3591
|
powU32(exponent: U32): U32;
|
|
3586
3592
|
/**
|
|
3587
|
-
*
|
|
3593
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3588
3594
|
*/
|
|
3589
3595
|
neg(): U32;
|
|
3590
3596
|
/**
|
|
3591
|
-
*
|
|
3597
|
+
* Check equality with another integer.
|
|
3592
3598
|
*/
|
|
3593
3599
|
equals(other: U32): boolean;
|
|
3594
3600
|
/**
|
|
3595
|
-
*
|
|
3601
|
+
* Get the remainder from integer division.
|
|
3596
3602
|
*/
|
|
3597
3603
|
rem(other: U32): U32;
|
|
3598
3604
|
/**
|
|
3599
|
-
*
|
|
3605
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3600
3606
|
*/
|
|
3601
3607
|
remWrapped(other: U32): U32;
|
|
3602
3608
|
/**
|
|
3603
|
-
* Convert to Scalar.
|
|
3609
|
+
* Convert the integer to a Scalar value.
|
|
3604
3610
|
*/
|
|
3605
3611
|
toScalar(): Scalar;
|
|
3606
3612
|
/**
|
|
3607
|
-
* Convert to
|
|
3613
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
3608
3614
|
*/
|
|
3609
3615
|
toPlaintext(): Plaintext;
|
|
3610
3616
|
/**
|
|
3611
|
-
*
|
|
3617
|
+
* Attempt to construct the integer from a field element.
|
|
3612
3618
|
*/
|
|
3613
3619
|
static fromField(field: Field): U32;
|
|
3614
3620
|
/**
|
|
3615
|
-
*
|
|
3621
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
3616
3622
|
*/
|
|
3617
3623
|
static fromFields(fields: Array<any>): U32;
|
|
3618
3624
|
/**
|
|
3619
|
-
* Clone.
|
|
3625
|
+
* Clone the integer in wasm memory.
|
|
3620
3626
|
*/
|
|
3621
3627
|
clone(): U32;
|
|
3622
3628
|
}
|
|
@@ -3624,27 +3630,27 @@ export class U64 {
|
|
|
3624
3630
|
private constructor();
|
|
3625
3631
|
free(): void;
|
|
3626
3632
|
/**
|
|
3627
|
-
*
|
|
3633
|
+
* Construct an integer from a string representation.
|
|
3628
3634
|
*/
|
|
3629
3635
|
static fromString(s: string): U64;
|
|
3630
3636
|
/**
|
|
3631
|
-
*
|
|
3637
|
+
* Get the string representation of the integer.
|
|
3632
3638
|
*/
|
|
3633
3639
|
toString(): string;
|
|
3634
3640
|
/**
|
|
3635
|
-
*
|
|
3641
|
+
* Get the byte array representation of the integer.
|
|
3636
3642
|
*/
|
|
3637
3643
|
static fromBytesLe(bytes: Uint8Array): U64;
|
|
3638
3644
|
/**
|
|
3639
|
-
*
|
|
3645
|
+
* Construct an integer from a byte array representation.
|
|
3640
3646
|
*/
|
|
3641
3647
|
toBytesLe(): Uint8Array;
|
|
3642
3648
|
/**
|
|
3643
|
-
*
|
|
3649
|
+
* Construct an integer from a boolean array representation.
|
|
3644
3650
|
*/
|
|
3645
3651
|
static fromBitsLe(bits: Array<any>): U64;
|
|
3646
3652
|
/**
|
|
3647
|
-
*
|
|
3653
|
+
* Get the boolean array representation of the integer.
|
|
3648
3654
|
*/
|
|
3649
3655
|
toBitsLe(): Array<any>;
|
|
3650
3656
|
/**
|
|
@@ -3656,15 +3662,15 @@ export class U64 {
|
|
|
3656
3662
|
*/
|
|
3657
3663
|
absWrapped(): U64;
|
|
3658
3664
|
/**
|
|
3659
|
-
* Wrapped addition.
|
|
3665
|
+
* Wrapped addition with another integer.
|
|
3660
3666
|
*/
|
|
3661
3667
|
addWrapped(other: U64): U64;
|
|
3662
3668
|
/**
|
|
3663
|
-
* Wrapped subtraction.
|
|
3669
|
+
* Wrapped subtraction with another integer.
|
|
3664
3670
|
*/
|
|
3665
3671
|
subWrapped(other: U64): U64;
|
|
3666
3672
|
/**
|
|
3667
|
-
* Wrapped multiplication.
|
|
3673
|
+
* Wrapped multiplication with another integer.
|
|
3668
3674
|
*/
|
|
3669
3675
|
mulWrapped(other: U64): U64;
|
|
3670
3676
|
/**
|
|
@@ -3672,51 +3678,51 @@ export class U64 {
|
|
|
3672
3678
|
*/
|
|
3673
3679
|
divWrapped(other: U64): U64;
|
|
3674
3680
|
/**
|
|
3675
|
-
*
|
|
3681
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3676
3682
|
*/
|
|
3677
3683
|
powU8(exponent: U8): U64;
|
|
3678
3684
|
/**
|
|
3679
|
-
*
|
|
3685
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3680
3686
|
*/
|
|
3681
3687
|
powU16(exponent: U16): U64;
|
|
3682
3688
|
/**
|
|
3683
|
-
*
|
|
3689
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3684
3690
|
*/
|
|
3685
3691
|
powU32(exponent: U32): U64;
|
|
3686
3692
|
/**
|
|
3687
|
-
*
|
|
3693
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3688
3694
|
*/
|
|
3689
3695
|
neg(): U64;
|
|
3690
3696
|
/**
|
|
3691
|
-
*
|
|
3697
|
+
* Check equality with another integer.
|
|
3692
3698
|
*/
|
|
3693
3699
|
equals(other: U64): boolean;
|
|
3694
3700
|
/**
|
|
3695
|
-
*
|
|
3701
|
+
* Get the remainder from integer division.
|
|
3696
3702
|
*/
|
|
3697
3703
|
rem(other: U64): U64;
|
|
3698
3704
|
/**
|
|
3699
|
-
*
|
|
3705
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3700
3706
|
*/
|
|
3701
3707
|
remWrapped(other: U64): U64;
|
|
3702
3708
|
/**
|
|
3703
|
-
* Convert to Scalar.
|
|
3709
|
+
* Convert the integer to a Scalar value.
|
|
3704
3710
|
*/
|
|
3705
3711
|
toScalar(): Scalar;
|
|
3706
3712
|
/**
|
|
3707
|
-
* Convert to
|
|
3713
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
3708
3714
|
*/
|
|
3709
3715
|
toPlaintext(): Plaintext;
|
|
3710
3716
|
/**
|
|
3711
|
-
*
|
|
3717
|
+
* Attempt to construct the integer from a field element.
|
|
3712
3718
|
*/
|
|
3713
3719
|
static fromField(field: Field): U64;
|
|
3714
3720
|
/**
|
|
3715
|
-
*
|
|
3721
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
3716
3722
|
*/
|
|
3717
3723
|
static fromFields(fields: Array<any>): U64;
|
|
3718
3724
|
/**
|
|
3719
|
-
* Clone.
|
|
3725
|
+
* Clone the integer in wasm memory.
|
|
3720
3726
|
*/
|
|
3721
3727
|
clone(): U64;
|
|
3722
3728
|
}
|
|
@@ -3724,27 +3730,27 @@ export class U8 {
|
|
|
3724
3730
|
private constructor();
|
|
3725
3731
|
free(): void;
|
|
3726
3732
|
/**
|
|
3727
|
-
*
|
|
3733
|
+
* Construct an integer from a string representation.
|
|
3728
3734
|
*/
|
|
3729
3735
|
static fromString(s: string): U8;
|
|
3730
3736
|
/**
|
|
3731
|
-
*
|
|
3737
|
+
* Get the string representation of the integer.
|
|
3732
3738
|
*/
|
|
3733
3739
|
toString(): string;
|
|
3734
3740
|
/**
|
|
3735
|
-
*
|
|
3741
|
+
* Get the byte array representation of the integer.
|
|
3736
3742
|
*/
|
|
3737
3743
|
static fromBytesLe(bytes: Uint8Array): U8;
|
|
3738
3744
|
/**
|
|
3739
|
-
*
|
|
3745
|
+
* Construct an integer from a byte array representation.
|
|
3740
3746
|
*/
|
|
3741
3747
|
toBytesLe(): Uint8Array;
|
|
3742
3748
|
/**
|
|
3743
|
-
*
|
|
3749
|
+
* Construct an integer from a boolean array representation.
|
|
3744
3750
|
*/
|
|
3745
3751
|
static fromBitsLe(bits: Array<any>): U8;
|
|
3746
3752
|
/**
|
|
3747
|
-
*
|
|
3753
|
+
* Get the boolean array representation of the integer.
|
|
3748
3754
|
*/
|
|
3749
3755
|
toBitsLe(): Array<any>;
|
|
3750
3756
|
/**
|
|
@@ -3756,15 +3762,15 @@ export class U8 {
|
|
|
3756
3762
|
*/
|
|
3757
3763
|
absWrapped(): U8;
|
|
3758
3764
|
/**
|
|
3759
|
-
* Wrapped addition.
|
|
3765
|
+
* Wrapped addition with another integer.
|
|
3760
3766
|
*/
|
|
3761
3767
|
addWrapped(other: U8): U8;
|
|
3762
3768
|
/**
|
|
3763
|
-
* Wrapped subtraction.
|
|
3769
|
+
* Wrapped subtraction with another integer.
|
|
3764
3770
|
*/
|
|
3765
3771
|
subWrapped(other: U8): U8;
|
|
3766
3772
|
/**
|
|
3767
|
-
* Wrapped multiplication.
|
|
3773
|
+
* Wrapped multiplication with another integer.
|
|
3768
3774
|
*/
|
|
3769
3775
|
mulWrapped(other: U8): U8;
|
|
3770
3776
|
/**
|
|
@@ -3772,51 +3778,51 @@ export class U8 {
|
|
|
3772
3778
|
*/
|
|
3773
3779
|
divWrapped(other: U8): U8;
|
|
3774
3780
|
/**
|
|
3775
|
-
*
|
|
3781
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3776
3782
|
*/
|
|
3777
3783
|
powU8(exponent: U8): U8;
|
|
3778
3784
|
/**
|
|
3779
|
-
*
|
|
3785
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3780
3786
|
*/
|
|
3781
3787
|
powU16(exponent: U16): U8;
|
|
3782
3788
|
/**
|
|
3783
|
-
*
|
|
3789
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3784
3790
|
*/
|
|
3785
3791
|
powU32(exponent: U32): U8;
|
|
3786
3792
|
/**
|
|
3787
|
-
*
|
|
3793
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3788
3794
|
*/
|
|
3789
3795
|
neg(): U8;
|
|
3790
3796
|
/**
|
|
3791
|
-
*
|
|
3797
|
+
* Check equality with another integer.
|
|
3792
3798
|
*/
|
|
3793
3799
|
equals(other: U8): boolean;
|
|
3794
3800
|
/**
|
|
3795
|
-
*
|
|
3801
|
+
* Get the remainder from integer division.
|
|
3796
3802
|
*/
|
|
3797
3803
|
rem(other: U8): U8;
|
|
3798
3804
|
/**
|
|
3799
|
-
*
|
|
3805
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3800
3806
|
*/
|
|
3801
3807
|
remWrapped(other: U8): U8;
|
|
3802
3808
|
/**
|
|
3803
|
-
* Convert to Scalar.
|
|
3809
|
+
* Convert the integer to a Scalar value.
|
|
3804
3810
|
*/
|
|
3805
3811
|
toScalar(): Scalar;
|
|
3806
3812
|
/**
|
|
3807
|
-
* Convert to
|
|
3813
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
3808
3814
|
*/
|
|
3809
3815
|
toPlaintext(): Plaintext;
|
|
3810
3816
|
/**
|
|
3811
|
-
*
|
|
3817
|
+
* Attempt to construct the integer from a field element.
|
|
3812
3818
|
*/
|
|
3813
3819
|
static fromField(field: Field): U8;
|
|
3814
3820
|
/**
|
|
3815
|
-
*
|
|
3821
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
3816
3822
|
*/
|
|
3817
3823
|
static fromFields(fields: Array<any>): U8;
|
|
3818
3824
|
/**
|
|
3819
|
-
* Clone.
|
|
3825
|
+
* Clone the integer in wasm memory.
|
|
3820
3826
|
*/
|
|
3821
3827
|
clone(): U8;
|
|
3822
3828
|
}
|
|
@@ -4044,6 +4050,12 @@ export class VerifyingKey {
|
|
|
4044
4050
|
* @returns {String} String representation of the verifying key
|
|
4045
4051
|
*/
|
|
4046
4052
|
toString(): string;
|
|
4053
|
+
/**
|
|
4054
|
+
* Get the number of constraints associated with the circuit
|
|
4055
|
+
*
|
|
4056
|
+
* @returns {number} The number of constraints
|
|
4057
|
+
*/
|
|
4058
|
+
numConstraints(): number;
|
|
4047
4059
|
}
|
|
4048
4060
|
export class ViewKey {
|
|
4049
4061
|
private constructor();
|
|
@@ -4078,6 +4090,10 @@ export class ViewKey {
|
|
|
4078
4090
|
* Get the underlying scalar of a view key.
|
|
4079
4091
|
*/
|
|
4080
4092
|
to_scalar(): Scalar;
|
|
4093
|
+
/**
|
|
4094
|
+
* Cast the view key to a field.
|
|
4095
|
+
*/
|
|
4096
|
+
toField(): Field;
|
|
4081
4097
|
/**
|
|
4082
4098
|
* Decrypt a record ciphertext with a view key
|
|
4083
4099
|
*
|