@pear-protocol/core-sdk 2.5.0 → 2.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.
@@ -9,10 +9,35 @@ 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";
15
- exchangeIdentifier: string;
40
+ copyingEnabled: boolean;
16
41
  followers: {
17
42
  tradeAccountId: string;
18
43
  status: "ACTIVE";
@@ -1416,6 +1441,10 @@ declare class Core {
1416
1441
  };
1417
1442
  })[] | undefined;
1418
1443
  }[];
1444
+ xHandle?: string | undefined;
1445
+ xName?: string | undefined;
1446
+ xAvatarUrl?: string | undefined;
1447
+ xUserId?: string | undefined;
1419
1448
  }>;
1420
1449
  };
1421
1450
  accounts: {
@@ -2655,7 +2684,7 @@ declare class Core {
2655
2684
  get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
2656
2685
  baseBps: string;
2657
2686
  discounts: {
2658
- scope: "connector" | "all" | "user" | "client_id";
2687
+ scope: "user" | "connector" | "all" | "client_id";
2659
2688
  rate: string;
2660
2689
  }[];
2661
2690
  finalBps: string;
@@ -5981,7 +6010,7 @@ declare class Core {
5981
6010
  entryPrices: Record<string, string>;
5982
6011
  createdAt: string;
5983
6012
  updatedAt: string;
5984
- closedReason?: "USER" | "NETTED" | "LIQUIDATED" | null | undefined;
6013
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | null | undefined;
5985
6014
  closedAt?: string | null | undefined;
5986
6015
  }[];
5987
6016
  nextCursor?: string | undefined;
@@ -6044,7 +6073,7 @@ declare class Core {
6044
6073
  entryVwap?: string | undefined;
6045
6074
  exitVwap?: string | undefined;
6046
6075
  }[];
6047
- closedReason?: "USER" | "NETTED" | "LIQUIDATED" | undefined;
6076
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | undefined;
6048
6077
  steps?: {
6049
6078
  at: string;
6050
6079
  grossPnl: `-${string}` | `+${string}`;
@@ -10325,6 +10354,7 @@ declare class Core {
10325
10354
  tradeAccountId: string;
10326
10355
  userId: string;
10327
10356
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
10357
+ copyingEnabled: boolean;
10328
10358
  followers: {
10329
10359
  tradeAccountId: string;
10330
10360
  status: "ACTIVE";
@@ -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.6.0",
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.13.0",
30
30
  "@pear-protocol/utils": "^1.3.0",
31
31
  "qs": "^6.14.0"
32
32
  },