@pear-protocol/core-sdk 2.13.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.
- package/dist/core/index.d.ts +91 -1
- package/dist/core/index.js +29 -4
- package/package.json +4 -4
package/dist/core/index.d.ts
CHANGED
|
@@ -2379,7 +2379,7 @@ declare class Core {
|
|
|
2379
2379
|
get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2380
2380
|
baseBps: string;
|
|
2381
2381
|
discounts: {
|
|
2382
|
-
scope: "
|
|
2382
|
+
scope: "user" | "connector" | "all" | "client_id";
|
|
2383
2383
|
rate: string;
|
|
2384
2384
|
}[];
|
|
2385
2385
|
finalBps: string;
|
|
@@ -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<{
|
package/dist/core/index.js
CHANGED
|
@@ -736,9 +736,10 @@ class Core {
|
|
|
736
736
|
lighterRhc: this.buildLighterMiscRoutes("/misc/lighter-rhc")
|
|
737
737
|
};
|
|
738
738
|
/**
|
|
739
|
-
|
|
740
|
-
|
|
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) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "2.
|
|
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": "
|
|
26
|
+
"typecheck": "bunx --package bun@1.4.3 bun --check --threads=2"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pear-protocol/types": "^2.
|
|
30
|
-
"@pear-protocol/utils": "^1.
|
|
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": {
|