@pear-protocol/core-sdk 2.13.0 → 2.14.1
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 +104 -1
- package/dist/core/index.js +29 -4
- package/package.json +4 -4
package/dist/core/index.d.ts
CHANGED
|
@@ -2379,13 +2379,24 @@ declare class Core {
|
|
|
2379
2379
|
get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2380
2380
|
baseBps: string;
|
|
2381
2381
|
discounts: {
|
|
2382
|
-
scope: "connector" | "all" | "
|
|
2382
|
+
scope: "user" | "connector" | "all" | "client_id" | "referral";
|
|
2383
2383
|
rate: string;
|
|
2384
2384
|
}[];
|
|
2385
2385
|
finalBps: string;
|
|
2386
2386
|
feeRecipient?: string | undefined;
|
|
2387
2387
|
overrideBps?: string | undefined;
|
|
2388
2388
|
overrideScope?: "user" | "client_id" | undefined;
|
|
2389
|
+
stpearPricing?: {
|
|
2390
|
+
scheduleVersion: string;
|
|
2391
|
+
observedBalance: string;
|
|
2392
|
+
observedAt: string;
|
|
2393
|
+
tierDiscountRate: string;
|
|
2394
|
+
feeWithoutStpearBps: string;
|
|
2395
|
+
observedBlock?: string | undefined;
|
|
2396
|
+
tierName?: string | undefined;
|
|
2397
|
+
tierMinimumBalance?: string | undefined;
|
|
2398
|
+
nextTierMinimumBalance?: string | undefined;
|
|
2399
|
+
} | undefined;
|
|
2389
2400
|
}>;
|
|
2390
2401
|
recipient: (query: HttpTypes.GetFeeRecipientParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2391
2402
|
recipient?: string | undefined;
|
|
@@ -6374,10 +6385,13 @@ declare class Core {
|
|
|
6374
6385
|
count: number;
|
|
6375
6386
|
pendingCount: number;
|
|
6376
6387
|
totalVolumeUsd: string;
|
|
6388
|
+
totalEarnedUsd: string;
|
|
6377
6389
|
referees: ({
|
|
6378
6390
|
status: "BOUND";
|
|
6379
6391
|
tradeCount: number;
|
|
6380
6392
|
volumeUsd: string;
|
|
6393
|
+
feesPaid: string;
|
|
6394
|
+
earned: string;
|
|
6381
6395
|
address?: HttpTypes.EthereumAddress | undefined;
|
|
6382
6396
|
referredAt?: number | undefined;
|
|
6383
6397
|
} | {
|
|
@@ -6642,6 +6656,7 @@ declare class Core {
|
|
|
6642
6656
|
executionsUpdatedAtEpochMs: number;
|
|
6643
6657
|
firstSyncStartedAt?: number | undefined;
|
|
6644
6658
|
confirmedExchangeFillIds?: string[] | undefined;
|
|
6659
|
+
hasPendingSynthetics?: boolean | undefined;
|
|
6645
6660
|
}>;
|
|
6646
6661
|
create: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
6647
6662
|
createBulk: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
@@ -9891,6 +9906,7 @@ declare class Core {
|
|
|
9891
9906
|
};
|
|
9892
9907
|
};
|
|
9893
9908
|
/**
|
|
9909
|
+
|
|
9894
9910
|
* The signer routes every Lighter deployment exposes, bound to one deployment's base path.
|
|
9895
9911
|
* zkLighter and Robinhood Chain share this whole surface; only the deployment behind it differs.
|
|
9896
9912
|
*/
|
|
@@ -10678,6 +10694,7 @@ declare class Core {
|
|
|
10678
10694
|
totalUsers: number;
|
|
10679
10695
|
};
|
|
10680
10696
|
}>;
|
|
10697
|
+
/** @deprecated Use leaderboardSnapshot(slug, query) for named boards, or leaderboardArchivePeriod for history. */
|
|
10681
10698
|
leaderboard: (query?: HttpTypes.LeaderboardQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
10682
10699
|
data: {
|
|
10683
10700
|
tradeAccountId: string;
|
|
@@ -10708,6 +10725,92 @@ declare class Core {
|
|
|
10708
10725
|
xUserId?: string | undefined;
|
|
10709
10726
|
}[];
|
|
10710
10727
|
}>;
|
|
10728
|
+
/** Read a board throughout its upcoming/live/final lifecycle; 503 while publication or finalization is pending. */
|
|
10729
|
+
leaderboardSnapshot: (slug: string, query?: HttpTypes.LeaderboardSnapshotQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
10730
|
+
slug: string;
|
|
10731
|
+
status: "upcoming" | "live" | "final";
|
|
10732
|
+
sortBy: "volume" | "totalNetPnl" | "roi" | "trades";
|
|
10733
|
+
updatedAt: string;
|
|
10734
|
+
window: {
|
|
10735
|
+
startDate?: number | undefined;
|
|
10736
|
+
endDate?: number | undefined;
|
|
10737
|
+
};
|
|
10738
|
+
data: {
|
|
10739
|
+
tradeAccountId: string;
|
|
10740
|
+
userId: string;
|
|
10741
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
|
|
10742
|
+
followers: {
|
|
10743
|
+
tradeAccountId: string;
|
|
10744
|
+
status: "ACTIVE";
|
|
10745
|
+
followedAt: string;
|
|
10746
|
+
xUserId?: string | undefined;
|
|
10747
|
+
xHandle?: string | undefined;
|
|
10748
|
+
xName?: string | undefined;
|
|
10749
|
+
xAvatarUrl?: string | undefined;
|
|
10750
|
+
}[];
|
|
10751
|
+
followerCount: number;
|
|
10752
|
+
volume: string;
|
|
10753
|
+
grossRealizedPnl: string;
|
|
10754
|
+
grossUpnl: string;
|
|
10755
|
+
fundingPayment: string;
|
|
10756
|
+
totalNetPnl: string;
|
|
10757
|
+
pearFee: string;
|
|
10758
|
+
tradeFee: string;
|
|
10759
|
+
totalTrades: number;
|
|
10760
|
+
roi?: string | undefined;
|
|
10761
|
+
xHandle?: string | undefined;
|
|
10762
|
+
xName?: string | undefined;
|
|
10763
|
+
xAvatarUrl?: string | undefined;
|
|
10764
|
+
xUserId?: string | undefined;
|
|
10765
|
+
}[];
|
|
10766
|
+
}>;
|
|
10767
|
+
/** List a leaderboard's archived periods, newest first; empty for a board that never archives. */
|
|
10768
|
+
leaderboardArchive: (slug: string, headers?: ClientHeaders) => Promise<{
|
|
10769
|
+
slug: string;
|
|
10770
|
+
periods: {
|
|
10771
|
+
startDate: number;
|
|
10772
|
+
endDate: number;
|
|
10773
|
+
archivedAt: string;
|
|
10774
|
+
}[];
|
|
10775
|
+
}>;
|
|
10776
|
+
/** Read one archived period of a leaderboard by its unix-second start, sorted and cut on read. */
|
|
10777
|
+
leaderboardArchivePeriod: (slug: string, startDate: number, query?: HttpTypes.LeaderboardSnapshotQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
10778
|
+
slug: string;
|
|
10779
|
+
sortBy: "volume" | "totalNetPnl" | "roi" | "trades";
|
|
10780
|
+
window: {
|
|
10781
|
+
startDate: number;
|
|
10782
|
+
endDate: number;
|
|
10783
|
+
};
|
|
10784
|
+
archivedAt: string;
|
|
10785
|
+
data: {
|
|
10786
|
+
tradeAccountId: string;
|
|
10787
|
+
userId: string;
|
|
10788
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
|
|
10789
|
+
followers: {
|
|
10790
|
+
tradeAccountId: string;
|
|
10791
|
+
status: "ACTIVE";
|
|
10792
|
+
followedAt: string;
|
|
10793
|
+
xUserId?: string | undefined;
|
|
10794
|
+
xHandle?: string | undefined;
|
|
10795
|
+
xName?: string | undefined;
|
|
10796
|
+
xAvatarUrl?: string | undefined;
|
|
10797
|
+
}[];
|
|
10798
|
+
followerCount: number;
|
|
10799
|
+
volume: string;
|
|
10800
|
+
grossRealizedPnl: string;
|
|
10801
|
+
grossUpnl: string;
|
|
10802
|
+
fundingPayment: string;
|
|
10803
|
+
totalNetPnl: string;
|
|
10804
|
+
pearFee: string;
|
|
10805
|
+
tradeFee: string;
|
|
10806
|
+
totalTrades: number;
|
|
10807
|
+
roi?: string | undefined;
|
|
10808
|
+
xHandle?: string | undefined;
|
|
10809
|
+
xName?: string | undefined;
|
|
10810
|
+
xAvatarUrl?: string | undefined;
|
|
10811
|
+
xUserId?: string | undefined;
|
|
10812
|
+
}[];
|
|
10813
|
+
}>;
|
|
10711
10814
|
};
|
|
10712
10815
|
tca: {
|
|
10713
10816
|
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.1",
|
|
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.22.0",
|
|
30
|
+
"@pear-protocol/utils": "^1.5.0",
|
|
31
31
|
"qs": "^6.14.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|