@riocrypto/common-server 1.0.1863 → 1.0.1865
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,19 +1,14 @@
|
|
|
1
|
-
import { SettlementTime } from "@riocrypto/common";
|
|
1
|
+
import { Blockchain, SettlementTime, TradingPair } from "@riocrypto/common";
|
|
2
2
|
import mongoose from "mongoose";
|
|
3
3
|
interface DashboardSettingsAttrs {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
theme?: "light" | "dark";
|
|
7
|
-
language?: "en" | "es";
|
|
8
|
-
previousTrade?: {
|
|
9
|
-
key: string;
|
|
10
|
-
amountFiat: number;
|
|
11
|
-
amountCrypto: number;
|
|
12
|
-
quoteInCrypto: boolean;
|
|
13
|
-
};
|
|
4
|
+
userId: string;
|
|
5
|
+
previousTrade?: TradingPair;
|
|
14
6
|
tradePresets?: {
|
|
15
|
-
[key
|
|
16
|
-
|
|
7
|
+
[key in TradingPair]: {
|
|
8
|
+
blockchain: Blockchain;
|
|
9
|
+
amountFiat: number;
|
|
10
|
+
amountCrypto: number;
|
|
11
|
+
quoteInCrypto: boolean;
|
|
17
12
|
destinationBankAccountId?: string;
|
|
18
13
|
destinationWalletId?: string;
|
|
19
14
|
originWalletId?: string;
|
|
@@ -24,19 +19,14 @@ interface DashboardSettingsAttrs {
|
|
|
24
19
|
};
|
|
25
20
|
}
|
|
26
21
|
interface DashboardSettingsDoc extends mongoose.Document {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
theme?: "light" | "dark";
|
|
30
|
-
language?: "en" | "es";
|
|
31
|
-
previousTrade?: {
|
|
32
|
-
key: string;
|
|
33
|
-
amountFiat: number;
|
|
34
|
-
amountCrypto: number;
|
|
35
|
-
quoteInCrypto: boolean;
|
|
36
|
-
};
|
|
22
|
+
userId: string;
|
|
23
|
+
previousTrade?: TradingPair;
|
|
37
24
|
tradePresets?: {
|
|
38
|
-
[key
|
|
39
|
-
|
|
25
|
+
[key in TradingPair]: {
|
|
26
|
+
blockchain: Blockchain;
|
|
27
|
+
amountFiat: number;
|
|
28
|
+
amountCrypto: number;
|
|
29
|
+
quoteInCrypto: boolean;
|
|
40
30
|
destinationBankAccountId?: string;
|
|
41
31
|
destinationWalletId?: string;
|
|
42
32
|
originWalletId?: string;
|
|
@@ -1,41 +1,20 @@
|
|
|
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");
|
|
4
5
|
const buildDashboardSettings = (mongoose) => {
|
|
5
6
|
// if model is already defined, return it
|
|
6
7
|
if (mongoose.models.DashboardSettings) {
|
|
7
8
|
return mongoose.model("DashboardSettings");
|
|
8
9
|
}
|
|
9
10
|
const DashboardSettingsSchema = new mongoose.Schema({
|
|
10
|
-
|
|
11
|
+
userId: {
|
|
11
12
|
type: String,
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
adminAuthId: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: null,
|
|
17
|
-
},
|
|
18
|
-
theme: {
|
|
19
|
-
type: String,
|
|
20
|
-
enum: ["light", "dark"],
|
|
21
|
-
},
|
|
22
|
-
language: {
|
|
23
|
-
type: String,
|
|
24
|
-
enum: ["en", "es"],
|
|
13
|
+
required: true,
|
|
25
14
|
},
|
|
26
15
|
previousTrade: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
amountFiat: {
|
|
31
|
-
type: Number,
|
|
32
|
-
},
|
|
33
|
-
amountCrypto: {
|
|
34
|
-
type: Number,
|
|
35
|
-
},
|
|
36
|
-
quoteInCrypto: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
},
|
|
16
|
+
type: String,
|
|
17
|
+
enum: common_1.TradingPair,
|
|
39
18
|
},
|
|
40
19
|
tradePresets: {
|
|
41
20
|
type: Object,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1865",
|
|
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.1670",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
32
|
"crypto-js": "^4.2.0",
|