@rabbitio/ui-kit 1.0.0-beta.30 → 1.0.0-beta.32
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 +17 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +13 -9
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +17 -9
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +17 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +16 -4
- package/src/swaps-lib/services/publicSwapService.js +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2975,7 +2975,7 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
2975
2975
|
}
|
|
2976
2976
|
_this = _SwapProvider.call(this) || this;
|
|
2977
2977
|
_this._supportedCoins = [];
|
|
2978
|
-
_this._URL =
|
|
2978
|
+
_this._URL = "" + apiKeysProxyUrl;
|
|
2979
2979
|
_this._maxRateDigits = 20;
|
|
2980
2980
|
_this.useRestrictedCoinsSet = useRestrictedCoinsSet;
|
|
2981
2981
|
_this._customCoinBuilder = customCoinBuilder;
|
|
@@ -3119,8 +3119,14 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3119
3119
|
if (!((_this6$_supportedCoin = _this6._supportedCoins) != null && _this6$_supportedCoin.length)) {
|
|
3120
3120
|
return Promise.resolve(axios__default["default"].get(_this6._URL + "/api/v2/currencies")).then(function (rawResponse) {
|
|
3121
3121
|
var _rawResponse$data, _rawResponse$data2;
|
|
3122
|
-
Logger.log("Retrieved " + (rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length)
|
|
3123
|
-
|
|
3122
|
+
Logger.log("Retrieved " + (rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length), loggerSource);
|
|
3123
|
+
var allowedCoins = (_rawResponse$data2 = rawResponse == null ? void 0 : rawResponse.data) != null ? _rawResponse$data2 : [];
|
|
3124
|
+
// TODO: [feature, critical] add support for extra ID. task_id=7219d65d41c242a292dfa47479b8d63f
|
|
3125
|
+
allowedCoins = allowedCoins.filter(function (c) {
|
|
3126
|
+
return c.hasExtraId !== true && c.hasExtraId !== "true";
|
|
3127
|
+
});
|
|
3128
|
+
Logger.log("Allowed cnt " + allowedCoins.length, loggerSource);
|
|
3129
|
+
_this6._supportedCoins = allowedCoins.map(function (item) {
|
|
3124
3130
|
var coin = _this6._customCoinBuilder(item.code, item.network);
|
|
3125
3131
|
if (!coin && !_this6.useRestrictedCoinsSet) {
|
|
3126
3132
|
/** Building coin object for coin that isn't supported OOB in Rabbit.
|
|
@@ -3136,11 +3142,10 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3136
3142
|
var ticker = "" + code + (code === network ? "" : network);
|
|
3137
3143
|
var defaultDecimalPlacesForCoinNotSupportedOOB = 8;
|
|
3138
3144
|
var defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
3145
|
+
// TODO: [dev] maybe we should recognize standard protocols?
|
|
3139
3146
|
coin = new Coin(item.name, ticker, code, defaultDecimalPlacesForCoinNotSupportedOOB, null, "", null, null, defaultMinConfirmationsForCoinNotSupportedOOB, null, [], 60000, null,
|
|
3140
3147
|
// We cannot recognize blockchain from swapspace data
|
|
3141
|
-
code !== network ? new Protocol(network) : null,
|
|
3142
|
-
// TODO: [dev] maybe we should recognize standard protocols?
|
|
3143
|
-
item.contractAddress || null, false);
|
|
3148
|
+
code !== network ? new Protocol(network) : null, item.contractAddress || null, false);
|
|
3144
3149
|
}
|
|
3145
3150
|
if (coin) {
|
|
3146
3151
|
var _item$deposit, _item$withdrawal, _item$validationRegex;
|
|
@@ -3527,6 +3532,9 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
3527
3532
|
return getNotFailingOn404(swapId);
|
|
3528
3533
|
}))).then(function (responses) {
|
|
3529
3534
|
var wo404 = responses.flat();
|
|
3535
|
+
Logger.log("All swaps RAW: " + JSON.stringify(wo404.map(function (r) {
|
|
3536
|
+
return r.data;
|
|
3537
|
+
})), loggerSource);
|
|
3530
3538
|
var swaps = wo404.map(function (r) {
|
|
3531
3539
|
return r.data;
|
|
3532
3540
|
}).map(function (swap, index) {
|
|
@@ -3935,8 +3943,8 @@ function _catch(body, recover) {
|
|
|
3935
3943
|
return result;
|
|
3936
3944
|
}
|
|
3937
3945
|
var PublicSwapService = /*#__PURE__*/function () {
|
|
3938
|
-
function PublicSwapService(
|
|
3939
|
-
this._swapProvider = new SwapspaceSwapProvider(
|
|
3946
|
+
function PublicSwapService(apiKeysProxyUrl, cache) {
|
|
3947
|
+
this._swapProvider = new SwapspaceSwapProvider(apiKeysProxyUrl, cache, function () {
|
|
3940
3948
|
return null;
|
|
3941
3949
|
}, false);
|
|
3942
3950
|
}
|
|
@@ -4022,7 +4030,7 @@ var PublicSwapService = /*#__PURE__*/function () {
|
|
|
4022
4030
|
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4023
4031
|
};
|
|
4024
4032
|
}
|
|
4025
|
-
Logger.log("Retrieved " + (result == null || (_result$coins2 = result.coins) == null ? void 0 : _result$coins2.length) + " supported currencies for swap", loggerSource);
|
|
4033
|
+
Logger.log("Retrieved " + (result == null || (_result$coins2 = result.coins) == null ? void 0 : _result$coins2.length) + " supported currencies for swap (withdraw=" + withdraw + ")", loggerSource);
|
|
4026
4034
|
return {
|
|
4027
4035
|
result: true,
|
|
4028
4036
|
coins: result.coins
|