@riocrypto/common-server 1.0.2071 → 1.0.2073
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/arbitrage-session.d.ts +2 -0
- package/build/models/arbitrage-session.js +4 -0
- package/build/models/pre-settlement-transaction.d.ts +22 -0
- package/build/models/pre-settlement-transaction.js +42 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ export * from "./models/arbitrage-alert";
|
|
|
78
78
|
export * from "./models/liquidity-automation";
|
|
79
79
|
export * from "./models/arbitrage-session";
|
|
80
80
|
export * from "./models/arbitrage-trade";
|
|
81
|
+
export * from "./models/pre-settlement-transaction";
|
|
81
82
|
export * from "./clients/axios-with-logging";
|
|
82
83
|
export * from "./clients/slack-client";
|
|
83
84
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -94,6 +94,7 @@ __exportStar(require("./models/arbitrage-alert"), exports);
|
|
|
94
94
|
__exportStar(require("./models/liquidity-automation"), exports);
|
|
95
95
|
__exportStar(require("./models/arbitrage-session"), exports);
|
|
96
96
|
__exportStar(require("./models/arbitrage-trade"), exports);
|
|
97
|
+
__exportStar(require("./models/pre-settlement-transaction"), exports);
|
|
97
98
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
98
99
|
__exportStar(require("./clients/slack-client"), exports);
|
|
99
100
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -10,6 +10,7 @@ interface ArbitrageSessionAttrs {
|
|
|
10
10
|
profit: number;
|
|
11
11
|
profitCurrency: Fiat | Crypto;
|
|
12
12
|
partiallyFilledOrderTTL: number;
|
|
13
|
+
isRunning?: boolean;
|
|
13
14
|
providerA: {
|
|
14
15
|
provider: ArbitrageProvider;
|
|
15
16
|
originCurrency: Fiat | Crypto;
|
|
@@ -56,6 +57,7 @@ interface ArbitrageSessionDoc extends Document {
|
|
|
56
57
|
status: ArbitrageSessionStatus;
|
|
57
58
|
limitPriceDifference?: number;
|
|
58
59
|
maxAmount?: number;
|
|
60
|
+
isRunning?: boolean;
|
|
59
61
|
profit: number;
|
|
60
62
|
limitPrice?: number;
|
|
61
63
|
profitCurrency: Fiat | Crypto;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Fiat, Crypto } from "@riocrypto/common";
|
|
2
|
+
import { PreSettlementTransactionType } from "@riocrypto/common";
|
|
3
|
+
import mongoose from "mongoose";
|
|
4
|
+
interface PreSettlementTransactionAttrs {
|
|
5
|
+
userId: string;
|
|
6
|
+
type: PreSettlementTransactionType;
|
|
7
|
+
amount: number;
|
|
8
|
+
currency: Fiat | Crypto;
|
|
9
|
+
orderId?: string;
|
|
10
|
+
}
|
|
11
|
+
interface PreSettlementTransactionDoc extends mongoose.Document {
|
|
12
|
+
userId: string;
|
|
13
|
+
type: PreSettlementTransactionType;
|
|
14
|
+
amount: number;
|
|
15
|
+
currency: Fiat | Crypto;
|
|
16
|
+
orderId?: string;
|
|
17
|
+
}
|
|
18
|
+
interface PreSettlementTransactionModel extends mongoose.Model<PreSettlementTransactionDoc> {
|
|
19
|
+
build(attrs: PreSettlementTransactionAttrs): PreSettlementTransactionDoc;
|
|
20
|
+
}
|
|
21
|
+
declare const buildPreSettlementTransaction: (mongoose: typeof mongoose) => PreSettlementTransactionModel;
|
|
22
|
+
export { buildPreSettlementTransaction, PreSettlementTransactionDoc, PreSettlementTransactionAttrs, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildPreSettlementTransaction = void 0;
|
|
4
|
+
const common_1 = require("@riocrypto/common");
|
|
5
|
+
const buildPreSettlementTransaction = (mongoose) => {
|
|
6
|
+
// if model is already defined, return it
|
|
7
|
+
if (mongoose.models.PreSettlementTransaction) {
|
|
8
|
+
return mongoose.model("PreSettlementTransaction");
|
|
9
|
+
}
|
|
10
|
+
const PreSettlementTransactionSchema = new mongoose.Schema({
|
|
11
|
+
userId: {
|
|
12
|
+
type: String,
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
enum: Object.values(common_1.PreSettlementTransactionType),
|
|
17
|
+
},
|
|
18
|
+
amount: {
|
|
19
|
+
type: Number,
|
|
20
|
+
},
|
|
21
|
+
currency: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
orderId: {
|
|
25
|
+
type: String,
|
|
26
|
+
},
|
|
27
|
+
}, {
|
|
28
|
+
toJSON: {
|
|
29
|
+
transform(doc, ret) {
|
|
30
|
+
ret.id = ret._id;
|
|
31
|
+
delete ret._id;
|
|
32
|
+
delete ret.__v;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
PreSettlementTransactionSchema.statics.build = (attrs) => {
|
|
37
|
+
return new PreSettlementTransaction(attrs);
|
|
38
|
+
};
|
|
39
|
+
const PreSettlementTransaction = mongoose.model("PreSettlementTransaction", PreSettlementTransactionSchema);
|
|
40
|
+
return PreSettlementTransaction;
|
|
41
|
+
};
|
|
42
|
+
exports.buildPreSettlementTransaction = buildPreSettlementTransaction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2073",
|
|
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.1812",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|