@pear-protocol/core-sdk 1.5.0 → 1.6.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.
@@ -1822,26 +1822,50 @@ declare class Core {
1822
1822
  list: (query?: HttpTypes.NotificationListParamsInput, headers?: ClientHeaders) => Promise<{
1823
1823
  notifications: {
1824
1824
  id: string;
1825
- category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT";
1825
+ category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT" | "TAKE_PROFIT_FAILED" | "STOP_LOSS_FAILED" | "TRIGGER_ORDER_FAILED" | "ATTACHED_TRIGGER_DISCARDED";
1826
1826
  parameters: {
1827
1827
  type: "take_profit";
1828
1828
  triggerId: string;
1829
1829
  positionId: string;
1830
1830
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1831
+ metric?: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing" | undefined;
1832
+ level?: number | undefined;
1833
+ reason?: string | undefined;
1831
1834
  } | {
1832
1835
  type: "stop_loss";
1833
1836
  triggerId: string;
1834
1837
  positionId: string;
1835
1838
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1839
+ metric?: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing" | undefined;
1840
+ level?: number | undefined;
1841
+ reason?: string | undefined;
1836
1842
  } | {
1837
1843
  type: "trigger_order";
1838
1844
  triggerId: string;
1839
1845
  positionId: string;
1840
1846
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1847
+ metric?: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing" | undefined;
1848
+ level?: number | undefined;
1849
+ reason?: string | undefined;
1841
1850
  } | {
1842
1851
  type: "default_trigger";
1843
1852
  triggerId: string;
1844
1853
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1854
+ metric?: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing" | undefined;
1855
+ level?: number | undefined;
1856
+ reason?: string | undefined;
1857
+ } | {
1858
+ type: "attached_trigger_discarded";
1859
+ positionId: string;
1860
+ positionKey: string;
1861
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1862
+ discarded: {
1863
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
1864
+ metric: "price" | "ratio" | "weighted_ratio" | "funding_rate" | "prediction_market" | "btc_dominance" | "notional" | "upnl" | "upnl_bps" | "ratio_trailing" | "price_trailing" | "weighted_ratio_trailing" | "notional_trailing" | "upnl_trailing" | "upnl_bps_trailing";
1865
+ reason: "TRIGGER_LIMIT" | "TRAILING_ALREADY_EXISTS";
1866
+ level?: number | undefined;
1867
+ }[];
1868
+ activeTriggerLimit: number;
1845
1869
  };
1846
1870
  isRead: boolean;
1847
1871
  createdAt: string;
@@ -1868,6 +1892,8 @@ declare class Core {
1868
1892
  };
1869
1893
  positions: {
1870
1894
  list: (query: HttpTypes.PositionListParamsInput, headers?: ClientHeaders) => Promise<{
1895
+ limit: number;
1896
+ nextCursor: string | undefined;
1871
1897
  positions: {
1872
1898
  id: string;
1873
1899
  tradeAccountId: string;
@@ -4485,6 +4511,14 @@ declare class Core {
4485
4511
  openPositions: number;
4486
4512
  }[];
4487
4513
  }>;
4514
+ totals: (query: HttpTypes.StatisticsTotalsQueryParamsInput, headers?: ClientHeaders) => Promise<{
4515
+ data: {
4516
+ totalVolume: number;
4517
+ totalFees: number;
4518
+ totalTrades: number;
4519
+ totalUsers: number;
4520
+ };
4521
+ }>;
4488
4522
  };
4489
4523
  tca: {
4490
4524
  execution: (executionId: string, headers?: ClientHeaders) => Promise<{
@@ -575,6 +575,13 @@ class Core {
575
575
  headers,
576
576
  query
577
577
  });
578
+ },
579
+ totals: async (query, headers) => {
580
+ return await this.client.fetch(`/statistics/totals`, {
581
+ method: "GET",
582
+ headers,
583
+ query
584
+ });
578
585
  }
579
586
  };
580
587
  tca = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Pear Protocol Core SDK",
5
5
  "private": false,
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "typecheck": "tsc --noEmit"
28
28
  },
29
29
  "dependencies": {
30
- "@pear-protocol/types": "^1.6.0",
30
+ "@pear-protocol/types": "^1.8.0",
31
31
  "@pear-protocol/utils": "^0.1.0",
32
32
  "qs": "^6.14.0"
33
33
  },