starknet 11.10.1 → 11.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
+ ## [11.10.2](https://github.com/starknet-io/starknet.js/compare/v11.10.1...v11.10.2) (2026-11-30)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **calldata:** keep a Span or fixed array of tuples whole inside a tuple ([#1771](https://github.com/starknet-io/starknet.js/issues/1771)) ([106a701](https://github.com/starknet-io/starknet.js/commit/106a70156047e6e9130c8cc6eaee2db62457989a))
6
+
1
7
  ## [11.10.1](https://github.com/starknet-io/starknet.js/compare/v11.10.0...v11.10.1) (2026-11-30)
2
8
 
3
9
  ### Bug Fixes
@@ -12587,39 +12587,25 @@ ${indent}}` : "}";
12587
12587
  }
12588
12588
  return recomposed;
12589
12589
  }
12590
- function getClosureOffset(input, open, close) {
12591
- for (let i = 0, counter = 0; i < input.length; i++) {
12592
- if (input[i] === open) {
12593
- counter++;
12594
- } else if (input[i] === close && --counter === 0) {
12595
- return i;
12596
- }
12597
- }
12598
- return Number.POSITIVE_INFINITY;
12599
- }
12600
12590
  function extractCairo1Tuple(type) {
12601
12591
  const input = type.slice(1, -1);
12602
12592
  const result = [];
12593
+ let depth = 0;
12603
12594
  let currentIndex = 0;
12604
- let limitIndex;
12605
- while (currentIndex < input.length) {
12606
- switch (true) {
12607
- // Tuple
12608
- case input[currentIndex] === "(": {
12609
- limitIndex = currentIndex + getClosureOffset(input.slice(currentIndex), "(", ")") + 1;
12610
- break;
12611
- }
12612
- case (input.startsWith("core::result::Result::<", currentIndex) || input.startsWith("core::array::Array::<", currentIndex) || input.startsWith("core::option::Option::<", currentIndex)): {
12613
- limitIndex = currentIndex + getClosureOffset(input.slice(currentIndex), "<", ">") + 1;
12614
- break;
12615
- }
12616
- default: {
12617
- const commaIndex = input.indexOf(",", currentIndex);
12618
- limitIndex = commaIndex !== -1 ? commaIndex : Number.POSITIVE_INFINITY;
12619
- }
12595
+ for (let i = 0; i < input.length; i++) {
12596
+ const char = input[i];
12597
+ if (char === "(" || char === "<" || char === "[") {
12598
+ depth++;
12599
+ } else if (char === ")" || char === ">" || char === "]") {
12600
+ depth--;
12601
+ } else if (char === "," && depth === 0) {
12602
+ result.push(input.slice(currentIndex, i));
12603
+ currentIndex = i + 2;
12604
+ i++;
12620
12605
  }
12621
- result.push(input.slice(currentIndex, limitIndex));
12622
- currentIndex = limitIndex + 2;
12606
+ }
12607
+ if (currentIndex < input.length) {
12608
+ result.push(input.slice(currentIndex));
12623
12609
  }
12624
12610
  return result;
12625
12611
  }