@lightsparkdev/core 1.2.8 → 1.3.0

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 CHANGED
@@ -80,10 +80,12 @@ __export(src_exports, {
80
80
  isNode: () => isNode,
81
81
  isNumber: () => isNumber,
82
82
  isObject: () => isObject2,
83
+ isRecord: () => isRecord,
83
84
  isSDKCurrencyAmount: () => isSDKCurrencyAmount,
84
85
  isTest: () => isTest,
85
86
  isType: () => isType,
86
87
  isUint8Array: () => isUint8Array,
88
+ isUmaCurrencyAmount: () => isUmaCurrencyAmount,
87
89
  linearInterpolate: () => linearInterpolate,
88
90
  localeToCurrencyCode: () => localeToCurrencyCode,
89
91
  localeToCurrencySymbol: () => localeToCurrencySymbol,
@@ -797,6 +799,7 @@ var CurrencyUnit = {
797
799
  USD: "USD",
798
800
  MXN: "MXN",
799
801
  PHP: "PHP",
802
+ EUR: "EUR",
800
803
  Bitcoin: "BITCOIN",
801
804
  Microbitcoin: "MICROBITCOIN",
802
805
  Millibitcoin: "MILLIBITCOIN",
@@ -817,7 +820,8 @@ var standardUnitConversionObj = {
817
820
  /* Converting between two different fiat types is not currently supported */
818
821
  [CurrencyUnit.USD]: (v) => v,
819
822
  [CurrencyUnit.MXN]: (v) => v,
820
- [CurrencyUnit.PHP]: (v) => v
823
+ [CurrencyUnit.PHP]: (v) => v,
824
+ [CurrencyUnit.EUR]: (v) => v
821
825
  };
822
826
  var toBitcoinConversion = (v, unitsPerBtc = 1) => round(v * unitsPerBtc);
823
827
  var toMicrobitcoinConversion = (v, unitsPerBtc = 1) => round(v / 1e6 * unitsPerBtc);
@@ -835,7 +839,8 @@ var CONVERSION_MAP = {
835
839
  [CurrencyUnit.SATOSHI]: (v) => v * 1e8,
836
840
  [CurrencyUnit.USD]: toBitcoinConversion,
837
841
  [CurrencyUnit.MXN]: toBitcoinConversion,
838
- [CurrencyUnit.PHP]: toBitcoinConversion
842
+ [CurrencyUnit.PHP]: toBitcoinConversion,
843
+ [CurrencyUnit.EUR]: toBitcoinConversion
839
844
  },
840
845
  [CurrencyUnit.MICROBITCOIN]: {
841
846
  [CurrencyUnit.BITCOIN]: (v) => v / 1e6,
@@ -846,7 +851,8 @@ var CONVERSION_MAP = {
846
851
  [CurrencyUnit.SATOSHI]: (v) => v * 100,
847
852
  [CurrencyUnit.USD]: toMicrobitcoinConversion,
848
853
  [CurrencyUnit.MXN]: toMicrobitcoinConversion,
849
- [CurrencyUnit.PHP]: toMicrobitcoinConversion
854
+ [CurrencyUnit.PHP]: toMicrobitcoinConversion,
855
+ [CurrencyUnit.EUR]: toMicrobitcoinConversion
850
856
  },
851
857
  [CurrencyUnit.MILLIBITCOIN]: {
852
858
  [CurrencyUnit.BITCOIN]: (v) => v / 1e3,
@@ -857,7 +863,8 @@ var CONVERSION_MAP = {
857
863
  [CurrencyUnit.SATOSHI]: (v) => v * 1e5,
858
864
  [CurrencyUnit.USD]: toMillibitcoinConversion,
859
865
  [CurrencyUnit.MXN]: toMillibitcoinConversion,
860
- [CurrencyUnit.PHP]: toMillibitcoinConversion
866
+ [CurrencyUnit.PHP]: toMillibitcoinConversion,
867
+ [CurrencyUnit.EUR]: toMillibitcoinConversion
861
868
  },
862
869
  [CurrencyUnit.MILLISATOSHI]: {
863
870
  [CurrencyUnit.BITCOIN]: (v) => v / 1e11,
@@ -868,7 +875,8 @@ var CONVERSION_MAP = {
868
875
  [CurrencyUnit.SATOSHI]: (v) => v / 1e3,
869
876
  [CurrencyUnit.USD]: toMillisatoshiConversion,
870
877
  [CurrencyUnit.MXN]: toMillisatoshiConversion,
871
- [CurrencyUnit.PHP]: toMillisatoshiConversion
878
+ [CurrencyUnit.PHP]: toMillisatoshiConversion,
879
+ [CurrencyUnit.EUR]: toMillisatoshiConversion
872
880
  },
873
881
  [CurrencyUnit.NANOBITCOIN]: {
874
882
  [CurrencyUnit.BITCOIN]: (v) => v / 1e9,
@@ -879,7 +887,8 @@ var CONVERSION_MAP = {
879
887
  [CurrencyUnit.SATOSHI]: (v) => v / 10,
880
888
  [CurrencyUnit.USD]: toNanobitcoinConversion,
881
889
  [CurrencyUnit.MXN]: toNanobitcoinConversion,
882
- [CurrencyUnit.PHP]: toNanobitcoinConversion
890
+ [CurrencyUnit.PHP]: toNanobitcoinConversion,
891
+ [CurrencyUnit.EUR]: toNanobitcoinConversion
883
892
  },
884
893
  [CurrencyUnit.SATOSHI]: {
885
894
  [CurrencyUnit.BITCOIN]: (v) => v / 1e8,
@@ -890,11 +899,13 @@ var CONVERSION_MAP = {
890
899
  [CurrencyUnit.SATOSHI]: (v) => v,
891
900
  [CurrencyUnit.USD]: toSatoshiConversion,
892
901
  [CurrencyUnit.MXN]: toSatoshiConversion,
893
- [CurrencyUnit.PHP]: toSatoshiConversion
902
+ [CurrencyUnit.PHP]: toSatoshiConversion,
903
+ [CurrencyUnit.EUR]: toSatoshiConversion
894
904
  },
895
905
  [CurrencyUnit.USD]: standardUnitConversionObj,
896
906
  [CurrencyUnit.MXN]: standardUnitConversionObj,
897
- [CurrencyUnit.PHP]: standardUnitConversionObj
907
+ [CurrencyUnit.PHP]: standardUnitConversionObj,
908
+ [CurrencyUnit.EUR]: standardUnitConversionObj
898
909
  };
899
910
  function convertCurrencyAmountValue(fromUnit, toUnit, amount, unitsPerBtc = 1) {
900
911
  if (fromUnit === CurrencyUnit.FUTURE_VALUE || toUnit === CurrencyUnit.FUTURE_VALUE) {
@@ -928,6 +939,9 @@ var convertCurrencyAmount = (from, toUnit) => {
928
939
  function isCurrencyAmountInputObj(arg) {
929
940
  return typeof arg === "object" && arg !== null && "value" in arg && (typeof arg.value === "number" || typeof arg.value === "string" || arg.value === null) && "unit" in arg && typeof arg.unit === "string";
930
941
  }
942
+ function isUmaCurrencyAmount(arg) {
943
+ return typeof arg === "object" && arg !== null && "value" in arg && typeof arg.value === "number" && "currency" in arg && typeof arg.currency === "object" && typeof arg.currency.code === "string" && typeof arg.currency.symbol === "string" && typeof arg.currency.name === "string" && typeof arg.currency.decimals === "number";
944
+ }
931
945
  function isDeprecatedCurrencyAmountObj(arg) {
932
946
  return typeof arg === "object" && arg !== null && "value" in arg && "unit" in arg;
933
947
  }
@@ -974,6 +988,7 @@ function convertCurrencyAmountValues(fromUnit, amount, unitsPerBtc = 1, conversi
974
988
  usd: CurrencyUnit.USD,
975
989
  mxn: CurrencyUnit.MXN,
976
990
  php: CurrencyUnit.PHP,
991
+ eur: CurrencyUnit.EUR,
977
992
  mibtc: CurrencyUnit.MICROBITCOIN,
978
993
  mlbtc: CurrencyUnit.MILLIBITCOIN,
979
994
  nbtc: CurrencyUnit.NANOBITCOIN
@@ -1012,7 +1027,7 @@ function getPreferredConversionOverride(currencyAmountArg) {
1012
1027
  function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
1013
1028
  const { value, unit } = getCurrencyAmount(currencyAmountArg);
1014
1029
  const conversionOverride = getPreferredConversionOverride(currencyAmountArg);
1015
- const { sats, msats, btc, usd, mxn, php, mibtc, mlbtc, nbtc } = convertCurrencyAmountValues(unit, value, unitsPerBtc, conversionOverride);
1030
+ const { sats, msats, btc, usd, mxn, php, mibtc, mlbtc, nbtc, eur } = convertCurrencyAmountValues(unit, value, unitsPerBtc, conversionOverride);
1016
1031
  const mapWithCurrencyUnits = {
1017
1032
  [CurrencyUnit.BITCOIN]: btc,
1018
1033
  [CurrencyUnit.SATOSHI]: sats,
@@ -1020,6 +1035,7 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
1020
1035
  [CurrencyUnit.USD]: usd,
1021
1036
  [CurrencyUnit.MXN]: mxn,
1022
1037
  [CurrencyUnit.PHP]: php,
1038
+ [CurrencyUnit.EUR]: eur,
1023
1039
  [CurrencyUnit.MICROBITCOIN]: mibtc,
1024
1040
  [CurrencyUnit.MILLIBITCOIN]: mlbtc,
1025
1041
  [CurrencyUnit.NANOBITCOIN]: nbtc,
@@ -1061,6 +1077,10 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
1061
1077
  value: php,
1062
1078
  unit: CurrencyUnit.PHP
1063
1079
  }),
1080
+ [CurrencyUnit.EUR]: formatCurrencyStr({
1081
+ value: eur,
1082
+ unit: CurrencyUnit.EUR
1083
+ }),
1064
1084
  [CurrencyUnit.FUTURE_VALUE]: "-"
1065
1085
  }
1066
1086
  };
@@ -1125,6 +1145,8 @@ var abbrCurrencyUnit = (unit) => {
1125
1145
  return "MXN";
1126
1146
  case CurrencyUnit.PHP:
1127
1147
  return "PHP";
1148
+ case CurrencyUnit.EUR:
1149
+ return "EUR";
1128
1150
  }
1129
1151
  return "Unsupported CurrencyUnit";
1130
1152
  };
@@ -1140,16 +1162,27 @@ function formatCurrencyStr(amount, options) {
1140
1162
  ...defaultOptions,
1141
1163
  ...options
1142
1164
  };
1143
- const currencyAmount = getCurrencyAmount(amount);
1144
- let { value: num } = currencyAmount;
1145
- const { unit } = currencyAmount;
1146
- const centCurrencies = [
1147
- CurrencyUnit.USD,
1148
- CurrencyUnit.MXN,
1149
- CurrencyUnit.PHP
1150
- ];
1151
- if (centCurrencies.includes(unit)) {
1152
- num = num / 100;
1165
+ let num;
1166
+ let unit;
1167
+ if (isUmaCurrencyAmount(amount)) {
1168
+ num = amount.value;
1169
+ unit = amount.currency.code;
1170
+ if (amount.currency.decimals > 0) {
1171
+ num = amount.value / Math.pow(10, amount.currency.decimals);
1172
+ }
1173
+ } else {
1174
+ const currencyAmount = getCurrencyAmount(amount);
1175
+ num = currencyAmount.value;
1176
+ unit = currencyAmount.unit;
1177
+ const centCurrencies = [
1178
+ CurrencyUnit.USD,
1179
+ CurrencyUnit.MXN,
1180
+ CurrencyUnit.PHP,
1181
+ CurrencyUnit.EUR
1182
+ ];
1183
+ if (centCurrencies.includes(unit)) {
1184
+ num = num / 100;
1185
+ }
1153
1186
  }
1154
1187
  function getDefaultMaxFractionDigits(defaultDigits, fullPrecisionDigits) {
1155
1188
  let digits = defaultDigits;
@@ -1162,21 +1195,22 @@ function formatCurrencyStr(amount, options) {
1162
1195
  }
1163
1196
  return digits;
1164
1197
  }
1165
- const symbol = !showBtcSymbol ? "" : unit === CurrencyUnit.BITCOIN ? "\uE903" : unit === CurrencyUnit.SATOSHI ? "\uE902" : "";
1198
+ const symbol = !showBtcSymbol ? "" : unit === CurrencyUnit.BITCOIN ? "\uE903" : unit === CurrencyUnit.SATOSHI || unit === abbrCurrencyUnit(CurrencyUnit.SATOSHI) ? "\uE902" : "";
1166
1199
  const currentLocale = getCurrentLocale();
1167
- let formattedStr = "";
1168
- switch (unit) {
1169
- case CurrencyUnit.MXN:
1170
- case CurrencyUnit.USD:
1171
- case CurrencyUnit.PHP:
1172
- formattedStr = num.toLocaleString(currentLocale, {
1200
+ function isFormattableFiatCurrencyCode(currencyCode) {
1201
+ try {
1202
+ new Intl.NumberFormat(currentLocale, {
1173
1203
  style: "currency",
1174
- currency: unit,
1175
- currencyDisplay: "narrowSymbol",
1176
- notation: compact ? "compact" : void 0,
1177
- maximumFractionDigits: getDefaultMaxFractionDigits(2, 2)
1204
+ currency: currencyCode
1178
1205
  });
1179
- break;
1206
+ return true;
1207
+ } catch (e) {
1208
+ return false;
1209
+ }
1210
+ }
1211
+ let formattedStr = "";
1212
+ let forceAppendUnits = false;
1213
+ switch (unit) {
1180
1214
  case CurrencyUnit.BITCOIN:
1181
1215
  formattedStr = `${symbol}${num.toLocaleString(currentLocale, {
1182
1216
  notation: compact ? "compact" : void 0,
@@ -1184,6 +1218,7 @@ function formatCurrencyStr(amount, options) {
1184
1218
  })}`;
1185
1219
  break;
1186
1220
  case CurrencyUnit.SATOSHI:
1221
+ case abbrCurrencyUnit(CurrencyUnit.SATOSHI):
1187
1222
  formattedStr = `${symbol}${num.toLocaleString(currentLocale, {
1188
1223
  notation: compact ? "compact" : void 0,
1189
1224
  maximumFractionDigits: getDefaultMaxFractionDigits(0, 3)
@@ -1193,21 +1228,35 @@ function formatCurrencyStr(amount, options) {
1193
1228
  case CurrencyUnit.MICROBITCOIN:
1194
1229
  case CurrencyUnit.MILLIBITCOIN:
1195
1230
  case CurrencyUnit.NANOBITCOIN:
1196
- default:
1197
1231
  formattedStr = `${symbol}${num.toLocaleString(currentLocale, {
1198
1232
  notation: compact ? "compact" : void 0,
1199
1233
  maximumFractionDigits: getDefaultMaxFractionDigits(0, 0)
1200
1234
  })}`;
1235
+ break;
1236
+ default:
1237
+ if (isFormattableFiatCurrencyCode(unit)) {
1238
+ formattedStr = num.toLocaleString(currentLocale, {
1239
+ style: "currency",
1240
+ currency: unit,
1241
+ currencyDisplay: "narrowSymbol",
1242
+ notation: compact ? "compact" : void 0,
1243
+ maximumFractionDigits: getDefaultMaxFractionDigits(2, 2)
1244
+ });
1245
+ } else {
1246
+ formattedStr = `${num}`;
1247
+ forceAppendUnits = true;
1248
+ }
1249
+ break;
1201
1250
  }
1202
- if (options?.appendUnits) {
1251
+ if (options?.appendUnits || forceAppendUnits) {
1203
1252
  const localeCurrencyCode = localeToCurrencyCode(currentLocale);
1204
- if (unit === localeCurrencyCode && !options.appendUnits.showForCurrentLocaleUnit) {
1253
+ if (unit === localeCurrencyCode && options?.appendUnits && !options.appendUnits.showForCurrentLocaleUnit) {
1205
1254
  return formattedStr;
1206
1255
  }
1207
- const unitStr = abbrCurrencyUnit(unit);
1208
- const unitSuffix = options.appendUnits.plural && num > 1 ? "s" : "";
1256
+ const unitStr = isUmaCurrencyAmount(amount) ? amount.currency.code : abbrCurrencyUnit(unit);
1257
+ const unitSuffix = options?.appendUnits?.plural && num > 1 ? "s" : "";
1209
1258
  const unitStrWithSuffix = `${unitStr}${unitSuffix}`;
1210
- formattedStr += ` ${options.appendUnits.lowercase ? unitStrWithSuffix.toLowerCase() : unitStrWithSuffix}`;
1259
+ formattedStr += ` ${options?.appendUnits?.lowercase ? unitStrWithSuffix.toLowerCase() : unitStrWithSuffix}`;
1211
1260
  }
1212
1261
  return formattedStr;
1213
1262
  }
@@ -1432,6 +1481,9 @@ var isType = (typename) => (node) => {
1432
1481
  function notNullUndefined(value) {
1433
1482
  return value !== null && value !== void 0;
1434
1483
  }
1484
+ function isRecord(value) {
1485
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1486
+ }
1435
1487
 
1436
1488
  // src/crypto/SigningKey.ts
1437
1489
  function isAlias(key) {
@@ -1859,10 +1911,12 @@ var ServerEnvironment_default = ServerEnvironment;
1859
1911
  isNode,
1860
1912
  isNumber,
1861
1913
  isObject,
1914
+ isRecord,
1862
1915
  isSDKCurrencyAmount,
1863
1916
  isTest,
1864
1917
  isType,
1865
1918
  isUint8Array,
1919
+ isUmaCurrencyAmount,
1866
1920
  linearInterpolate,
1867
1921
  localeToCurrencyCode,
1868
1922
  localeToCurrencySymbol,
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AppendUnitsOptions, a7 as ById, ah as Complete, C as ConfigKeys, n as CurrencyAmountArg, k as CurrencyAmountInputObj, l as CurrencyAmountObj, m as CurrencyAmountPreferenceObj, R as CurrencyCodes, Q as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, aa as DeepPartial, D as DeprecatedCurrencyAmountObj, a6 as ExpandRecursively, ab as JSONLiteral, ad as JSONObject, ac as JSONType, a5 as Maybe, ae as NN, a8 as OmitTypename, ag as PartialBy, ai as RequiredKeys, S as SDKCurrencyAmountType, x as abbrCurrencyUnit, b as b64decode, a as b64encode, M as bytesToHex, Y as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, P as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, X as deleteLocalStorageItem, e as ensureArray, L as errorToJSON, y as formatCurrencyStr, t as getCurrencyAmount, O as getCurrentLocale, J as getErrorMsg, V as getLocalStorageBoolean, U as getLocalStorageConfigItem, N as hexToBytes, E as isBrowser, o as isCurrencyAmountInputObj, q as isCurrencyAmountObj, r as isCurrencyAmountPreferenceObj, w as isCurrencyMap, p as isDeprecatedCurrencyAmountObj, H as isError, K as isErrorMsg, I as isErrorWithMessage, F as isNode, $ as isNumber, a4 as isObject, s as isSDKCurrencyAmount, G as isTest, a9 as isType, a3 as isUint8Array, Z as linearInterpolate, T as localeToCurrencyCode, B as localeToCurrencySymbol, a2 as lsidToUUID, v as mapCurrencyAmount, af as notNullUndefined, a0 as pollUntil, _ as round, z as separateCurrencyStrParts, W as setLocalStorageBoolean, a1 as sleep, u as urlsafe_b64decode } from './index-r0bUxDu_.cjs';
1
+ export { A as AppendUnitsOptions, aa as ById, al as Complete, C as ConfigKeys, o as CurrencyAmountArg, k as CurrencyAmountInputObj, m as CurrencyAmountObj, n as CurrencyAmountPreferenceObj, V as CurrencyCodes, T as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, ae as DeepPartial, D as DeprecatedCurrencyAmountObj, a9 as ExpandRecursively, ad as ExtractByTypename, af as JSONLiteral, ah as JSONObject, ag as JSONType, a8 as Maybe, ai as NN, ab as OmitTypename, ak as PartialBy, am as RequiredKeys, S as SDKCurrencyAmountType, U as UmaCurrency, l as UmaCurrencyAmount, z as abbrCurrencyUnit, b as b64decode, a as b64encode, O as bytesToHex, $ as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, R as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, _ as deleteLocalStorageItem, e as ensureArray, N as errorToJSON, B as formatCurrencyStr, w as getCurrencyAmount, Q as getCurrentLocale, L as getErrorMsg, Y as getLocalStorageBoolean, X as getLocalStorageConfigItem, P as hexToBytes, G as isBrowser, p as isCurrencyAmountInputObj, s as isCurrencyAmountObj, t as isCurrencyAmountPreferenceObj, y as isCurrencyMap, r as isDeprecatedCurrencyAmountObj, J as isError, M as isErrorMsg, K as isErrorWithMessage, H as isNode, a2 as isNumber, a7 as isObject, an as isRecord, v as isSDKCurrencyAmount, I as isTest, ac as isType, a6 as isUint8Array, q as isUmaCurrencyAmount, a0 as linearInterpolate, W as localeToCurrencyCode, F as localeToCurrencySymbol, a5 as lsidToUUID, x as mapCurrencyAmount, aj as notNullUndefined, a3 as pollUntil, a1 as round, E as separateCurrencyStrParts, Z as setLocalStorageBoolean, a4 as sleep, u as urlsafe_b64decode } from './index-C7dqDM91.cjs';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  type Headers = Record<string, string>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AppendUnitsOptions, a7 as ById, ah as Complete, C as ConfigKeys, n as CurrencyAmountArg, k as CurrencyAmountInputObj, l as CurrencyAmountObj, m as CurrencyAmountPreferenceObj, R as CurrencyCodes, Q as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, aa as DeepPartial, D as DeprecatedCurrencyAmountObj, a6 as ExpandRecursively, ab as JSONLiteral, ad as JSONObject, ac as JSONType, a5 as Maybe, ae as NN, a8 as OmitTypename, ag as PartialBy, ai as RequiredKeys, S as SDKCurrencyAmountType, x as abbrCurrencyUnit, b as b64decode, a as b64encode, M as bytesToHex, Y as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, P as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, X as deleteLocalStorageItem, e as ensureArray, L as errorToJSON, y as formatCurrencyStr, t as getCurrencyAmount, O as getCurrentLocale, J as getErrorMsg, V as getLocalStorageBoolean, U as getLocalStorageConfigItem, N as hexToBytes, E as isBrowser, o as isCurrencyAmountInputObj, q as isCurrencyAmountObj, r as isCurrencyAmountPreferenceObj, w as isCurrencyMap, p as isDeprecatedCurrencyAmountObj, H as isError, K as isErrorMsg, I as isErrorWithMessage, F as isNode, $ as isNumber, a4 as isObject, s as isSDKCurrencyAmount, G as isTest, a9 as isType, a3 as isUint8Array, Z as linearInterpolate, T as localeToCurrencyCode, B as localeToCurrencySymbol, a2 as lsidToUUID, v as mapCurrencyAmount, af as notNullUndefined, a0 as pollUntil, _ as round, z as separateCurrencyStrParts, W as setLocalStorageBoolean, a1 as sleep, u as urlsafe_b64decode } from './index-r0bUxDu_.js';
1
+ export { A as AppendUnitsOptions, aa as ById, al as Complete, C as ConfigKeys, o as CurrencyAmountArg, k as CurrencyAmountInputObj, m as CurrencyAmountObj, n as CurrencyAmountPreferenceObj, V as CurrencyCodes, T as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, ae as DeepPartial, D as DeprecatedCurrencyAmountObj, a9 as ExpandRecursively, ad as ExtractByTypename, af as JSONLiteral, ah as JSONObject, ag as JSONType, a8 as Maybe, ai as NN, ab as OmitTypename, ak as PartialBy, am as RequiredKeys, S as SDKCurrencyAmountType, U as UmaCurrency, l as UmaCurrencyAmount, z as abbrCurrencyUnit, b as b64decode, a as b64encode, O as bytesToHex, $ as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, R as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, _ as deleteLocalStorageItem, e as ensureArray, N as errorToJSON, B as formatCurrencyStr, w as getCurrencyAmount, Q as getCurrentLocale, L as getErrorMsg, Y as getLocalStorageBoolean, X as getLocalStorageConfigItem, P as hexToBytes, G as isBrowser, p as isCurrencyAmountInputObj, s as isCurrencyAmountObj, t as isCurrencyAmountPreferenceObj, y as isCurrencyMap, r as isDeprecatedCurrencyAmountObj, J as isError, M as isErrorMsg, K as isErrorWithMessage, H as isNode, a2 as isNumber, a7 as isObject, an as isRecord, v as isSDKCurrencyAmount, I as isTest, ac as isType, a6 as isUint8Array, q as isUmaCurrencyAmount, a0 as linearInterpolate, W as localeToCurrencyCode, F as localeToCurrencySymbol, a5 as lsidToUUID, x as mapCurrencyAmount, aj as notNullUndefined, a3 as pollUntil, a1 as round, E as separateCurrencyStrParts, Z as setLocalStorageBoolean, a4 as sleep, u as urlsafe_b64decode } from './index-C7dqDM91.js';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  type Headers = Record<string, string>;
package/dist/index.js CHANGED
@@ -33,10 +33,12 @@ import {
33
33
  isNode,
34
34
  isNumber,
35
35
  isObject,
36
+ isRecord,
36
37
  isSDKCurrencyAmount,
37
38
  isTest,
38
39
  isType,
39
40
  isUint8Array,
41
+ isUmaCurrencyAmount,
40
42
  linearInterpolate,
41
43
  localeToCurrencyCode,
42
44
  localeToCurrencySymbol,
@@ -49,7 +51,7 @@ import {
49
51
  setLocalStorageBoolean,
50
52
  sleep,
51
53
  urlsafe_b64decode
52
- } from "./chunk-NY4EJZNK.js";
54
+ } from "./chunk-23SS5EX2.js";
53
55
 
54
56
  // src/auth/LightsparkAuthException.ts
55
57
  var LightsparkAuthException = class extends LightsparkException_default {
@@ -761,10 +763,12 @@ export {
761
763
  isNode,
762
764
  isNumber,
763
765
  isObject,
766
+ isRecord,
764
767
  isSDKCurrencyAmount,
765
768
  isTest,
766
769
  isType,
767
770
  isUint8Array,
771
+ isUmaCurrencyAmount,
768
772
  linearInterpolate,
769
773
  localeToCurrencyCode,
770
774
  localeToCurrencySymbol,
@@ -63,10 +63,12 @@ __export(utils_exports, {
63
63
  isNode: () => isNode,
64
64
  isNumber: () => isNumber,
65
65
  isObject: () => isObject2,
66
+ isRecord: () => isRecord,
66
67
  isSDKCurrencyAmount: () => isSDKCurrencyAmount,
67
68
  isTest: () => isTest,
68
69
  isType: () => isType,
69
70
  isUint8Array: () => isUint8Array,
71
+ isUmaCurrencyAmount: () => isUmaCurrencyAmount,
70
72
  linearInterpolate: () => linearInterpolate,
71
73
  localeToCurrencyCode: () => localeToCurrencyCode,
72
74
  localeToCurrencySymbol: () => localeToCurrencySymbol,
@@ -492,6 +494,7 @@ var CurrencyUnit = {
492
494
  USD: "USD",
493
495
  MXN: "MXN",
494
496
  PHP: "PHP",
497
+ EUR: "EUR",
495
498
  Bitcoin: "BITCOIN",
496
499
  Microbitcoin: "MICROBITCOIN",
497
500
  Millibitcoin: "MILLIBITCOIN",
@@ -512,7 +515,8 @@ var standardUnitConversionObj = {
512
515
  /* Converting between two different fiat types is not currently supported */
513
516
  [CurrencyUnit.USD]: (v) => v,
514
517
  [CurrencyUnit.MXN]: (v) => v,
515
- [CurrencyUnit.PHP]: (v) => v
518
+ [CurrencyUnit.PHP]: (v) => v,
519
+ [CurrencyUnit.EUR]: (v) => v
516
520
  };
517
521
  var toBitcoinConversion = (v, unitsPerBtc = 1) => round(v * unitsPerBtc);
518
522
  var toMicrobitcoinConversion = (v, unitsPerBtc = 1) => round(v / 1e6 * unitsPerBtc);
@@ -530,7 +534,8 @@ var CONVERSION_MAP = {
530
534
  [CurrencyUnit.SATOSHI]: (v) => v * 1e8,
531
535
  [CurrencyUnit.USD]: toBitcoinConversion,
532
536
  [CurrencyUnit.MXN]: toBitcoinConversion,
533
- [CurrencyUnit.PHP]: toBitcoinConversion
537
+ [CurrencyUnit.PHP]: toBitcoinConversion,
538
+ [CurrencyUnit.EUR]: toBitcoinConversion
534
539
  },
535
540
  [CurrencyUnit.MICROBITCOIN]: {
536
541
  [CurrencyUnit.BITCOIN]: (v) => v / 1e6,
@@ -541,7 +546,8 @@ var CONVERSION_MAP = {
541
546
  [CurrencyUnit.SATOSHI]: (v) => v * 100,
542
547
  [CurrencyUnit.USD]: toMicrobitcoinConversion,
543
548
  [CurrencyUnit.MXN]: toMicrobitcoinConversion,
544
- [CurrencyUnit.PHP]: toMicrobitcoinConversion
549
+ [CurrencyUnit.PHP]: toMicrobitcoinConversion,
550
+ [CurrencyUnit.EUR]: toMicrobitcoinConversion
545
551
  },
546
552
  [CurrencyUnit.MILLIBITCOIN]: {
547
553
  [CurrencyUnit.BITCOIN]: (v) => v / 1e3,
@@ -552,7 +558,8 @@ var CONVERSION_MAP = {
552
558
  [CurrencyUnit.SATOSHI]: (v) => v * 1e5,
553
559
  [CurrencyUnit.USD]: toMillibitcoinConversion,
554
560
  [CurrencyUnit.MXN]: toMillibitcoinConversion,
555
- [CurrencyUnit.PHP]: toMillibitcoinConversion
561
+ [CurrencyUnit.PHP]: toMillibitcoinConversion,
562
+ [CurrencyUnit.EUR]: toMillibitcoinConversion
556
563
  },
557
564
  [CurrencyUnit.MILLISATOSHI]: {
558
565
  [CurrencyUnit.BITCOIN]: (v) => v / 1e11,
@@ -563,7 +570,8 @@ var CONVERSION_MAP = {
563
570
  [CurrencyUnit.SATOSHI]: (v) => v / 1e3,
564
571
  [CurrencyUnit.USD]: toMillisatoshiConversion,
565
572
  [CurrencyUnit.MXN]: toMillisatoshiConversion,
566
- [CurrencyUnit.PHP]: toMillisatoshiConversion
573
+ [CurrencyUnit.PHP]: toMillisatoshiConversion,
574
+ [CurrencyUnit.EUR]: toMillisatoshiConversion
567
575
  },
568
576
  [CurrencyUnit.NANOBITCOIN]: {
569
577
  [CurrencyUnit.BITCOIN]: (v) => v / 1e9,
@@ -574,7 +582,8 @@ var CONVERSION_MAP = {
574
582
  [CurrencyUnit.SATOSHI]: (v) => v / 10,
575
583
  [CurrencyUnit.USD]: toNanobitcoinConversion,
576
584
  [CurrencyUnit.MXN]: toNanobitcoinConversion,
577
- [CurrencyUnit.PHP]: toNanobitcoinConversion
585
+ [CurrencyUnit.PHP]: toNanobitcoinConversion,
586
+ [CurrencyUnit.EUR]: toNanobitcoinConversion
578
587
  },
579
588
  [CurrencyUnit.SATOSHI]: {
580
589
  [CurrencyUnit.BITCOIN]: (v) => v / 1e8,
@@ -585,11 +594,13 @@ var CONVERSION_MAP = {
585
594
  [CurrencyUnit.SATOSHI]: (v) => v,
586
595
  [CurrencyUnit.USD]: toSatoshiConversion,
587
596
  [CurrencyUnit.MXN]: toSatoshiConversion,
588
- [CurrencyUnit.PHP]: toSatoshiConversion
597
+ [CurrencyUnit.PHP]: toSatoshiConversion,
598
+ [CurrencyUnit.EUR]: toSatoshiConversion
589
599
  },
590
600
  [CurrencyUnit.USD]: standardUnitConversionObj,
591
601
  [CurrencyUnit.MXN]: standardUnitConversionObj,
592
- [CurrencyUnit.PHP]: standardUnitConversionObj
602
+ [CurrencyUnit.PHP]: standardUnitConversionObj,
603
+ [CurrencyUnit.EUR]: standardUnitConversionObj
593
604
  };
594
605
  function convertCurrencyAmountValue(fromUnit, toUnit, amount, unitsPerBtc = 1) {
595
606
  if (fromUnit === CurrencyUnit.FUTURE_VALUE || toUnit === CurrencyUnit.FUTURE_VALUE) {
@@ -623,6 +634,9 @@ var convertCurrencyAmount = (from, toUnit) => {
623
634
  function isCurrencyAmountInputObj(arg) {
624
635
  return typeof arg === "object" && arg !== null && "value" in arg && (typeof arg.value === "number" || typeof arg.value === "string" || arg.value === null) && "unit" in arg && typeof arg.unit === "string";
625
636
  }
637
+ function isUmaCurrencyAmount(arg) {
638
+ return typeof arg === "object" && arg !== null && "value" in arg && typeof arg.value === "number" && "currency" in arg && typeof arg.currency === "object" && typeof arg.currency.code === "string" && typeof arg.currency.symbol === "string" && typeof arg.currency.name === "string" && typeof arg.currency.decimals === "number";
639
+ }
626
640
  function isDeprecatedCurrencyAmountObj(arg) {
627
641
  return typeof arg === "object" && arg !== null && "value" in arg && "unit" in arg;
628
642
  }
@@ -669,6 +683,7 @@ function convertCurrencyAmountValues(fromUnit, amount, unitsPerBtc = 1, conversi
669
683
  usd: CurrencyUnit.USD,
670
684
  mxn: CurrencyUnit.MXN,
671
685
  php: CurrencyUnit.PHP,
686
+ eur: CurrencyUnit.EUR,
672
687
  mibtc: CurrencyUnit.MICROBITCOIN,
673
688
  mlbtc: CurrencyUnit.MILLIBITCOIN,
674
689
  nbtc: CurrencyUnit.NANOBITCOIN
@@ -707,7 +722,7 @@ function getPreferredConversionOverride(currencyAmountArg) {
707
722
  function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
708
723
  const { value, unit } = getCurrencyAmount(currencyAmountArg);
709
724
  const conversionOverride = getPreferredConversionOverride(currencyAmountArg);
710
- const { sats, msats, btc, usd, mxn, php, mibtc, mlbtc, nbtc } = convertCurrencyAmountValues(unit, value, unitsPerBtc, conversionOverride);
725
+ const { sats, msats, btc, usd, mxn, php, mibtc, mlbtc, nbtc, eur } = convertCurrencyAmountValues(unit, value, unitsPerBtc, conversionOverride);
711
726
  const mapWithCurrencyUnits = {
712
727
  [CurrencyUnit.BITCOIN]: btc,
713
728
  [CurrencyUnit.SATOSHI]: sats,
@@ -715,6 +730,7 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
715
730
  [CurrencyUnit.USD]: usd,
716
731
  [CurrencyUnit.MXN]: mxn,
717
732
  [CurrencyUnit.PHP]: php,
733
+ [CurrencyUnit.EUR]: eur,
718
734
  [CurrencyUnit.MICROBITCOIN]: mibtc,
719
735
  [CurrencyUnit.MILLIBITCOIN]: mlbtc,
720
736
  [CurrencyUnit.NANOBITCOIN]: nbtc,
@@ -756,6 +772,10 @@ function mapCurrencyAmount(currencyAmountArg, unitsPerBtc = 1) {
756
772
  value: php,
757
773
  unit: CurrencyUnit.PHP
758
774
  }),
775
+ [CurrencyUnit.EUR]: formatCurrencyStr({
776
+ value: eur,
777
+ unit: CurrencyUnit.EUR
778
+ }),
759
779
  [CurrencyUnit.FUTURE_VALUE]: "-"
760
780
  }
761
781
  };
@@ -820,6 +840,8 @@ var abbrCurrencyUnit = (unit) => {
820
840
  return "MXN";
821
841
  case CurrencyUnit.PHP:
822
842
  return "PHP";
843
+ case CurrencyUnit.EUR:
844
+ return "EUR";
823
845
  }
824
846
  return "Unsupported CurrencyUnit";
825
847
  };
@@ -835,16 +857,27 @@ function formatCurrencyStr(amount, options) {
835
857
  ...defaultOptions,
836
858
  ...options
837
859
  };
838
- const currencyAmount = getCurrencyAmount(amount);
839
- let { value: num } = currencyAmount;
840
- const { unit } = currencyAmount;
841
- const centCurrencies = [
842
- CurrencyUnit.USD,
843
- CurrencyUnit.MXN,
844
- CurrencyUnit.PHP
845
- ];
846
- if (centCurrencies.includes(unit)) {
847
- num = num / 100;
860
+ let num;
861
+ let unit;
862
+ if (isUmaCurrencyAmount(amount)) {
863
+ num = amount.value;
864
+ unit = amount.currency.code;
865
+ if (amount.currency.decimals > 0) {
866
+ num = amount.value / Math.pow(10, amount.currency.decimals);
867
+ }
868
+ } else {
869
+ const currencyAmount = getCurrencyAmount(amount);
870
+ num = currencyAmount.value;
871
+ unit = currencyAmount.unit;
872
+ const centCurrencies = [
873
+ CurrencyUnit.USD,
874
+ CurrencyUnit.MXN,
875
+ CurrencyUnit.PHP,
876
+ CurrencyUnit.EUR
877
+ ];
878
+ if (centCurrencies.includes(unit)) {
879
+ num = num / 100;
880
+ }
848
881
  }
849
882
  function getDefaultMaxFractionDigits(defaultDigits, fullPrecisionDigits) {
850
883
  let digits = defaultDigits;
@@ -857,21 +890,22 @@ function formatCurrencyStr(amount, options) {
857
890
  }
858
891
  return digits;
859
892
  }
860
- const symbol = !showBtcSymbol ? "" : unit === CurrencyUnit.BITCOIN ? "\uE903" : unit === CurrencyUnit.SATOSHI ? "\uE902" : "";
893
+ const symbol = !showBtcSymbol ? "" : unit === CurrencyUnit.BITCOIN ? "\uE903" : unit === CurrencyUnit.SATOSHI || unit === abbrCurrencyUnit(CurrencyUnit.SATOSHI) ? "\uE902" : "";
861
894
  const currentLocale = getCurrentLocale();
862
- let formattedStr = "";
863
- switch (unit) {
864
- case CurrencyUnit.MXN:
865
- case CurrencyUnit.USD:
866
- case CurrencyUnit.PHP:
867
- formattedStr = num.toLocaleString(currentLocale, {
895
+ function isFormattableFiatCurrencyCode(currencyCode) {
896
+ try {
897
+ new Intl.NumberFormat(currentLocale, {
868
898
  style: "currency",
869
- currency: unit,
870
- currencyDisplay: "narrowSymbol",
871
- notation: compact ? "compact" : void 0,
872
- maximumFractionDigits: getDefaultMaxFractionDigits(2, 2)
899
+ currency: currencyCode
873
900
  });
874
- break;
901
+ return true;
902
+ } catch (e) {
903
+ return false;
904
+ }
905
+ }
906
+ let formattedStr = "";
907
+ let forceAppendUnits = false;
908
+ switch (unit) {
875
909
  case CurrencyUnit.BITCOIN:
876
910
  formattedStr = `${symbol}${num.toLocaleString(currentLocale, {
877
911
  notation: compact ? "compact" : void 0,
@@ -879,6 +913,7 @@ function formatCurrencyStr(amount, options) {
879
913
  })}`;
880
914
  break;
881
915
  case CurrencyUnit.SATOSHI:
916
+ case abbrCurrencyUnit(CurrencyUnit.SATOSHI):
882
917
  formattedStr = `${symbol}${num.toLocaleString(currentLocale, {
883
918
  notation: compact ? "compact" : void 0,
884
919
  maximumFractionDigits: getDefaultMaxFractionDigits(0, 3)
@@ -888,21 +923,35 @@ function formatCurrencyStr(amount, options) {
888
923
  case CurrencyUnit.MICROBITCOIN:
889
924
  case CurrencyUnit.MILLIBITCOIN:
890
925
  case CurrencyUnit.NANOBITCOIN:
891
- default:
892
926
  formattedStr = `${symbol}${num.toLocaleString(currentLocale, {
893
927
  notation: compact ? "compact" : void 0,
894
928
  maximumFractionDigits: getDefaultMaxFractionDigits(0, 0)
895
929
  })}`;
930
+ break;
931
+ default:
932
+ if (isFormattableFiatCurrencyCode(unit)) {
933
+ formattedStr = num.toLocaleString(currentLocale, {
934
+ style: "currency",
935
+ currency: unit,
936
+ currencyDisplay: "narrowSymbol",
937
+ notation: compact ? "compact" : void 0,
938
+ maximumFractionDigits: getDefaultMaxFractionDigits(2, 2)
939
+ });
940
+ } else {
941
+ formattedStr = `${num}`;
942
+ forceAppendUnits = true;
943
+ }
944
+ break;
896
945
  }
897
- if (options?.appendUnits) {
946
+ if (options?.appendUnits || forceAppendUnits) {
898
947
  const localeCurrencyCode = localeToCurrencyCode(currentLocale);
899
- if (unit === localeCurrencyCode && !options.appendUnits.showForCurrentLocaleUnit) {
948
+ if (unit === localeCurrencyCode && options?.appendUnits && !options.appendUnits.showForCurrentLocaleUnit) {
900
949
  return formattedStr;
901
950
  }
902
- const unitStr = abbrCurrencyUnit(unit);
903
- const unitSuffix = options.appendUnits.plural && num > 1 ? "s" : "";
951
+ const unitStr = isUmaCurrencyAmount(amount) ? amount.currency.code : abbrCurrencyUnit(unit);
952
+ const unitSuffix = options?.appendUnits?.plural && num > 1 ? "s" : "";
904
953
  const unitStrWithSuffix = `${unitStr}${unitSuffix}`;
905
- formattedStr += ` ${options.appendUnits.lowercase ? unitStrWithSuffix.toLowerCase() : unitStrWithSuffix}`;
954
+ formattedStr += ` ${options?.appendUnits?.lowercase ? unitStrWithSuffix.toLowerCase() : unitStrWithSuffix}`;
906
955
  }
907
956
  return formattedStr;
908
957
  }
@@ -1127,6 +1176,9 @@ var isType = (typename) => (node) => {
1127
1176
  function notNullUndefined(value) {
1128
1177
  return value !== null && value !== void 0;
1129
1178
  }
1179
+ function isRecord(value) {
1180
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1181
+ }
1130
1182
  // Annotate the CommonJS export names for ESM import in node:
1131
1183
  0 && (module.exports = {
1132
1184
  CurrencyUnit,
@@ -1162,10 +1214,12 @@ function notNullUndefined(value) {
1162
1214
  isNode,
1163
1215
  isNumber,
1164
1216
  isObject,
1217
+ isRecord,
1165
1218
  isSDKCurrencyAmount,
1166
1219
  isTest,
1167
1220
  isType,
1168
1221
  isUint8Array,
1222
+ isUmaCurrencyAmount,
1169
1223
  linearInterpolate,
1170
1224
  localeToCurrencyCode,
1171
1225
  localeToCurrencySymbol,
@@ -1 +1 @@
1
- export { A as AppendUnitsOptions, a7 as ById, ah as Complete, n as CurrencyAmountArg, k as CurrencyAmountInputObj, l as CurrencyAmountObj, m as CurrencyAmountPreferenceObj, R as CurrencyCodes, Q as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, aa as DeepPartial, D as DeprecatedCurrencyAmountObj, a6 as ExpandRecursively, ab as JSONLiteral, ad as JSONObject, ac as JSONType, a5 as Maybe, ae as NN, a8 as OmitTypename, ag as PartialBy, ai as RequiredKeys, S as SDKCurrencyAmountType, x as abbrCurrencyUnit, b as b64decode, a as b64encode, M as bytesToHex, Y as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, P as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, X as deleteLocalStorageItem, e as ensureArray, L as errorToJSON, y as formatCurrencyStr, t as getCurrencyAmount, O as getCurrentLocale, J as getErrorMsg, V as getLocalStorageBoolean, U as getLocalStorageConfigItem, N as hexToBytes, E as isBrowser, o as isCurrencyAmountInputObj, q as isCurrencyAmountObj, r as isCurrencyAmountPreferenceObj, w as isCurrencyMap, p as isDeprecatedCurrencyAmountObj, H as isError, K as isErrorMsg, I as isErrorWithMessage, F as isNode, $ as isNumber, a4 as isObject, s as isSDKCurrencyAmount, G as isTest, a9 as isType, a3 as isUint8Array, Z as linearInterpolate, T as localeToCurrencyCode, B as localeToCurrencySymbol, a2 as lsidToUUID, v as mapCurrencyAmount, af as notNullUndefined, a0 as pollUntil, _ as round, z as separateCurrencyStrParts, W as setLocalStorageBoolean, a1 as sleep, u as urlsafe_b64decode } from '../index-r0bUxDu_.cjs';
1
+ export { A as AppendUnitsOptions, aa as ById, al as Complete, o as CurrencyAmountArg, k as CurrencyAmountInputObj, m as CurrencyAmountObj, n as CurrencyAmountPreferenceObj, V as CurrencyCodes, T as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, ae as DeepPartial, D as DeprecatedCurrencyAmountObj, a9 as ExpandRecursively, ad as ExtractByTypename, af as JSONLiteral, ah as JSONObject, ag as JSONType, a8 as Maybe, ai as NN, ab as OmitTypename, ak as PartialBy, am as RequiredKeys, S as SDKCurrencyAmountType, U as UmaCurrency, l as UmaCurrencyAmount, z as abbrCurrencyUnit, b as b64decode, a as b64encode, O as bytesToHex, $ as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, R as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, _ as deleteLocalStorageItem, e as ensureArray, N as errorToJSON, B as formatCurrencyStr, w as getCurrencyAmount, Q as getCurrentLocale, L as getErrorMsg, Y as getLocalStorageBoolean, X as getLocalStorageConfigItem, P as hexToBytes, G as isBrowser, p as isCurrencyAmountInputObj, s as isCurrencyAmountObj, t as isCurrencyAmountPreferenceObj, y as isCurrencyMap, r as isDeprecatedCurrencyAmountObj, J as isError, M as isErrorMsg, K as isErrorWithMessage, H as isNode, a2 as isNumber, a7 as isObject, an as isRecord, v as isSDKCurrencyAmount, I as isTest, ac as isType, a6 as isUint8Array, q as isUmaCurrencyAmount, a0 as linearInterpolate, W as localeToCurrencyCode, F as localeToCurrencySymbol, a5 as lsidToUUID, x as mapCurrencyAmount, aj as notNullUndefined, a3 as pollUntil, a1 as round, E as separateCurrencyStrParts, Z as setLocalStorageBoolean, a4 as sleep, u as urlsafe_b64decode } from '../index-C7dqDM91.cjs';