@pear-protocol/core-sdk 2.5.0 → 2.5.1

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.
@@ -9,6 +9,31 @@ declare class Core {
9
9
  constructor(client: HttpClient, clientId?: string | null);
10
10
  private withClientId;
11
11
  traders: {
12
+ /** Read a public trader's paginated closed history without account authentication. */
13
+ closedPositions: (tradeAccountId: string, query?: HttpTypes.PublicTraderClosedPositionsParamsInput, headers?: ClientHeaders) => Promise<{
14
+ limit: number;
15
+ positions: {
16
+ status: "CLOSED";
17
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
18
+ positionId: string;
19
+ closedAt: string;
20
+ grossPnl: `-${string}` | `+${string}`;
21
+ netPnl: `-${string}` | `+${string}`;
22
+ openedAt: string;
23
+ hasProvisionalFills: boolean;
24
+ legs: {
25
+ side: "LONG" | "SHORT";
26
+ asset: string;
27
+ grossPnl: `-${string}` | `+${string}`;
28
+ netPnl: `-${string}` | `+${string}`;
29
+ entryNotional: string;
30
+ entryVwap?: string | undefined;
31
+ exitVwap?: string | undefined;
32
+ }[];
33
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | undefined;
34
+ }[];
35
+ nextCursor?: string | undefined;
36
+ }>;
12
37
  /** Read the latest 20 open positions and active automation records per section without account authentication. */
13
38
  public: (tradeAccountId: string, headers?: ClientHeaders) => Promise<{
14
39
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
@@ -2655,7 +2680,7 @@ declare class Core {
2655
2680
  get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
2656
2681
  baseBps: string;
2657
2682
  discounts: {
2658
- scope: "connector" | "all" | "user" | "client_id";
2683
+ scope: "user" | "connector" | "all" | "client_id";
2659
2684
  rate: string;
2660
2685
  }[];
2661
2686
  finalBps: string;
@@ -5981,7 +6006,7 @@ declare class Core {
5981
6006
  entryPrices: Record<string, string>;
5982
6007
  createdAt: string;
5983
6008
  updatedAt: string;
5984
- closedReason?: "USER" | "NETTED" | "LIQUIDATED" | null | undefined;
6009
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | null | undefined;
5985
6010
  closedAt?: string | null | undefined;
5986
6011
  }[];
5987
6012
  nextCursor?: string | undefined;
@@ -6044,7 +6069,7 @@ declare class Core {
6044
6069
  entryVwap?: string | undefined;
6045
6070
  exitVwap?: string | undefined;
6046
6071
  }[];
6047
- closedReason?: "USER" | "NETTED" | "LIQUIDATED" | undefined;
6072
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | undefined;
6048
6073
  steps?: {
6049
6074
  at: string;
6050
6075
  grossPnl: `-${string}` | `+${string}`;
@@ -23,6 +23,14 @@ class Core {
23
23
  };
24
24
  }
25
25
  traders = {
26
+ /** Read a public trader's paginated closed history without account authentication. */
27
+ closedPositions: /* @__PURE__ */ __name(async (tradeAccountId, query, headers) => {
28
+ return await this.client.fetch(`/traders/${encodeURIComponent(tradeAccountId)}/closed-positions`, {
29
+ method: "GET",
30
+ query,
31
+ headers
32
+ });
33
+ }, "closedPositions"),
26
34
  /** Read the latest 20 open positions and active automation records per section without account authentication. */
27
35
  public: /* @__PURE__ */ __name(async (tradeAccountId, headers) => {
28
36
  return await this.client.fetch(`/traders/${encodeURIComponent(tradeAccountId)}`, {
@@ -416,7 +416,7 @@ declare class Vaults {
416
416
  entryVwap?: string | undefined;
417
417
  exitVwap?: string | undefined;
418
418
  }[];
419
- closedReason?: "USER" | "NETTED" | "LIQUIDATED" | undefined;
419
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | undefined;
420
420
  }[];
421
421
  nextCursor?: string | undefined;
422
422
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Pear Protocol Core SDK",
5
5
  "private": false,
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsc --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@pear-protocol/types": "^2.12.0",
29
+ "@pear-protocol/types": "^2.12.1",
30
30
  "@pear-protocol/utils": "^1.3.0",
31
31
  "qs": "^6.14.0"
32
32
  },