@pear-protocol/core-sdk 2.5.1 → 2.7.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.
@@ -37,7 +37,7 @@ declare class Core {
37
37
  /** Read the latest 20 open positions and active automation records per section without account authentication. */
38
38
  public: (tradeAccountId: string, headers?: ClientHeaders) => Promise<{
39
39
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
40
- exchangeIdentifier: string;
40
+ copyingEnabled: boolean;
41
41
  followers: {
42
42
  tradeAccountId: string;
43
43
  status: "ACTIVE";
@@ -1441,6 +1441,10 @@ declare class Core {
1441
1441
  };
1442
1442
  })[] | undefined;
1443
1443
  }[];
1444
+ xHandle?: string | undefined;
1445
+ xName?: string | undefined;
1446
+ xAvatarUrl?: string | undefined;
1447
+ xUserId?: string | undefined;
1444
1448
  }>;
1445
1449
  };
1446
1450
  accounts: {
@@ -6122,6 +6126,8 @@ declare class Core {
6122
6126
  updatedAt: string;
6123
6127
  origin: "PARTIAL" | "PEAR" | "EXTERNAL";
6124
6128
  realizedGrossPnl: `-${string}` | `+${string}`;
6129
+ volume: string;
6130
+ grossUpnl: `-${string}` | `+${string}`;
6125
6131
  netCashflow: `-${string}` | `+${string}`;
6126
6132
  totalFees: `-${string}` | `+${string}`;
6127
6133
  tradeFees: `-${string}` | `+${string}`;
@@ -10187,6 +10193,13 @@ declare class Core {
10187
10193
  };
10188
10194
  createdAt: string;
10189
10195
  status: "ACTIVE";
10196
+ volume: string;
10197
+ grossRealizedPnl: `-${string}` | `+${string}`;
10198
+ grossUpnl: `-${string}` | `+${string}`;
10199
+ fundingPayment: `-${string}` | `+${string}`;
10200
+ tradeFee: `-${string}` | `+${string}`;
10201
+ pearFee: `-${string}` | `+${string}`;
10202
+ totalNetPnl: `-${string}` | `+${string}`;
10190
10203
  endedAt?: string | undefined;
10191
10204
  };
10192
10205
  }>;
@@ -10220,20 +10233,39 @@ declare class Core {
10220
10233
  xAvatarUrl?: string | undefined;
10221
10234
  }[];
10222
10235
  }>;
10223
- /** Read subscription history; use copy.state for the current relationship of one account. */
10224
- listSubscriptions: (headers?: ClientHeaders) => Promise<{
10225
- subscriptions: {
10236
+ /** Read subscription history, optionally by status; use copy.state for one account's current relationship. */
10237
+ listSubscriptions: (headers?: ClientHeaders, query?: HttpTypes.CopySubscriptionListQueryInput) => Promise<{
10238
+ subscriptions: ({
10226
10239
  id: string;
10227
10240
  leaderTradeAccountId: string;
10228
10241
  followerTradeAccountId: string;
10229
10242
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
10230
- status: "ACTIVE" | "ENDED";
10231
10243
  sizing: {
10232
10244
  mode: "LEADER_EQUITY_FRACTION";
10233
10245
  };
10234
10246
  createdAt: string;
10247
+ status: "ACTIVE";
10248
+ volume: string;
10249
+ grossRealizedPnl: `-${string}` | `+${string}`;
10250
+ grossUpnl: `-${string}` | `+${string}`;
10251
+ fundingPayment: `-${string}` | `+${string}`;
10252
+ tradeFee: `-${string}` | `+${string}`;
10253
+ pearFee: `-${string}` | `+${string}`;
10254
+ totalNetPnl: `-${string}` | `+${string}`;
10235
10255
  endedAt?: string | undefined;
10236
- }[];
10256
+ } | {
10257
+ id: string;
10258
+ leaderTradeAccountId: string;
10259
+ followerTradeAccountId: string;
10260
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
10261
+ sizing: {
10262
+ mode: "LEADER_EQUITY_FRACTION";
10263
+ };
10264
+ createdAt: string;
10265
+ status: "ENDED";
10266
+ volume: string;
10267
+ endedAt?: string | undefined;
10268
+ })[];
10237
10269
  }>;
10238
10270
  /** Start copying into the account selected by x-trade-account-id, syncing existing positions by default. */
10239
10271
  subscribe: (body: HttpTypes.CreateCopySubscriptionInput, headers?: ClientHeaders) => Promise<{
@@ -10350,6 +10382,7 @@ declare class Core {
10350
10382
  tradeAccountId: string;
10351
10383
  userId: string;
10352
10384
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
10385
+ copyingEnabled: boolean;
10353
10386
  followers: {
10354
10387
  tradeAccountId: string;
10355
10388
  status: "ACTIVE";
@@ -861,11 +861,12 @@ class Core {
861
861
  query
862
862
  });
863
863
  }, "stats"),
864
- /** Read subscription history; use copy.state for the current relationship of one account. */
865
- listSubscriptions: /* @__PURE__ */ __name(async (headers) => {
864
+ /** Read subscription history, optionally by status; use copy.state for one account's current relationship. */
865
+ listSubscriptions: /* @__PURE__ */ __name(async (headers, query) => {
866
866
  return await this.client.fetch(`/copy/subscriptions`, {
867
867
  method: "GET",
868
- headers
868
+ headers,
869
+ query
869
870
  });
870
871
  }, "listSubscriptions"),
871
872
  /** Start copying into the account selected by x-trade-account-id, syncing existing positions by default. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "2.5.1",
3
+ "version": "2.7.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.1",
29
+ "@pear-protocol/types": "^2.14.0",
30
30
  "@pear-protocol/utils": "^1.3.0",
31
31
  "qs": "^6.14.0"
32
32
  },