starknet 11.10.6 → 11.10.7

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.7](https://github.com/starknet-io/starknet.js/compare/v11.10.6...v11.10.7) (2026-12-03)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **num:** normalize a hex input in getHexString ([#1776](https://github.com/starknet-io/starknet.js/issues/1776)) ([d643b7a](https://github.com/starknet-io/starknet.js/commit/d643b7a89594e58b81f23f7ce48a283c8512bead))
6
+
1
7
  ## [11.10.6](https://github.com/starknet-io/starknet.js/compare/v11.10.5...v11.10.6) (2026-12-02)
2
8
 
3
9
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -12427,18 +12427,28 @@ declare function isStringWholeNumber(str: string): boolean;
12427
12427
  */
12428
12428
  declare function getDecimalString(str: string): string;
12429
12429
  /**
12430
- * Convert string to hexadecimal string
12431
- *
12432
- * @param {string} str string to convert
12433
- * @returns converted hex-string
12434
- * @throws str needs to be a number string in hex or whole number format
12430
+ * Convert a hex-string, or a string of decimal digits, to a hex-string
12431
+ *
12432
+ * The result has the form that a node expects for a felt: it starts with `0x`,
12433
+ * its letters are lowercase, and it has no leading zero.
12434
+ * For example, `'0X1F'` and `'0x001f'` both give `'0x1f'`.
12435
+ * @param {string} str the string to convert, like `'123'` or `'0X7B'`
12436
+ * @returns {string} the hex-string
12437
+ * @throws {Error} when `str` is `'0x'`, which has no digit
12438
+ * @throws {Error} when `str` is not a hex-string and not a string of decimal digits
12435
12439
  * @example
12436
12440
  * ```typescript
12437
12441
  * const result = getHexString("123");
12438
12442
  * // result = "0x7b"
12439
12443
  *
12440
- * const result2 = getHexString("Hello");
12444
+ * const result2 = getHexString("0X001F");
12445
+ * // result2 = "0x1f"
12446
+ *
12447
+ * const result3 = getHexString("Hello");
12441
12448
  * // throws Error: Hello needs to be a hex-string or whole-number-string
12449
+ *
12450
+ * const result4 = getHexString("0x");
12451
+ * // throws Error: Invalid input: '0x' holds no hexadecimal digit
12442
12452
  * ```
12443
12453
  */
12444
12454
  declare function getHexString(str: string): string;
@@ -3142,7 +3142,7 @@ ${indent}}` : "}";
3142
3142
  }
3143
3143
  function getHexString(str) {
3144
3144
  if (isHex2(str)) {
3145
- return str;
3145
+ return toHex(str);
3146
3146
  }
3147
3147
  if (isStringWholeNumber(str)) {
3148
3148
  return toHexString(str);