@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/package.json
CHANGED
|
@@ -144,10 +144,17 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
144
144
|
`${this._URL}/api/v2/currencies`
|
|
145
145
|
);
|
|
146
146
|
Logger.log(
|
|
147
|
-
`Retrieved ${rawResponse?.data?.length}
|
|
147
|
+
`Retrieved ${rawResponse?.data?.length}`,
|
|
148
148
|
loggerSource
|
|
149
149
|
);
|
|
150
|
-
|
|
150
|
+
let allowedCoins = rawResponse?.data ?? [];
|
|
151
|
+
// TODO: [feature, critical] add support for extra ID. task_id=7219d65d41c242a292dfa47479b8d63f
|
|
152
|
+
allowedCoins = allowedCoins.filter(
|
|
153
|
+
(c) => c.hasExtraId !== true && c.hasExtraId !== "true"
|
|
154
|
+
);
|
|
155
|
+
Logger.log(`Allowed cnt ${allowedCoins.length}`, loggerSource);
|
|
156
|
+
|
|
157
|
+
this._supportedCoins = allowedCoins
|
|
151
158
|
.map((item) => {
|
|
152
159
|
let coin = this._customCoinBuilder(
|
|
153
160
|
item.code,
|
|
@@ -169,6 +176,7 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
169
176
|
}`;
|
|
170
177
|
const defaultDecimalPlacesForCoinNotSupportedOOB = 8;
|
|
171
178
|
const defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
179
|
+
// TODO: [dev] maybe we should recognize standard protocols?
|
|
172
180
|
coin = new Coin(
|
|
173
181
|
item.name,
|
|
174
182
|
ticker,
|
|
@@ -183,7 +191,7 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
183
191
|
[],
|
|
184
192
|
60000,
|
|
185
193
|
null, // We cannot recognize blockchain from swapspace data
|
|
186
|
-
code !== network ? new Protocol(network) : null,
|
|
194
|
+
code !== network ? new Protocol(network) : null,
|
|
187
195
|
item.contractAddress || null,
|
|
188
196
|
false
|
|
189
197
|
);
|
|
@@ -737,6 +745,10 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
737
745
|
swapIds.map((swapId) => getNotFailingOn404(swapId))
|
|
738
746
|
);
|
|
739
747
|
const wo404 = responses.flat();
|
|
748
|
+
Logger.log(
|
|
749
|
+
"All swaps RAW: " + JSON.stringify(wo404.map((r) => r.data)),
|
|
750
|
+
loggerSource
|
|
751
|
+
);
|
|
740
752
|
const swaps = wo404
|
|
741
753
|
.map((r) => r.data)
|
|
742
754
|
.map((swap, index) => {
|
|
@@ -28,9 +28,9 @@ export class PublicSwapService {
|
|
|
28
28
|
static _fiatDecimalsCount =
|
|
29
29
|
FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
30
30
|
|
|
31
|
-
constructor(
|
|
31
|
+
constructor(apiKeysProxyUrl, cache) {
|
|
32
32
|
this._swapProvider = new SwapspaceSwapProvider(
|
|
33
|
-
|
|
33
|
+
apiKeysProxyUrl,
|
|
34
34
|
cache,
|
|
35
35
|
() => null,
|
|
36
36
|
false
|
|
@@ -104,7 +104,7 @@ export class PublicSwapService {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
Logger.log(
|
|
107
|
-
`Retrieved ${result?.coins?.length} supported currencies for swap`,
|
|
107
|
+
`Retrieved ${result?.coins?.length} supported currencies for swap (withdraw=${withdraw})`,
|
|
108
108
|
loggerSource
|
|
109
109
|
);
|
|
110
110
|
return { result: true, coins: result.coins };
|