@rabbitio/ui-kit 1.0.0-beta.24 → 1.0.0-beta.26

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.
@@ -2858,7 +2858,7 @@ class SwapspaceSwapProvider extends SwapProvider {
2858
2858
  }
2859
2859
 
2860
2860
  // This calculation is not precise as we cannot recognize the actual fee and network fee. Just approximate.
2861
- const standardSwapspaceFeeMultiplier = 1.002; // usually 0.2%
2861
+ const standardSwapspaceFeeMultiplier = 1.004; // usually 0.2%
2862
2862
  const rate = BigNumber(1).div(BigNumber(result.rate).times(standardSwapspaceFeeMultiplier)).toString();
2863
2863
  this._cache.put("swapspace_usdt_rate_" + coin.ticker, rate, 15 * 60000 // 15 minutes
2864
2864
  );
@@ -3197,6 +3197,8 @@ class SwapUtils {
3197
3197
  * @param swapProvider {SwapProvider}
3198
3198
  * @param fromCoin {Coin} enabled coin (to swap amount from)
3199
3199
  * @param toCoin {Coin}
3200
+ * @param coinToCurrentFiatRate {string|null}
3201
+ * @param fiatCurrencyDecimals {number|null}
3200
3202
  * @return {Promise<{
3201
3203
  * result: true,
3202
3204
  * min: string,
@@ -3209,7 +3211,7 @@ class SwapUtils {
3209
3211
  * reason: string
3210
3212
  * }>}
3211
3213
  */
3212
- static async getInitialSwapData(swapProvider, fromCoin, toCoin) {
3214
+ static async getInitialSwapData(swapProvider, fromCoin, toCoin, coinToCurrentFiatRate = null, fiatCurrencyDecimals = null) {
3213
3215
  const loggerSource = "getInitialSwapData";
3214
3216
  try {
3215
3217
  /* We use some amount here that should fit at least some of the limits of the swap providers.
@@ -3237,10 +3239,11 @@ class SwapUtils {
3237
3239
  }
3238
3240
  let fiatMin = null;
3239
3241
  let fiatMax = null;
3240
- if ((coinUsdRate == null ? void 0 : coinUsdRate.rate) != null) {
3241
- const usdDecimals = FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
3242
- fiatMin = BigNumber(details == null ? void 0 : details.smallestMin).times(coinUsdRate.rate).toFixed(usdDecimals);
3243
- fiatMax = BigNumber(details == null ? void 0 : details.greatestMax).times(coinUsdRate.rate).toFixed(usdDecimals);
3242
+ const fiatRate = coinToCurrentFiatRate != null ? coinToCurrentFiatRate : coinUsdRate == null ? void 0 : coinUsdRate.rate;
3243
+ const fiatDecimals = fiatCurrencyDecimals != null ? fiatCurrencyDecimals : FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
3244
+ if (fiatRate != null) {
3245
+ fiatMin = BigNumber(details == null ? void 0 : details.smallestMin).times(coinToCurrentFiatRate).toFixed(fiatDecimals);
3246
+ fiatMax = BigNumber(details == null ? void 0 : details.greatestMax).times(coinToCurrentFiatRate).toFixed(fiatDecimals);
3244
3247
  }
3245
3248
  const result = {
3246
3249
  result: true,