@dhedge/backend-flatcoin-core 0.2.70 → 0.2.72

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.
@@ -40,6 +40,18 @@ exports.LeverageModule = [
40
40
  name: 'positionSummary',
41
41
  type: 'tuple',
42
42
  },
43
+ {
44
+ indexed: false,
45
+ internalType: 'uint256',
46
+ name: 'settledMargin',
47
+ type: 'uint256',
48
+ },
49
+ {
50
+ indexed: false,
51
+ internalType: 'uint256',
52
+ name: 'size',
53
+ type: 'uint256',
54
+ },
43
55
  ],
44
56
  name: 'LeverageClose',
45
57
  type: 'event',
@@ -65,6 +77,18 @@ exports.LeverageModule = [
65
77
  name: 'entryPrice',
66
78
  type: 'uint256',
67
79
  },
80
+ {
81
+ indexed: false,
82
+ internalType: 'uint256',
83
+ name: 'margin',
84
+ type: 'uint256',
85
+ },
86
+ {
87
+ indexed: false,
88
+ internalType: 'uint256',
89
+ name: 'size',
90
+ type: 'uint256',
91
+ },
68
92
  ],
69
93
  name: 'LeverageOpen',
70
94
  type: 'event',
@@ -90,6 +114,18 @@ exports.LeverageModule = [
90
114
  name: 'adjustPrice',
91
115
  type: 'uint256',
92
116
  },
117
+ {
118
+ indexed: false,
119
+ internalType: 'int256',
120
+ name: 'marginDelta',
121
+ type: 'int256',
122
+ },
123
+ {
124
+ indexed: false,
125
+ internalType: 'int256',
126
+ name: 'sizeDelta',
127
+ type: 'int256',
128
+ },
93
129
  ],
94
130
  name: 'LeverageAdjust',
95
131
  type: 'event',
@@ -27,7 +27,6 @@ __decorate([
27
27
  __metadata("design:type", String)
28
28
  ], LeverageMonthlyPnl.prototype, "account", void 0);
29
29
  __decorate([
30
- (0, graphql_1.Field)(() => graphql_1.Float, { nullable: true }),
31
30
  (0, typeorm_1.Column)({ name: 'pnl_reth', type: 'bigint', precision: 30, transformer: utils_1.bigNumberTransformer }),
32
31
  __metadata("design:type", ethers_1.BigNumber)
33
32
  ], LeverageMonthlyPnl.prototype, "pnlReth", void 0);
@@ -2,8 +2,10 @@ import { Logger } from '@nestjs/common';
2
2
  export declare class NotificationService {
3
3
  private readonly logger;
4
4
  private readonly slackUri;
5
+ private readonly slackEmergencyUri;
5
6
  private readonly telegramUri;
6
7
  constructor(logger: Logger);
7
8
  sendSlackNotification(message: string, slackUri?: string): Promise<void>;
9
+ sendSlackEmergencyNotification(message: string, slackUri?: string): Promise<void>;
8
10
  sendTelegramNotification(message: string): Promise<void>;
9
11
  }
@@ -29,6 +29,11 @@ let NotificationService = class NotificationService {
29
29
  }
30
30
  else
31
31
  this.logger.warn('NotificationService -> env property TELEGRAM_CHANNEL is not provided');
32
+ if (process.env.SLACK_EMERGENCY_CHANNEL) {
33
+ this.slackEmergencyUri = process.env.SLACK_EMERGENCY_CHANNEL;
34
+ }
35
+ else
36
+ this.logger.warn('NotificationService -> env property SLACK_EMERGENCY_CHANNEL is not provided');
32
37
  }
33
38
  async sendSlackNotification(message, slackUri = this.slackUri) {
34
39
  try {
@@ -38,6 +43,14 @@ let NotificationService = class NotificationService {
38
43
  this.logger.error(`Error sending notification '${message}' to slack channel ${process.env.SLACK_CHANNEL}`, error);
39
44
  }
40
45
  }
46
+ async sendSlackEmergencyNotification(message, slackUri = this.slackEmergencyUri) {
47
+ try {
48
+ await axios_1.default.post(slackUri, { text: message });
49
+ }
50
+ catch (error) {
51
+ this.logger.error(`Error sending notification '${message}' to slack channel ${process.env.SLACK_EMERGENCY_CHANNEL}`, error);
52
+ }
53
+ }
41
54
  async sendTelegramNotification(message) {
42
55
  if (this.telegramUri) {
43
56
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.2.70",
3
+ "version": "0.2.72",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",