arky-sdk 0.4.21 → 0.4.23
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.cjs +5 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -19
- package/dist/index.d.ts +3 -19
- package/dist/index.js +6 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1416,31 +1416,20 @@ var createPlatformApi = (apiConfig) => {
|
|
|
1416
1416
|
},
|
|
1417
1417
|
getConfigCache() {
|
|
1418
1418
|
return cachedConfig;
|
|
1419
|
+
},
|
|
1420
|
+
async getCurrencies(options) {
|
|
1421
|
+
return apiConfig.httpClient.get("/v1/platform/currencies", options);
|
|
1419
1422
|
}
|
|
1420
1423
|
};
|
|
1421
1424
|
};
|
|
1422
1425
|
|
|
1423
|
-
// src/utils/
|
|
1426
|
+
// src/utils/price.ts
|
|
1424
1427
|
function formatCurrency(amount, currencyCode, locale = "en") {
|
|
1425
1428
|
return new Intl.NumberFormat(locale, {
|
|
1426
1429
|
style: "currency",
|
|
1427
1430
|
currency: currencyCode.toUpperCase()
|
|
1428
1431
|
}).format(amount);
|
|
1429
1432
|
}
|
|
1430
|
-
function getCurrencySymbol(currencyCode) {
|
|
1431
|
-
const parts = new Intl.NumberFormat("en", {
|
|
1432
|
-
style: "currency",
|
|
1433
|
-
currency: currencyCode.toUpperCase(),
|
|
1434
|
-
currencyDisplay: "narrowSymbol"
|
|
1435
|
-
}).formatToParts(0);
|
|
1436
|
-
return parts.find((p) => p.type === "currency")?.value || "";
|
|
1437
|
-
}
|
|
1438
|
-
function getCurrencyName(currencyCode) {
|
|
1439
|
-
const displayNames = new Intl.DisplayNames(["en"], { type: "currency" });
|
|
1440
|
-
return displayNames.of(currencyCode.toUpperCase()) || "";
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
// src/utils/price.ts
|
|
1444
1433
|
function convertToMajor(minorAmount) {
|
|
1445
1434
|
return minorAmount / 100;
|
|
1446
1435
|
}
|
|
@@ -1652,7 +1641,7 @@ function track(eventName, params) {
|
|
|
1652
1641
|
}
|
|
1653
1642
|
|
|
1654
1643
|
// src/index.ts
|
|
1655
|
-
var SDK_VERSION = "0.4.
|
|
1644
|
+
var SDK_VERSION = "0.4.23";
|
|
1656
1645
|
var SUPPORTED_FRAMEWORKS = [
|
|
1657
1646
|
"astro",
|
|
1658
1647
|
"react",
|
|
@@ -1734,9 +1723,6 @@ async function createArkySDK(config) {
|
|
|
1734
1723
|
getPriceAmount: (prices) => getPriceAmount(prices, apiConfig.market),
|
|
1735
1724
|
formatPayment,
|
|
1736
1725
|
formatMinor,
|
|
1737
|
-
formatCurrency,
|
|
1738
|
-
getCurrencySymbol,
|
|
1739
|
-
getCurrencyName,
|
|
1740
1726
|
validatePhoneNumber,
|
|
1741
1727
|
tzGroups,
|
|
1742
1728
|
findTimeZone,
|
|
@@ -1765,8 +1751,5 @@ exports.PaymentMethodType = PaymentMethodType;
|
|
|
1765
1751
|
exports.SDK_VERSION = SDK_VERSION;
|
|
1766
1752
|
exports.SUPPORTED_FRAMEWORKS = SUPPORTED_FRAMEWORKS;
|
|
1767
1753
|
exports.createArkySDK = createArkySDK;
|
|
1768
|
-
exports.formatCurrency = formatCurrency;
|
|
1769
|
-
exports.getCurrencyName = getCurrencyName;
|
|
1770
|
-
exports.getCurrencySymbol = getCurrencySymbol;
|
|
1771
1754
|
//# sourceMappingURL=index.cjs.map
|
|
1772
1755
|
//# sourceMappingURL=index.cjs.map
|