@rabbitio/ui-kit 1.0.0-beta.21 → 1.0.0-beta.23

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.
@@ -2865,6 +2865,12 @@ class SwapspaceSwapProvider extends SwapProvider {
2865
2865
  if (!fromCoinSwapspaceDetails || !toCoinSwapspaceDetails) {
2866
2866
  throw new Error("Failed to find swapspace coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
2867
2867
  }
2868
+ if (!fromCoinSwapspaceDetails.deposit || !toCoinSwapspaceDetails.withdrawal) {
2869
+ return {
2870
+ result: false,
2871
+ reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
2872
+ };
2873
+ }
2868
2874
  /* Here we use not documented parameter 'estimated=false'. This parameter controls whether we want to use
2869
2875
  * cached rate values stored in swapspace cache. Their support says they store at most for 30 sec.
2870
2876
  * But we are better off using the most actual rates.
@@ -3100,7 +3106,7 @@ class SwapspaceSwapProvider extends SwapProvider {
3100
3106
  }
3101
3107
  const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
3102
3108
  const expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
3103
- const isExpiredByTime = expiresAt > Date.now();
3109
+ const isExpiredByTime = expiresAt < Date.now();
3104
3110
  const status = this._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
3105
3111
  const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
3106
3112
  const addressToSendCoinsToSwapspace = swap.from.address;