@pear-protocol/core-sdk 2.18.0 → 2.20.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 +1603 -209
- package/dist/core/index.js +60 -1
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/core/index.js
CHANGED
|
@@ -21,6 +21,53 @@ class Core {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
traders = {
|
|
24
|
+
/** Page through the curated venue addresses, newest first; read their stats from the venue directly. */
|
|
25
|
+
curated: /* @__PURE__ */ __name(async (query, headers) => {
|
|
26
|
+
return await this.client.fetch("/traders/curated", {
|
|
27
|
+
method: "GET",
|
|
28
|
+
query,
|
|
29
|
+
headers
|
|
30
|
+
});
|
|
31
|
+
}, "curated"),
|
|
32
|
+
/** List the Hyperliquid builders whose most profitable users Pear tracks. */
|
|
33
|
+
builders: /* @__PURE__ */ __name(async (headers) => {
|
|
34
|
+
return await this.client.fetch("/traders/builders", {
|
|
35
|
+
method: "GET",
|
|
36
|
+
headers
|
|
37
|
+
});
|
|
38
|
+
}, "builders"),
|
|
39
|
+
/** Page a tracked builder's users ranked by PnL over a window. */
|
|
40
|
+
builderTraders: /* @__PURE__ */ __name(async (query, headers) => {
|
|
41
|
+
return await this.client.fetch("/traders/builder-traders", {
|
|
42
|
+
method: "GET",
|
|
43
|
+
query,
|
|
44
|
+
headers
|
|
45
|
+
});
|
|
46
|
+
}, "builderTraders"),
|
|
47
|
+
/** Page the wallets HyperTracker users favorite most, all-time. */
|
|
48
|
+
mostFavorited: /* @__PURE__ */ __name(async (query, headers) => {
|
|
49
|
+
return await this.client.fetch("/traders/most-favorited", {
|
|
50
|
+
method: "GET",
|
|
51
|
+
query,
|
|
52
|
+
headers
|
|
53
|
+
});
|
|
54
|
+
}, "mostFavorited"),
|
|
55
|
+
/** Page the claimed, verified wallets ranked by PnL over a window. */
|
|
56
|
+
topClaimed: /* @__PURE__ */ __name(async (query, headers) => {
|
|
57
|
+
return await this.client.fetch("/traders/top-claimed", {
|
|
58
|
+
method: "GET",
|
|
59
|
+
query,
|
|
60
|
+
headers
|
|
61
|
+
});
|
|
62
|
+
}, "topClaimed"),
|
|
63
|
+
/** Page Hyperliquid's public leaderboard: the top 50 by PnL or by ROI over a window. */
|
|
64
|
+
hyperliquidLeaderboard: /* @__PURE__ */ __name(async (query, headers) => {
|
|
65
|
+
return await this.client.fetch("/traders/hyperliquid-leaderboard", {
|
|
66
|
+
method: "GET",
|
|
67
|
+
query,
|
|
68
|
+
headers
|
|
69
|
+
});
|
|
70
|
+
}, "hyperliquidLeaderboard"),
|
|
24
71
|
/** Read one ordered account chart series for an active public trader. */
|
|
25
72
|
performance: /* @__PURE__ */ __name(async (tradeAccountId, query, headers) => {
|
|
26
73
|
return await this.client.fetch(`/traders/${encodeURIComponent(tradeAccountId)}/performance`, {
|
|
@@ -200,7 +247,19 @@ class Core {
|
|
|
200
247
|
method: "GET",
|
|
201
248
|
headers
|
|
202
249
|
});
|
|
203
|
-
}, "get")
|
|
250
|
+
}, "get"),
|
|
251
|
+
cancel: /* @__PURE__ */ __name(async (id, headers) => {
|
|
252
|
+
return await this.client.fetch(`/executions/${id}/cancel`, {
|
|
253
|
+
method: "POST",
|
|
254
|
+
headers
|
|
255
|
+
});
|
|
256
|
+
}, "cancel"),
|
|
257
|
+
complete: /* @__PURE__ */ __name(async (id, headers) => {
|
|
258
|
+
return await this.client.fetch(`/executions/${id}/complete`, {
|
|
259
|
+
method: "POST",
|
|
260
|
+
headers
|
|
261
|
+
});
|
|
262
|
+
}, "complete")
|
|
204
263
|
};
|
|
205
264
|
fills = {
|
|
206
265
|
/** Read one position's assigned quantities and fees at the original receipt price. */
|
package/dist/types.d.ts
CHANGED
|
@@ -162,6 +162,6 @@ type FetchArgs = Omit<RequestInit, 'headers' | 'body'> & {
|
|
|
162
162
|
};
|
|
163
163
|
type RequestMiddleware = (request: Request, next: () => Promise<Response>) => Promise<Response>;
|
|
164
164
|
type ResponseMiddleware = (response: Response, retry: () => Promise<Response>, request: Request) => Promise<Response>;
|
|
165
|
-
type ClientIdBody = HttpTypes.RebalanceManual | HttpTypes.CreateSchedule | HttpTypes.
|
|
165
|
+
type ClientIdBody = HttpTypes.RebalanceManual | HttpTypes.CreateSchedule | HttpTypes.CreateTradeOpenInput | HttpTypes.CreateTradeAdjust | HttpTypes.CreateTradeClose | HttpTypes.CreateTradeCloseAll | HttpTypes.CreateTriggerOpen | HttpTypes.CreateTriggerClose;
|
|
166
166
|
|
|
167
167
|
export type { AuthErrorContext, AuthMode, ClientHeaders, ClientIdBody, FetchArgs, FetchInput, FetchParams, Logger, RequestMiddleware, ResponseMiddleware, SDKConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
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.29.0",
|
|
30
|
+
"@pear-protocol/utils": "^1.8.0",
|
|
31
31
|
"qs": "^6.14.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|