@riocrypto/common-server 1.0.1735 → 1.0.1737
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.
|
@@ -33,6 +33,7 @@ declare class ClusterClient {
|
|
|
33
33
|
}>;
|
|
34
34
|
verifyCode(phoneNumber: string, code?: string, authenticatorCode?: string): Promise<void>;
|
|
35
35
|
sendVerificationEmail(userId: string, country?: Country): Promise<void>;
|
|
36
|
+
registerFXTrade(orderId: string, amount: number, price: number): Promise<void>;
|
|
36
37
|
}
|
|
37
38
|
export declare const buildClusterClient: () => Promise<ClusterClient>;
|
|
38
39
|
export {};
|
|
@@ -269,6 +269,20 @@ class ClusterClient {
|
|
|
269
269
|
});
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
+
registerFXTrade(orderId, amount, price) {
|
|
273
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
+
yield this.axios.post(`${this.baseUrl}/api/fx/orders`, {
|
|
275
|
+
provider: "BBVA",
|
|
276
|
+
orderId,
|
|
277
|
+
price,
|
|
278
|
+
amount,
|
|
279
|
+
}, {
|
|
280
|
+
headers: {
|
|
281
|
+
"x-cluster-api-key": this.clusterApiKey,
|
|
282
|
+
},
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
}
|
|
272
286
|
}
|
|
273
287
|
const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
274
288
|
// Retrieve secrets asynchronously
|
package/build/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export * from "./models/coinbase-order";
|
|
|
61
61
|
export * from "./models/multipart-liquidity-order";
|
|
62
62
|
export * from "./models/onboarding";
|
|
63
63
|
export * from "./models/alert";
|
|
64
|
+
export * from "./models/admin-action";
|
|
64
65
|
export * from "./clients/axios-with-logging";
|
|
65
66
|
export * from "./clients/slack-client";
|
|
66
67
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -77,6 +77,7 @@ __exportStar(require("./models/coinbase-order"), exports);
|
|
|
77
77
|
__exportStar(require("./models/multipart-liquidity-order"), exports);
|
|
78
78
|
__exportStar(require("./models/onboarding"), exports);
|
|
79
79
|
__exportStar(require("./models/alert"), exports);
|
|
80
|
+
__exportStar(require("./models/admin-action"), exports);
|
|
80
81
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
81
82
|
__exportStar(require("./clients/slack-client"), exports);
|
|
82
83
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AdminActionStatus, AdminActionType } from "@riocrypto/common";
|
|
2
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
+
interface AdminActionAttrs {
|
|
4
|
+
type: AdminActionType;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
status: AdminActionStatus;
|
|
7
|
+
adminAuthId: string;
|
|
8
|
+
totalTasks: number;
|
|
9
|
+
tasksCompleted: number;
|
|
10
|
+
executionErrors: string[];
|
|
11
|
+
}
|
|
12
|
+
interface AdminActionDoc extends Document {
|
|
13
|
+
type: AdminActionType;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
status: AdminActionStatus;
|
|
16
|
+
adminAuthId: string;
|
|
17
|
+
totalTasks: number;
|
|
18
|
+
tasksCompleted: number;
|
|
19
|
+
executionErrors: string[];
|
|
20
|
+
}
|
|
21
|
+
interface AdminActionModel extends Model<AdminActionDoc> {
|
|
22
|
+
build(attrs: AdminActionAttrs): AdminActionDoc;
|
|
23
|
+
}
|
|
24
|
+
declare const buildAdminAction: (mongoose: Mongoose) => AdminActionModel;
|
|
25
|
+
export { buildAdminAction, AdminActionDoc, AdminActionAttrs };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAdminAction = void 0;
|
|
4
|
+
const buildAdminAction = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.AdminAction) {
|
|
7
|
+
return mongoose.model("AdminAction");
|
|
8
|
+
}
|
|
9
|
+
const AdminActionSchema = new mongoose.Schema({
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
createdAt: {
|
|
15
|
+
type: mongoose.Schema.Types.Date,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
status: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
adminAuthId: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
totalTasks: {
|
|
27
|
+
type: Number,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
tasksCompleted: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
executionErrors: {
|
|
35
|
+
type: [String],
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
}, {
|
|
39
|
+
toJSON: {
|
|
40
|
+
transform(doc, ret) {
|
|
41
|
+
ret.id = ret._id.valueOf();
|
|
42
|
+
delete ret._id;
|
|
43
|
+
delete ret.__v;
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
AdminActionSchema.statics.build = (attrs) => {
|
|
48
|
+
return new AdminAction(attrs);
|
|
49
|
+
};
|
|
50
|
+
const AdminAction = mongoose.model("AdminAction", AdminActionSchema);
|
|
51
|
+
return AdminAction;
|
|
52
|
+
};
|
|
53
|
+
exports.buildAdminAction = buildAdminAction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1737",
|
|
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.1523",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
32
|
"crypto-js": "^4.2.0",
|