@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.
- package/dist/index.cjs +5 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +7 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +5 -6
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +5 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/external-apis/swapProvider.js +20 -1
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +33 -1
- package/src/swaps-lib/services/publicSwapService.js +25 -5
package/dist/index.cjs
CHANGED
|
@@ -3202,11 +3202,10 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3202
3202
|
if (!fromCoinSwapspaceDetails || !toCoinSwapspaceDetails) {
|
|
3203
3203
|
throw new Error("Failed to find swapspace coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
3204
3204
|
}
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
return Promise.resolve(axios__default["default"].get(_this7._URL + "/api/v2/amounts?fromCurrency=" + fromCoinSwapspaceDetails.code + "&fromNetwork=" + fromCoinSwapspaceDetails.network + "&toNetwork=" + toCoinSwapspaceDetails.network + "&toCurrency=" + toCoinSwapspaceDetails.code + "&amount=" + amountCoins + "&float=true&estimated=false")).then(function (response) {
|
|
3205
|
+
return !fromCoinSwapspaceDetails.deposit || !toCoinSwapspaceDetails.withdrawal ? {
|
|
3206
|
+
result: false,
|
|
3207
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3208
|
+
} : Promise.resolve(axios__default["default"].get(_this7._URL + "/api/v2/amounts?fromCurrency=" + fromCoinSwapspaceDetails.code + "&fromNetwork=" + fromCoinSwapspaceDetails.network + "&toNetwork=" + toCoinSwapspaceDetails.network + "&toCurrency=" + toCoinSwapspaceDetails.code + "&amount=" + amountCoins + "&float=true&estimated=false")).then(function (response) {
|
|
3210
3209
|
var _response$data;
|
|
3211
3210
|
Logger.log("Retrieved " + (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) + " options", loggerSource);
|
|
3212
3211
|
var options = Array.isArray(response.data) ? response.data : [];
|
|
@@ -3482,7 +3481,7 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3482
3481
|
return Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : timeStr + "Z");
|
|
3483
3482
|
};
|
|
3484
3483
|
var expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
|
|
3485
|
-
var isExpiredByTime = expiresAt
|
|
3484
|
+
var isExpiredByTime = expiresAt < Date.now();
|
|
3486
3485
|
var status = _this9._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
3487
3486
|
var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
3488
3487
|
var addressToSendCoinsToSwapspace = swap.from.address;
|