@pear-protocol/core-sdk 2.19.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 +137 -0
- package/dist/core/index.js +47 -0
- package/package.json +2 -2
package/dist/core/index.d.ts
CHANGED
|
@@ -9,6 +9,143 @@ declare class Core {
|
|
|
9
9
|
constructor(client: HttpClient, clientId?: string | null);
|
|
10
10
|
private withClientId;
|
|
11
11
|
traders: {
|
|
12
|
+
/** Page through the curated venue addresses, newest first; read their stats from the venue directly. */
|
|
13
|
+
curated: (query?: HttpTypes.CuratedTradersQueryInput, headers?: ClientHeaders) => Promise<{
|
|
14
|
+
limit: number;
|
|
15
|
+
traders: {
|
|
16
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter" | "lighter_rhc";
|
|
17
|
+
address: HttpTypes.EthereumAddress;
|
|
18
|
+
name: string;
|
|
19
|
+
source: "CURATION" | "BUILDER" | "MOST_FAVORITED" | "TOP_CLAIMED" | "HYPERLIQUID_LEADERBOARD";
|
|
20
|
+
category?: string | undefined;
|
|
21
|
+
xHandle?: string | undefined;
|
|
22
|
+
xName?: string | undefined;
|
|
23
|
+
xAvatarUrl?: string | undefined;
|
|
24
|
+
xUserId?: string | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
nextCursor?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
/** List the Hyperliquid builders whose most profitable users Pear tracks. */
|
|
29
|
+
builders: (headers?: ClientHeaders) => Promise<{
|
|
30
|
+
builders: {
|
|
31
|
+
address: HttpTypes.EthereumAddress;
|
|
32
|
+
name: string;
|
|
33
|
+
imageUrl?: string | undefined;
|
|
34
|
+
xHandle?: string | undefined;
|
|
35
|
+
snapshotAt?: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
}>;
|
|
38
|
+
/** Page a tracked builder's users ranked by PnL over a window. */
|
|
39
|
+
builderTraders: (query: HttpTypes.BuilderTradersQueryInput, headers?: ClientHeaders) => Promise<{
|
|
40
|
+
limit: number;
|
|
41
|
+
traders: {
|
|
42
|
+
rank: number;
|
|
43
|
+
address: HttpTypes.EthereumAddress;
|
|
44
|
+
pnl: string;
|
|
45
|
+
perpPnl: string;
|
|
46
|
+
volume: string;
|
|
47
|
+
equity: string;
|
|
48
|
+
identity: {
|
|
49
|
+
kind: "CURATED";
|
|
50
|
+
name: string;
|
|
51
|
+
category?: string | undefined;
|
|
52
|
+
xHandle?: string | undefined;
|
|
53
|
+
xName?: string | undefined;
|
|
54
|
+
xAvatarUrl?: string | undefined;
|
|
55
|
+
xUserId?: string | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "HYPERTRACKER";
|
|
58
|
+
displayName?: string | undefined;
|
|
59
|
+
xUserId?: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
}[];
|
|
62
|
+
nextCursor?: string | undefined;
|
|
63
|
+
snapshotAt?: string | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
/** Page the wallets HyperTracker users favorite most, all-time. */
|
|
66
|
+
mostFavorited: (query?: HttpTypes.MostFavoritedTradersQueryInput, headers?: ClientHeaders) => Promise<{
|
|
67
|
+
limit: number;
|
|
68
|
+
traders: {
|
|
69
|
+
rank: number;
|
|
70
|
+
address: HttpTypes.EthereumAddress;
|
|
71
|
+
pnlDay: string;
|
|
72
|
+
pnlWeek: string;
|
|
73
|
+
pnlMonth: string;
|
|
74
|
+
pnlAllTime: string;
|
|
75
|
+
totalEquity: string;
|
|
76
|
+
favoriteCount: number;
|
|
77
|
+
verified: boolean;
|
|
78
|
+
identity: {
|
|
79
|
+
kind: "CURATED";
|
|
80
|
+
name: string;
|
|
81
|
+
category?: string | undefined;
|
|
82
|
+
xHandle?: string | undefined;
|
|
83
|
+
xName?: string | undefined;
|
|
84
|
+
xAvatarUrl?: string | undefined;
|
|
85
|
+
xUserId?: string | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
kind: "HYPERTRACKER";
|
|
88
|
+
displayName?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
}[];
|
|
91
|
+
nextCursor?: string | undefined;
|
|
92
|
+
snapshotAt?: string | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
/** Page the claimed, verified wallets ranked by PnL over a window. */
|
|
95
|
+
topClaimed: (query?: HttpTypes.TopClaimedTradersQueryInput, headers?: ClientHeaders) => Promise<{
|
|
96
|
+
limit: number;
|
|
97
|
+
traders: {
|
|
98
|
+
rank: number;
|
|
99
|
+
address: HttpTypes.EthereumAddress;
|
|
100
|
+
pnlDay: string;
|
|
101
|
+
pnlWeek: string;
|
|
102
|
+
pnlMonth: string;
|
|
103
|
+
pnlAllTime: string;
|
|
104
|
+
totalEquity: string;
|
|
105
|
+
favoriteCount: number;
|
|
106
|
+
verified: boolean;
|
|
107
|
+
identity: {
|
|
108
|
+
kind: "CURATED";
|
|
109
|
+
name: string;
|
|
110
|
+
category?: string | undefined;
|
|
111
|
+
xHandle?: string | undefined;
|
|
112
|
+
xName?: string | undefined;
|
|
113
|
+
xAvatarUrl?: string | undefined;
|
|
114
|
+
xUserId?: string | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
kind: "HYPERTRACKER";
|
|
117
|
+
displayName?: string | undefined;
|
|
118
|
+
};
|
|
119
|
+
}[];
|
|
120
|
+
nextCursor?: string | undefined;
|
|
121
|
+
snapshotAt?: string | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
/** Page Hyperliquid's public leaderboard: the top 50 by PnL or by ROI over a window. */
|
|
124
|
+
hyperliquidLeaderboard: (query?: HttpTypes.HyperliquidLeaderboardQueryInput, headers?: ClientHeaders) => Promise<{
|
|
125
|
+
limit: number;
|
|
126
|
+
traders: {
|
|
127
|
+
rank: number;
|
|
128
|
+
address: HttpTypes.EthereumAddress;
|
|
129
|
+
pnl: string;
|
|
130
|
+
roi: string;
|
|
131
|
+
volume: string;
|
|
132
|
+
accountValue: string;
|
|
133
|
+
identity: {
|
|
134
|
+
kind: "CURATED";
|
|
135
|
+
name: string;
|
|
136
|
+
category?: string | undefined;
|
|
137
|
+
xHandle?: string | undefined;
|
|
138
|
+
xName?: string | undefined;
|
|
139
|
+
xAvatarUrl?: string | undefined;
|
|
140
|
+
xUserId?: string | undefined;
|
|
141
|
+
} | {
|
|
142
|
+
kind: "HYPERLIQUID";
|
|
143
|
+
displayName?: string | undefined;
|
|
144
|
+
};
|
|
145
|
+
}[];
|
|
146
|
+
nextCursor?: string | undefined;
|
|
147
|
+
snapshotAt?: string | undefined;
|
|
148
|
+
}>;
|
|
12
149
|
/** Read one ordered account chart series for an active public trader. */
|
|
13
150
|
performance: (tradeAccountId: string, query?: HttpTypes.TraderPerformanceQueryInput, headers?: ClientHeaders) => Promise<{
|
|
14
151
|
points: {
|
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`, {
|
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,7 +26,7 @@
|
|
|
26
26
|
"typecheck": "bunx --package bun@1.4.3 bun --check --threads=2"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pear-protocol/types": "^2.
|
|
29
|
+
"@pear-protocol/types": "^2.29.0",
|
|
30
30
|
"@pear-protocol/utils": "^1.8.0",
|
|
31
31
|
"qs": "^6.14.0"
|
|
32
32
|
},
|