nexushub-commands 1.5.4 → 1.5.6

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.
@@ -117,7 +117,7 @@ let DepositCommand = class DepositCommand extends evogram_1.Command {
117
117
  : '',
118
118
  keyboard: [[{ text: '🚀 Оплатить счет', callback_data: `PaidOrderCommand?orderId=${order.id}` }]],
119
119
  });
120
- if (Number(deposit) !== Number(order.amount)) {
120
+ if (Number(deposit) !== Number(order.amount) && method !== 'cryptoWallet') {
121
121
  return context.sendFormatted({
122
122
  photo: config.images.deposit,
123
123
  header: `<blockquote><b>ℹ️ Сумма пополнения стала выше</b></blockquote>\n\n<i>Для определения вашего пополнения в системе, Вам придется заплатить ${Number(order.amount).toLocaleString('ru')} ${order.currency.toUpperCase()}. Приносим свои извинения за неудобства</i>`,
@@ -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,
@@ -235,8 +237,6 @@ tslib_1.__decorate([
235
237
  name: 'deposit',
236
238
  question: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ context, error, args, validateArgs }) {
237
239
  var _b;
238
- if (args.method === 'cryptoWallet')
239
- return 1;
240
240
  const config = Client_1.Client.config(context);
241
241
  let minAmountSetting = JSON.parse(context.state.settings.find((x) => x.name === 'minDeposit').value);
242
242
  let minAmount = (_b = minAmountSetting[config.currency]) !== null && _b !== void 0 ? _b : (yield minAmountSetting['RUB'].convert({ from: 'RUB', to: config.currency }));
@@ -96,8 +96,8 @@ let GetDepositOrderCommand = class GetDepositOrderCommand extends evogram_1.Comm
96
96
  `<i>— Сумма пополнения: ${order.amount} ${order.currency}</i>\n` +
97
97
  `<i>— Курс: 1 ${order.currency} ≈ ${order.crypto.rate} ${order.crypto.currency}</i>\n\n` +
98
98
  `<i>— Сеть пополнения: ${order.crypto.wallet.currency.name} / ${order.crypto.wallet.network}</i>\n` +
99
- `<i>— Время пополнения: до ${new Date(order.expiresAt).toLocaleString('ru')} по МКС</i>\n\n` +
100
- `<b>${order.crypto.wallet.address}</b>`,
99
+ `<i>— Активно: до ${new Date(order.expiresAt).toLocaleString('ru')} по МКС</i>\n\n` +
100
+ `<code>${order.crypto.wallet.address}</code>`,
101
101
  }, {
102
102
  reply_markup: {
103
103
  inline_keyboard: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
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>`,
@@ -126,7 +128,6 @@ export class DepositCommand extends Command {
126
128
  {
127
129
  name: 'deposit',
128
130
  question: async ({ context, error, args, validateArgs }) => {
129
- if (args.method === 'cryptoWallet') return 1;
130
131
  const config = Client.config(context);
131
132
 
132
133
  let minAmountSetting = JSON.parse(context.state.settings.find((x: any) => x.name === 'minDeposit').value);
@@ -289,7 +290,7 @@ export class DepositCommand extends Command {
289
290
  }
290
291
  );
291
292
 
292
- if (Number(deposit) !== Number(order.amount)) {
293
+ if (Number(deposit) !== Number(order.amount) && method !== 'cryptoWallet') {
293
294
  return context.sendFormatted(
294
295
  {
295
296
  photo: config.images.deposit,
@@ -108,9 +108,9 @@ export class GetDepositOrderCommand extends Command {
108
108
  `<i>— Курс: 1 ${order.currency} ≈ ${order.crypto.rate} ${order.crypto.currency}</i>\n\n` +
109
109
 
110
110
  `<i>— Сеть пополнения: ${order.crypto.wallet.currency.name} / ${order.crypto.wallet.network}</i>\n` +
111
- `<i>— Время пополнения: до ${new Date(order.expiresAt).toLocaleString('ru')} по МКС</i>\n\n` +
111
+ `<i>— Активно: до ${new Date(order.expiresAt).toLocaleString('ru')} по МКС</i>\n\n` +
112
112
 
113
- `<b>${order.crypto.wallet.address}</b>`,
113
+ `<code>${order.crypto.wallet.address}</code>`,
114
114
  },
115
115
  {
116
116
  reply_markup: {