@riocrypto/common-server 1.0.2007 → 1.0.2009
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/liquidity-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/liquidity-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,56 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { InternalTransferType, TreasuryProvider, Fiat, Crypto, InternalTransferAutomationFrequency, InternalTradeType, LiquidityAutomationType } from "@riocrypto/common";
|
|
3
|
+
interface LiquidityAutomationAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
adminId: string;
|
|
6
|
+
type: LiquidityAutomationType;
|
|
7
|
+
transferDetails?: {
|
|
8
|
+
transferType?: InternalTransferType;
|
|
9
|
+
origin: TreasuryProvider;
|
|
10
|
+
destination: TreasuryProvider;
|
|
11
|
+
amount: number;
|
|
12
|
+
currency: Fiat | Crypto;
|
|
13
|
+
};
|
|
14
|
+
tradeDetails?: {
|
|
15
|
+
provider: TreasuryProvider;
|
|
16
|
+
originAmount: number;
|
|
17
|
+
originCurrency: Fiat | Crypto;
|
|
18
|
+
destinationAmount: number;
|
|
19
|
+
destinationCurrency: Fiat | Crypto;
|
|
20
|
+
type: InternalTradeType;
|
|
21
|
+
};
|
|
22
|
+
initialExecutionDate: Date;
|
|
23
|
+
frequency: InternalTransferAutomationFrequency;
|
|
24
|
+
lastExecutionDate?: Date;
|
|
25
|
+
isActive: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface LiquidityAutomationDoc extends mongoose.Document {
|
|
28
|
+
id: string;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
adminId: string;
|
|
31
|
+
type: LiquidityAutomationType;
|
|
32
|
+
transferDetails?: {
|
|
33
|
+
transferType?: InternalTransferType;
|
|
34
|
+
origin: TreasuryProvider;
|
|
35
|
+
destination: TreasuryProvider;
|
|
36
|
+
amount: number;
|
|
37
|
+
currency: Fiat | Crypto;
|
|
38
|
+
};
|
|
39
|
+
tradeDetails?: {
|
|
40
|
+
provider: TreasuryProvider;
|
|
41
|
+
originAmount: number;
|
|
42
|
+
originCurrency: Fiat | Crypto;
|
|
43
|
+
destinationAmount: number;
|
|
44
|
+
destinationCurrency: Fiat | Crypto;
|
|
45
|
+
type: InternalTradeType;
|
|
46
|
+
};
|
|
47
|
+
initialExecutionDate: Date;
|
|
48
|
+
frequency: InternalTransferAutomationFrequency;
|
|
49
|
+
lastExecutionDate?: Date;
|
|
50
|
+
isActive: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface LiquidityAutomationModel extends mongoose.Model<LiquidityAutomationDoc> {
|
|
53
|
+
build(attrs: LiquidityAutomationAttrs): LiquidityAutomationDoc;
|
|
54
|
+
}
|
|
55
|
+
declare const buildInternalTransferAutomation: (mongoose: typeof mongoose) => LiquidityAutomationModel;
|
|
56
|
+
export { buildInternalTransferAutomation, LiquidityAutomationDoc, LiquidityAutomationAttrs, };
|
|
@@ -0,0 +1,56 @@
|
|
|
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.LiquidityAutomation) {
|
|
8
|
+
return mongoose.model("LiquidityAutomation");
|
|
9
|
+
}
|
|
10
|
+
const LiquidityAutomationSchema = new mongoose.Schema({
|
|
11
|
+
adminId: {
|
|
12
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Admin",
|
|
14
|
+
},
|
|
15
|
+
type: {
|
|
16
|
+
type: String,
|
|
17
|
+
enum: common_1.LiquidityAutomationType,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
transferDetails: {
|
|
21
|
+
type: Object,
|
|
22
|
+
},
|
|
23
|
+
tradeDetails: {
|
|
24
|
+
type: Object,
|
|
25
|
+
},
|
|
26
|
+
initialExecutionDate: {
|
|
27
|
+
type: Date,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
frequency: {
|
|
31
|
+
type: String,
|
|
32
|
+
enum: common_1.InternalTransferAutomationFrequency,
|
|
33
|
+
},
|
|
34
|
+
lastExecutionDate: {
|
|
35
|
+
type: Date,
|
|
36
|
+
},
|
|
37
|
+
isActive: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true,
|
|
40
|
+
},
|
|
41
|
+
}, {
|
|
42
|
+
toJSON: {
|
|
43
|
+
transform(doc, ret) {
|
|
44
|
+
ret.id = ret._id;
|
|
45
|
+
delete ret._id;
|
|
46
|
+
delete ret.__v;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
LiquidityAutomationSchema.statics.build = (attrs) => {
|
|
51
|
+
return new LiquidityAutomation(attrs);
|
|
52
|
+
};
|
|
53
|
+
const LiquidityAutomation = mongoose.model("LiquidityAutomation", LiquidityAutomationSchema);
|
|
54
|
+
return LiquidityAutomation;
|
|
55
|
+
};
|
|
56
|
+
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.2009",
|
|
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.1765",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|