@riocrypto/common-server 1.0.2285 → 1.0.2287
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 +1 -0
- package/build/index.js +1 -0
- package/build/models/axe.d.ts +47 -0
- package/build/models/axe.js +77 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export * from "./models/webauthn-credential";
|
|
|
94
94
|
export * from "./models/admin-webauthn-credential";
|
|
95
95
|
export * from "./models/custom-rate-limit";
|
|
96
96
|
export * from "./models/order-update-request";
|
|
97
|
+
export * from "./models/axe";
|
|
97
98
|
export * from "./clients/axios-with-logging";
|
|
98
99
|
export * from "./clients/slack-client";
|
|
99
100
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -110,6 +110,7 @@ __exportStar(require("./models/webauthn-credential"), exports);
|
|
|
110
110
|
__exportStar(require("./models/admin-webauthn-credential"), exports);
|
|
111
111
|
__exportStar(require("./models/custom-rate-limit"), exports);
|
|
112
112
|
__exportStar(require("./models/order-update-request"), exports);
|
|
113
|
+
__exportStar(require("./models/axe"), exports);
|
|
113
114
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
114
115
|
__exportStar(require("./clients/slack-client"), exports);
|
|
115
116
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AxeStatus, Country, Fiat, Side } from "@riocrypto/common";
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
interface AxeAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
oppositeUserId: string;
|
|
6
|
+
oppositeOrderId: string;
|
|
7
|
+
side: Side;
|
|
8
|
+
currency: Fiat;
|
|
9
|
+
country: Country;
|
|
10
|
+
totalAmount: number;
|
|
11
|
+
netPrice: number;
|
|
12
|
+
amountConsumed: number;
|
|
13
|
+
amountRemaining: number;
|
|
14
|
+
status: AxeStatus;
|
|
15
|
+
takerOrders: {
|
|
16
|
+
id: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
amount: number;
|
|
19
|
+
netPrice: number;
|
|
20
|
+
}[];
|
|
21
|
+
usersExcludedFromNotifications: string[];
|
|
22
|
+
}
|
|
23
|
+
interface AxeDoc extends mongoose.Document {
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
oppositeUserId: string;
|
|
26
|
+
oppositeOrderId: string;
|
|
27
|
+
currency: Fiat;
|
|
28
|
+
country: Country;
|
|
29
|
+
side: Side;
|
|
30
|
+
totalAmount: number;
|
|
31
|
+
netPrice: number;
|
|
32
|
+
amountConsumed: number;
|
|
33
|
+
amountRemaining: number;
|
|
34
|
+
status: AxeStatus;
|
|
35
|
+
takerOrders: {
|
|
36
|
+
id: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
amount: number;
|
|
39
|
+
netPrice: number;
|
|
40
|
+
}[];
|
|
41
|
+
usersExcludedFromNotifications: string[];
|
|
42
|
+
}
|
|
43
|
+
interface AxeModel extends mongoose.Model<AxeDoc> {
|
|
44
|
+
build(attrs: AxeAttrs): AxeDoc;
|
|
45
|
+
}
|
|
46
|
+
declare const buildAxe: (mongoose: typeof mongoose) => AxeModel;
|
|
47
|
+
export { buildAxe, AxeDoc, AxeAttrs };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAxe = void 0;
|
|
4
|
+
const buildAxe = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.Axe) {
|
|
7
|
+
return mongoose.model("Axe");
|
|
8
|
+
}
|
|
9
|
+
const AxeSchema = new mongoose.Schema({
|
|
10
|
+
createdAt: {
|
|
11
|
+
type: mongoose.Schema.Types.Date,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
oppositeUserId: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
currency: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
country: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
oppositeOrderId: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
side: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
totalAmount: {
|
|
35
|
+
type: Number,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
netPrice: {
|
|
39
|
+
type: Number,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
amountConsumed: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
amountRemaining: {
|
|
47
|
+
type: Number,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
status: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
takerOrders: {
|
|
55
|
+
type: [mongoose.Schema.Types.Mixed],
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
usersExcludedFromNotifications: {
|
|
59
|
+
type: [String],
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
62
|
+
}, {
|
|
63
|
+
toJSON: {
|
|
64
|
+
transform(doc, ret) {
|
|
65
|
+
ret.id = ret._id;
|
|
66
|
+
delete ret._id;
|
|
67
|
+
delete ret.__v;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
AxeSchema.statics.build = (attrs) => {
|
|
72
|
+
return new Axe(attrs);
|
|
73
|
+
};
|
|
74
|
+
const Axe = mongoose.model("Axe", AxeSchema);
|
|
75
|
+
return Axe;
|
|
76
|
+
};
|
|
77
|
+
exports.buildAxe = buildAxe;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2287",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2003",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|