@pear-protocol/core-sdk 2.12.0 → 2.14.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.
@@ -6374,6 +6374,7 @@ declare class Core {
6374
6374
  count: number;
6375
6375
  pendingCount: number;
6376
6376
  totalVolumeUsd: string;
6377
+ totalEarnedUsd: string;
6377
6378
  referees: ({
6378
6379
  status: "BOUND";
6379
6380
  tradeCount: number;
@@ -6642,6 +6643,7 @@ declare class Core {
6642
6643
  executionsUpdatedAtEpochMs: number;
6643
6644
  firstSyncStartedAt?: number | undefined;
6644
6645
  confirmedExchangeFillIds?: string[] | undefined;
6646
+ hasPendingSynthetics?: boolean | undefined;
6645
6647
  }>;
6646
6648
  create: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
6647
6649
  createBulk: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
@@ -9891,6 +9893,7 @@ declare class Core {
9891
9893
  };
9892
9894
  };
9893
9895
  /**
9896
+
9894
9897
  * The signer routes every Lighter deployment exposes, bound to one deployment's base path.
9895
9898
  * zkLighter and Robinhood Chain share this whole surface; only the deployment behind it differs.
9896
9899
  */
@@ -10678,6 +10681,7 @@ declare class Core {
10678
10681
  totalUsers: number;
10679
10682
  };
10680
10683
  }>;
10684
+ /** @deprecated Use leaderboardSnapshot(slug, query) for named boards, or leaderboardArchivePeriod for history. */
10681
10685
  leaderboard: (query?: HttpTypes.LeaderboardQueryParamsInput, headers?: ClientHeaders) => Promise<{
10682
10686
  data: {
10683
10687
  tradeAccountId: string;
@@ -10708,6 +10712,92 @@ declare class Core {
10708
10712
  xUserId?: string | undefined;
10709
10713
  }[];
10710
10714
  }>;
10715
+ /** Read a board throughout its upcoming/live/final lifecycle; 503 while publication or finalization is pending. */
10716
+ leaderboardSnapshot: (slug: string, query?: HttpTypes.LeaderboardSnapshotQueryParamsInput, headers?: ClientHeaders) => Promise<{
10717
+ slug: string;
10718
+ status: "upcoming" | "live" | "final";
10719
+ sortBy: "volume" | "totalNetPnl" | "roi" | "trades";
10720
+ updatedAt: string;
10721
+ window: {
10722
+ startDate?: number | undefined;
10723
+ endDate?: number | undefined;
10724
+ };
10725
+ data: {
10726
+ tradeAccountId: string;
10727
+ userId: string;
10728
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
10729
+ followers: {
10730
+ tradeAccountId: string;
10731
+ status: "ACTIVE";
10732
+ followedAt: string;
10733
+ xUserId?: string | undefined;
10734
+ xHandle?: string | undefined;
10735
+ xName?: string | undefined;
10736
+ xAvatarUrl?: string | undefined;
10737
+ }[];
10738
+ followerCount: number;
10739
+ volume: string;
10740
+ grossRealizedPnl: string;
10741
+ grossUpnl: string;
10742
+ fundingPayment: string;
10743
+ totalNetPnl: string;
10744
+ pearFee: string;
10745
+ tradeFee: string;
10746
+ totalTrades: number;
10747
+ roi?: string | undefined;
10748
+ xHandle?: string | undefined;
10749
+ xName?: string | undefined;
10750
+ xAvatarUrl?: string | undefined;
10751
+ xUserId?: string | undefined;
10752
+ }[];
10753
+ }>;
10754
+ /** List a leaderboard's archived periods, newest first; empty for a board that never archives. */
10755
+ leaderboardArchive: (slug: string, headers?: ClientHeaders) => Promise<{
10756
+ slug: string;
10757
+ periods: {
10758
+ startDate: number;
10759
+ endDate: number;
10760
+ archivedAt: string;
10761
+ }[];
10762
+ }>;
10763
+ /** Read one archived period of a leaderboard by its unix-second start, sorted and cut on read. */
10764
+ leaderboardArchivePeriod: (slug: string, startDate: number, query?: HttpTypes.LeaderboardSnapshotQueryParamsInput, headers?: ClientHeaders) => Promise<{
10765
+ slug: string;
10766
+ sortBy: "volume" | "totalNetPnl" | "roi" | "trades";
10767
+ window: {
10768
+ startDate: number;
10769
+ endDate: number;
10770
+ };
10771
+ archivedAt: string;
10772
+ data: {
10773
+ tradeAccountId: string;
10774
+ userId: string;
10775
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
10776
+ followers: {
10777
+ tradeAccountId: string;
10778
+ status: "ACTIVE";
10779
+ followedAt: string;
10780
+ xUserId?: string | undefined;
10781
+ xHandle?: string | undefined;
10782
+ xName?: string | undefined;
10783
+ xAvatarUrl?: string | undefined;
10784
+ }[];
10785
+ followerCount: number;
10786
+ volume: string;
10787
+ grossRealizedPnl: string;
10788
+ grossUpnl: string;
10789
+ fundingPayment: string;
10790
+ totalNetPnl: string;
10791
+ pearFee: string;
10792
+ tradeFee: string;
10793
+ totalTrades: number;
10794
+ roi?: string | undefined;
10795
+ xHandle?: string | undefined;
10796
+ xName?: string | undefined;
10797
+ xAvatarUrl?: string | undefined;
10798
+ xUserId?: string | undefined;
10799
+ }[];
10800
+ }>;
10711
10801
  };
10712
10802
  tca: {
10713
10803
  execution: (executionId: string, headers?: ClientHeaders) => Promise<{
@@ -736,9 +736,10 @@ class Core {
736
736
  lighterRhc: this.buildLighterMiscRoutes("/misc/lighter-rhc")
737
737
  };
738
738
  /**
739
- * The signer routes every Lighter deployment exposes, bound to one deployment's base path.
740
- * zkLighter and Robinhood Chain share this whole surface; only the deployment behind it differs.
741
- */
739
+
740
+ * The signer routes every Lighter deployment exposes, bound to one deployment's base path.
741
+ * zkLighter and Robinhood Chain share this whole surface; only the deployment behind it differs.
742
+ */
742
743
  buildLighterMiscRoutes(basePath) {
743
744
  return {
744
745
  /** Creates a Lighter subaccount with the main account's API credentials. */
@@ -914,13 +915,37 @@ class Core {
914
915
  query
915
916
  });
916
917
  }, "totals"),
918
+ /** @deprecated Use leaderboardSnapshot(slug, query) for named boards, or leaderboardArchivePeriod for history. */
917
919
  leaderboard: /* @__PURE__ */ __name(async (query, headers) => {
918
920
  return await this.client.fetch(`/statistics/leaderboard`, {
919
921
  method: "GET",
920
922
  headers,
921
923
  query
922
924
  });
923
- }, "leaderboard")
925
+ }, "leaderboard"),
926
+ /** Read a board throughout its upcoming/live/final lifecycle; 503 while publication or finalization is pending. */
927
+ leaderboardSnapshot: /* @__PURE__ */ __name(async (slug, query, headers) => {
928
+ return await this.client.fetch(`/statistics/leaderboard/${encodeURIComponent(slug)}`, {
929
+ method: "GET",
930
+ headers,
931
+ query
932
+ });
933
+ }, "leaderboardSnapshot"),
934
+ /** List a leaderboard's archived periods, newest first; empty for a board that never archives. */
935
+ leaderboardArchive: /* @__PURE__ */ __name(async (slug, headers) => {
936
+ return await this.client.fetch(`/statistics/leaderboard/${encodeURIComponent(slug)}/archive`, {
937
+ method: "GET",
938
+ headers
939
+ });
940
+ }, "leaderboardArchive"),
941
+ /** Read one archived period of a leaderboard by its unix-second start, sorted and cut on read. */
942
+ leaderboardArchivePeriod: /* @__PURE__ */ __name(async (slug, startDate, query, headers) => {
943
+ return await this.client.fetch(`/statistics/leaderboard/${encodeURIComponent(slug)}/archive/${startDate}`, {
944
+ method: "GET",
945
+ headers,
946
+ query
947
+ });
948
+ }, "leaderboardArchivePeriod")
924
949
  };
925
950
  tca = {
926
951
  execution: /* @__PURE__ */ __name(async (executionId, headers) => {
@@ -300,15 +300,6 @@ declare class Vaults {
300
300
  };
301
301
  }>;
302
302
  agent: {
303
- /** GET /vaults/:vaultAddress/balances — fetch agent balances for a vault. */
304
- balances: (vaultAddress: string, headers?: ClientHeaders) => Promise<{
305
- agentAddress: string;
306
- spot: Record<string, string>;
307
- perp: {
308
- accountValue: string;
309
- withdrawable: string;
310
- };
311
- }>;
312
303
  /** POST /vaults/:vaultAddress/agent/approve — approve an agent action for a vault. */
313
304
  approve: (vaultAddress: string, body: HttpTypes.AgentApproveInput, headers?: ClientHeaders) => Promise<{
314
305
  result: {
@@ -121,13 +121,6 @@ class Vaults {
121
121
  });
122
122
  }, "withdrawToEvm");
123
123
  agent = {
124
- /** GET /vaults/:vaultAddress/balances — fetch agent balances for a vault. */
125
- balances: /* @__PURE__ */ __name(async (vaultAddress, headers) => {
126
- return await this.client.fetch(`/vaults/${vaultAddress}/balances`, {
127
- method: "GET",
128
- headers
129
- });
130
- }, "balances"),
131
124
  /** POST /vaults/:vaultAddress/agent/approve — approve an agent action for a vault. */
132
125
  approve: /* @__PURE__ */ __name(async (vaultAddress, body, headers) => {
133
126
  return await this.client.fetch(`/vaults/${vaultAddress}/agent/approve`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "2.12.0",
3
+ "version": "2.14.0",
4
4
  "description": "Pear Protocol Core SDK",
5
5
  "private": false,
6
6
  "type": "module",
@@ -23,11 +23,11 @@
23
23
  "build": "tsup",
24
24
  "clean": "rm -rf dist .turbo",
25
25
  "test": "vitest run",
26
- "typecheck": "tsc --noEmit"
26
+ "typecheck": "bunx --package bun@1.4.3 bun --check --threads=2"
27
27
  },
28
28
  "dependencies": {
29
- "@pear-protocol/types": "^2.19.0",
30
- "@pear-protocol/utils": "^1.4.0",
29
+ "@pear-protocol/types": "^2.21.0",
30
+ "@pear-protocol/utils": "^1.5.0",
31
31
  "qs": "^6.14.0"
32
32
  },
33
33
  "devDependencies": {