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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [5.10.2](https://github.com/0xs34n/starknet.js/compare/v5.10.1...v5.10.2) (2023-05-17)
2
+
3
+ ### Bug Fixes
4
+
5
+ - use of uint256 in array in calls ([969b3c1](https://github.com/0xs34n/starknet.js/commit/969b3c1670902d7cc55156d5b3f6a8e7d45c731b))
6
+
1
7
  ## [5.10.1](https://github.com/0xs34n/starknet.js/compare/v5.10.0...v5.10.1) (2023-05-16)
2
8
 
3
9
  ### Bug Fixes
@@ -5829,6 +5829,14 @@ var starknet = (() => {
5829
5829
  return acc.concat(parsedData);
5830
5830
  }, []);
5831
5831
  }
5832
+ if (isTypeUint256(type)) {
5833
+ if (typeof element === "object") {
5834
+ const { low, high } = element;
5835
+ return [felt(low), felt(high)];
5836
+ }
5837
+ const el_uint256 = uint256(element);
5838
+ return [felt(el_uint256.low), felt(el_uint256.high)];
5839
+ }
5832
5840
  if (typeof element === "object") {
5833
5841
  throw Error(`Parameter ${element} do not align with abi parameter ${type}`);
5834
5842
  }
@@ -5846,14 +5854,8 @@ var starknet = (() => {
5846
5854
  value = splitLongString(value);
5847
5855
  }
5848
5856
  return parseCalldataValue(value, input.type, structs);
5849
- case (isTypeStruct(type, structs) || isTypeTuple(type)):
5857
+ case (isTypeStruct(type, structs) || isTypeTuple(type) || isTypeUint256(type)):
5850
5858
  return parseCalldataValue(value, type, structs);
5851
- case isTypeUint256(type):
5852
- if (typeof value === "object") {
5853
- return [felt(value.low), felt(value.high)];
5854
- }
5855
- const el_uint256 = uint256(value);
5856
- return [felt(el_uint256.low), felt(el_uint256.high)];
5857
5859
  default:
5858
5860
  return parseBaseTypes(type, value);
5859
5861
  }