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 CHANGED
@@ -1,3 +1,15 @@
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
+
7
+ ## [5.10.1](https://github.com/0xs34n/starknet.js/compare/v5.10.0...v5.10.1) (2023-05-16)
8
+
9
+ ### Bug Fixes
10
+
11
+ - c1 acc execute props order, c1 test flag, local testing fix ([d86057c](https://github.com/0xs34n/starknet.js/commit/d86057cefe9e4053dac6d45d043401605246d3ed))
12
+
1
13
  # [5.10.0](https://github.com/0xs34n/starknet.js/compare/v5.9.2...v5.10.0) (2023-05-10)
2
14
 
3
15
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -2664,7 +2664,7 @@ declare class Account extends Provider implements AccountInterface {
2664
2664
  * If contract already declared returned transaction_hash is ''.
2665
2665
  * Method will pass even if contract is already declared
2666
2666
  * @param payload DeclareContractPayload
2667
- * @param transactionsDetail (optional) InvocationsDetails = {}
2667
+ * @param transactionsDetail (optional) InvocationsDetails = \{\}
2668
2668
  * @returns DeclareContractResponse
2669
2669
  */
2670
2670
  declareIfNot(payload: DeclareContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeclareContractResponse>;
@@ -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
  }
@@ -14001,11 +14003,16 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
14001
14003
  return callArray;
14002
14004
  };
14003
14005
  var fromCallsToExecuteCalldata_cairo1 = (calls) => {
14004
- return CallData.compile({ calls });
14006
+ const orderCalls = calls.map((call) => ({
14007
+ contractAddress: call.contractAddress,
14008
+ entrypoint: call.entrypoint,
14009
+ calldata: call.calldata
14010
+ }));
14011
+ return CallData.compile({ orderCalls });
14005
14012
  };
14006
14013
  var getExecuteCalldata = (calls, cairoVersion = "0") => {
14007
14014
  if (cairoVersion === "1") {
14008
- return CallData.compile({ calls });
14015
+ return fromCallsToExecuteCalldata_cairo1(calls);
14009
14016
  }
14010
14017
  return fromCallsToExecuteCalldata(calls);
14011
14018
  };