@riocrypto/common-server 1.0.1356 → 1.0.1358
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.
- package/build/clients/bitso-client.js +1 -1
- package/build/helpers/calculate-aggregate-volume-and-revenue.js +1 -1
- package/build/helpers/calculate-weekly-volume-and-revenue.js +1 -1
- package/build/helpers/get-exchange-rates.js +3 -3
- package/build/models/bank-payment.d.ts +8 -0
- package/build/models/bank-payment.js +12 -0
- package/build/models/bitso-bank-account.d.ts +2 -2
- package/build/models/bitso-bank-account.js +1 -1
- package/package.json +2 -2
|
@@ -292,7 +292,7 @@ class BitsoClient {
|
|
|
292
292
|
const url = new URL(requestConfig.url || "");
|
|
293
293
|
const requestPath = url.pathname + (url.search || "");
|
|
294
294
|
const payload = JSON.stringify(requestConfig.data) || "";
|
|
295
|
-
const nonce =
|
|
295
|
+
const nonce = new Date().getTime().toString();
|
|
296
296
|
const data = nonce +
|
|
297
297
|
(((_a = requestConfig.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || "") +
|
|
298
298
|
requestPath +
|
|
@@ -14,7 +14,7 @@ const common_1 = require("@riocrypto/common");
|
|
|
14
14
|
const order_1 = require("../models/order");
|
|
15
15
|
const calculateAggregateVolumeAndRevenue = (mongoose, days, user, excludeBrokerCustomerOrders) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
var _a;
|
|
17
|
-
const startDate =
|
|
17
|
+
const startDate = new Date();
|
|
18
18
|
startDate.setDate(startDate.getDate() - days); // Subtract 14 days from current date
|
|
19
19
|
const Order = (0, order_1.buildOrder)(mongoose);
|
|
20
20
|
let orders;
|
|
@@ -14,7 +14,7 @@ const common_1 = require("@riocrypto/common");
|
|
|
14
14
|
const order_1 = require("../models/order");
|
|
15
15
|
const calculateWeeklyVolumeAndRevenue = (mongoose, user) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
var _a;
|
|
17
|
-
const startDate =
|
|
17
|
+
const startDate = new Date();
|
|
18
18
|
startDate.setDate(startDate.getDate() - ((startDate.getDay() + 6) % 7));
|
|
19
19
|
startDate.setHours(12, 0, 0, 0);
|
|
20
20
|
const Order = (0, order_1.buildOrder)(mongoose);
|
|
@@ -26,7 +26,7 @@ const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
26
26
|
let conversionRateFromUSDWithMarkups = conversionRateFromUSD;
|
|
27
27
|
// Time based markups
|
|
28
28
|
if (fiat === common_1.Fiat.PEN) {
|
|
29
|
-
const now =
|
|
29
|
+
const now = new Date();
|
|
30
30
|
const peruTime = new Date(now.toLocaleString("en-US", { timeZone: "America/Lima" }));
|
|
31
31
|
const hours = peruTime.getHours();
|
|
32
32
|
const minutes = peruTime.getMinutes();
|
|
@@ -37,7 +37,7 @@ const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
if (fiat === common_1.Fiat.MXN) {
|
|
40
|
-
const now =
|
|
40
|
+
const now = new Date();
|
|
41
41
|
const mexicoCityTime = new Date(now.toLocaleString("en-US", { timeZone: "America/Mexico_City" }));
|
|
42
42
|
const hours = mexicoCityTime.getHours();
|
|
43
43
|
const minutes = mexicoCityTime.getMinutes();
|
|
@@ -61,7 +61,7 @@ const getExchangeRates = (fiat) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
61
61
|
});
|
|
62
62
|
exports.getExchangeRates = getExchangeRates;
|
|
63
63
|
// function getDateRange(): { startDate: Date; endDate: Date } {
|
|
64
|
-
// const endDate =
|
|
64
|
+
// const endDate = new Date(); // Current time
|
|
65
65
|
// // Subtract 10 minutes from the end_date
|
|
66
66
|
// const startDate = new Date(endDate.getTime() - 10 * 60 * 1000);
|
|
67
67
|
// return { startDate, endDate };
|
|
@@ -15,6 +15,10 @@ interface BankPaymentAttrs {
|
|
|
15
15
|
rfc?: string;
|
|
16
16
|
swiftCode?: string;
|
|
17
17
|
cci?: string;
|
|
18
|
+
CLABE?: string;
|
|
19
|
+
RUC?: string;
|
|
20
|
+
RFC?: string;
|
|
21
|
+
CCI?: string;
|
|
18
22
|
status: string;
|
|
19
23
|
}
|
|
20
24
|
interface BankPaymentDoc extends Document {
|
|
@@ -33,6 +37,10 @@ interface BankPaymentDoc extends Document {
|
|
|
33
37
|
rfc?: string;
|
|
34
38
|
swiftCode?: string;
|
|
35
39
|
cci?: string;
|
|
40
|
+
CLABE?: string;
|
|
41
|
+
RUC?: string;
|
|
42
|
+
RFC?: string;
|
|
43
|
+
CCI?: string;
|
|
36
44
|
status: string;
|
|
37
45
|
}
|
|
38
46
|
interface BankPaymentModel extends Model<BankPaymentDoc> {
|
|
@@ -57,6 +57,18 @@ const buildBankPayment = (mongoose) => {
|
|
|
57
57
|
cci: {
|
|
58
58
|
type: String,
|
|
59
59
|
},
|
|
60
|
+
CLABE: {
|
|
61
|
+
type: String,
|
|
62
|
+
},
|
|
63
|
+
RUC: {
|
|
64
|
+
type: String,
|
|
65
|
+
},
|
|
66
|
+
RFC: {
|
|
67
|
+
type: String,
|
|
68
|
+
},
|
|
69
|
+
CCI: {
|
|
70
|
+
type: String,
|
|
71
|
+
},
|
|
60
72
|
}, {
|
|
61
73
|
toJSON: {
|
|
62
74
|
transform(doc, ret) {
|
|
@@ -2,13 +2,13 @@ import { Mongoose, Model, Document } from "mongoose";
|
|
|
2
2
|
interface BitsoBankAccountAttrs {
|
|
3
3
|
createdAt: Date;
|
|
4
4
|
userId: string;
|
|
5
|
-
|
|
5
|
+
CLABE: string;
|
|
6
6
|
approved: boolean;
|
|
7
7
|
}
|
|
8
8
|
interface BitsoBankAccountDoc extends Document {
|
|
9
9
|
createdAt: Date;
|
|
10
10
|
userId: string;
|
|
11
|
-
|
|
11
|
+
CLABE: string;
|
|
12
12
|
approved: boolean;
|
|
13
13
|
}
|
|
14
14
|
interface BitsoBankAccountModel extends Model<BitsoBankAccountDoc> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1358",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
|
-
"@riocrypto/common": "^1.0.
|
|
30
|
+
"@riocrypto/common": "^1.0.1195",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|