@riocrypto/common-server 1.0.1865 → 1.0.1868
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,10 +1,13 @@
|
|
|
1
|
-
import { Blockchain, SettlementTime,
|
|
1
|
+
import { Blockchain, SettlementTime, Side, TradingMarket } from "@riocrypto/common";
|
|
2
2
|
import mongoose from "mongoose";
|
|
3
3
|
interface DashboardSettingsAttrs {
|
|
4
4
|
userId: string;
|
|
5
|
-
previousTrade?:
|
|
5
|
+
previousTrade?: {
|
|
6
|
+
market: TradingMarket;
|
|
7
|
+
side: Side;
|
|
8
|
+
};
|
|
6
9
|
tradePresets?: {
|
|
7
|
-
[key in
|
|
10
|
+
[key in TradingMarket]: {
|
|
8
11
|
blockchain: Blockchain;
|
|
9
12
|
amountFiat: number;
|
|
10
13
|
amountCrypto: number;
|
|
@@ -20,9 +23,12 @@ interface DashboardSettingsAttrs {
|
|
|
20
23
|
}
|
|
21
24
|
interface DashboardSettingsDoc extends mongoose.Document {
|
|
22
25
|
userId: string;
|
|
23
|
-
previousTrade?:
|
|
26
|
+
previousTrade?: {
|
|
27
|
+
market: TradingMarket;
|
|
28
|
+
side: Side;
|
|
29
|
+
};
|
|
24
30
|
tradePresets?: {
|
|
25
|
-
[key in
|
|
31
|
+
[key in TradingMarket]: {
|
|
26
32
|
blockchain: Blockchain;
|
|
27
33
|
amountFiat: number;
|
|
28
34
|
amountCrypto: number;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildDashboardSettings = void 0;
|
|
4
|
-
const common_1 = require("@riocrypto/common");
|
|
5
4
|
const buildDashboardSettings = (mongoose) => {
|
|
6
5
|
// if model is already defined, return it
|
|
7
6
|
if (mongoose.models.DashboardSettings) {
|
|
@@ -13,8 +12,7 @@ const buildDashboardSettings = (mongoose) => {
|
|
|
13
12
|
required: true,
|
|
14
13
|
},
|
|
15
14
|
previousTrade: {
|
|
16
|
-
type:
|
|
17
|
-
enum: common_1.TradingPair,
|
|
15
|
+
type: Object,
|
|
18
16
|
},
|
|
19
17
|
tradePresets: {
|
|
20
18
|
type: Object,
|
package/build/models/order.js
CHANGED
|
@@ -289,6 +289,15 @@ const buildOrder = (mongoose) => {
|
|
|
289
289
|
},
|
|
290
290
|
},
|
|
291
291
|
});
|
|
292
|
+
// Define indexes
|
|
293
|
+
orderSchema.index({ userId: 1 });
|
|
294
|
+
orderSchema.index({ userId: 1, createdAt: 1 });
|
|
295
|
+
orderSchema.index({ userId: 1, createdAt: 1, country: 1 });
|
|
296
|
+
orderSchema.index({ userId: 1, createdAt: 1, side: 1 });
|
|
297
|
+
orderSchema.index({ brokerId: 1 });
|
|
298
|
+
orderSchema.index({ brokerId: 1, createdAt: 1 });
|
|
299
|
+
orderSchema.index({ brokerId: 1, createdAt: 1, country: 1 });
|
|
300
|
+
orderSchema.index({ brokerId: 1, createdAt: 1, side: 1 });
|
|
292
301
|
orderSchema.statics.build = (attrs) => {
|
|
293
302
|
return new Order(attrs);
|
|
294
303
|
};
|
package/build/models/user.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1868",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
27
27
|
"@google-cloud/storage": "^6.9.5",
|
|
28
28
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
29
|
-
"@riocrypto/common": "^1.0.
|
|
29
|
+
"@riocrypto/common": "^1.0.1675",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
32
|
"crypto-js": "^4.2.0",
|