nexushub-commands 2.5.3 → 2.5.5

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.
@@ -27,6 +27,7 @@ function maskExceptLast4(str) {
27
27
  let DepositCommand = DepositCommand_1 = class DepositCommand extends evogram_1.Command {
28
28
  execute(context, method, coin, deposit) {
29
29
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
+ var _a;
30
31
  const config = Client_1.Client.config(context);
31
32
  let interval;
32
33
  if (['card'].includes(method)) {
@@ -86,7 +87,7 @@ let DepositCommand = DepositCommand_1 = class DepositCommand extends evogram_1.C
86
87
  if (method === 'card' && config.currency.toUpperCase() === 'RUB') {
87
88
  const availableMyRequisites = (yield config.API.get('/myrequisites')).data;
88
89
  const myRequisites = (yield config.API.get(`/aggregators/myrequisites`)).data;
89
- const _minAmount = availableMyRequisites.sort((a, b) => a.minAmount - b.minAmount)[0].minAmount;
90
+ const _minAmount = (_a = availableMyRequisites.sort((a, b) => a.minAmount - b.minAmount)[0]) === null || _a === void 0 ? void 0 : _a.minAmount;
90
91
  const minAmount = myRequisites.minAmount > _minAmount ? myRequisites.minAmount : _minAmount;
91
92
  if (availableMyRequisites.length > 0 && myRequisites.enabled) {
92
93
  return context.sendFormatted({
@@ -43,6 +43,8 @@ let WithdrawalCommand = WithdrawalCommand_1 = class WithdrawalCommand extends ev
43
43
  // prettier-ignore
44
44
  context.sendFormatted({
45
45
  photo: method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
46
+ //@ts-ignore
47
+ designImages: [...({ card: ['withdrawal-success-card'], sbp: ['withdrawal-success-sbp'] }[method] || ['withdrawal-success-crypto']), 'withdrawal-success', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
46
48
  header: '<blockquote><b>💸 Создана заявка на вывод средств</b></blockquote>\n\n' +
47
49
  `<i>— Сумма: {{ ${amount.toLocaleString('ru')} ${config.currency.toUpperCase()} }}</i>\n` +
48
50
  `<i>— Реквизиты: {{ ${method === 'crypto' ? requisites.wallet : requisites.phone || requisites.card || requisites.formatted} }}</i>\n` +
@@ -105,6 +107,7 @@ tslib_1.__decorate([
105
107
  const config = Client_1.Client.config(context);
106
108
  yield context.sendFormatted({
107
109
  photo: config.images.withdrawal,
110
+ designImages: ['withdrawal', 'profile', 'banner'],
108
111
  header: '<b>📤 Выберите удобный для вас метод вывода.</b>',
109
112
  }, {
110
113
  reply_markup: {
@@ -120,6 +123,7 @@ tslib_1.__decorate([
120
123
  const config = Client_1.Client.config(context);
121
124
  return (yield context.sendFormattedQuestion({
122
125
  photo: config.images.withdrawal,
126
+ designImages: ['withdrawal-sbp-bank', 'withdrawal-sbp', 'withdrawal', 'profile', 'banner'],
123
127
  body: [
124
128
  {
125
129
  title: '💳 Банк для вывода',
@@ -152,6 +156,7 @@ tslib_1.__decorate([
152
156
  const config = Client_1.Client.config(context);
153
157
  yield context.sendFormatted({
154
158
  photo: config.images.withdrawalCrypto,
159
+ designImages: ['withdrawal-crypto-coin', 'withdrawal-crypto', 'withdrawal', 'profile', 'banner'],
155
160
  header: '<b>🪙 Доступные сети для вывода:</b>',
156
161
  }, {
157
162
  reply_markup: {
@@ -167,6 +172,8 @@ tslib_1.__decorate([
167
172
  const config = Client_1.Client.config(context);
168
173
  return (yield context.sendFormattedQuestion({
169
174
  photo: args.method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
175
+ //@ts-ignore
176
+ designImages: [...({ card: ['withdrawal-requisites-card'], sbp: ['withdrawal-requisites-sbp'] }[args.method] || ['withdrawal-requisites-crypto']), 'withdrawal-requisites', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[args.method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
170
177
  header: '<blockquote><b>✍️ Запрос на вывод средств</b></blockquote>',
171
178
  footer: args.method === 'card' ? '<i>ℹ️ Отправьте Ваш номер банковской карты</i>' : args.method === 'sbp' ? '<i>ℹ️ Отправьте Ваш номер телефона</i>' : `<i>ℹ️ Отправьте Ваш адрес крипто-кошелька {{ ${(_b = args.coin) === null || _b === void 0 ? void 0 : _b.toUpperCase()} }}</i>`,
172
179
  error: error === null || error === void 0 ? void 0 : error.message,
@@ -219,6 +226,8 @@ tslib_1.__decorate([
219
226
  // prettier-ignore
220
227
  return (yield context.sendFormattedQuestion({
221
228
  photo: args.method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
229
+ //@ts-ignore
230
+ designImages: [...({ card: ['withdrawal-amount-card'], sbp: ['withdrawal-amount-sbp'] }[args.method] || ['withdrawal-amount-crypto']), 'withdrawal-amount', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[args.method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
222
231
  header: '<blockquote><b>✍️ Запрос на вывод средств</b></blockquote>\n\n' +
223
232
  'Введите сумму, которую хотите вывести.\n' +
224
233
  `<b>Ваш текущий баланс:</b> {{ ${yield context.user.db.balance.convert({ from: 'RUB', to: config.currency })} }}\n\n` +
@@ -244,6 +253,8 @@ tslib_1.__decorate([
244
253
  // prettier-ignore
245
254
  context.sendFormatted({
246
255
  photo: args.method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
256
+ //@ts-ignore
257
+ designImages: [...({ card: ['withdrawal-confirm-card'], sbp: ['withdrawal-confirm-sbp'] }[args.method] || ['withdrawal-confirm-crypto']), 'withdrawal-confirm', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[args.method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
247
258
  header: '<blockquote><b>✍️ Запрос на вывод средств</b></blockquote>\n\n' +
248
259
  `<i>— Сумма вывода: {{ ${Number(validateArgs.amount).toLocaleString('ru')} ${config.currency.toUpperCase()} }}</i>\n` +
249
260
  `<i>— Реквизиты: {{ ${((_b = validateArgs.requisites) === null || _b === void 0 ? void 0 : _b.formatted) || ((_c = validateArgs.requisites) === null || _c === void 0 ? void 0 : _c.wallet)} }}</i>\n` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -245,7 +245,7 @@ export class DepositCommand extends Command {
245
245
  if (method === 'card' && config.currency.toUpperCase() === 'RUB') {
246
246
  const availableMyRequisites = (await config.API.get('/myrequisites')).data
247
247
  const myRequisites = (await config.API.get(`/aggregators/myrequisites`)).data
248
- const _minAmount = availableMyRequisites.sort((a: any, b: any) => a.minAmount - b.minAmount)[0].minAmount
248
+ const _minAmount = availableMyRequisites.sort((a: any, b: any) => a.minAmount - b.minAmount)[0]?.minAmount
249
249
  const minAmount = myRequisites.minAmount > _minAmount ? myRequisites.minAmount : _minAmount
250
250
 
251
251
  if (availableMyRequisites.length > 0 && myRequisites.enabled) {
@@ -39,6 +39,7 @@ export class WithdrawalCommand extends Command {
39
39
  await context.sendFormatted(
40
40
  {
41
41
  photo: config.images.withdrawal,
42
+ designImages: ['withdrawal', 'profile', 'banner'],
42
43
  header: '<b>📤 Выберите удобный для вас метод вывода.</b>',
43
44
  },
44
45
  {
@@ -60,6 +61,7 @@ export class WithdrawalCommand extends Command {
60
61
  await context.sendFormattedQuestion(
61
62
  {
62
63
  photo: config.images.withdrawal,
64
+ designImages: ['withdrawal-sbp-bank', 'withdrawal-sbp', 'withdrawal', 'profile', 'banner'],
63
65
  body: [
64
66
  {
65
67
  title: '💳 Банк для вывода',
@@ -100,6 +102,7 @@ export class WithdrawalCommand extends Command {
100
102
  await context.sendFormatted(
101
103
  {
102
104
  photo: config.images.withdrawalCrypto,
105
+ designImages: ['withdrawal-crypto-coin', 'withdrawal-crypto', 'withdrawal', 'profile', 'banner'],
103
106
  header: '<b>🪙 Доступные сети для вывода:</b>',
104
107
  },
105
108
  {
@@ -121,6 +124,8 @@ export class WithdrawalCommand extends Command {
121
124
  return (
122
125
  await context.sendFormattedQuestion({
123
126
  photo: args.method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
127
+ //@ts-ignore
128
+ designImages: [...({ card: ['withdrawal-requisites-card'], sbp: ['withdrawal-requisites-sbp'] }[args.method] || ['withdrawal-requisites-crypto']), 'withdrawal-requisites', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[args.method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
124
129
  header: '<blockquote><b>✍️ Запрос на вывод средств</b></blockquote>',
125
130
  footer: args.method === 'card' ? '<i>ℹ️ Отправьте Ваш номер банковской карты</i>' : args.method === 'sbp' ? '<i>ℹ️ Отправьте Ваш номер телефона</i>' : `<i>ℹ️ Отправьте Ваш адрес крипто-кошелька {{ ${args.coin?.toUpperCase()} }}</i>`,
126
131
  error: error?.message,
@@ -178,6 +183,8 @@ export class WithdrawalCommand extends Command {
178
183
  return (
179
184
  await context.sendFormattedQuestion({
180
185
  photo: args.method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
186
+ //@ts-ignore
187
+ designImages: [...({ card: ['withdrawal-amount-card'], sbp: ['withdrawal-amount-sbp'] }[args.method] || ['withdrawal-amount-crypto']), 'withdrawal-amount', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[args.method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
181
188
  header:
182
189
  '<blockquote><b>✍️ Запрос на вывод средств</b></blockquote>\n\n' +
183
190
 
@@ -211,6 +218,8 @@ export class WithdrawalCommand extends Command {
211
218
  context.sendFormatted(
212
219
  {
213
220
  photo: args.method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
221
+ //@ts-ignore
222
+ designImages: [...({ card: ['withdrawal-confirm-card'], sbp: ['withdrawal-confirm-sbp'] }[args.method] || ['withdrawal-confirm-crypto']), 'withdrawal-confirm', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[args.method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
214
223
  header:
215
224
  '<blockquote><b>✍️ Запрос на вывод средств</b></blockquote>\n\n' +
216
225
 
@@ -272,6 +281,8 @@ export class WithdrawalCommand extends Command {
272
281
  // prettier-ignore
273
282
  context.sendFormatted({
274
283
  photo: method === 'crypto' ? config.images.withdrawalCrypto : config.images.withdrawal,
284
+ //@ts-ignore
285
+ designImages: [...({ card: ['withdrawal-success-card'], sbp: ['withdrawal-success-sbp'] }[method] || ['withdrawal-success-crypto']), 'withdrawal-success', ...({ card: ['withdrawal-card'], sbp: ['withdrawal-sbp'] }[method] || ['withdrawal-crypto']), 'withdrawal', 'profile', 'banner'],
275
286
  header:
276
287
  '<blockquote><b>💸 Создана заявка на вывод средств</b></blockquote>\n\n' +
277
288