@rabbitio/ui-kit 1.0.0-beta.30 → 1.0.0-beta.31
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 +16 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +12 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +16 -8
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +16 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +15 -3
- package/src/swaps-lib/services/publicSwapService.js +3 -3
package/dist/index.module.js
CHANGED
|
@@ -3113,8 +3113,14 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3113
3113
|
if (!((_this6$_supportedCoin = _this6._supportedCoins) != null && _this6$_supportedCoin.length)) {
|
|
3114
3114
|
return Promise.resolve(axios.get(_this6._URL + "/api/v2/currencies")).then(function (rawResponse) {
|
|
3115
3115
|
var _rawResponse$data, _rawResponse$data2;
|
|
3116
|
-
Logger.log("Retrieved " + (rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length)
|
|
3117
|
-
|
|
3116
|
+
Logger.log("Retrieved " + (rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length), loggerSource);
|
|
3117
|
+
var allowedCoins = (_rawResponse$data2 = rawResponse == null ? void 0 : rawResponse.data) != null ? _rawResponse$data2 : [];
|
|
3118
|
+
// TODO: [feature, critical] add support for extra ID. task_id=7219d65d41c242a292dfa47479b8d63f
|
|
3119
|
+
allowedCoins = allowedCoins.filter(function (c) {
|
|
3120
|
+
return c.hasExtraId !== true && c.hasExtraId !== "true";
|
|
3121
|
+
});
|
|
3122
|
+
Logger.log("Allowed cnt " + allowedCoins.length, loggerSource);
|
|
3123
|
+
_this6._supportedCoins = allowedCoins.map(function (item) {
|
|
3118
3124
|
var coin = _this6._customCoinBuilder(item.code, item.network);
|
|
3119
3125
|
if (!coin && !_this6.useRestrictedCoinsSet) {
|
|
3120
3126
|
/** Building coin object for coin that isn't supported OOB in Rabbit.
|
|
@@ -3130,11 +3136,10 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3130
3136
|
var ticker = "" + code + (code === network ? "" : network);
|
|
3131
3137
|
var defaultDecimalPlacesForCoinNotSupportedOOB = 8;
|
|
3132
3138
|
var defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
3139
|
+
// TODO: [dev] maybe we should recognize standard protocols?
|
|
3133
3140
|
coin = new Coin(item.name, ticker, code, defaultDecimalPlacesForCoinNotSupportedOOB, null, "", null, null, defaultMinConfirmationsForCoinNotSupportedOOB, null, [], 60000, null,
|
|
3134
3141
|
// We cannot recognize blockchain from swapspace data
|
|
3135
|
-
code !== network ? new Protocol(network) : null,
|
|
3136
|
-
// TODO: [dev] maybe we should recognize standard protocols?
|
|
3137
|
-
item.contractAddress || null, false);
|
|
3142
|
+
code !== network ? new Protocol(network) : null, item.contractAddress || null, false);
|
|
3138
3143
|
}
|
|
3139
3144
|
if (coin) {
|
|
3140
3145
|
var _item$deposit, _item$withdrawal, _item$validationRegex;
|
|
@@ -3521,6 +3526,9 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3521
3526
|
return getNotFailingOn404(swapId);
|
|
3522
3527
|
}))).then(function (responses) {
|
|
3523
3528
|
var wo404 = responses.flat();
|
|
3529
|
+
Logger.log("All swaps RAW: " + JSON.stringify(wo404.map(function (r) {
|
|
3530
|
+
return r.data;
|
|
3531
|
+
})), loggerSource);
|
|
3524
3532
|
var swaps = wo404.map(function (r) {
|
|
3525
3533
|
return r.data;
|
|
3526
3534
|
}).map(function (swap, index) {
|
|
@@ -3929,8 +3937,8 @@ function _catch(body, recover) {
|
|
|
3929
3937
|
return result;
|
|
3930
3938
|
}
|
|
3931
3939
|
var PublicSwapService = /*#__PURE__*/function () {
|
|
3932
|
-
function PublicSwapService(
|
|
3933
|
-
this._swapProvider = new SwapspaceSwapProvider(
|
|
3940
|
+
function PublicSwapService(apiKeysProxyUrl, cache) {
|
|
3941
|
+
this._swapProvider = new SwapspaceSwapProvider(apiKeysProxyUrl, cache, function () {
|
|
3934
3942
|
return null;
|
|
3935
3943
|
}, false);
|
|
3936
3944
|
}
|
|
@@ -4016,7 +4024,7 @@ var PublicSwapService = /*#__PURE__*/function () {
|
|
|
4016
4024
|
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4017
4025
|
};
|
|
4018
4026
|
}
|
|
4019
|
-
Logger.log("Retrieved " + (result == null || (_result$coins2 = result.coins) == null ? void 0 : _result$coins2.length) + " supported currencies for swap", loggerSource);
|
|
4027
|
+
Logger.log("Retrieved " + (result == null || (_result$coins2 = result.coins) == null ? void 0 : _result$coins2.length) + " supported currencies for swap (withdraw=" + withdraw + ")", loggerSource);
|
|
4020
4028
|
return {
|
|
4021
4029
|
result: true,
|
|
4022
4030
|
coins: result.coins
|