starknet 11.7.0 → 11.7.1

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.mjs CHANGED
@@ -21813,8 +21813,11 @@ function units(amount, simbol = "fri") {
21813
21813
  }
21814
21814
  }
21815
21815
  const [integer, decimal = "0"] = numStr.split(".");
21816
+ if (decimal.length > 18) {
21817
+ throw new Error(`units: '${numStr}' strk has more than 18 decimals`);
21818
+ }
21816
21819
  const pdec = decimal.padEnd(18, "0");
21817
- return `${integer}${pdec}`.replace(/\b0+/g, "");
21820
+ return `${integer}${pdec}`.replace(/\b0+(?=\d)/g, "");
21818
21821
  }
21819
21822
  const bis = BigInt(amount).toString();
21820
21823
  let strk;