@riocrypto/common-server 1.0.2006 → 1.0.2008
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
|
@@ -75,6 +75,7 @@ export * from "./models/bulk-bank-payment";
|
|
|
75
75
|
export * from "./models/bulk-crypto-payment";
|
|
76
76
|
export * from "./models/fx-trade";
|
|
77
77
|
export * from "./models/arbitrage-alert";
|
|
78
|
+
export * from "./models/internal-transfer-automation";
|
|
78
79
|
export * from "./clients/axios-with-logging";
|
|
79
80
|
export * from "./clients/slack-client";
|
|
80
81
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -91,6 +91,7 @@ __exportStar(require("./models/bulk-bank-payment"), exports);
|
|
|
91
91
|
__exportStar(require("./models/bulk-crypto-payment"), exports);
|
|
92
92
|
__exportStar(require("./models/fx-trade"), exports);
|
|
93
93
|
__exportStar(require("./models/arbitrage-alert"), exports);
|
|
94
|
+
__exportStar(require("./models/internal-transfer-automation"), exports);
|
|
94
95
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
95
96
|
__exportStar(require("./clients/slack-client"), exports);
|
|
96
97
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { InternalTransferType, TreasuryProvider, Fiat, Crypto, InternalTransferAutomationFrequency } from "@riocrypto/common";
|
|
3
|
+
interface InternalTransferAutomationAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
adminId: string;
|
|
6
|
+
transferType: InternalTransferType;
|
|
7
|
+
initialExecutionDate: Date;
|
|
8
|
+
origin: TreasuryProvider;
|
|
9
|
+
destination: TreasuryProvider;
|
|
10
|
+
amount: number;
|
|
11
|
+
currency: Fiat | Crypto;
|
|
12
|
+
frequency: InternalTransferAutomationFrequency;
|
|
13
|
+
lastExecutionDate?: Date;
|
|
14
|
+
isActive: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface InternalTransferAutomationDoc extends mongoose.Document {
|
|
17
|
+
id: string;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
adminId: string;
|
|
20
|
+
transferType: InternalTransferType;
|
|
21
|
+
initialExecutionDate: Date;
|
|
22
|
+
origin: TreasuryProvider;
|
|
23
|
+
destination: TreasuryProvider;
|
|
24
|
+
amount: number;
|
|
25
|
+
currency: Fiat | Crypto;
|
|
26
|
+
frequency: InternalTransferAutomationFrequency;
|
|
27
|
+
lastExecutionDate?: Date;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface InternalTransferAutomationModel extends mongoose.Model<InternalTransferAutomationDoc> {
|
|
31
|
+
build(attrs: InternalTransferAutomationAttrs): InternalTransferAutomationDoc;
|
|
32
|
+
}
|
|
33
|
+
declare const buildInternalTransferAutomation: (mongoose: typeof mongoose) => InternalTransferAutomationModel;
|
|
34
|
+
export { buildInternalTransferAutomation, InternalTransferAutomationDoc, InternalTransferAutomationAttrs, };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildInternalTransferAutomation = void 0;
|
|
4
|
+
const common_1 = require("@riocrypto/common");
|
|
5
|
+
const buildInternalTransferAutomation = (mongoose) => {
|
|
6
|
+
// if model is already defined, return it
|
|
7
|
+
if (mongoose.models.InternalTransferAutomation) {
|
|
8
|
+
return mongoose.model("InternalTransferAutomation");
|
|
9
|
+
}
|
|
10
|
+
const InternalTransferAutomationSchema = new mongoose.Schema({
|
|
11
|
+
createdAt: {
|
|
12
|
+
type: Date,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
adminId: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
transferType: {
|
|
20
|
+
type: String,
|
|
21
|
+
enum: Object.values(common_1.InternalTransferType),
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
initialExecutionDate: {
|
|
25
|
+
type: Date,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
origin: {
|
|
29
|
+
type: String,
|
|
30
|
+
enum: Object.values(common_1.TreasuryProvider),
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
destination: {
|
|
34
|
+
type: String,
|
|
35
|
+
enum: Object.values(common_1.TreasuryProvider),
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
amount: {
|
|
39
|
+
type: Number,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
currency: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
frequency: {
|
|
47
|
+
type: String,
|
|
48
|
+
enum: Object.values(common_1.InternalTransferAutomationFrequency),
|
|
49
|
+
},
|
|
50
|
+
lastExecutionDate: {
|
|
51
|
+
type: Date,
|
|
52
|
+
},
|
|
53
|
+
isActive: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
}, {
|
|
58
|
+
toJSON: {
|
|
59
|
+
transform(doc, ret) {
|
|
60
|
+
ret.id = ret._id;
|
|
61
|
+
delete ret._id;
|
|
62
|
+
delete ret.__v;
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
InternalTransferAutomationSchema.statics.build = (attrs) => {
|
|
67
|
+
return new InternalTransferAutomation(attrs);
|
|
68
|
+
};
|
|
69
|
+
const InternalTransferAutomation = mongoose.model("InternalTransferAutomation", InternalTransferAutomationSchema);
|
|
70
|
+
return InternalTransferAutomation;
|
|
71
|
+
};
|
|
72
|
+
exports.buildInternalTransferAutomation = buildInternalTransferAutomation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2008",
|
|
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.1764",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|