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.js
CHANGED
|
@@ -3001,6 +3001,12 @@ function parseCalldataField(argsIterator, input, structs) {
|
|
|
3001
3001
|
}, result);
|
|
3002
3002
|
case (isTypeStruct(type, structs) || isTypeTuple(type)):
|
|
3003
3003
|
return parseCalldataValue(value, type, structs);
|
|
3004
|
+
case isTypeUint256(type):
|
|
3005
|
+
if (typeof value === "object") {
|
|
3006
|
+
return [felt(value.low), felt(value.high)];
|
|
3007
|
+
}
|
|
3008
|
+
const el_uint256 = uint256(value);
|
|
3009
|
+
return [felt(el_uint256.low), felt(el_uint256.high)];
|
|
3004
3010
|
default:
|
|
3005
3011
|
return parseBaseTypes(type, value);
|
|
3006
3012
|
}
|
|
@@ -3088,10 +3094,10 @@ var validateUint = (parameter, input) => {
|
|
|
3088
3094
|
);
|
|
3089
3095
|
}
|
|
3090
3096
|
assert(
|
|
3091
|
-
typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint",
|
|
3092
|
-
`Validate: arg ${input.name} of cairo type ${input.type} should be type (String, Number or BigInt)`
|
|
3097
|
+
typeof parameter === "string" || typeof parameter === "number" || typeof parameter === "bigint" || typeof parameter === "object" && "low" in parameter && "high" in parameter,
|
|
3098
|
+
`Validate: arg ${input.name} of cairo ZORG type ${input.type} should be type (String, Number or BigInt)`
|
|
3093
3099
|
);
|
|
3094
|
-
const param = toBigInt(parameter);
|
|
3100
|
+
const param = typeof parameter === "object" ? uint256ToBN(parameter) : toBigInt(parameter);
|
|
3095
3101
|
switch (input.type) {
|
|
3096
3102
|
case "core::integer::u8" /* u8 */:
|
|
3097
3103
|
assert(
|