nexushub-commands 1.5.5 → 1.5.7

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.
@@ -215,6 +215,8 @@ tslib_1.__decorate([
215
215
  }
216
216
  else {
217
217
  const wallets = yield config.API.get(`/crypto/coins/${value}/wallets`).then((x) => x.data);
218
+ if (wallets.length === 1)
219
+ return wallets[0].id;
218
220
  context.sendFormatted({
219
221
  header: `<b>🪙 Выберите необходимую сеть для пополнения в ${value}</b>`,
220
222
  photo: config.images.depositCrypto,
@@ -255,11 +257,11 @@ tslib_1.__decorate([
255
257
  error: error === null || error === void 0 ? void 0 : error.message,
256
258
  })).text;
257
259
  }),
258
- }, (0, evogram_1.numberValidator)({ allowFloat: true, min: 0 }), (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ value, context }) {
260
+ }, (0, evogram_1.numberValidator)({ allowFloat: true, min: 0 }), (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ value, context, validateArgs }) {
259
261
  const config = Client_1.Client.config(context);
260
262
  const maxDeposit = yield config.API.get('/config/maxDepositInService').then((x) => x.data.value);
261
263
  const depositAmount = yield value.convert({ from: config.currency, to: 'RUB' });
262
- if (depositAmount > maxDeposit)
264
+ if (depositAmount > maxDeposit && validateArgs.method !== 'cryptowallet')
263
265
  throw new Error(`Пополнение, более чем на ${yield maxDeposit.convert({ from: 'RUB', to: config.currency })}, доступно только через <a href="t.me/{{ ${config.support.username} }}">тех. поддержку</a>`);
264
266
  return value;
265
267
  }), (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ value, context, validateArgs }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -101,6 +101,8 @@ export class DepositCommand extends Command {
101
101
  );
102
102
  } else {
103
103
  const wallets = await config.API.get(`/crypto/coins/${value}/wallets`).then((x) => x.data);
104
+ if (wallets.length === 1) return wallets[0].id;
105
+
104
106
  context.sendFormatted(
105
107
  {
106
108
  header: `<b>🪙 Выберите необходимую сеть для пополнения в ${value}</b>`,
@@ -153,13 +155,13 @@ export class DepositCommand extends Command {
153
155
  },
154
156
  },
155
157
  numberValidator({ allowFloat: true, min: 0 }),
156
- async ({ value, context }) => {
158
+ async ({ value, context, validateArgs }) => {
157
159
  const config = Client.config(context);
158
160
 
159
161
  const maxDeposit = await config.API.get('/config/maxDepositInService').then((x) => x.data.value);
160
162
  const depositAmount = await value.convert({ from: config.currency, to: 'RUB' });
161
163
 
162
- if (depositAmount > maxDeposit)
164
+ if (depositAmount > maxDeposit && validateArgs.method !== 'cryptowallet')
163
165
  throw new Error(
164
166
  `Пополнение, более чем на ${await maxDeposit.convert({ from: 'RUB', to: config.currency })}, доступно только через <a href="t.me/{{ ${
165
167
  config.support.username