@riocrypto/common-server 1.0.2458 → 1.0.2460
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.
|
@@ -55,7 +55,7 @@ declare class ClusterClient {
|
|
|
55
55
|
checkBankPayment(orderId: string): Promise<void>;
|
|
56
56
|
checkCryptoPayment(orderId: string): Promise<void>;
|
|
57
57
|
createBitsoBankAccount(userId: string): Promise<BitsoBankAccount>;
|
|
58
|
-
createAuthWithoutRegistration({ phoneNumber, firstName, lastName, role, permissions, telegramUsername, telegramUserId, }: {
|
|
58
|
+
createAuthWithoutRegistration({ phoneNumber, firstName, lastName, role, permissions, telegramUsername, telegramUserId, slackUsername, }: {
|
|
59
59
|
phoneNumber: string;
|
|
60
60
|
firstName: string;
|
|
61
61
|
lastName: string;
|
|
@@ -63,6 +63,7 @@ declare class ClusterClient {
|
|
|
63
63
|
permissions?: AuthPermission[];
|
|
64
64
|
telegramUsername?: string;
|
|
65
65
|
telegramUserId?: string;
|
|
66
|
+
slackUsername?: string;
|
|
66
67
|
}): Promise<Auth>;
|
|
67
68
|
getLiquidityAvailable(): Promise<{
|
|
68
69
|
buy: number;
|
|
@@ -229,7 +229,7 @@ class ClusterClient {
|
|
|
229
229
|
return response.data;
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
createAuthWithoutRegistration({ phoneNumber, firstName, lastName, role, permissions, telegramUsername, telegramUserId, }) {
|
|
232
|
+
createAuthWithoutRegistration({ phoneNumber, firstName, lastName, role, permissions, telegramUsername, telegramUserId, slackUsername, }) {
|
|
233
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
234
|
const response = yield this.axios.post(`${this.baseUrl}/api/auth/unregistered`, {
|
|
235
235
|
phoneNumber,
|
|
@@ -241,6 +241,9 @@ class ClusterClient {
|
|
|
241
241
|
username: telegramUsername,
|
|
242
242
|
telegramUserId: telegramUserId,
|
|
243
243
|
},
|
|
244
|
+
slack: {
|
|
245
|
+
username: slackUsername,
|
|
246
|
+
},
|
|
244
247
|
}, {
|
|
245
248
|
headers: {
|
|
246
249
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -13,12 +13,10 @@ exports.getBulkPaymentFromReference = void 0;
|
|
|
13
13
|
const common_1 = require("@riocrypto/common");
|
|
14
14
|
const bulk_bank_payment_1 = require("../models/bulk-bank-payment");
|
|
15
15
|
const getBulkPaymentFromReference = (reference, mongoose) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
throw new Error("Invalid reference. It must be exactly 8 characters long.");
|
|
16
|
+
if (!reference) {
|
|
17
|
+
throw new Error("Invalid reference. Reference cannot be empty.");
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
const bulkPaymentIdPart = reference.slice(2).toLowerCase();
|
|
19
|
+
const referenceText = reference.toLowerCase();
|
|
22
20
|
const BulkBankPayment = (0, bulk_bank_payment_1.buildBulkBankPayment)(mongoose);
|
|
23
21
|
const bulkPayments = yield BulkBankPayment.find({
|
|
24
22
|
status: {
|
|
@@ -29,7 +27,11 @@ const getBulkPaymentFromReference = (reference, mongoose) => __awaiter(void 0, v
|
|
|
29
27
|
],
|
|
30
28
|
},
|
|
31
29
|
});
|
|
32
|
-
const bulkPayment = bulkPayments.find((bulkPayment) =>
|
|
30
|
+
const bulkPayment = bulkPayments.find((bulkPayment) => {
|
|
31
|
+
const bulkPaymentId = bulkPayment.id.toString().toLowerCase();
|
|
32
|
+
const last6Chars = bulkPaymentId.slice(-6);
|
|
33
|
+
return referenceText.includes(last6Chars);
|
|
34
|
+
});
|
|
33
35
|
if (!bulkPayment) {
|
|
34
36
|
throw new Error("Bulk payment not found");
|
|
35
37
|
}
|