starknet 5.9.0 → 5.9.2
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/CHANGELOG.md +14 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.global.js +1582 -367
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -2930,6 +2930,12 @@ function parseCalldataField(argsIterator, input, structs) {
|
|
|
2930
2930
|
}, result);
|
|
2931
2931
|
case (isTypeStruct(type, structs) || isTypeTuple(type)):
|
|
2932
2932
|
return parseCalldataValue(value, type, structs);
|
|
2933
|
+
case isTypeUint256(type):
|
|
2934
|
+
if (typeof value === "object") {
|
|
2935
|
+
return [felt(value.low), felt(value.high)];
|
|
2936
|
+
}
|
|
2937
|
+
const el_uint256 = uint256(value);
|
|
2938
|
+
return [felt(el_uint256.low), felt(el_uint256.high)];
|
|
2933
2939
|
default:
|
|
2934
2940
|
return parseBaseTypes(type, value);
|
|
2935
2941
|
}
|
|
@@ -3017,10 +3023,10 @@ var validateUint = (parameter, input) => {
|
|
|
3017
3023
|
);
|
|
3018
3024
|
}
|
|
3019
3025
|
assert(
|
|
3020
|
-
typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint",
|
|
3021
|
-
`Validate: arg ${input.name} of cairo type ${input.type} should be type (String, Number or BigInt)`
|
|
3026
|
+
typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint" || typeof parameter === "object" && "low" in parameter && "high" in parameter,
|
|
3027
|
+
`Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)`
|
|
3022
3028
|
);
|
|
3023
|
-
const param = toBigInt(parameter);
|
|
3029
|
+
const param = typeof parameter === "object" ? uint256ToBN(parameter) : toBigInt(parameter);
|
|
3024
3030
|
switch (input.type) {
|
|
3025
3031
|
case "core::integer::u8" /* u8 */:
|
|
3026
3032
|
assert(
|