starknet 5.10.1 → 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/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
  }