@riocrypto/common-server 1.0.1857 → 1.0.1859
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/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export * from "./models/admin-action";
|
|
|
66
66
|
export * from "./models/arbitrage-settings";
|
|
67
67
|
export * from "./models/arbitrage-opportunity";
|
|
68
68
|
export * from "./models/email-receipt";
|
|
69
|
+
export * from "./models/dashboard-settings";
|
|
69
70
|
export * from "./clients/axios-with-logging";
|
|
70
71
|
export * from "./clients/slack-client";
|
|
71
72
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -82,6 +82,7 @@ __exportStar(require("./models/admin-action"), exports);
|
|
|
82
82
|
__exportStar(require("./models/arbitrage-settings"), exports);
|
|
83
83
|
__exportStar(require("./models/arbitrage-opportunity"), exports);
|
|
84
84
|
__exportStar(require("./models/email-receipt"), exports);
|
|
85
|
+
__exportStar(require("./models/dashboard-settings"), exports);
|
|
85
86
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
86
87
|
__exportStar(require("./clients/slack-client"), exports);
|
|
87
88
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SettlementTime } from "@riocrypto/common";
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
interface DashboardSettingsAttrs {
|
|
4
|
+
theme: "light" | "dark";
|
|
5
|
+
language: "en" | "es";
|
|
6
|
+
tradePresets: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
userId: string;
|
|
9
|
+
destinationBankAccountId?: string;
|
|
10
|
+
destinationWalletId?: string;
|
|
11
|
+
originWalletId?: string;
|
|
12
|
+
settlementTime?: SettlementTime;
|
|
13
|
+
originUSBankTransferMethod?: "ach_push" | "wire";
|
|
14
|
+
destinationUSBankTransferMethod?: "ach_push" | "wire";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface DashboardSettingsDoc extends mongoose.Document {
|
|
19
|
+
theme: "light" | "dark";
|
|
20
|
+
language: "en" | "es";
|
|
21
|
+
previousTrade: {
|
|
22
|
+
key: string;
|
|
23
|
+
amountFiat: number;
|
|
24
|
+
amountCrypto: number;
|
|
25
|
+
};
|
|
26
|
+
tradePresets: {
|
|
27
|
+
[key: string]: {
|
|
28
|
+
userId: string;
|
|
29
|
+
destinationBankAccountId?: string;
|
|
30
|
+
destinationWalletId?: string;
|
|
31
|
+
originWalletId?: string;
|
|
32
|
+
settlementTime?: SettlementTime;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
interface DashboardSettingsModel extends mongoose.Model<DashboardSettingsDoc> {
|
|
37
|
+
build(attrs: DashboardSettingsAttrs): DashboardSettingsDoc;
|
|
38
|
+
}
|
|
39
|
+
declare const buildDashboardSettings: (mongoose: typeof mongoose) => DashboardSettingsModel;
|
|
40
|
+
export { buildDashboardSettings, DashboardSettingsModel, DashboardSettingsAttrs, };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildDashboardSettings = void 0;
|
|
4
|
+
const buildDashboardSettings = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.DashboardSettings) {
|
|
7
|
+
return mongoose.model("DashboardSettings");
|
|
8
|
+
}
|
|
9
|
+
const DashboardSettingsSchema = new mongoose.Schema({
|
|
10
|
+
theme: {
|
|
11
|
+
type: String,
|
|
12
|
+
enum: ["light", "dark"],
|
|
13
|
+
default: "light",
|
|
14
|
+
},
|
|
15
|
+
language: {
|
|
16
|
+
type: String,
|
|
17
|
+
enum: ["en", "es"],
|
|
18
|
+
default: "en",
|
|
19
|
+
},
|
|
20
|
+
tradePresets: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: {},
|
|
23
|
+
},
|
|
24
|
+
}, {
|
|
25
|
+
toJSON: {
|
|
26
|
+
transform(doc, ret) {
|
|
27
|
+
ret.id = ret._id;
|
|
28
|
+
delete ret._id;
|
|
29
|
+
delete ret.__v;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
DashboardSettingsSchema.statics.build = (attrs) => {
|
|
34
|
+
return new DashboardSettings(attrs);
|
|
35
|
+
};
|
|
36
|
+
const DashboardSettings = mongoose.model("DashboardSettings", DashboardSettingsSchema);
|
|
37
|
+
return DashboardSettings;
|
|
38
|
+
};
|
|
39
|
+
exports.buildDashboardSettings = buildDashboardSettings;
|
package/build/models/user.js
CHANGED
|
@@ -313,9 +313,30 @@ const buildUser = (mongoose) => {
|
|
|
313
313
|
},
|
|
314
314
|
},
|
|
315
315
|
accumulatedVolumeInUSD: {
|
|
316
|
-
MX:
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
MX: {
|
|
317
|
+
buy: {
|
|
318
|
+
type: Number,
|
|
319
|
+
},
|
|
320
|
+
sell: {
|
|
321
|
+
type: Number,
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
PE: {
|
|
325
|
+
buy: {
|
|
326
|
+
type: Number,
|
|
327
|
+
},
|
|
328
|
+
sell: {
|
|
329
|
+
type: Number,
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
US: {
|
|
333
|
+
buy: {
|
|
334
|
+
type: Number,
|
|
335
|
+
},
|
|
336
|
+
sell: {
|
|
337
|
+
type: Number,
|
|
338
|
+
},
|
|
339
|
+
},
|
|
319
340
|
},
|
|
320
341
|
}, {
|
|
321
342
|
toJSON: {
|