nexushub-commands 2.4.1 → 2.5.0
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var DepositCommand_1;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.DepositCommand = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
@@ -23,7 +24,7 @@ function maskExceptLast4(str) {
|
|
|
23
24
|
}
|
|
24
25
|
return chars.join('');
|
|
25
26
|
}
|
|
26
|
-
let DepositCommand = class DepositCommand extends evogram_1.Command {
|
|
27
|
+
let DepositCommand = DepositCommand_1 = class DepositCommand extends evogram_1.Command {
|
|
27
28
|
execute(context, method, coin, deposit) {
|
|
28
29
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
30
|
const config = Client_1.Client.config(context);
|
|
@@ -82,6 +83,22 @@ let DepositCommand = class DepositCommand extends evogram_1.Command {
|
|
|
82
83
|
this.logger.log(`Запрос на пополнение: ${JSON.stringify(order, null, 2)}`);
|
|
83
84
|
if (!order) {
|
|
84
85
|
context.user.log(0, `Не удалось получить реквизиты для пополнения на сумму ${Number(deposit).toLocaleString('ru')} ${config.currency}`);
|
|
86
|
+
if (method === 'card' && config.currency.toUpperCase() === 'RUB') {
|
|
87
|
+
const availableMyRequisites = (yield config.API.get('/myrequisites')).data;
|
|
88
|
+
const myRequisites = (yield config.API.get(`/aggregators/myrequisites`)).data;
|
|
89
|
+
if (availableMyRequisites.length > 0 && myRequisites.enabled) {
|
|
90
|
+
return context.sendFormatted({
|
|
91
|
+
designImages: ['deposit-no-requisite', 'deposit'],
|
|
92
|
+
photo: config.images.deposit,
|
|
93
|
+
header: '<b>❗️К сожалению, сейчас нет доступных реквизитов для оплаты.</b>',
|
|
94
|
+
footer: `<i>ℹ️ На данный момент есть доступные реквизиты для суммы, начинающейся от ${yield myRequisites.minAmount.convert({ from: 'RUB', to: config.currency })}</i>`,
|
|
95
|
+
}, {
|
|
96
|
+
reply_markup: {
|
|
97
|
+
inline_keyboard: [[{ text: `💸 Пополнить на ${yield myRequisites.minAmount.convert({ from: 'RUB', to: config.currency })}`, command: DepositCommand_1, payload: { method: 'card', deposit: myRequisites.minAmount } }]],
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
85
102
|
return context.sendFormatted({
|
|
86
103
|
designImages: ['deposit-no-requisite', 'deposit'],
|
|
87
104
|
photo: config.images.deposit,
|
|
@@ -266,6 +283,6 @@ tslib_1.__decorate([
|
|
|
266
283
|
tslib_1.__metadata("design:paramtypes", [Object, String, Object, Number]),
|
|
267
284
|
tslib_1.__metadata("design:returntype", Promise)
|
|
268
285
|
], DepositCommand.prototype, "execute", null);
|
|
269
|
-
exports.DepositCommand = DepositCommand = tslib_1.__decorate([
|
|
286
|
+
exports.DepositCommand = DepositCommand = DepositCommand_1 = tslib_1.__decorate([
|
|
270
287
|
(0, evogram_1.CommandD)({ name: 'deposit', description: [{ text: 'Пополнение' }, { language: 'en', text: 'Deposit' }] })
|
|
271
288
|
], DepositCommand);
|
package/load.sh
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
# Параметры
|
|
4
4
|
REMOTE_USER="root"
|
|
5
5
|
REMOTE_IP="109.120.178.210"
|
|
6
|
-
REMOTE_PATH="/root/
|
|
6
|
+
REMOTE_PATH="/root/NFTv2/node_modules/nexushub-commands/"
|
|
7
7
|
LOCAL_PATH="./"
|
|
8
8
|
export SSHPASS="CIwF179lkIG1"
|
|
9
9
|
|
|
10
10
|
# 1. Синхронизация через rsync
|
|
11
11
|
echo "Синхронизация файлов..."
|
|
12
12
|
sshpass -e rsync -avzP --delete -e "ssh -o StrictHostKeyChecking=no" "$LOCAL_PATH/lib/" "$REMOTE_USER@$REMOTE_IP:$REMOTE_PATH/lib/"
|
|
13
|
-
sshpass -e ssh -o StrictHostKeyChecking=no "$REMOTE_USER@$REMOTE_IP" "export PATH=\$PATH:/root/.nvm/versions/node/v22.16.0/bin && pm2 restart
|
|
13
|
+
sshpass -e ssh -o StrictHostKeyChecking=no "$REMOTE_USER@$REMOTE_IP" "export PATH=\$PATH:/root/.nvm/versions/node/v22.16.0/bin && pm2 restart nftv2"
|
|
14
14
|
|
|
15
15
|
echo "Готово!"
|
package/package.json
CHANGED
|
@@ -237,6 +237,28 @@ export class DepositCommand extends Command {
|
|
|
237
237
|
|
|
238
238
|
if (!order) {
|
|
239
239
|
context.user.log(0, `Не удалось получить реквизиты для пополнения на сумму ${Number(deposit).toLocaleString('ru')} ${config.currency}`)
|
|
240
|
+
|
|
241
|
+
if (method === 'card' && config.currency.toUpperCase() === 'RUB') {
|
|
242
|
+
const availableMyRequisites = (await config.API.get('/myrequisites')).data
|
|
243
|
+
const myRequisites = (await config.API.get(`/aggregators/myrequisites`)).data
|
|
244
|
+
|
|
245
|
+
if (availableMyRequisites.length > 0 && myRequisites.enabled) {
|
|
246
|
+
return context.sendFormatted(
|
|
247
|
+
{
|
|
248
|
+
designImages: ['deposit-no-requisite', 'deposit'],
|
|
249
|
+
photo: config.images.deposit,
|
|
250
|
+
header: '<b>❗️К сожалению, сейчас нет доступных реквизитов для оплаты.</b>',
|
|
251
|
+
footer: `<i>ℹ️ На данный момент есть доступные реквизиты для суммы, начинающейся от ${await myRequisites.minAmount.convert({ from: 'RUB', to: config.currency })}</i>`,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
reply_markup: {
|
|
255
|
+
inline_keyboard: [[{ text: `💸 Пополнить на ${await myRequisites.minAmount.convert({ from: 'RUB', to: config.currency })}`, command: DepositCommand, payload: { method: 'card', deposit: myRequisites.minAmount } }]],
|
|
256
|
+
},
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
240
262
|
return context.sendFormatted(
|
|
241
263
|
{
|
|
242
264
|
designImages: ['deposit-no-requisite', 'deposit'],
|