@rabbitio/ui-kit 1.0.0-beta.17 → 1.0.0-beta.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabbitio/ui-kit",
3
- "version": "1.0.0-beta.17",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "Rabbit.io react.js components kit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -45,14 +45,27 @@ export class PublicSwapService {
45
45
  }
46
46
  }
47
47
 
48
- async getCurrenciesListForPublicSwap(currencyThatShouldNotBeFirst = null) {
48
+ async getDepositCurrenciesListForPublicSwap() {
49
+ try {
50
+ return await this._getCurrenciesListForPublicSwap(false);
51
+ } catch (e) {
52
+ improveAndRethrow(e, "getDepositCurrenciesListForPublicSwap");
53
+ }
54
+ }
55
+
56
+ async getWithdrawCurrenciesListForPublicSwap() {
57
+ try {
58
+ return await this._getCurrenciesListForPublicSwap(true);
59
+ } catch (e) {
60
+ improveAndRethrow(e, "getWithdrawCurrenciesListForPublicSwap");
61
+ }
62
+ }
63
+
64
+ async _getCurrenciesListForPublicSwap(withdraw = false) {
49
65
  const loggerSource = "getCurrenciesListForPublicSwap";
50
66
  try {
51
- // TODO: [dev] this is temporary hack, change it to use dedicated lists inside UI and also here
52
- const result = currencyThatShouldNotBeFirst
53
- ? await this._swapProvider.getWithdrawalCurrencies(
54
- currencyThatShouldNotBeFirst
55
- )
67
+ const result = withdraw
68
+ ? await this._swapProvider.getWithdrawalCurrencies()
56
69
  : await this._swapProvider.getDepositCurrencies();
57
70
  if (
58
71
  result.reason ===