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.js CHANGED
@@ -22022,8 +22022,11 @@ function units(amount, simbol = "fri") {
22022
22022
  }
22023
22023
  }
22024
22024
  const [integer, decimal = "0"] = numStr.split(".");
22025
+ if (decimal.length > 18) {
22026
+ throw new Error(`units: '${numStr}' strk has more than 18 decimals`);
22027
+ }
22025
22028
  const pdec = decimal.padEnd(18, "0");
22026
- return `${integer}${pdec}`.replace(/\b0+/g, "");
22029
+ return `${integer}${pdec}`.replace(/\b0+(?=\d)/g, "");
22027
22030
  }
22028
22031
  const bis = BigInt(amount).toString();
22029
22032
  let strk;