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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.global.js +4 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
21820
|
+
return `${integer}${pdec}`.replace(/\b0+(?=\d)/g, "");
|
|
21818
21821
|
}
|
|
21819
21822
|
const bis = BigInt(amount).toString();
|
|
21820
21823
|
let strk;
|