@lightsparkdev/core 1.0.21 → 1.0.22
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/{chunk-Y3FWNVYS.js → chunk-RC2KOZKZ.js} +129 -122
- package/dist/{index-9e41ffe5.d.ts → index-9ecb1570.d.ts} +29 -74
- package/dist/index.cjs +130 -123
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/utils/index.cjs +130 -123
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -3
- package/package.json +1 -1
- package/src/utils/currency.ts +46 -88
package/dist/utils/index.cjs
CHANGED
|
@@ -50,7 +50,6 @@ __export(utils_exports, {
|
|
|
50
50
|
getLocalStorageConfigItem: () => getLocalStorageConfigItem,
|
|
51
51
|
hexToBytes: () => hexToBytes,
|
|
52
52
|
isBrowser: () => isBrowser,
|
|
53
|
-
isCurrencyAmount: () => isCurrencyAmount,
|
|
54
53
|
isCurrencyAmountObj: () => isCurrencyAmountObj,
|
|
55
54
|
isCurrencyMap: () => isCurrencyMap,
|
|
56
55
|
isError: () => isError,
|
|
@@ -58,6 +57,7 @@ __export(utils_exports, {
|
|
|
58
57
|
isErrorWithMessage: () => isErrorWithMessage,
|
|
59
58
|
isNode: () => isNode,
|
|
60
59
|
isNumber: () => isNumber,
|
|
60
|
+
isSDKCurrencyAmount: () => isSDKCurrencyAmount,
|
|
61
61
|
isTest: () => isTest,
|
|
62
62
|
isType: () => isType,
|
|
63
63
|
isUint8Array: () => isUint8Array,
|
|
@@ -470,102 +470,108 @@ function isNumber(value) {
|
|
|
470
470
|
|
|
471
471
|
// src/utils/currency.ts
|
|
472
472
|
var defaultCurrencyCode = "USD";
|
|
473
|
-
var CurrencyUnit =
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
473
|
+
var CurrencyUnit = {
|
|
474
|
+
FUTURE_VALUE: "FUTURE_VALUE",
|
|
475
|
+
BITCOIN: "BITCOIN",
|
|
476
|
+
SATOSHI: "SATOSHI",
|
|
477
|
+
MILLISATOSHI: "MILLISATOSHI",
|
|
478
|
+
USD: "USD",
|
|
479
|
+
NANOBITCOIN: "NANOBITCOIN",
|
|
480
|
+
MICROBITCOIN: "MICROBITCOIN",
|
|
481
|
+
MILLIBITCOIN: "MILLIBITCOIN",
|
|
482
|
+
Bitcoin: "BITCOIN",
|
|
483
|
+
Microbitcoin: "MICROBITCOIN",
|
|
484
|
+
Millibitcoin: "MILLIBITCOIN",
|
|
485
|
+
Millisatoshi: "MILLISATOSHI",
|
|
486
|
+
Nanobitcoin: "NANOBITCOIN",
|
|
487
|
+
Satoshi: "SATOSHI",
|
|
488
|
+
Usd: "USD"
|
|
489
|
+
};
|
|
484
490
|
var CONVERSION_MAP = {
|
|
485
|
-
[
|
|
486
|
-
[
|
|
487
|
-
[
|
|
488
|
-
[
|
|
489
|
-
[
|
|
490
|
-
[
|
|
491
|
-
[
|
|
492
|
-
[
|
|
491
|
+
[CurrencyUnit.BITCOIN]: {
|
|
492
|
+
[CurrencyUnit.BITCOIN]: (v) => v,
|
|
493
|
+
[CurrencyUnit.MICROBITCOIN]: (v) => v * 1e6,
|
|
494
|
+
[CurrencyUnit.MILLIBITCOIN]: (v) => v * 1e3,
|
|
495
|
+
[CurrencyUnit.MILLISATOSHI]: (v) => v * 1e11,
|
|
496
|
+
[CurrencyUnit.NANOBITCOIN]: (v) => v * 1e9,
|
|
497
|
+
[CurrencyUnit.SATOSHI]: (v) => v * 1e8,
|
|
498
|
+
[CurrencyUnit.USD]: (v, centsPerBtc = 1) => (
|
|
493
499
|
/* Round without decimals since we're returning cents: */
|
|
494
500
|
round(v * centsPerBtc, 2)
|
|
495
501
|
)
|
|
496
502
|
},
|
|
497
|
-
[
|
|
498
|
-
[
|
|
499
|
-
[
|
|
500
|
-
[
|
|
501
|
-
[
|
|
502
|
-
[
|
|
503
|
-
[
|
|
504
|
-
[
|
|
503
|
+
[CurrencyUnit.MICROBITCOIN]: {
|
|
504
|
+
[CurrencyUnit.BITCOIN]: (v) => v / 1e6,
|
|
505
|
+
[CurrencyUnit.MICROBITCOIN]: (v) => v,
|
|
506
|
+
[CurrencyUnit.MILLIBITCOIN]: (v) => v / 1e3,
|
|
507
|
+
[CurrencyUnit.MILLISATOSHI]: (v) => v * 1e5,
|
|
508
|
+
[CurrencyUnit.NANOBITCOIN]: (v) => v * 1e3,
|
|
509
|
+
[CurrencyUnit.SATOSHI]: (v) => v * 100,
|
|
510
|
+
[CurrencyUnit.USD]: (v, centsPerBtc = 1) => (
|
|
505
511
|
/* Round without decimals since we're returning cents: */
|
|
506
512
|
round(v / 1e6 * centsPerBtc)
|
|
507
513
|
)
|
|
508
514
|
},
|
|
509
|
-
[
|
|
510
|
-
[
|
|
511
|
-
[
|
|
512
|
-
[
|
|
513
|
-
[
|
|
514
|
-
[
|
|
515
|
-
[
|
|
516
|
-
[
|
|
515
|
+
[CurrencyUnit.MILLIBITCOIN]: {
|
|
516
|
+
[CurrencyUnit.BITCOIN]: (v) => v / 1e3,
|
|
517
|
+
[CurrencyUnit.MICROBITCOIN]: (v) => v * 1e3,
|
|
518
|
+
[CurrencyUnit.MILLIBITCOIN]: (v) => v,
|
|
519
|
+
[CurrencyUnit.MILLISATOSHI]: (v) => v * 1e8,
|
|
520
|
+
[CurrencyUnit.NANOBITCOIN]: (v) => v * 1e6,
|
|
521
|
+
[CurrencyUnit.SATOSHI]: (v) => v * 1e5,
|
|
522
|
+
[CurrencyUnit.USD]: (v, centsPerBtc = 1) => (
|
|
517
523
|
/* Round without decimals since we're returning cents: */
|
|
518
524
|
round(v / 1e3 * centsPerBtc)
|
|
519
525
|
)
|
|
520
526
|
},
|
|
521
|
-
[
|
|
522
|
-
[
|
|
523
|
-
[
|
|
524
|
-
[
|
|
525
|
-
[
|
|
526
|
-
[
|
|
527
|
-
[
|
|
528
|
-
[
|
|
527
|
+
[CurrencyUnit.MILLISATOSHI]: {
|
|
528
|
+
[CurrencyUnit.BITCOIN]: (v) => v / 1e11,
|
|
529
|
+
[CurrencyUnit.MICROBITCOIN]: (v) => v / 1e5,
|
|
530
|
+
[CurrencyUnit.MILLIBITCOIN]: (v) => v / 1e8,
|
|
531
|
+
[CurrencyUnit.MILLISATOSHI]: (v) => v,
|
|
532
|
+
[CurrencyUnit.NANOBITCOIN]: (v) => v / 100,
|
|
533
|
+
[CurrencyUnit.SATOSHI]: (v) => v / 1e3,
|
|
534
|
+
[CurrencyUnit.USD]: (v, centsPerBtc = 1) => (
|
|
529
535
|
/* Round without decimals since we're returning cents: */
|
|
530
536
|
round(v / 1e11 * centsPerBtc)
|
|
531
537
|
)
|
|
532
538
|
},
|
|
533
|
-
[
|
|
534
|
-
[
|
|
535
|
-
[
|
|
536
|
-
[
|
|
537
|
-
[
|
|
538
|
-
[
|
|
539
|
-
[
|
|
540
|
-
[
|
|
539
|
+
[CurrencyUnit.NANOBITCOIN]: {
|
|
540
|
+
[CurrencyUnit.BITCOIN]: (v) => v / 1e9,
|
|
541
|
+
[CurrencyUnit.MICROBITCOIN]: (v) => v / 1e3,
|
|
542
|
+
[CurrencyUnit.MILLIBITCOIN]: (v) => v / 1e6,
|
|
543
|
+
[CurrencyUnit.MILLISATOSHI]: (v) => v * 100,
|
|
544
|
+
[CurrencyUnit.NANOBITCOIN]: (v) => v,
|
|
545
|
+
[CurrencyUnit.SATOSHI]: (v) => v / 10,
|
|
546
|
+
[CurrencyUnit.USD]: (v, centsPerBtc = 1) => (
|
|
541
547
|
/* Round without decimals since we're returning cents: */
|
|
542
548
|
round(v / 1e9 * centsPerBtc)
|
|
543
549
|
)
|
|
544
550
|
},
|
|
545
|
-
[
|
|
546
|
-
[
|
|
547
|
-
[
|
|
548
|
-
[
|
|
549
|
-
[
|
|
550
|
-
[
|
|
551
|
-
[
|
|
552
|
-
[
|
|
551
|
+
[CurrencyUnit.SATOSHI]: {
|
|
552
|
+
[CurrencyUnit.BITCOIN]: (v) => v / 1e8,
|
|
553
|
+
[CurrencyUnit.MICROBITCOIN]: (v) => v / 100,
|
|
554
|
+
[CurrencyUnit.MILLIBITCOIN]: (v) => v / 1e5,
|
|
555
|
+
[CurrencyUnit.MILLISATOSHI]: (v) => v * 1e3,
|
|
556
|
+
[CurrencyUnit.NANOBITCOIN]: (v) => v * 10,
|
|
557
|
+
[CurrencyUnit.SATOSHI]: (v) => v,
|
|
558
|
+
[CurrencyUnit.USD]: (v, centsPerBtc = 1) => (
|
|
553
559
|
/* Round without decimals since we're returning cents: */
|
|
554
560
|
round(v / 1e8 * centsPerBtc)
|
|
555
561
|
)
|
|
556
562
|
},
|
|
557
|
-
[
|
|
558
|
-
[
|
|
559
|
-
[
|
|
560
|
-
[
|
|
561
|
-
[
|
|
562
|
-
[
|
|
563
|
-
[
|
|
564
|
-
[
|
|
563
|
+
[CurrencyUnit.USD]: {
|
|
564
|
+
[CurrencyUnit.BITCOIN]: (v, centsPerBtc = 1) => v / centsPerBtc,
|
|
565
|
+
[CurrencyUnit.MICROBITCOIN]: (v, centsPerBtc = 1) => v / centsPerBtc * 1e6,
|
|
566
|
+
[CurrencyUnit.MILLIBITCOIN]: (v, centsPerBtc = 1) => v / centsPerBtc * 1e3,
|
|
567
|
+
[CurrencyUnit.MILLISATOSHI]: (v, centsPerBtc = 1) => v / centsPerBtc * 1e11,
|
|
568
|
+
[CurrencyUnit.NANOBITCOIN]: (v, centsPerBtc = 1) => v / centsPerBtc * 1e9,
|
|
569
|
+
[CurrencyUnit.SATOSHI]: (v, centsPerBtc = 1) => v / centsPerBtc * 1e8,
|
|
570
|
+
[CurrencyUnit.USD]: (v) => v
|
|
565
571
|
}
|
|
566
572
|
};
|
|
567
573
|
function convertCurrencyAmountValue(fromUnit, toUnit, amount, centsPerBtc = 1) {
|
|
568
|
-
if (fromUnit ===
|
|
574
|
+
if (fromUnit === CurrencyUnit.FUTURE_VALUE || toUnit === CurrencyUnit.FUTURE_VALUE) {
|
|
569
575
|
throw new LightsparkException_default("CurrencyError", `Unsupported CurrencyUnit.`);
|
|
570
576
|
}
|
|
571
577
|
if (fromUnit === toUnit) {
|
|
@@ -596,8 +602,9 @@ var convertCurrencyAmount = (from, toUnit) => {
|
|
|
596
602
|
function isCurrencyAmountObj(arg) {
|
|
597
603
|
return typeof arg === "object" && arg !== null && "value" in arg && "unit" in arg;
|
|
598
604
|
}
|
|
599
|
-
function
|
|
600
|
-
return typeof arg === "object" && arg !== null &&
|
|
605
|
+
function isSDKCurrencyAmount(arg) {
|
|
606
|
+
return typeof arg === "object" && arg !== null && /* We can expect all SDK CurrencyAmount types to always have these exact properties: */
|
|
607
|
+
"originalValue" in arg && "originalUnit" in arg && "preferredCurrencyUnit" in arg && "preferredCurrencyValueRounded" in arg && "preferredCurrencyValueApprox" in arg;
|
|
601
608
|
}
|
|
602
609
|
function asNumber(value) {
|
|
603
610
|
if (typeof value === "string") {
|
|
@@ -608,67 +615,67 @@ function asNumber(value) {
|
|
|
608
615
|
function getCurrencyAmount(currencyAmountArg) {
|
|
609
616
|
let value = 0;
|
|
610
617
|
let unit = void 0;
|
|
611
|
-
if (
|
|
612
|
-
value = asNumber(currencyAmountArg.value);
|
|
613
|
-
unit = currencyAmountArg.unit;
|
|
614
|
-
} else if (isCurrencyAmount(currencyAmountArg)) {
|
|
618
|
+
if (isSDKCurrencyAmount(currencyAmountArg)) {
|
|
615
619
|
value = currencyAmountArg.originalValue;
|
|
616
620
|
unit = currencyAmountArg.originalUnit;
|
|
621
|
+
} else if (isCurrencyAmountObj(currencyAmountArg)) {
|
|
622
|
+
value = asNumber(currencyAmountArg.value);
|
|
623
|
+
unit = currencyAmountArg.unit;
|
|
617
624
|
}
|
|
618
625
|
return {
|
|
619
626
|
value: asNumber(value),
|
|
620
|
-
unit: unit ||
|
|
627
|
+
unit: unit || CurrencyUnit.SATOSHI
|
|
621
628
|
};
|
|
622
629
|
}
|
|
623
630
|
function mapCurrencyAmount(currencyAmountArg, centsPerBtc = 1) {
|
|
624
631
|
const { value, unit } = getCurrencyAmount(currencyAmountArg);
|
|
625
632
|
const convert = convertCurrencyAmountValue;
|
|
626
|
-
const sats = convert(unit,
|
|
627
|
-
const btc = convert(unit,
|
|
628
|
-
const msats = convert(unit,
|
|
629
|
-
const usd = convert(unit,
|
|
630
|
-
const mibtc = convert(unit,
|
|
631
|
-
const mlbtc = convert(unit,
|
|
632
|
-
const nbtc = convert(unit,
|
|
633
|
+
const sats = convert(unit, CurrencyUnit.SATOSHI, value, centsPerBtc);
|
|
634
|
+
const btc = convert(unit, CurrencyUnit.BITCOIN, value, centsPerBtc);
|
|
635
|
+
const msats = convert(unit, CurrencyUnit.MILLISATOSHI, value, centsPerBtc);
|
|
636
|
+
const usd = convert(unit, CurrencyUnit.USD, value, centsPerBtc);
|
|
637
|
+
const mibtc = convert(unit, CurrencyUnit.MICROBITCOIN, value, centsPerBtc);
|
|
638
|
+
const mlbtc = convert(unit, CurrencyUnit.MILLIBITCOIN, value, centsPerBtc);
|
|
639
|
+
const nbtc = convert(unit, CurrencyUnit.NANOBITCOIN, value, centsPerBtc);
|
|
633
640
|
const mapWithCurrencyUnits = {
|
|
634
|
-
[
|
|
635
|
-
[
|
|
636
|
-
[
|
|
637
|
-
[
|
|
638
|
-
[
|
|
639
|
-
[
|
|
640
|
-
[
|
|
641
|
-
[
|
|
641
|
+
[CurrencyUnit.BITCOIN]: btc,
|
|
642
|
+
[CurrencyUnit.SATOSHI]: sats,
|
|
643
|
+
[CurrencyUnit.MILLISATOSHI]: msats,
|
|
644
|
+
[CurrencyUnit.USD]: usd,
|
|
645
|
+
[CurrencyUnit.MICROBITCOIN]: mibtc,
|
|
646
|
+
[CurrencyUnit.MILLIBITCOIN]: mlbtc,
|
|
647
|
+
[CurrencyUnit.NANOBITCOIN]: nbtc,
|
|
648
|
+
[CurrencyUnit.FUTURE_VALUE]: NaN,
|
|
642
649
|
formatted: {
|
|
643
|
-
[
|
|
650
|
+
[CurrencyUnit.BITCOIN]: formatCurrencyStr({
|
|
644
651
|
value: btc,
|
|
645
|
-
unit:
|
|
652
|
+
unit: CurrencyUnit.BITCOIN
|
|
646
653
|
}),
|
|
647
|
-
[
|
|
654
|
+
[CurrencyUnit.SATOSHI]: formatCurrencyStr({
|
|
648
655
|
value: sats,
|
|
649
|
-
unit:
|
|
656
|
+
unit: CurrencyUnit.SATOSHI
|
|
650
657
|
}),
|
|
651
|
-
[
|
|
658
|
+
[CurrencyUnit.MILLISATOSHI]: formatCurrencyStr({
|
|
652
659
|
value: msats,
|
|
653
|
-
unit:
|
|
660
|
+
unit: CurrencyUnit.MILLISATOSHI
|
|
654
661
|
}),
|
|
655
|
-
[
|
|
662
|
+
[CurrencyUnit.MICROBITCOIN]: formatCurrencyStr({
|
|
656
663
|
value: mibtc,
|
|
657
|
-
unit:
|
|
664
|
+
unit: CurrencyUnit.MICROBITCOIN
|
|
658
665
|
}),
|
|
659
|
-
[
|
|
666
|
+
[CurrencyUnit.MILLIBITCOIN]: formatCurrencyStr({
|
|
660
667
|
value: mlbtc,
|
|
661
|
-
unit:
|
|
668
|
+
unit: CurrencyUnit.MILLIBITCOIN
|
|
662
669
|
}),
|
|
663
|
-
[
|
|
670
|
+
[CurrencyUnit.NANOBITCOIN]: formatCurrencyStr({
|
|
664
671
|
value: nbtc,
|
|
665
|
-
unit:
|
|
672
|
+
unit: CurrencyUnit.NANOBITCOIN
|
|
666
673
|
}),
|
|
667
|
-
[
|
|
674
|
+
[CurrencyUnit.USD]: formatCurrencyStr({
|
|
668
675
|
value: usd,
|
|
669
|
-
unit:
|
|
676
|
+
unit: CurrencyUnit.USD
|
|
670
677
|
}),
|
|
671
|
-
[
|
|
678
|
+
[CurrencyUnit.FUTURE_VALUE]: "-"
|
|
672
679
|
}
|
|
673
680
|
};
|
|
674
681
|
return {
|
|
@@ -706,9 +713,9 @@ function mapCurrencyAmount(currencyAmountArg, centsPerBtc = 1) {
|
|
|
706
713
|
},
|
|
707
714
|
formatted: {
|
|
708
715
|
...mapWithCurrencyUnits.formatted,
|
|
709
|
-
btc: mapWithCurrencyUnits.formatted[
|
|
710
|
-
sats: mapWithCurrencyUnits.formatted[
|
|
711
|
-
msats: mapWithCurrencyUnits.formatted[
|
|
716
|
+
btc: mapWithCurrencyUnits.formatted[CurrencyUnit.BITCOIN],
|
|
717
|
+
sats: mapWithCurrencyUnits.formatted[CurrencyUnit.SATOSHI],
|
|
718
|
+
msats: mapWithCurrencyUnits.formatted[CurrencyUnit.MILLISATOSHI]
|
|
712
719
|
},
|
|
713
720
|
type: "CurrencyMap"
|
|
714
721
|
};
|
|
@@ -716,13 +723,13 @@ function mapCurrencyAmount(currencyAmountArg, centsPerBtc = 1) {
|
|
|
716
723
|
var isCurrencyMap = (currencyMap) => typeof currencyMap === "object" && currencyMap !== null && "type" in currencyMap && typeof currencyMap.type === "string" && currencyMap.type === "CurrencyMap";
|
|
717
724
|
var abbrCurrencyUnit = (unit) => {
|
|
718
725
|
switch (unit) {
|
|
719
|
-
case
|
|
726
|
+
case CurrencyUnit.BITCOIN:
|
|
720
727
|
return "BTC";
|
|
721
|
-
case
|
|
728
|
+
case CurrencyUnit.SATOSHI:
|
|
722
729
|
return "SAT";
|
|
723
|
-
case
|
|
730
|
+
case CurrencyUnit.MILLISATOSHI:
|
|
724
731
|
return "MSAT";
|
|
725
|
-
case
|
|
732
|
+
case CurrencyUnit.USD:
|
|
726
733
|
return "USD";
|
|
727
734
|
}
|
|
728
735
|
return "Unsupported CurrencyUnit";
|
|
@@ -731,33 +738,33 @@ function formatCurrencyStr(amount, maxFractionDigits, compact, showBtcSymbol = f
|
|
|
731
738
|
const currencyAmount = getCurrencyAmount(amount);
|
|
732
739
|
let { value: num } = currencyAmount;
|
|
733
740
|
const { unit } = currencyAmount;
|
|
734
|
-
if (unit ===
|
|
741
|
+
if (unit === CurrencyUnit.USD) {
|
|
735
742
|
num = num / 100;
|
|
736
743
|
}
|
|
737
744
|
function getDefaultMaxFractionDigits(defaultDigits) {
|
|
738
745
|
return typeof maxFractionDigits === "undefined" ? compact ? 1 : defaultDigits : maxFractionDigits;
|
|
739
746
|
}
|
|
740
|
-
const symbol = !showBtcSymbol ? "" : unit ===
|
|
747
|
+
const symbol = !showBtcSymbol ? "" : unit === CurrencyUnit.BITCOIN ? "\uE903" : unit === CurrencyUnit.SATOSHI ? "\uE902" : "";
|
|
741
748
|
const currentLocale = getCurrentLocale();
|
|
742
749
|
switch (unit) {
|
|
743
|
-
case
|
|
750
|
+
case CurrencyUnit.BITCOIN:
|
|
744
751
|
return `${symbol}${num.toLocaleString(currentLocale, {
|
|
745
752
|
notation: compact ? "compact" : void 0,
|
|
746
753
|
maximumFractionDigits: getDefaultMaxFractionDigits(4),
|
|
747
754
|
...options
|
|
748
755
|
})}`;
|
|
749
|
-
case
|
|
750
|
-
case
|
|
751
|
-
case
|
|
752
|
-
case
|
|
753
|
-
case
|
|
756
|
+
case CurrencyUnit.MILLISATOSHI:
|
|
757
|
+
case CurrencyUnit.SATOSHI:
|
|
758
|
+
case CurrencyUnit.MICROBITCOIN:
|
|
759
|
+
case CurrencyUnit.MILLIBITCOIN:
|
|
760
|
+
case CurrencyUnit.NANOBITCOIN:
|
|
754
761
|
default:
|
|
755
762
|
return `${symbol}${num.toLocaleString(currentLocale, {
|
|
756
763
|
notation: compact ? "compact" : void 0,
|
|
757
764
|
maximumFractionDigits: getDefaultMaxFractionDigits(0),
|
|
758
765
|
...options
|
|
759
766
|
})}`;
|
|
760
|
-
case
|
|
767
|
+
case CurrencyUnit.USD:
|
|
761
768
|
return num.toLocaleString(currentLocale, {
|
|
762
769
|
style: "currency",
|
|
763
770
|
currency: defaultCurrencyCode,
|
|
@@ -1006,7 +1013,6 @@ function notNullUndefined(value) {
|
|
|
1006
1013
|
getLocalStorageConfigItem,
|
|
1007
1014
|
hexToBytes,
|
|
1008
1015
|
isBrowser,
|
|
1009
|
-
isCurrencyAmount,
|
|
1010
1016
|
isCurrencyAmountObj,
|
|
1011
1017
|
isCurrencyMap,
|
|
1012
1018
|
isError,
|
|
@@ -1014,6 +1020,7 @@ function notNullUndefined(value) {
|
|
|
1014
1020
|
isErrorWithMessage,
|
|
1015
1021
|
isNode,
|
|
1016
1022
|
isNumber,
|
|
1023
|
+
isSDKCurrencyAmount,
|
|
1017
1024
|
isTest,
|
|
1018
1025
|
isType,
|
|
1019
1026
|
isUint8Array,
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Z as ById, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a0 as DeepPartial, Y as ExpandRecursively, a1 as JSONLiteral, a3 as JSONObject, a2 as JSONType, X as Maybe, a4 as NN, _ as OmitTypename, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, m as isSDKCurrencyAmount, w as isTest, $ as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a5 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from '../index-9ecb1570.js';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Z as ById, k as CurrencyAmountArg, j as CurrencyAmountObj, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, f as CurrencyUnitType, a0 as DeepPartial, Y as ExpandRecursively, a1 as JSONLiteral, a3 as JSONObject, a2 as JSONType, X as Maybe, a4 as NN, _ as OmitTypename, S as SDKCurrencyAmountType, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, m as isSDKCurrencyAmount, w as isTest, $ as isType, W as isUint8Array, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, V as lsidToUUID, n as mapCurrencyAmount, a5 as notNullUndefined, T as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, U as sleep, u as urlsafe_b64decode } from '../index-9ecb1570.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
getLocalStorageConfigItem,
|
|
20
20
|
hexToBytes,
|
|
21
21
|
isBrowser,
|
|
22
|
-
isCurrencyAmount,
|
|
23
22
|
isCurrencyAmountObj,
|
|
24
23
|
isCurrencyMap,
|
|
25
24
|
isError,
|
|
@@ -27,6 +26,7 @@ import {
|
|
|
27
26
|
isErrorWithMessage,
|
|
28
27
|
isNode,
|
|
29
28
|
isNumber,
|
|
29
|
+
isSDKCurrencyAmount,
|
|
30
30
|
isTest,
|
|
31
31
|
isType,
|
|
32
32
|
isUint8Array,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
setLocalStorageBoolean,
|
|
43
43
|
sleep,
|
|
44
44
|
urlsafe_b64decode
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-RC2KOZKZ.js";
|
|
46
46
|
export {
|
|
47
47
|
CurrencyUnit,
|
|
48
48
|
abbrCurrencyUnit,
|
|
@@ -64,7 +64,6 @@ export {
|
|
|
64
64
|
getLocalStorageConfigItem,
|
|
65
65
|
hexToBytes,
|
|
66
66
|
isBrowser,
|
|
67
|
-
isCurrencyAmount,
|
|
68
67
|
isCurrencyAmountObj,
|
|
69
68
|
isCurrencyMap,
|
|
70
69
|
isError,
|
|
@@ -72,6 +71,7 @@ export {
|
|
|
72
71
|
isErrorWithMessage,
|
|
73
72
|
isNode,
|
|
74
73
|
isNumber,
|
|
74
|
+
isSDKCurrencyAmount,
|
|
75
75
|
isTest,
|
|
76
76
|
isType,
|
|
77
77
|
isUint8Array,
|