@lightsparkdev/core 1.4.2 → 1.4.4

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.
@@ -28,6 +28,7 @@ declare const CurrencyUnit: {
28
28
  readonly PHP: "PHP";
29
29
  readonly EUR: "EUR";
30
30
  readonly GBP: "GBP";
31
+ readonly INR: "INR";
31
32
  readonly Bitcoin: "BITCOIN";
32
33
  readonly Microbitcoin: "MICROBITCOIN";
33
34
  readonly Millibitcoin: "MILLIBITCOIN";
@@ -38,6 +39,7 @@ declare const CurrencyUnit: {
38
39
  readonly Mxn: "MXN";
39
40
  readonly Php: "PHP";
40
41
  readonly Gbp: "GBP";
42
+ readonly Inr: "INR";
41
43
  };
42
44
  type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
43
45
  type SDKCurrencyAmountType = {
@@ -64,6 +66,7 @@ type CurrencyMap = {
64
66
  [CurrencyUnit.PHP]: number;
65
67
  [CurrencyUnit.EUR]: number;
66
68
  [CurrencyUnit.GBP]: number;
69
+ [CurrencyUnit.INR]: number;
67
70
  [CurrencyUnit.FUTURE_VALUE]: number;
68
71
  formatted: {
69
72
  sats: string;
@@ -80,6 +83,7 @@ type CurrencyMap = {
80
83
  [CurrencyUnit.PHP]: string;
81
84
  [CurrencyUnit.EUR]: string;
82
85
  [CurrencyUnit.GBP]: string;
86
+ [CurrencyUnit.INR]: string;
83
87
  [CurrencyUnit.FUTURE_VALUE]: string;
84
88
  };
85
89
  isZero: boolean;
@@ -135,7 +139,7 @@ declare function getCurrencyAmount(currencyAmountArg: CurrencyAmountArg): {
135
139
  };
136
140
  declare function mapCurrencyAmount(currencyAmountArg: CurrencyAmountArg, unitsPerBtc?: number): CurrencyMap;
137
141
  declare const isCurrencyMap: (currencyMap: unknown) => currencyMap is CurrencyMap;
138
- declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "MXN" | "PHP" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
142
+ declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "INR" | "MXN" | "PHP" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
139
143
  type AppendUnitsOptions = {
140
144
  plural?: boolean | undefined;
141
145
  lowercase?: boolean | undefined;
@@ -153,10 +157,22 @@ declare function separateCurrencyStrParts(currencyStr: string): {
153
157
  amount: string;
154
158
  };
155
159
  declare function localeToCurrencySymbol(locale: string): string;
160
+ /**
161
+ * Formats an amount from the smallest currency unit to a display string
162
+ * @param amount - The amount in the smallest currency unit (No decimals)
163
+ * @param currency - The currency object with code and decimals
164
+ * @returns Formatted string like "12.50 USD" or empty string if invalid
165
+ */
166
+ declare function formatInviteAmount(amount: number | null | undefined, currency: UmaCurrency | null | undefined): string;
156
167
 
168
+ declare global {
169
+ const Bare: unknown;
170
+ }
157
171
  declare const isBrowser: boolean;
158
172
  declare const isNode: boolean;
159
173
  declare const isTest: boolean;
174
+ declare const isBare: boolean;
175
+ declare const isReactNative: boolean;
160
176
 
161
177
  type Maybe<T> = T | null | undefined;
162
178
  type ExpandRecursively<T> = T extends object ? T extends infer O ? {
@@ -321,4 +337,4 @@ declare const zipcodeToStateCode: Record<string, StateCode>;
321
337
  */
322
338
  declare function zipcodeToState(zipcode: string): StateCode | null;
323
339
 
324
- export { clamp as $, type AppendUnitsOptions as A, formatCurrencyStr as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, separateCurrencyStrParts as E, localeToCurrencySymbol as F, isBrowser as G, isNode as H, isTest as I, isError as J, isErrorWithMessage as K, getErrorMsg as L, isErrorMsg as M, errorToJSON as N, bytesToHex as O, hexToBytes as P, getCurrentLocale as Q, countryCodesToCurrencyCodes as R, type SDKCurrencyAmountType as S, type CurrencyLocales as T, type UmaCurrency as U, type CurrencyCodes as V, localeToCurrencyCode as W, getLocalStorageConfigItem as X, getLocalStorageBoolean as Y, setLocalStorageBoolean as Z, deleteLocalStorageItem as _, b64encode as a, linearInterpolate as a0, round as a1, isNumber as a2, pollUntil as a3, sleep as a4, lsidToUUID as a5, isUint8Array as a6, isObject as a7, isRecord as a8, type Maybe as a9, type ExpandRecursively as aa, type ById as ab, type OmitTypename as ac, isType as ad, type ExtractByTypename as ae, type DeepPartial as af, type JSONLiteral as ag, type JSONType as ah, type JSONObject as ai, type NN as aj, notNullUndefined as ak, type PartialBy as al, type Complete as am, type RequiredKeys as an, type StateCode as ao, zipcodeToStateCode as ap, zipcodeToState as aq, 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 };
340
+ 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 };
@@ -28,6 +28,7 @@ declare const CurrencyUnit: {
28
28
  readonly PHP: "PHP";
29
29
  readonly EUR: "EUR";
30
30
  readonly GBP: "GBP";
31
+ readonly INR: "INR";
31
32
  readonly Bitcoin: "BITCOIN";
32
33
  readonly Microbitcoin: "MICROBITCOIN";
33
34
  readonly Millibitcoin: "MILLIBITCOIN";
@@ -38,6 +39,7 @@ declare const CurrencyUnit: {
38
39
  readonly Mxn: "MXN";
39
40
  readonly Php: "PHP";
40
41
  readonly Gbp: "GBP";
42
+ readonly Inr: "INR";
41
43
  };
42
44
  type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
43
45
  type SDKCurrencyAmountType = {
@@ -64,6 +66,7 @@ type CurrencyMap = {
64
66
  [CurrencyUnit.PHP]: number;
65
67
  [CurrencyUnit.EUR]: number;
66
68
  [CurrencyUnit.GBP]: number;
69
+ [CurrencyUnit.INR]: number;
67
70
  [CurrencyUnit.FUTURE_VALUE]: number;
68
71
  formatted: {
69
72
  sats: string;
@@ -80,6 +83,7 @@ type CurrencyMap = {
80
83
  [CurrencyUnit.PHP]: string;
81
84
  [CurrencyUnit.EUR]: string;
82
85
  [CurrencyUnit.GBP]: string;
86
+ [CurrencyUnit.INR]: string;
83
87
  [CurrencyUnit.FUTURE_VALUE]: string;
84
88
  };
85
89
  isZero: boolean;
@@ -135,7 +139,7 @@ declare function getCurrencyAmount(currencyAmountArg: CurrencyAmountArg): {
135
139
  };
136
140
  declare function mapCurrencyAmount(currencyAmountArg: CurrencyAmountArg, unitsPerBtc?: number): CurrencyMap;
137
141
  declare const isCurrencyMap: (currencyMap: unknown) => currencyMap is CurrencyMap;
138
- declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "MXN" | "PHP" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
142
+ declare const abbrCurrencyUnit: (unit: CurrencyUnitType) => "EUR" | "USD" | "GBP" | "INR" | "MXN" | "PHP" | "BTC" | "SAT" | "MSAT" | "mBTC" | "μBTC" | "Unsupported CurrencyUnit";
139
143
  type AppendUnitsOptions = {
140
144
  plural?: boolean | undefined;
141
145
  lowercase?: boolean | undefined;
@@ -153,10 +157,22 @@ declare function separateCurrencyStrParts(currencyStr: string): {
153
157
  amount: string;
154
158
  };
155
159
  declare function localeToCurrencySymbol(locale: string): string;
160
+ /**
161
+ * Formats an amount from the smallest currency unit to a display string
162
+ * @param amount - The amount in the smallest currency unit (No decimals)
163
+ * @param currency - The currency object with code and decimals
164
+ * @returns Formatted string like "12.50 USD" or empty string if invalid
165
+ */
166
+ declare function formatInviteAmount(amount: number | null | undefined, currency: UmaCurrency | null | undefined): string;
156
167
 
168
+ declare global {
169
+ const Bare: unknown;
170
+ }
157
171
  declare const isBrowser: boolean;
158
172
  declare const isNode: boolean;
159
173
  declare const isTest: boolean;
174
+ declare const isBare: boolean;
175
+ declare const isReactNative: boolean;
160
176
 
161
177
  type Maybe<T> = T | null | undefined;
162
178
  type ExpandRecursively<T> = T extends object ? T extends infer O ? {
@@ -321,4 +337,4 @@ declare const zipcodeToStateCode: Record<string, StateCode>;
321
337
  */
322
338
  declare function zipcodeToState(zipcode: string): StateCode | null;
323
339
 
324
- export { clamp as $, type AppendUnitsOptions as A, formatCurrencyStr as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, separateCurrencyStrParts as E, localeToCurrencySymbol as F, isBrowser as G, isNode as H, isTest as I, isError as J, isErrorWithMessage as K, getErrorMsg as L, isErrorMsg as M, errorToJSON as N, bytesToHex as O, hexToBytes as P, getCurrentLocale as Q, countryCodesToCurrencyCodes as R, type SDKCurrencyAmountType as S, type CurrencyLocales as T, type UmaCurrency as U, type CurrencyCodes as V, localeToCurrencyCode as W, getLocalStorageConfigItem as X, getLocalStorageBoolean as Y, setLocalStorageBoolean as Z, deleteLocalStorageItem as _, b64encode as a, linearInterpolate as a0, round as a1, isNumber as a2, pollUntil as a3, sleep as a4, lsidToUUID as a5, isUint8Array as a6, isObject as a7, isRecord as a8, type Maybe as a9, type ExpandRecursively as aa, type ById as ab, type OmitTypename as ac, isType as ad, type ExtractByTypename as ae, type DeepPartial as af, type JSONLiteral as ag, type JSONType as ah, type JSONObject as ai, type NN as aj, notNullUndefined as ak, type PartialBy as al, type Complete as am, type RequiredKeys as an, type StateCode as ao, zipcodeToStateCode as ap, zipcodeToState as aq, 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 };
340
+ 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 };