starknet 5.10.0 → 5.10.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 +12 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +16 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -2721,6 +2721,14 @@ function parseCalldataValue(element, type, structs) {
|
|
|
2721
2721
|
return acc.concat(parsedData);
|
|
2722
2722
|
}, []);
|
|
2723
2723
|
}
|
|
2724
|
+
if (isTypeUint256(type)) {
|
|
2725
|
+
if (typeof element === "object") {
|
|
2726
|
+
const { low, high } = element;
|
|
2727
|
+
return [felt(low), felt(high)];
|
|
2728
|
+
}
|
|
2729
|
+
const el_uint256 = uint256(element);
|
|
2730
|
+
return [felt(el_uint256.low), felt(el_uint256.high)];
|
|
2731
|
+
}
|
|
2724
2732
|
if (typeof element === "object") {
|
|
2725
2733
|
throw Error(`Parameter ${element} do not align with abi parameter ${type}`);
|
|
2726
2734
|
}
|
|
@@ -2738,14 +2746,8 @@ function parseCalldataField(argsIterator, input, structs) {
|
|
|
2738
2746
|
value = splitLongString(value);
|
|
2739
2747
|
}
|
|
2740
2748
|
return parseCalldataValue(value, input.type, structs);
|
|
2741
|
-
case (isTypeStruct(type, structs) || isTypeTuple(type)):
|
|
2749
|
+
case (isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type)):
|
|
2742
2750
|
return parseCalldataValue(value, type, structs);
|
|
2743
|
-
case isTypeUint256(type):
|
|
2744
|
-
if (typeof value === "object") {
|
|
2745
|
-
return [felt(value.low), felt(value.high)];
|
|
2746
|
-
}
|
|
2747
|
-
const el_uint256 = uint256(value);
|
|
2748
|
-
return [felt(el_uint256.low), felt(el_uint256.high)];
|
|
2749
2751
|
default:
|
|
2750
2752
|
return parseBaseTypes(type, value);
|
|
2751
2753
|
}
|
|
@@ -5067,11 +5069,16 @@ var transformCallsToMulticallArrays_cairo1 = (calls) => {
|
|
|
5067
5069
|
return callArray;
|
|
5068
5070
|
};
|
|
5069
5071
|
var fromCallsToExecuteCalldata_cairo1 = (calls) => {
|
|
5070
|
-
|
|
5072
|
+
const orderCalls = calls.map((call) => ({
|
|
5073
|
+
contractAddress: call.contractAddress,
|
|
5074
|
+
entrypoint: call.entrypoint,
|
|
5075
|
+
calldata: call.calldata
|
|
5076
|
+
}));
|
|
5077
|
+
return CallData.compile({ orderCalls });
|
|
5071
5078
|
};
|
|
5072
5079
|
var getExecuteCalldata = (calls, cairoVersion = "0") => {
|
|
5073
5080
|
if (cairoVersion === "1") {
|
|
5074
|
-
return
|
|
5081
|
+
return fromCallsToExecuteCalldata_cairo1(calls);
|
|
5075
5082
|
}
|
|
5076
5083
|
return fromCallsToExecuteCalldata(calls);
|
|
5077
5084
|
};
|