@pear-protocol/core-sdk 2.7.0 → 2.8.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.
@@ -34,8 +34,8 @@ declare class Core {
34
34
  }[];
35
35
  nextCursor?: string | undefined;
36
36
  }>;
37
- /** Read the latest 20 open positions and active automation records per section without account authentication. */
38
- public: (tradeAccountId: string, headers?: ClientHeaders) => Promise<{
37
+ /** Read public positions; opt into viewer copy state with authentication and an owned account header. */
38
+ public: (tradeAccountId: string, headers?: ClientHeaders, query?: HttpTypes.PublicTraderQueryInput) => Promise<{
39
39
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
40
40
  copyingEnabled: boolean;
41
41
  followers: {
@@ -71,6 +71,9 @@ declare class Core {
71
71
  entryVwap?: string | undefined;
72
72
  };
73
73
  }[];
74
+ copySubscriptionId?: string | undefined;
75
+ copyStatus?: "COPIED" | "PARTIAL" | "PENDING" | "NOT_COPIED" | "UNKNOWN" | undefined;
76
+ copyReason?: string | undefined;
74
77
  }[];
75
78
  triggers: ({
76
79
  type: "MARKET";
@@ -6011,6 +6014,8 @@ declare class Core {
6011
6014
  createdAt: string;
6012
6015
  updatedAt: string;
6013
6016
  closedReason?: "NETTED" | "USER" | "LIQUIDATED" | null | undefined;
6017
+ copySubscriptionId?: string | undefined;
6018
+ isCopying?: boolean | undefined;
6014
6019
  closedAt?: string | null | undefined;
6015
6020
  }[];
6016
6021
  nextCursor?: string | undefined;
@@ -6074,6 +6079,8 @@ declare class Core {
6074
6079
  exitVwap?: string | undefined;
6075
6080
  }[];
6076
6081
  closedReason?: "NETTED" | "USER" | "LIQUIDATED" | undefined;
6082
+ copySubscriptionId?: string | undefined;
6083
+ isCopying?: false | undefined;
6077
6084
  steps?: {
6078
6085
  at: string;
6079
6086
  grossPnl: `-${string}` | `+${string}`;
@@ -6156,6 +6163,8 @@ declare class Core {
6156
6163
  pearFees: `-${string}` | `+${string}`;
6157
6164
  funding: `-${string}` | `+${string}`;
6158
6165
  }[];
6166
+ copySubscriptionId?: string | undefined;
6167
+ isCopying?: boolean | undefined;
6159
6168
  steps?: {
6160
6169
  at: string;
6161
6170
  grossPnl: `-${string}` | `+${string}`;
@@ -10344,7 +10353,7 @@ declare class Core {
10344
10353
  origin: "AUTO_REBALANCE";
10345
10354
  configId: string;
10346
10355
  } | undefined;
10347
- outcome?: "FAILED" | "PARTIAL" | "COPIED" | "SKIPPED" | undefined;
10356
+ outcome?: "FAILED" | "COPIED" | "PARTIAL" | "SKIPPED" | undefined;
10348
10357
  skipReason?: "SUBSCRIPTION_NOT_ACTIVE" | "POSITION_EXCLUDED" | "INCLUDED_IN_JOIN" | "VENUE_MISMATCH" | "BELOW_VENUE_MINIMUM" | "PAIR_ALREADY_ENTERED" | "ENTRY_EXPIRED" | "FOLLOWER_LEG_ABSENT" | "LEADER_LEG_REOPENED" | "NO_FOLLOWER_DELTA" | "LEADER_EQUITY_UNREADABLE" | "FOLLOWER_EQUITY_UNREADABLE" | "PRICE_UNAVAILABLE" | "LEVERAGE_NOT_APPLIED" | undefined;
10349
10358
  failureReason?: string | undefined;
10350
10359
  leaderEquityFraction?: string | undefined;
@@ -31,11 +31,12 @@ class Core {
31
31
  headers
32
32
  });
33
33
  }, "closedPositions"),
34
- /** Read the latest 20 open positions and active automation records per section without account authentication. */
35
- public: /* @__PURE__ */ __name(async (tradeAccountId, headers) => {
34
+ /** Read public positions; opt into viewer copy state with authentication and an owned account header. */
35
+ public: /* @__PURE__ */ __name(async (tradeAccountId, headers, query) => {
36
36
  return await this.client.fetch(`/traders/${encodeURIComponent(tradeAccountId)}`, {
37
37
  method: "GET",
38
- headers
38
+ headers,
39
+ query
39
40
  });
40
41
  }, "public")
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "2.7.0",
3
+ "version": "2.8.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.14.0",
29
+ "@pear-protocol/types": "^2.15.0",
30
30
  "@pear-protocol/utils": "^1.3.0",
31
31
  "qs": "^6.14.0"
32
32
  },