@lightsparkdev/core 1.4.3 → 1.4.5
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 +13 -0
- package/README.md +0 -2
- package/dist/{chunk-36QHRQJC.js → chunk-IWYMQNIA.js} +54 -20
- package/dist/chunk-L5YREN7B.js +713 -0
- package/dist/{index-gUXiTlhb.d.cts → index-CpAae9dR.d.cts} +7 -2
- package/dist/{index-gUXiTlhb.d.ts → index-CpAae9dR.d.ts} +7 -2
- package/dist/index.cjs +2618 -2574
- package/dist/index.d.cts +8 -171
- package/dist/index.d.ts +8 -171
- package/dist/index.js +25 -679
- package/dist/react-native/index.cjs +3143 -0
- package/dist/react-native/index.d.cts +175 -0
- package/dist/react-native/index.d.ts +175 -0
- package/dist/react-native/index.js +154 -0
- package/dist/utils/index.cjs +46 -11
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -1
- package/package.json +15 -1
- package/src/Logger.ts +2 -1
- package/src/crypto/SigningKey.ts +4 -2
- package/src/index.ts +3 -11
- package/src/react-native/index.ts +2 -0
- package/src/requester/DefaultRequester.ts +46 -0
- package/src/requester/Requester.ts +11 -44
- package/src/requester/tests/DefaultRequester.test.ts +129 -0
- package/src/requester/tests/Requester.test.ts +23 -32
- package/src/shared.ts +10 -0
- package/src/utils/currency.ts +35 -2
- package/src/utils/environment.ts +3 -0
|
@@ -29,6 +29,7 @@ declare const CurrencyUnit: {
|
|
|
29
29
|
readonly EUR: "EUR";
|
|
30
30
|
readonly GBP: "GBP";
|
|
31
31
|
readonly INR: "INR";
|
|
32
|
+
readonly USDT: "USDT";
|
|
32
33
|
readonly Bitcoin: "BITCOIN";
|
|
33
34
|
readonly Microbitcoin: "MICROBITCOIN";
|
|
34
35
|
readonly Millibitcoin: "MILLIBITCOIN";
|
|
@@ -40,6 +41,7 @@ declare const CurrencyUnit: {
|
|
|
40
41
|
readonly Php: "PHP";
|
|
41
42
|
readonly Gbp: "GBP";
|
|
42
43
|
readonly Inr: "INR";
|
|
44
|
+
readonly Usdt: "USDT";
|
|
43
45
|
};
|
|
44
46
|
type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
|
|
45
47
|
type SDKCurrencyAmountType = {
|
|
@@ -67,6 +69,7 @@ type CurrencyMap = {
|
|
|
67
69
|
[CurrencyUnit.EUR]: number;
|
|
68
70
|
[CurrencyUnit.GBP]: number;
|
|
69
71
|
[CurrencyUnit.INR]: number;
|
|
72
|
+
[CurrencyUnit.USDT]: number;
|
|
70
73
|
[CurrencyUnit.FUTURE_VALUE]: number;
|
|
71
74
|
formatted: {
|
|
72
75
|
sats: string;
|
|
@@ -84,6 +87,7 @@ type CurrencyMap = {
|
|
|
84
87
|
[CurrencyUnit.EUR]: string;
|
|
85
88
|
[CurrencyUnit.GBP]: string;
|
|
86
89
|
[CurrencyUnit.INR]: string;
|
|
90
|
+
[CurrencyUnit.USDT]: string;
|
|
87
91
|
[CurrencyUnit.FUTURE_VALUE]: string;
|
|
88
92
|
};
|
|
89
93
|
isZero: boolean;
|
|
@@ -139,7 +143,7 @@ declare function getCurrencyAmount(currencyAmountArg: CurrencyAmountArg): {
|
|
|
139
143
|
};
|
|
140
144
|
declare function mapCurrencyAmount(currencyAmountArg: CurrencyAmountArg, unitsPerBtc?: number): CurrencyMap;
|
|
141
145
|
declare const isCurrencyMap: (currencyMap: unknown) => currencyMap is CurrencyMap;
|
|
142
|
-
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "INR" | "MXN" | "PHP" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
146
|
+
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "INR" | "MXN" | "PHP" | "USDT" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
143
147
|
type AppendUnitsOptions = {
|
|
144
148
|
plural?: boolean | undefined;
|
|
145
149
|
lowercase?: boolean | undefined;
|
|
@@ -172,6 +176,7 @@ declare const isBrowser: boolean;
|
|
|
172
176
|
declare const isNode: boolean;
|
|
173
177
|
declare const isTest: boolean;
|
|
174
178
|
declare const isBare: boolean;
|
|
179
|
+
declare const isReactNative: boolean;
|
|
175
180
|
|
|
176
181
|
type Maybe<T> = T | null | undefined;
|
|
177
182
|
type ExpandRecursively<T> = T extends object ? T extends infer O ? {
|
|
@@ -336,4 +341,4 @@ declare const zipcodeToStateCode: Record<string, StateCode>;
|
|
|
336
341
|
*/
|
|
337
342
|
declare function zipcodeToState(zipcode: string): StateCode | null;
|
|
338
343
|
|
|
339
|
-
export {
|
|
344
|
+
export { getLocalStorageBoolean as $, type AppendUnitsOptions as A, formatCurrencyStr as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, separateCurrencyStrParts as E, localeToCurrencySymbol as F, formatInviteAmount as G, isBrowser as H, isNode as I, isTest as J, isBare as K, isReactNative as L, isError as M, isErrorWithMessage as N, getErrorMsg as O, isErrorMsg as P, errorToJSON as Q, bytesToHex as R, type SDKCurrencyAmountType as S, hexToBytes as T, type UmaCurrency as U, getCurrentLocale as V, countryCodesToCurrencyCodes as W, type CurrencyLocales as X, type CurrencyCodes as Y, localeToCurrencyCode as Z, getLocalStorageConfigItem as _, b64encode as a, setLocalStorageBoolean as a0, deleteLocalStorageItem as a1, clamp as a2, linearInterpolate as a3, round as a4, isNumber as a5, pollUntil as a6, sleep as a7, lsidToUUID as a8, isUint8Array as a9, isObject as aa, isRecord as ab, type Maybe as ac, type ExpandRecursively as ad, type ById as ae, type OmitTypename as af, isType as ag, type ExtractByTypename as ah, type DeepPartial as ai, type JSONLiteral as aj, type JSONType as ak, type JSONObject as al, type NN as am, notNullUndefined as an, type PartialBy as ao, type Complete as ap, type RequiredKeys as aq, type StateCode as ar, zipcodeToStateCode as as, zipcodeToState as at, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, ensureArray as e, CurrencyUnit as f, type CurrencyUnitType as g, convertCurrencyAmountValue as h, convertCurrencyAmount as i, type CurrencyMap as j, type CurrencyAmountInputObj as k, type UmaCurrencyAmount as l, type CurrencyAmountObj as m, type CurrencyAmountPreferenceObj as n, type CurrencyAmountArg as o, isCurrencyAmountInputObj as p, isUmaCurrencyAmount as q, isDeprecatedCurrencyAmountObj as r, isCurrencyAmountObj as s, isCurrencyAmountPreferenceObj as t, urlsafe_b64decode as u, isSDKCurrencyAmount as v, getCurrencyAmount as w, mapCurrencyAmount as x, isCurrencyMap as y, abbrCurrencyUnit as z };
|
|
@@ -29,6 +29,7 @@ declare const CurrencyUnit: {
|
|
|
29
29
|
readonly EUR: "EUR";
|
|
30
30
|
readonly GBP: "GBP";
|
|
31
31
|
readonly INR: "INR";
|
|
32
|
+
readonly USDT: "USDT";
|
|
32
33
|
readonly Bitcoin: "BITCOIN";
|
|
33
34
|
readonly Microbitcoin: "MICROBITCOIN";
|
|
34
35
|
readonly Millibitcoin: "MILLIBITCOIN";
|
|
@@ -40,6 +41,7 @@ declare const CurrencyUnit: {
|
|
|
40
41
|
readonly Php: "PHP";
|
|
41
42
|
readonly Gbp: "GBP";
|
|
42
43
|
readonly Inr: "INR";
|
|
44
|
+
readonly Usdt: "USDT";
|
|
43
45
|
};
|
|
44
46
|
type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
|
|
45
47
|
type SDKCurrencyAmountType = {
|
|
@@ -67,6 +69,7 @@ type CurrencyMap = {
|
|
|
67
69
|
[CurrencyUnit.EUR]: number;
|
|
68
70
|
[CurrencyUnit.GBP]: number;
|
|
69
71
|
[CurrencyUnit.INR]: number;
|
|
72
|
+
[CurrencyUnit.USDT]: number;
|
|
70
73
|
[CurrencyUnit.FUTURE_VALUE]: number;
|
|
71
74
|
formatted: {
|
|
72
75
|
sats: string;
|
|
@@ -84,6 +87,7 @@ type CurrencyMap = {
|
|
|
84
87
|
[CurrencyUnit.EUR]: string;
|
|
85
88
|
[CurrencyUnit.GBP]: string;
|
|
86
89
|
[CurrencyUnit.INR]: string;
|
|
90
|
+
[CurrencyUnit.USDT]: string;
|
|
87
91
|
[CurrencyUnit.FUTURE_VALUE]: string;
|
|
88
92
|
};
|
|
89
93
|
isZero: boolean;
|
|
@@ -139,7 +143,7 @@ declare function getCurrencyAmount(currencyAmountArg: CurrencyAmountArg): {
|
|
|
139
143
|
};
|
|
140
144
|
declare function mapCurrencyAmount(currencyAmountArg: CurrencyAmountArg, unitsPerBtc?: number): CurrencyMap;
|
|
141
145
|
declare const isCurrencyMap: (currencyMap: unknown) => currencyMap is CurrencyMap;
|
|
142
|
-
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "INR" | "MXN" | "PHP" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
146
|
+
declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "INR" | "MXN" | "PHP" | "USDT" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
|
|
143
147
|
type AppendUnitsOptions = {
|
|
144
148
|
plural?: boolean | undefined;
|
|
145
149
|
lowercase?: boolean | undefined;
|
|
@@ -172,6 +176,7 @@ declare const isBrowser: boolean;
|
|
|
172
176
|
declare const isNode: boolean;
|
|
173
177
|
declare const isTest: boolean;
|
|
174
178
|
declare const isBare: boolean;
|
|
179
|
+
declare const isReactNative: boolean;
|
|
175
180
|
|
|
176
181
|
type Maybe<T> = T | null | undefined;
|
|
177
182
|
type ExpandRecursively<T> = T extends object ? T extends infer O ? {
|
|
@@ -336,4 +341,4 @@ declare const zipcodeToStateCode: Record<string, StateCode>;
|
|
|
336
341
|
*/
|
|
337
342
|
declare function zipcodeToState(zipcode: string): StateCode | null;
|
|
338
343
|
|
|
339
|
-
export {
|
|
344
|
+
export { getLocalStorageBoolean as $, type AppendUnitsOptions as A, formatCurrencyStr as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, separateCurrencyStrParts as E, localeToCurrencySymbol as F, formatInviteAmount as G, isBrowser as H, isNode as I, isTest as J, isBare as K, isReactNative as L, isError as M, isErrorWithMessage as N, getErrorMsg as O, isErrorMsg as P, errorToJSON as Q, bytesToHex as R, type SDKCurrencyAmountType as S, hexToBytes as T, type UmaCurrency as U, getCurrentLocale as V, countryCodesToCurrencyCodes as W, type CurrencyLocales as X, type CurrencyCodes as Y, localeToCurrencyCode as Z, getLocalStorageConfigItem as _, b64encode as a, setLocalStorageBoolean as a0, deleteLocalStorageItem as a1, clamp as a2, linearInterpolate as a3, round as a4, isNumber as a5, pollUntil as a6, sleep as a7, lsidToUUID as a8, isUint8Array as a9, isObject as aa, isRecord as ab, type Maybe as ac, type ExpandRecursively as ad, type ById as ae, type OmitTypename as af, isType as ag, type ExtractByTypename as ah, type DeepPartial as ai, type JSONLiteral as aj, type JSONType as ak, type JSONObject as al, type NN as am, notNullUndefined as an, type PartialBy as ao, type Complete as ap, type RequiredKeys as aq, type StateCode as ar, zipcodeToStateCode as as, zipcodeToState as at, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, ensureArray as e, CurrencyUnit as f, type CurrencyUnitType as g, convertCurrencyAmountValue as h, convertCurrencyAmount as i, type CurrencyMap as j, type CurrencyAmountInputObj as k, type UmaCurrencyAmount as l, type CurrencyAmountObj as m, type CurrencyAmountPreferenceObj as n, type CurrencyAmountArg as o, isCurrencyAmountInputObj as p, isUmaCurrencyAmount as q, isDeprecatedCurrencyAmountObj as r, isCurrencyAmountObj as s, isCurrencyAmountPreferenceObj as t, urlsafe_b64decode as u, isSDKCurrencyAmount as v, getCurrencyAmount as w, mapCurrencyAmount as x, isCurrencyMap as y, abbrCurrencyUnit as z };
|