@lightsparkdev/core 1.4.6 → 1.4.7
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 +8 -0
- package/dist/{chunk-RS4VXJZY.js → chunk-RGVVA4QG.js} +1 -1
- package/dist/{chunk-NCCCATWW.js → chunk-W4DKUOEW.js} +146 -12
- package/dist/{index-BI-zWPu_.d.cts → index-HyhbxNE8.d.cts} +23 -1
- package/dist/{index-BI-zWPu_.d.ts → index-HyhbxNE8.d.ts} +23 -1
- package/dist/index.cjs +146 -12
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/react-native/index.cjs +146 -12
- package/dist/react-native/index.d.cts +1 -1
- package/dist/react-native/index.d.ts +1 -1
- package/dist/react-native/index.js +2 -2
- package/dist/utils/index.cjs +146 -12
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/src/utils/currency.ts +148 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @lightsparkdev/core
|
|
2
2
|
|
|
3
|
+
## 1.4.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8e4690a: - Add new currencies to currency utils
|
|
8
|
+
- 8e4690a: - Added payment hash parameters to create_invoice. This is for RK customers to specify payment hash upfront when creating
|
|
9
|
+
an invoice so that a round-trip to the RK to fetch the payment hash doesn't have to be made mid-request.
|
|
10
|
+
|
|
3
11
|
## 1.4.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -422,7 +422,14 @@ var CurrencyUnit = {
|
|
|
422
422
|
SGD: "SGD",
|
|
423
423
|
THB: "THB",
|
|
424
424
|
VND: "VND",
|
|
425
|
+
NGN: "NGN",
|
|
426
|
+
ZAR: "ZAR",
|
|
427
|
+
KES: "KES",
|
|
428
|
+
TZS: "TZS",
|
|
429
|
+
UGX: "UGX",
|
|
430
|
+
BWP: "BWP",
|
|
425
431
|
USDT: "USDT",
|
|
432
|
+
USDC: "USDC",
|
|
426
433
|
Bitcoin: "BITCOIN",
|
|
427
434
|
Microbitcoin: "MICROBITCOIN",
|
|
428
435
|
Millibitcoin: "MILLIBITCOIN",
|
|
@@ -435,7 +442,8 @@ var CurrencyUnit = {
|
|
|
435
442
|
Gbp: "GBP",
|
|
436
443
|
Inr: "INR",
|
|
437
444
|
Brl: "BRL",
|
|
438
|
-
Usdt: "USDT"
|
|
445
|
+
Usdt: "USDT",
|
|
446
|
+
Usdc: "USDC"
|
|
439
447
|
};
|
|
440
448
|
var standardUnitConversionObj = {
|
|
441
449
|
[CurrencyUnit.BITCOIN]: (v, unitsPerBtc = 1) => v / unitsPerBtc,
|
|
@@ -460,7 +468,14 @@ var standardUnitConversionObj = {
|
|
|
460
468
|
[CurrencyUnit.SGD]: (v) => v,
|
|
461
469
|
[CurrencyUnit.THB]: (v) => v,
|
|
462
470
|
[CurrencyUnit.VND]: (v) => v,
|
|
463
|
-
[CurrencyUnit.
|
|
471
|
+
[CurrencyUnit.NGN]: (v) => v,
|
|
472
|
+
[CurrencyUnit.ZAR]: (v) => v,
|
|
473
|
+
[CurrencyUnit.KES]: (v) => v,
|
|
474
|
+
[CurrencyUnit.TZS]: (v) => v,
|
|
475
|
+
[CurrencyUnit.UGX]: (v) => v,
|
|
476
|
+
[CurrencyUnit.BWP]: (v) => v,
|
|
477
|
+
[CurrencyUnit.USDT]: (v) => v,
|
|
478
|
+
[CurrencyUnit.USDC]: (v) => v
|
|
464
479
|
};
|
|
465
480
|
var toBitcoinConversion = (v, unitsPerBtc = 1) => round(v * unitsPerBtc);
|
|
466
481
|
var toMicrobitcoinConversion = (v, unitsPerBtc = 1) => round(v / 1e6 * unitsPerBtc);
|
|
@@ -491,7 +506,14 @@ var CONVERSION_MAP = {
|
|
|
491
506
|
[CurrencyUnit.SGD]: toBitcoinConversion,
|
|
492
507
|
[CurrencyUnit.THB]: toBitcoinConversion,
|
|
493
508
|
[CurrencyUnit.VND]: toBitcoinConversion,
|
|
494
|
-
[CurrencyUnit.
|
|
509
|
+
[CurrencyUnit.NGN]: toBitcoinConversion,
|
|
510
|
+
[CurrencyUnit.ZAR]: toBitcoinConversion,
|
|
511
|
+
[CurrencyUnit.KES]: toBitcoinConversion,
|
|
512
|
+
[CurrencyUnit.TZS]: toBitcoinConversion,
|
|
513
|
+
[CurrencyUnit.UGX]: toBitcoinConversion,
|
|
514
|
+
[CurrencyUnit.BWP]: toBitcoinConversion,
|
|
515
|
+
[CurrencyUnit.USDT]: toBitcoinConversion,
|
|
516
|
+
[CurrencyUnit.USDC]: toBitcoinConversion
|
|
495
517
|
},
|
|
496
518
|
[CurrencyUnit.MICROBITCOIN]: {
|
|
497
519
|
[CurrencyUnit.BITCOIN]: (v) => v / 1e6,
|
|
@@ -515,7 +537,14 @@ var CONVERSION_MAP = {
|
|
|
515
537
|
[CurrencyUnit.SGD]: toMicrobitcoinConversion,
|
|
516
538
|
[CurrencyUnit.THB]: toMicrobitcoinConversion,
|
|
517
539
|
[CurrencyUnit.VND]: toMicrobitcoinConversion,
|
|
518
|
-
[CurrencyUnit.
|
|
540
|
+
[CurrencyUnit.NGN]: toMicrobitcoinConversion,
|
|
541
|
+
[CurrencyUnit.ZAR]: toMicrobitcoinConversion,
|
|
542
|
+
[CurrencyUnit.KES]: toMicrobitcoinConversion,
|
|
543
|
+
[CurrencyUnit.TZS]: toMicrobitcoinConversion,
|
|
544
|
+
[CurrencyUnit.UGX]: toMicrobitcoinConversion,
|
|
545
|
+
[CurrencyUnit.BWP]: toMicrobitcoinConversion,
|
|
546
|
+
[CurrencyUnit.USDT]: toMicrobitcoinConversion,
|
|
547
|
+
[CurrencyUnit.USDC]: toMicrobitcoinConversion
|
|
519
548
|
},
|
|
520
549
|
[CurrencyUnit.MILLIBITCOIN]: {
|
|
521
550
|
[CurrencyUnit.BITCOIN]: (v) => v / 1e3,
|
|
@@ -539,7 +568,14 @@ var CONVERSION_MAP = {
|
|
|
539
568
|
[CurrencyUnit.SGD]: toMillibitcoinConversion,
|
|
540
569
|
[CurrencyUnit.THB]: toMillibitcoinConversion,
|
|
541
570
|
[CurrencyUnit.VND]: toMillibitcoinConversion,
|
|
542
|
-
[CurrencyUnit.
|
|
571
|
+
[CurrencyUnit.NGN]: toMillibitcoinConversion,
|
|
572
|
+
[CurrencyUnit.ZAR]: toMillibitcoinConversion,
|
|
573
|
+
[CurrencyUnit.KES]: toMillibitcoinConversion,
|
|
574
|
+
[CurrencyUnit.TZS]: toMillibitcoinConversion,
|
|
575
|
+
[CurrencyUnit.UGX]: toMillibitcoinConversion,
|
|
576
|
+
[CurrencyUnit.BWP]: toMillibitcoinConversion,
|
|
577
|
+
[CurrencyUnit.USDT]: toMillibitcoinConversion,
|
|
578
|
+
[CurrencyUnit.USDC]: toMillibitcoinConversion
|
|
543
579
|
},
|
|
544
580
|
[CurrencyUnit.MILLISATOSHI]: {
|
|
545
581
|
[CurrencyUnit.BITCOIN]: (v) => v / 1e11,
|
|
@@ -563,7 +599,14 @@ var CONVERSION_MAP = {
|
|
|
563
599
|
[CurrencyUnit.SGD]: toMillisatoshiConversion,
|
|
564
600
|
[CurrencyUnit.THB]: toMillisatoshiConversion,
|
|
565
601
|
[CurrencyUnit.VND]: toMillisatoshiConversion,
|
|
566
|
-
[CurrencyUnit.
|
|
602
|
+
[CurrencyUnit.NGN]: toMillisatoshiConversion,
|
|
603
|
+
[CurrencyUnit.ZAR]: toMillisatoshiConversion,
|
|
604
|
+
[CurrencyUnit.KES]: toMillisatoshiConversion,
|
|
605
|
+
[CurrencyUnit.TZS]: toMillisatoshiConversion,
|
|
606
|
+
[CurrencyUnit.UGX]: toMillisatoshiConversion,
|
|
607
|
+
[CurrencyUnit.BWP]: toMillisatoshiConversion,
|
|
608
|
+
[CurrencyUnit.USDT]: toMillisatoshiConversion,
|
|
609
|
+
[CurrencyUnit.USDC]: toMillisatoshiConversion
|
|
567
610
|
},
|
|
568
611
|
[CurrencyUnit.NANOBITCOIN]: {
|
|
569
612
|
[CurrencyUnit.BITCOIN]: (v) => v / 1e9,
|
|
@@ -587,7 +630,14 @@ var CONVERSION_MAP = {
|
|
|
587
630
|
[CurrencyUnit.SGD]: toNanobitcoinConversion,
|
|
588
631
|
[CurrencyUnit.THB]: toNanobitcoinConversion,
|
|
589
632
|
[CurrencyUnit.VND]: toNanobitcoinConversion,
|
|
590
|
-
[CurrencyUnit.
|
|
633
|
+
[CurrencyUnit.NGN]: toNanobitcoinConversion,
|
|
634
|
+
[CurrencyUnit.ZAR]: toNanobitcoinConversion,
|
|
635
|
+
[CurrencyUnit.KES]: toNanobitcoinConversion,
|
|
636
|
+
[CurrencyUnit.TZS]: toNanobitcoinConversion,
|
|
637
|
+
[CurrencyUnit.UGX]: toNanobitcoinConversion,
|
|
638
|
+
[CurrencyUnit.BWP]: toNanobitcoinConversion,
|
|
639
|
+
[CurrencyUnit.USDT]: toNanobitcoinConversion,
|
|
640
|
+
[CurrencyUnit.USDC]: toNanobitcoinConversion
|
|
591
641
|
},
|
|
592
642
|
[CurrencyUnit.SATOSHI]: {
|
|
593
643
|
[CurrencyUnit.BITCOIN]: (v) => v / 1e8,
|
|
@@ -611,7 +661,14 @@ var CONVERSION_MAP = {
|
|
|
611
661
|
[CurrencyUnit.SGD]: toSatoshiConversion,
|
|
612
662
|
[CurrencyUnit.THB]: toSatoshiConversion,
|
|
613
663
|
[CurrencyUnit.VND]: toSatoshiConversion,
|
|
614
|
-
[CurrencyUnit.
|
|
664
|
+
[CurrencyUnit.NGN]: toSatoshiConversion,
|
|
665
|
+
[CurrencyUnit.ZAR]: toSatoshiConversion,
|
|
666
|
+
[CurrencyUnit.KES]: toSatoshiConversion,
|
|
667
|
+
[CurrencyUnit.TZS]: toSatoshiConversion,
|
|
668
|
+
[CurrencyUnit.UGX]: toSatoshiConversion,
|
|
669
|
+
[CurrencyUnit.BWP]: toSatoshiConversion,
|
|
670
|
+
[CurrencyUnit.USDT]: toSatoshiConversion,
|
|
671
|
+
[CurrencyUnit.USDC]: toSatoshiConversion
|
|
615
672
|
},
|
|
616
673
|
[CurrencyUnit.USD]: standardUnitConversionObj,
|
|
617
674
|
[CurrencyUnit.MXN]: standardUnitConversionObj,
|
|
@@ -628,7 +685,14 @@ var CONVERSION_MAP = {
|
|
|
628
685
|
[CurrencyUnit.SGD]: standardUnitConversionObj,
|
|
629
686
|
[CurrencyUnit.THB]: standardUnitConversionObj,
|
|
630
687
|
[CurrencyUnit.VND]: standardUnitConversionObj,
|
|
631
|
-
[CurrencyUnit.
|
|
688
|
+
[CurrencyUnit.NGN]: standardUnitConversionObj,
|
|
689
|
+
[CurrencyUnit.ZAR]: standardUnitConversionObj,
|
|
690
|
+
[CurrencyUnit.KES]: standardUnitConversionObj,
|
|
691
|
+
[CurrencyUnit.TZS]: standardUnitConversionObj,
|
|
692
|
+
[CurrencyUnit.UGX]: standardUnitConversionObj,
|
|
693
|
+
[CurrencyUnit.BWP]: standardUnitConversionObj,
|
|
694
|
+
[CurrencyUnit.USDT]: standardUnitConversionObj,
|
|
695
|
+
[CurrencyUnit.USDC]: standardUnitConversionObj
|
|
632
696
|
};
|
|
633
697
|
function convertCurrencyAmountValue(fromUnit, toUnit, amount, unitsPerBtc = 1) {
|
|
634
698
|
if (fromUnit === CurrencyUnit.FUTURE_VALUE || toUnit === CurrencyUnit.FUTURE_VALUE) {
|
|
@@ -723,10 +787,17 @@ function convertCurrencyAmountValues(fromUnit, amount, unitsPerBtc = 1, conversi
|
|
|
723
787
|
sgd: CurrencyUnit.SGD,
|
|
724
788
|
thb: CurrencyUnit.THB,
|
|
725
789
|
vnd: CurrencyUnit.VND,
|
|
790
|
+
ngn: CurrencyUnit.NGN,
|
|
791
|
+
zar: CurrencyUnit.ZAR,
|
|
792
|
+
kes: CurrencyUnit.KES,
|
|
793
|
+
tzs: CurrencyUnit.TZS,
|
|
794
|
+
ugx: CurrencyUnit.UGX,
|
|
795
|
+
bwp: CurrencyUnit.BWP,
|
|
726
796
|
mibtc: CurrencyUnit.MICROBITCOIN,
|
|
727
797
|
mlbtc: CurrencyUnit.MILLIBITCOIN,
|
|
728
798
|
nbtc: CurrencyUnit.NANOBITCOIN,
|
|
729
|
-
usdt: CurrencyUnit.USDT
|
|
799
|
+
usdt: CurrencyUnit.USDT,
|
|
800
|
+
usdc: CurrencyUnit.USDC
|
|
730
801
|
};
|
|
731
802
|
return Object.entries(namesToUnits).reduce(
|
|
732
803
|
(acc, [name, unit]) => {
|
|
@@ -784,7 +855,14 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
|
|
|
784
855
|
sgd,
|
|
785
856
|
thb,
|
|
786
857
|
vnd,
|
|
787
|
-
|
|
858
|
+
ngn,
|
|
859
|
+
zar,
|
|
860
|
+
kes,
|
|
861
|
+
tzs,
|
|
862
|
+
ugx,
|
|
863
|
+
bwp,
|
|
864
|
+
usdt,
|
|
865
|
+
usdc
|
|
788
866
|
} = convertCurrencyAmountValues(unit, value, unitsPerBtc, conversionOverride);
|
|
789
867
|
const mapWithCurrencyUnits = {
|
|
790
868
|
[CurrencyUnit.BITCOIN]: btc,
|
|
@@ -805,10 +883,17 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
|
|
|
805
883
|
[CurrencyUnit.SGD]: sgd,
|
|
806
884
|
[CurrencyUnit.THB]: thb,
|
|
807
885
|
[CurrencyUnit.VND]: vnd,
|
|
886
|
+
[CurrencyUnit.NGN]: ngn,
|
|
887
|
+
[CurrencyUnit.ZAR]: zar,
|
|
888
|
+
[CurrencyUnit.KES]: kes,
|
|
889
|
+
[CurrencyUnit.TZS]: tzs,
|
|
890
|
+
[CurrencyUnit.UGX]: ugx,
|
|
891
|
+
[CurrencyUnit.BWP]: bwp,
|
|
808
892
|
[CurrencyUnit.MICROBITCOIN]: mibtc,
|
|
809
893
|
[CurrencyUnit.MILLIBITCOIN]: mlbtc,
|
|
810
894
|
[CurrencyUnit.NANOBITCOIN]: nbtc,
|
|
811
895
|
[CurrencyUnit.USDT]: usdt,
|
|
896
|
+
[CurrencyUnit.USDC]: usdc,
|
|
812
897
|
[CurrencyUnit.FUTURE_VALUE]: NaN,
|
|
813
898
|
formatted: {
|
|
814
899
|
[CurrencyUnit.BITCOIN]: formatCurrencyStr({
|
|
@@ -895,10 +980,38 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
|
|
|
895
980
|
value: vnd,
|
|
896
981
|
unit: CurrencyUnit.VND
|
|
897
982
|
}),
|
|
983
|
+
[CurrencyUnit.NGN]: formatCurrencyStr({
|
|
984
|
+
value: ngn,
|
|
985
|
+
unit: CurrencyUnit.NGN
|
|
986
|
+
}),
|
|
987
|
+
[CurrencyUnit.ZAR]: formatCurrencyStr({
|
|
988
|
+
value: zar,
|
|
989
|
+
unit: CurrencyUnit.ZAR
|
|
990
|
+
}),
|
|
991
|
+
[CurrencyUnit.KES]: formatCurrencyStr({
|
|
992
|
+
value: kes,
|
|
993
|
+
unit: CurrencyUnit.KES
|
|
994
|
+
}),
|
|
995
|
+
[CurrencyUnit.TZS]: formatCurrencyStr({
|
|
996
|
+
value: tzs,
|
|
997
|
+
unit: CurrencyUnit.TZS
|
|
998
|
+
}),
|
|
999
|
+
[CurrencyUnit.UGX]: formatCurrencyStr({
|
|
1000
|
+
value: ugx,
|
|
1001
|
+
unit: CurrencyUnit.UGX
|
|
1002
|
+
}),
|
|
1003
|
+
[CurrencyUnit.BWP]: formatCurrencyStr({
|
|
1004
|
+
value: bwp,
|
|
1005
|
+
unit: CurrencyUnit.BWP
|
|
1006
|
+
}),
|
|
898
1007
|
[CurrencyUnit.USDT]: formatCurrencyStr({
|
|
899
1008
|
value: usdt,
|
|
900
1009
|
unit: CurrencyUnit.USDT
|
|
901
1010
|
}),
|
|
1011
|
+
[CurrencyUnit.USDC]: formatCurrencyStr({
|
|
1012
|
+
value: usdc,
|
|
1013
|
+
unit: CurrencyUnit.USDC
|
|
1014
|
+
}),
|
|
902
1015
|
[CurrencyUnit.FUTURE_VALUE]: "-"
|
|
903
1016
|
}
|
|
904
1017
|
};
|
|
@@ -971,6 +1084,8 @@ var abbrCurrencyUnit = (unit) => {
|
|
|
971
1084
|
return "INR";
|
|
972
1085
|
case CurrencyUnit.USDT:
|
|
973
1086
|
return "USDT";
|
|
1087
|
+
case CurrencyUnit.USDC:
|
|
1088
|
+
return "USDC";
|
|
974
1089
|
case CurrencyUnit.BRL:
|
|
975
1090
|
return "BRL";
|
|
976
1091
|
case CurrencyUnit.CAD:
|
|
@@ -989,6 +1104,18 @@ var abbrCurrencyUnit = (unit) => {
|
|
|
989
1104
|
return "THB";
|
|
990
1105
|
case CurrencyUnit.VND:
|
|
991
1106
|
return "VND";
|
|
1107
|
+
case CurrencyUnit.NGN:
|
|
1108
|
+
return "NGN";
|
|
1109
|
+
case CurrencyUnit.ZAR:
|
|
1110
|
+
return "ZAR";
|
|
1111
|
+
case CurrencyUnit.KES:
|
|
1112
|
+
return "KES";
|
|
1113
|
+
case CurrencyUnit.TZS:
|
|
1114
|
+
return "TZS";
|
|
1115
|
+
case CurrencyUnit.UGX:
|
|
1116
|
+
return "UGX";
|
|
1117
|
+
case CurrencyUnit.BWP:
|
|
1118
|
+
return "BWP";
|
|
992
1119
|
}
|
|
993
1120
|
return "Unsupported CurrencyUnit";
|
|
994
1121
|
};
|
|
@@ -1022,7 +1149,14 @@ function formatCurrencyStr(amount, options) {
|
|
|
1022
1149
|
CurrencyUnit.PHP,
|
|
1023
1150
|
CurrencyUnit.EUR,
|
|
1024
1151
|
CurrencyUnit.GBP,
|
|
1025
|
-
CurrencyUnit.INR
|
|
1152
|
+
CurrencyUnit.INR,
|
|
1153
|
+
CurrencyUnit.BRL,
|
|
1154
|
+
CurrencyUnit.NGN,
|
|
1155
|
+
CurrencyUnit.ZAR,
|
|
1156
|
+
CurrencyUnit.KES,
|
|
1157
|
+
CurrencyUnit.TZS,
|
|
1158
|
+
CurrencyUnit.UGX,
|
|
1159
|
+
CurrencyUnit.BWP
|
|
1026
1160
|
];
|
|
1027
1161
|
if (centCurrencies.includes(unit)) {
|
|
1028
1162
|
num = num / 100;
|
|
@@ -38,7 +38,14 @@ declare const CurrencyUnit: {
|
|
|
38
38
|
readonly SGD: "SGD";
|
|
39
39
|
readonly THB: "THB";
|
|
40
40
|
readonly VND: "VND";
|
|
41
|
+
readonly NGN: "NGN";
|
|
42
|
+
readonly ZAR: "ZAR";
|
|
43
|
+
readonly KES: "KES";
|
|
44
|
+
readonly TZS: "TZS";
|
|
45
|
+
readonly UGX: "UGX";
|
|
46
|
+
readonly BWP: "BWP";
|
|
41
47
|
readonly USDT: "USDT";
|
|
48
|
+
readonly USDC: "USDC";
|
|
42
49
|
readonly Bitcoin: "BITCOIN";
|
|
43
50
|
readonly Microbitcoin: "MICROBITCOIN";
|
|
44
51
|
readonly Millibitcoin: "MILLIBITCOIN";
|
|
@@ -52,6 +59,7 @@ declare const CurrencyUnit: {
|
|
|
52
59
|
readonly Inr: "INR";
|
|
53
60
|
readonly Brl: "BRL";
|
|
54
61
|
readonly Usdt: "USDT";
|
|
62
|
+
readonly Usdc: "USDC";
|
|
55
63
|
};
|
|
56
64
|
type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
|
|
57
65
|
type SDKCurrencyAmountType = {
|
|
@@ -88,7 +96,14 @@ type CurrencyMap = {
|
|
|
88
96
|
[CurrencyUnit.SGD]: number;
|
|
89
97
|
[CurrencyUnit.THB]: number;
|
|
90
98
|
[CurrencyUnit.VND]: number;
|
|
99
|
+
[CurrencyUnit.NGN]: number;
|
|
100
|
+
[CurrencyUnit.ZAR]: number;
|
|
101
|
+
[CurrencyUnit.KES]: number;
|
|
102
|
+
[CurrencyUnit.TZS]: number;
|
|
103
|
+
[CurrencyUnit.UGX]: number;
|
|
104
|
+
[CurrencyUnit.BWP]: number;
|
|
91
105
|
[CurrencyUnit.USDT]: number;
|
|
106
|
+
[CurrencyUnit.USDC]: number;
|
|
92
107
|
[CurrencyUnit.FUTURE_VALUE]: number;
|
|
93
108
|
formatted: {
|
|
94
109
|
sats: string;
|
|
@@ -115,7 +130,14 @@ type CurrencyMap = {
|
|
|
115
130
|
[CurrencyUnit.SGD]: string;
|
|
116
131
|
[CurrencyUnit.THB]: string;
|
|
117
132
|
[CurrencyUnit.VND]: string;
|
|
133
|
+
[CurrencyUnit.NGN]: string;
|
|
134
|
+
[CurrencyUnit.ZAR]: string;
|
|
135
|
+
[CurrencyUnit.KES]: string;
|
|
136
|
+
[CurrencyUnit.TZS]: string;
|
|
137
|
+
[CurrencyUnit.UGX]: string;
|
|
138
|
+
[CurrencyUnit.BWP]: string;
|
|
118
139
|
[CurrencyUnit.USDT]: string;
|
|
140
|
+
[CurrencyUnit.USDC]: string;
|
|
119
141
|
[CurrencyUnit.FUTURE_VALUE]: string;
|
|
120
142
|
};
|
|
121
143
|
isZero: boolean;
|
|
@@ -171,7 +193,7 @@ declare function getCurrencyAmount(currencyAmountArg: CurrencyAmountArg): {
|
|
|
171
193
|
};
|
|
172
194
|
declare function mapCurrencyAmount(currencyAmountArg: CurrencyAmountArg, unitsPerBtc?: number): CurrencyMap;
|
|
173
195
|
declare const isCurrencyMap: (currencyMap: unknown) => currencyMap is CurrencyMap;
|
|
174
|
-
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "BRL" | "CAD" | "GBP" | "INR" | "MXN" | "PHP" | "DKK" | "HKD" | "IDR" | "MYR" | "SGD" | "THB" | "VND" | "USDT" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
196
|
+
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "BRL" | "CAD" | "GBP" | "INR" | "MXN" | "PHP" | "DKK" | "HKD" | "IDR" | "MYR" | "SGD" | "THB" | "VND" | "NGN" | "ZAR" | "KES" | "TZS" | "UGX" | "BWP" | "USDT" | "USDC" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
175
197
|
type AppendUnitsOptions = {
|
|
176
198
|
plural?: boolean | undefined;
|
|
177
199
|
lowercase?: boolean | undefined;
|
|
@@ -38,7 +38,14 @@ declare const CurrencyUnit: {
|
|
|
38
38
|
readonly SGD: "SGD";
|
|
39
39
|
readonly THB: "THB";
|
|
40
40
|
readonly VND: "VND";
|
|
41
|
+
readonly NGN: "NGN";
|
|
42
|
+
readonly ZAR: "ZAR";
|
|
43
|
+
readonly KES: "KES";
|
|
44
|
+
readonly TZS: "TZS";
|
|
45
|
+
readonly UGX: "UGX";
|
|
46
|
+
readonly BWP: "BWP";
|
|
41
47
|
readonly USDT: "USDT";
|
|
48
|
+
readonly USDC: "USDC";
|
|
42
49
|
readonly Bitcoin: "BITCOIN";
|
|
43
50
|
readonly Microbitcoin: "MICROBITCOIN";
|
|
44
51
|
readonly Millibitcoin: "MILLIBITCOIN";
|
|
@@ -52,6 +59,7 @@ declare const CurrencyUnit: {
|
|
|
52
59
|
readonly Inr: "INR";
|
|
53
60
|
readonly Brl: "BRL";
|
|
54
61
|
readonly Usdt: "USDT";
|
|
62
|
+
readonly Usdc: "USDC";
|
|
55
63
|
};
|
|
56
64
|
type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
|
|
57
65
|
type SDKCurrencyAmountType = {
|
|
@@ -88,7 +96,14 @@ type CurrencyMap = {
|
|
|
88
96
|
[CurrencyUnit.SGD]: number;
|
|
89
97
|
[CurrencyUnit.THB]: number;
|
|
90
98
|
[CurrencyUnit.VND]: number;
|
|
99
|
+
[CurrencyUnit.NGN]: number;
|
|
100
|
+
[CurrencyUnit.ZAR]: number;
|
|
101
|
+
[CurrencyUnit.KES]: number;
|
|
102
|
+
[CurrencyUnit.TZS]: number;
|
|
103
|
+
[CurrencyUnit.UGX]: number;
|
|
104
|
+
[CurrencyUnit.BWP]: number;
|
|
91
105
|
[CurrencyUnit.USDT]: number;
|
|
106
|
+
[CurrencyUnit.USDC]: number;
|
|
92
107
|
[CurrencyUnit.FUTURE_VALUE]: number;
|
|
93
108
|
formatted: {
|
|
94
109
|
sats: string;
|
|
@@ -115,7 +130,14 @@ type CurrencyMap = {
|
|
|
115
130
|
[CurrencyUnit.SGD]: string;
|
|
116
131
|
[CurrencyUnit.THB]: string;
|
|
117
132
|
[CurrencyUnit.VND]: string;
|
|
133
|
+
[CurrencyUnit.NGN]: string;
|
|
134
|
+
[CurrencyUnit.ZAR]: string;
|
|
135
|
+
[CurrencyUnit.KES]: string;
|
|
136
|
+
[CurrencyUnit.TZS]: string;
|
|
137
|
+
[CurrencyUnit.UGX]: string;
|
|
138
|
+
[CurrencyUnit.BWP]: string;
|
|
118
139
|
[CurrencyUnit.USDT]: string;
|
|
140
|
+
[CurrencyUnit.USDC]: string;
|
|
119
141
|
[CurrencyUnit.FUTURE_VALUE]: string;
|
|
120
142
|
};
|
|
121
143
|
isZero: boolean;
|
|
@@ -171,7 +193,7 @@ declare function getCurrencyAmount(currencyAmountArg: CurrencyAmountArg): {
|
|
|
171
193
|
};
|
|
172
194
|
declare function mapCurrencyAmount(currencyAmountArg: CurrencyAmountArg, unitsPerBtc?: number): CurrencyMap;
|
|
173
195
|
declare const isCurrencyMap: (currencyMap: unknown) => currencyMap is CurrencyMap;
|
|
174
|
-
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "BRL" | "CAD" | "GBP" | "INR" | "MXN" | "PHP" | "DKK" | "HKD" | "IDR" | "MYR" | "SGD" | "THB" | "VND" | "USDT" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
196
|
+
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "BRL" | "CAD" | "GBP" | "INR" | "MXN" | "PHP" | "DKK" | "HKD" | "IDR" | "MYR" | "SGD" | "THB" | "VND" | "NGN" | "ZAR" | "KES" | "TZS" | "UGX" | "BWP" | "USDT" | "USDC" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
175
197
|
type AppendUnitsOptions = {
|
|
176
198
|
plural?: boolean | undefined;
|
|
177
199
|
lowercase?: boolean | undefined;
|