@riocrypto/common-server 1.0.2546 → 1.0.2547

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
@@ -94,6 +94,7 @@ export * from "./models/liquidity-reservation";
94
94
  export * from "./models/axe-slack-thread";
95
95
  export * from "./models/axe-telegram-thread";
96
96
  export * from "./models/auth-activity-slack-thread";
97
+ export * from "./models/twap-slack-thread";
97
98
  export * from "./models/twap-session";
98
99
  export * from "./models/bulk-bank-payout";
99
100
  export * from "./models/bulk-crypto-payout";
package/build/index.js CHANGED
@@ -110,6 +110,7 @@ __exportStar(require("./models/liquidity-reservation"), exports);
110
110
  __exportStar(require("./models/axe-slack-thread"), exports);
111
111
  __exportStar(require("./models/axe-telegram-thread"), exports);
112
112
  __exportStar(require("./models/auth-activity-slack-thread"), exports);
113
+ __exportStar(require("./models/twap-slack-thread"), exports);
113
114
  __exportStar(require("./models/twap-session"), exports);
114
115
  __exportStar(require("./models/bulk-bank-payout"), exports);
115
116
  __exportStar(require("./models/bulk-crypto-payout"), exports);
@@ -0,0 +1,58 @@
1
+ import { Country, Crypto, DeferredPaymentType, Fiat, Side, TwoWaySettlementType } from "@riocrypto/common";
2
+ import mongoose from "mongoose";
3
+ interface TWAPSlackThreadAttrs {
4
+ createdAt: Date;
5
+ userId: string;
6
+ country: Country;
7
+ fiat: Fiat;
8
+ side: Side;
9
+ messageTs?: string;
10
+ channel: string;
11
+ currentStep: "initial" | "twap_details" | "settlement_details" | "completed" | "declined";
12
+ sessionData?: {
13
+ crypto?: Crypto;
14
+ tradeCurrency?: Fiat | Crypto;
15
+ maxOriginAmount?: number;
16
+ maxDestinationAmount?: number;
17
+ clipSize?: number;
18
+ maxAmountPerSettlement?: number;
19
+ payoutBankAccountId?: string;
20
+ payoutAddressId?: string;
21
+ deferredPaymentType?: DeferredPaymentType;
22
+ twoWaySettlementType?: TwoWaySettlementType;
23
+ twoWaySettlementDateOffset?: number;
24
+ };
25
+ lastActivity: Date;
26
+ twapSessionId?: string;
27
+ }
28
+ interface TWAPSlackThreadDoc extends mongoose.Document {
29
+ id: string;
30
+ createdAt: Date;
31
+ userId: string;
32
+ country: Country;
33
+ fiat: Fiat;
34
+ side: Side;
35
+ messageTs?: string;
36
+ channel: string;
37
+ currentStep: "initial" | "twap_details" | "settlement_details" | "completed" | "declined";
38
+ sessionData?: {
39
+ crypto?: Crypto;
40
+ tradeCurrency?: Fiat | Crypto;
41
+ maxOriginAmount?: number;
42
+ maxDestinationAmount?: number;
43
+ clipSize?: number;
44
+ maxAmountPerSettlement?: number;
45
+ payoutBankAccountId?: string;
46
+ payoutAddressId?: string;
47
+ deferredPaymentType?: DeferredPaymentType;
48
+ twoWaySettlementType?: TwoWaySettlementType;
49
+ twoWaySettlementDateOffset?: number;
50
+ };
51
+ lastActivity: Date;
52
+ twapSessionId?: string;
53
+ }
54
+ interface TWAPSlackThreadModel extends mongoose.Model<TWAPSlackThreadDoc> {
55
+ build(attrs: TWAPSlackThreadAttrs): TWAPSlackThreadDoc;
56
+ }
57
+ declare const buildTWAPSlackThread: (mongoose: typeof mongoose) => TWAPSlackThreadModel;
58
+ export { buildTWAPSlackThread, TWAPSlackThreadDoc, TWAPSlackThreadAttrs };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildTWAPSlackThread = void 0;
4
+ const buildTWAPSlackThread = (mongoose) => {
5
+ if (mongoose.models.TWAPSlackThread) {
6
+ return mongoose.model("TWAPSlackThread");
7
+ }
8
+ const TWAPSlackThreadSchema = new mongoose.Schema({
9
+ createdAt: {
10
+ type: mongoose.Schema.Types.Date,
11
+ required: true,
12
+ },
13
+ userId: {
14
+ type: String,
15
+ required: true,
16
+ },
17
+ country: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+ fiat: {
22
+ type: String,
23
+ required: true,
24
+ },
25
+ side: {
26
+ type: String,
27
+ required: true,
28
+ },
29
+ messageTs: {
30
+ type: String,
31
+ required: false,
32
+ },
33
+ channel: {
34
+ type: String,
35
+ required: true,
36
+ },
37
+ currentStep: {
38
+ type: String,
39
+ required: true,
40
+ },
41
+ sessionData: {
42
+ type: Object,
43
+ required: false,
44
+ },
45
+ lastActivity: {
46
+ type: mongoose.Schema.Types.Date,
47
+ required: true,
48
+ },
49
+ twapSessionId: {
50
+ type: String,
51
+ required: false,
52
+ },
53
+ }, {
54
+ toJSON: {
55
+ transform(doc, ret) {
56
+ ret.id = ret._id;
57
+ delete ret._id;
58
+ delete ret.__v;
59
+ },
60
+ },
61
+ });
62
+ TWAPSlackThreadSchema.index({
63
+ userId: 1,
64
+ country: 1,
65
+ fiat: 1,
66
+ side: 1,
67
+ createdAt: -1,
68
+ });
69
+ TWAPSlackThreadSchema.statics.build = (attrs) => {
70
+ return new TWAPSlackThread(attrs);
71
+ };
72
+ const TWAPSlackThread = mongoose.model("TWAPSlackThread", TWAPSlackThreadSchema);
73
+ return TWAPSlackThread;
74
+ };
75
+ exports.buildTWAPSlackThread = buildTWAPSlackThread;
@@ -114,6 +114,7 @@ interface UserAttrs {
114
114
  [key in Side]?: {
115
115
  minClipSize?: number;
116
116
  interval?: number;
117
+ dailyPromptTime?: string;
117
118
  };
118
119
  };
119
120
  };
@@ -266,6 +267,7 @@ interface UserDoc extends Document {
266
267
  [key in Side]?: {
267
268
  minClipSize?: number;
268
269
  interval?: number;
270
+ dailyPromptTime?: string;
269
271
  };
270
272
  };
271
273
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2546",
3
+ "version": "1.0.2547",
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.2346",
31
+ "@riocrypto/common": "^1.0.2349",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",