@pear-protocol/core-sdk 1.0.0 → 1.1.0

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.
@@ -477,6 +477,43 @@ declare class Core {
477
477
  }[];
478
478
  }>;
479
479
  };
480
+ notifications: {
481
+ list: (query?: HttpTypes.NotificationListParamsInput, headers?: ClientHeaders) => Promise<{
482
+ notifications: {
483
+ id: string;
484
+ category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT";
485
+ parameters: {
486
+ type: "take_profit";
487
+ triggerId: string;
488
+ positionId: string;
489
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
490
+ } | {
491
+ type: "stop_loss";
492
+ triggerId: string;
493
+ positionId: string;
494
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
495
+ } | {
496
+ type: "trigger_order";
497
+ triggerId: string;
498
+ positionId: string;
499
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
500
+ } | {
501
+ type: "default_trigger";
502
+ triggerId: string;
503
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
504
+ };
505
+ isRead: boolean;
506
+ createdAt: string;
507
+ updatedAt: string;
508
+ }[];
509
+ }>;
510
+ markRead: (body: HttpTypes.MarkNotificationsReadPayloadInput, headers?: ClientHeaders) => Promise<{
511
+ updated: number;
512
+ }>;
513
+ markUnread: (body: HttpTypes.MarkNotificationUnreadPayloadInput, headers?: ClientHeaders) => Promise<{
514
+ updated: number;
515
+ }>;
516
+ };
480
517
  oracle: {
481
518
  btcdom: (headers?: ClientHeaders) => Promise<{
482
519
  id: string;
@@ -145,6 +145,29 @@ class Core {
145
145
  });
146
146
  }
147
147
  };
148
+ notifications = {
149
+ list: async (query, headers) => {
150
+ return await this.client.fetch(`/notifications`, {
151
+ method: "GET",
152
+ headers,
153
+ query
154
+ });
155
+ },
156
+ markRead: async (body, headers) => {
157
+ return await this.client.fetch(`/notifications/read`, {
158
+ method: "POST",
159
+ headers,
160
+ body
161
+ });
162
+ },
163
+ markUnread: async (body, headers) => {
164
+ return await this.client.fetch(`/notifications/unread`, {
165
+ method: "POST",
166
+ headers,
167
+ body
168
+ });
169
+ }
170
+ };
148
171
  oracle = {
149
172
  btcdom: async (headers) => {
150
173
  return await this.client.fetch(`/oracle/btcdom`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Pear Protocol Core SDK",
5
5
  "private": false,
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "typecheck": "tsc --noEmit"
26
26
  },
27
27
  "dependencies": {
28
- "@pear-protocol/types": "^1.0.0",
28
+ "@pear-protocol/types": "^1.1.0",
29
29
  "@pear-protocol/utils": "^0.0.23",
30
30
  "qs": "^6.14.0"
31
31
  },