@oasisprotocol/privana-sdk 0.5.8 → 0.5.10
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/{chunk-EXFISDHQ.cjs → chunk-KCXYYUUG.cjs} +7 -6
- package/dist/chunk-KCXYYUUG.cjs.map +1 -0
- package/dist/{chunk-ONXJGUOH.js → chunk-RDYNQUMV.js} +7 -6
- package/dist/chunk-RDYNQUMV.js.map +1 -0
- package/dist/index.cjs +290 -277
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +32 -19
- package/dist/index.js.map +1 -1
- package/dist/on-ramp.cjs +5 -5
- package/dist/on-ramp.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-EXFISDHQ.cjs.map +0 -1
- package/dist/chunk-ONXJGUOH.js.map +0 -1
|
@@ -2878,15 +2878,16 @@ function cloneAllowance(allowance) {
|
|
|
2878
2878
|
function cn(...inputs) {
|
|
2879
2879
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
2880
2880
|
}
|
|
2881
|
-
function formatTokenAmount(amount, decimals = 18) {
|
|
2881
|
+
function formatTokenAmount(amount, decimals = 18, maxDecimals = 6) {
|
|
2882
2882
|
const value = typeof amount === "string" ? BigInt(amount) : amount;
|
|
2883
|
-
const divisor =
|
|
2883
|
+
const divisor = 10n ** BigInt(decimals);
|
|
2884
2884
|
const integerPart = value / divisor;
|
|
2885
2885
|
const fractionalPart = value % divisor;
|
|
2886
2886
|
const fractionalStr = fractionalPart.toString().padStart(decimals, "0");
|
|
2887
|
-
const
|
|
2887
|
+
const shown = fractionalStr.slice(0, Math.max(2, Math.min(maxDecimals, decimals)));
|
|
2888
|
+
const trimmed = shown.replace(/0+$/, "").padEnd(2, "0");
|
|
2888
2889
|
const integerWithSpaces = integerPart.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "\u2009");
|
|
2889
|
-
return `${integerWithSpaces}.${
|
|
2890
|
+
return `${integerWithSpaces}.${trimmed}`;
|
|
2890
2891
|
}
|
|
2891
2892
|
function parseTokenAmount(amount, decimals = 18) {
|
|
2892
2893
|
const sanitized = amount.replace(/[\s\u2009]/g, "").replace(/,/g, ".");
|
|
@@ -6162,5 +6163,5 @@ exports.useSafePrivanaContext = useSafePrivanaContext;
|
|
|
6162
6163
|
exports.useSiweAuth = useSiweAuth;
|
|
6163
6164
|
exports.useTransakOnRamp = useTransakOnRamp;
|
|
6164
6165
|
exports.waitForTransactionReceipt = waitForTransactionReceipt;
|
|
6165
|
-
//# sourceMappingURL=chunk-
|
|
6166
|
-
//# sourceMappingURL=chunk-
|
|
6166
|
+
//# sourceMappingURL=chunk-KCXYYUUG.cjs.map
|
|
6167
|
+
//# sourceMappingURL=chunk-KCXYYUUG.cjs.map
|