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.mjs
CHANGED
|
@@ -2650,6 +2650,14 @@ function parseCalldataValue(element, type, structs) {
|
|
|
2650
2650
|
return acc.concat(parsedData);
|
|
2651
2651
|
}, []);
|
|
2652
2652
|
}
|
|
2653
|
+
if (isTypeUint256(type)) {
|
|
2654
|
+
if (typeof element === "object") {
|
|
2655
|
+
const { low, high } = element;
|
|
2656
|
+
return [felt(low), felt(high)];
|
|
2657
|
+
}
|
|
2658
|
+
const el_uint256 = uint256(element);
|
|
2659
|
+
return [felt(el_uint256.low), felt(el_uint256.high)];
|
|
2660
|
+
}
|
|
2653
2661
|
if (typeof element === "object") {
|
|
2654
2662
|
throw Error(`Parameter ${element} do not align with abi parameter ${type}`);
|
|
2655
2663
|
}
|
|
@@ -2667,14 +2675,8 @@ function parseCalldataField(argsIterator, input, structs) {
|
|
|
2667
2675
|
value = splitLongString(value);
|
|
2668
2676
|
}
|
|
2669
2677
|
return parseCalldataValue(value, input.type, structs);
|
|
2670
|
-
case (isTypeStruct(type, structs) || isTypeTuple(type)):
|
|
2678
|
+
case (isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type)):
|
|
2671
2679
|
return parseCalldataValue(value, type, structs);
|
|
2672
|
-
case isTypeUint256(type):
|
|
2673
|
-
if (typeof value === "object") {
|
|
2674
|
-
return [felt(value.low), felt(value.high)];
|
|
2675
|
-
}
|
|
2676
|
-
const el_uint256 = uint256(value);
|
|
2677
|
-
return [felt(el_uint256.low), felt(el_uint256.high)];
|
|
2678
2680
|
default:
|
|
2679
2681
|
return parseBaseTypes(type, value);
|
|
2680
2682
|
}
|
|
@@ -4996,11 +4998,16 @@ var transformCallsToMulticallArrays_cairo1 = (calls) => {
|
|
|
4996
4998
|
return callArray;
|
|
4997
4999
|
};
|
|
4998
5000
|
var fromCallsToExecuteCalldata_cairo1 = (calls) => {
|
|
4999
|
-
|
|
5001
|
+
const orderCalls = calls.map((call) => ({
|
|
5002
|
+
contractAddress: call.contractAddress,
|
|
5003
|
+
entrypoint: call.entrypoint,
|
|
5004
|
+
calldata: call.calldata
|
|
5005
|
+
}));
|
|
5006
|
+
return CallData.compile({ orderCalls });
|
|
5000
5007
|
};
|
|
5001
5008
|
var getExecuteCalldata = (calls, cairoVersion = "0") => {
|
|
5002
5009
|
if (cairoVersion === "1") {
|
|
5003
|
-
return
|
|
5010
|
+
return fromCallsToExecuteCalldata_cairo1(calls);
|
|
5004
5011
|
}
|
|
5005
5012
|
return fromCallsToExecuteCalldata(calls);
|
|
5006
5013
|
};
|