@coinlist-co/react 0.12.1 → 0.12.2-rc.726778a
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-VH34YC3Q.js → chunk-3UQPCAU4.js} +2 -2
- package/dist/{chunk-DCW7NQXH.js → chunk-C6F5FOFP.js} +2 -2
- package/dist/{chunk-MOE5S6CE.js → chunk-IRV5YU42.js} +17 -3
- package/dist/chunk-IRV5YU42.js.map +1 -0
- package/dist/client/index.cjs +836 -875
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +3 -5
- package/dist/client/index.d.ts +3 -5
- package/dist/client/index.js +826 -877
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +2 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/universal/index.cjs +17 -2
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +18 -1
- package/dist/universal/index.d.ts +18 -1
- package/dist/universal/index.js +4 -2
- package/package.json +1 -1
- package/dist/chunk-MOE5S6CE.js.map +0 -1
- /package/dist/{chunk-VH34YC3Q.js.map → chunk-3UQPCAU4.js.map} +0 -0
- /package/dist/{chunk-DCW7NQXH.js.map → chunk-C6F5FOFP.js.map} +0 -0
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
generateSecureRandomBase64Url,
|
|
20
20
|
internalLogger,
|
|
21
21
|
sha256
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-IRV5YU42.js";
|
|
23
23
|
|
|
24
24
|
// src/universal/types/oauth.ts
|
|
25
25
|
var AuthorizationCode = (value) => value;
|
|
@@ -406,4 +406,4 @@ export {
|
|
|
406
406
|
UserEmail,
|
|
407
407
|
User
|
|
408
408
|
};
|
|
409
|
-
//# sourceMappingURL=chunk-
|
|
409
|
+
//# sourceMappingURL=chunk-3UQPCAU4.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getUUIDv4,
|
|
8
8
|
internalLogger,
|
|
9
9
|
viemChain
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IRV5YU42.js";
|
|
11
11
|
|
|
12
12
|
// src/universal/api/nabu/config.ts
|
|
13
13
|
var NABU_BASE_URL = "https://asset.coinlist.co";
|
|
@@ -402,4 +402,4 @@ export {
|
|
|
402
402
|
SDK_LOGGER_NAME,
|
|
403
403
|
loggerOverPino
|
|
404
404
|
};
|
|
405
|
-
//# sourceMappingURL=chunk-
|
|
405
|
+
//# sourceMappingURL=chunk-C6F5FOFP.js.map
|
|
@@ -1069,7 +1069,11 @@ function formatAmount(amount, locale, options) {
|
|
|
1069
1069
|
const decimal = formatRawAmount(amount);
|
|
1070
1070
|
let [integerPart, fractionPart = ""] = decimal.split(".");
|
|
1071
1071
|
const maxFractionDigits = options?.maxFractionDigits;
|
|
1072
|
-
const minFractionDigits =
|
|
1072
|
+
const minFractionDigits = Math.min(
|
|
1073
|
+
options?.minFractionDigits ?? (maxFractionDigits !== void 0 ? maxFractionDigits : 2),
|
|
1074
|
+
maxFractionDigits ?? amount.decimals,
|
|
1075
|
+
amount.decimals
|
|
1076
|
+
);
|
|
1073
1077
|
if (maxFractionDigits !== void 0 && fractionPart.length > maxFractionDigits) {
|
|
1074
1078
|
({ integerPart, fractionPart } = roundFractionHalfUp(
|
|
1075
1079
|
integerPart,
|
|
@@ -1077,7 +1081,8 @@ function formatAmount(amount, locale, options) {
|
|
|
1077
1081
|
maxFractionDigits
|
|
1078
1082
|
));
|
|
1079
1083
|
}
|
|
1080
|
-
const
|
|
1084
|
+
const trimmed = fractionPart.replace(/0+$/, "");
|
|
1085
|
+
const fraction = trimmed.padEnd(minFractionDigits, "0");
|
|
1081
1086
|
const integerFormatted = BigInt(integerPart).toLocaleString(locale);
|
|
1082
1087
|
if (minFractionDigits === 0 && fraction === "") {
|
|
1083
1088
|
return FormattedAmountUi(integerFormatted);
|
|
@@ -1146,6 +1151,14 @@ function assetAmount(amount, symbol) {
|
|
|
1146
1151
|
return FormattedAmountAssetUi(`${amount} ${symbol}`);
|
|
1147
1152
|
}
|
|
1148
1153
|
var NA_AMOUNT_ASSET_UI = FormattedAmountAssetUi("-");
|
|
1154
|
+
var SHARE_MAX_FRACTION_DIGITS = AssetDecimals(6);
|
|
1155
|
+
var SHARE_MIN_FRACTION_DIGITS = AssetDecimals(2);
|
|
1156
|
+
function formatShareAmount(amount, locale) {
|
|
1157
|
+
return formatAmount(amount, locale, {
|
|
1158
|
+
maxFractionDigits: SHARE_MAX_FRACTION_DIGITS,
|
|
1159
|
+
minFractionDigits: SHARE_MIN_FRACTION_DIGITS
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1149
1162
|
var USD_FRACTION_DIGITS = AssetDecimals(2);
|
|
1150
1163
|
function formattedUsdPrice(amount, locale) {
|
|
1151
1164
|
if (!amount) return NA_AMOUNT_ASSET_UI;
|
|
@@ -3473,6 +3486,7 @@ export {
|
|
|
3473
3486
|
usdAmount,
|
|
3474
3487
|
assetAmount,
|
|
3475
3488
|
NA_AMOUNT_ASSET_UI,
|
|
3489
|
+
formatShareAmount,
|
|
3476
3490
|
formattedUsdPrice,
|
|
3477
3491
|
viemChain,
|
|
3478
3492
|
getChainId,
|
|
@@ -3521,4 +3535,4 @@ export {
|
|
|
3521
3535
|
OAuthRefreshToken,
|
|
3522
3536
|
OAuthSession
|
|
3523
3537
|
};
|
|
3524
|
-
//# sourceMappingURL=chunk-
|
|
3538
|
+
//# sourceMappingURL=chunk-IRV5YU42.js.map
|