solana-agent-kit-plugin-madeonsol 1.3.0 → 1.4.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/index.js DELETED
@@ -1,82 +0,0 @@
1
- import { kolFeedAction } from "./actions/kolFeed.js";
2
- import { kolCoordinationAction } from "./actions/kolCoordination.js";
3
- import { kolLeaderboardAction } from "./actions/kolLeaderboard.js";
4
- import { deployerAlertsAction } from "./actions/deployerAlerts.js";
5
- import { kolPnlAction } from "./actions/kolPnl.js";
6
- import { kolTrendingTokensAction } from "./actions/kolTrendingTokens.js";
7
- import { walletTrackerWatchlistAction, walletTrackerAddAction, walletTrackerRemoveAction, walletTrackerTradesAction, walletTrackerSummaryAction } from "./actions/walletTracker.js";
8
- import { kolTokenEntryOrderAction } from "./actions/kolTokenEntryOrder.js";
9
- import { kolCompareAction } from "./actions/kolCompare.js";
10
- import { kolAlertsRecentAction } from "./actions/kolAlertsRecent.js";
11
- import { kolFirstTouchesAction } from "./actions/kolFirstTouches.js";
12
- import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary, alphaLeaderboard, alphaWallet, alphaLinked, tokenCapTable, tokenBuyerQuality, copyTradeList, copyTradeCreate, copyTradeGet, copyTradeUpdate, copyTradeDelete, copyTradeSignals, coordinationAlertsList, coordinationAlertsCreate, coordinationAlertsGet, coordinationAlertsUpdate, coordinationAlertsDelete, kolFirstTouches, firstTouchSubscriptionsList, firstTouchSubscriptionsCreate, firstTouchSubscriptionsGet, firstTouchSubscriptionsUpdate, firstTouchSubscriptionsDelete, } from "./tools/index.js";
13
- const MadeOnSolPlugin = {
14
- name: "madeonsol",
15
- methods: {
16
- kolFeed,
17
- kolCoordination,
18
- kolLeaderboard,
19
- deployerAlerts,
20
- kolPnl,
21
- kolTrendingTokens,
22
- kolTokenEntryOrder,
23
- kolCompare,
24
- kolAlertsRecent,
25
- createWebhook,
26
- listWebhooks,
27
- deleteWebhook,
28
- testWebhook,
29
- getStreamToken,
30
- walletTrackerWatchlist,
31
- walletTrackerAdd,
32
- walletTrackerRemove,
33
- walletTrackerTrades,
34
- walletTrackerSummary,
35
- alphaLeaderboard,
36
- alphaWallet,
37
- alphaLinked,
38
- tokenCapTable,
39
- tokenBuyerQuality,
40
- copyTradeList,
41
- copyTradeCreate,
42
- copyTradeGet,
43
- copyTradeUpdate,
44
- copyTradeDelete,
45
- copyTradeSignals,
46
- coordinationAlertsList,
47
- coordinationAlertsCreate,
48
- coordinationAlertsGet,
49
- coordinationAlertsUpdate,
50
- coordinationAlertsDelete,
51
- kolFirstTouches,
52
- firstTouchSubscriptionsList,
53
- firstTouchSubscriptionsCreate,
54
- firstTouchSubscriptionsGet,
55
- firstTouchSubscriptionsUpdate,
56
- firstTouchSubscriptionsDelete,
57
- },
58
- actions: [
59
- kolFeedAction,
60
- kolCoordinationAction,
61
- kolLeaderboardAction,
62
- deployerAlertsAction,
63
- kolPnlAction,
64
- kolTrendingTokensAction,
65
- kolTokenEntryOrderAction,
66
- kolCompareAction,
67
- kolAlertsRecentAction,
68
- kolFirstTouchesAction,
69
- walletTrackerWatchlistAction,
70
- walletTrackerAddAction,
71
- walletTrackerRemoveAction,
72
- walletTrackerTradesAction,
73
- walletTrackerSummaryAction,
74
- ],
75
- initialize(_agent) {
76
- // No-op — payment setup is lazy in tool functions
77
- },
78
- };
79
- export default MadeOnSolPlugin;
80
- export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary, alphaLeaderboard, alphaWallet, alphaLinked, tokenCapTable, tokenBuyerQuality, copyTradeList, copyTradeCreate, copyTradeGet, copyTradeUpdate, copyTradeDelete, copyTradeSignals, coordinationAlertsList, coordinationAlertsCreate, coordinationAlertsGet, coordinationAlertsUpdate, coordinationAlertsDelete, kolFirstTouches, firstTouchSubscriptionsList, firstTouchSubscriptionsCreate, firstTouchSubscriptionsGet, firstTouchSubscriptionsUpdate, firstTouchSubscriptionsDelete, };
81
- export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction, kolPnlAction, kolTrendingTokensAction, kolTokenEntryOrderAction, kolCompareAction, kolAlertsRecentAction, kolFirstTouchesAction };
82
- export { walletTrackerWatchlistAction, walletTrackerAddAction, walletTrackerRemoveAction, walletTrackerTradesAction, walletTrackerSummaryAction };
@@ -1,248 +0,0 @@
1
- /**
2
- * Tool functions — pure logic that calls MadeOnSol API.
3
- * Auth priority: MADEONSOL_API_KEY > SVM_PRIVATE_KEY (x402).
4
- *
5
- * v1.0 breaking change: RAPIDAPI_KEY support has been removed
6
- * (MadeOnSol RapidAPI marketplace was retired 2026-04-19).
7
- * Get a free `msk_` key at https://madeonsol.com/developer.
8
- */
9
- type Agent = any;
10
- export interface RateLimitInfo {
11
- limit?: string;
12
- remaining?: string;
13
- reset?: string;
14
- requestId?: string;
15
- }
16
- /** Most recent rate-limit headers, populated by every successful API request. */
17
- export declare let lastRateLimit: RateLimitInfo;
18
- export declare function initAuth(agent: Agent): Promise<void>;
19
- /** @deprecated Use initAuth instead */
20
- export declare function initPaidFetch(agent: Agent): Promise<typeof fetch>;
21
- export declare function kolFeed(agent: Agent, params?: {
22
- limit?: number;
23
- before?: string;
24
- action?: string;
25
- kol?: string;
26
- min_sol?: number;
27
- token_age_max_min?: number;
28
- exclude_sells?: boolean;
29
- min_kol_winrate?: number;
30
- strategy?: string;
31
- }): Promise<any>;
32
- export declare function kolCoordination(agent: Agent, params?: {
33
- period?: string;
34
- min_kols?: number;
35
- limit?: number;
36
- min_avg_winrate?: number;
37
- unique_strategies?: number;
38
- /** v1.1 — include WIF/BONK/POPCAT etc. Default false. */
39
- include_majors?: boolean;
40
- /** v1.1 — peak-density window in minutes (1-60, default 15). */
41
- window_minutes?: number;
42
- /** v1.1 — minimum composite coordination_score (0-100). */
43
- min_score?: number;
44
- }): Promise<any>;
45
- export declare function kolLeaderboard(agent: Agent, params?: {
46
- period?: string;
47
- limit?: number;
48
- }): Promise<any>;
49
- /**
50
- * Get Pump.fun deployer alerts with KOL buy enrichment.
51
- * The `tier` filter (elite/good/moderate/rising/cold) is PRO/ULTRA only —
52
- * BASIC callers passing it receive HTTP 403.
53
- */
54
- export declare function deployerAlerts(agent: Agent, params?: {
55
- limit?: number;
56
- since?: string;
57
- before?: string;
58
- offset?: number;
59
- tier?: "elite" | "good" | "moderate" | "rising" | "cold";
60
- alert_type?: string;
61
- priority?: "high" | "medium" | "low";
62
- min_kol_buys?: number;
63
- }): Promise<any>;
64
- export declare function kolPairs(agent: Agent, params?: {
65
- period?: string;
66
- min_shared?: number;
67
- limit?: number;
68
- }): Promise<any>;
69
- export declare function kolHotTokens(agent: Agent, params?: {
70
- period?: string;
71
- min_kols?: number;
72
- limit?: number;
73
- }): Promise<any>;
74
- export declare function kolTrendingTokens(agent: Agent, params?: {
75
- period?: string;
76
- min_kols?: number;
77
- limit?: number;
78
- }): Promise<any>;
79
- export declare function kolTokenEntryOrder(agent: Agent, params: {
80
- mint: string;
81
- limit?: number;
82
- }): Promise<any>;
83
- export declare function kolCompare(agent: Agent, params: {
84
- wallets: string[];
85
- }): Promise<any>;
86
- export declare function kolAlertsRecent(agent: Agent, params?: {
87
- window?: string;
88
- types?: string[];
89
- min_severity?: string;
90
- limit?: number;
91
- }): Promise<any>;
92
- export declare function kolPnl(agent: Agent, params: {
93
- wallet: string;
94
- period?: string;
95
- }): Promise<any>;
96
- export declare function kolTiming(agent: Agent, params: {
97
- wallet: string;
98
- period?: string;
99
- }): Promise<any>;
100
- export declare function deployerTrajectory(agent: Agent, params: {
101
- wallet: string;
102
- }): Promise<any>;
103
- export declare function createWebhook(agent: Agent, params: {
104
- url: string;
105
- events: string[];
106
- filters?: Record<string, unknown>;
107
- }): Promise<any>;
108
- export declare function listWebhooks(agent: Agent): Promise<any>;
109
- export declare function deleteWebhook(agent: Agent, params: {
110
- id: number;
111
- }): Promise<any>;
112
- export declare function testWebhook(agent: Agent, params: {
113
- webhook_id: number;
114
- }): Promise<any>;
115
- export declare function getStreamToken(agent: Agent): Promise<any>;
116
- export declare function walletTrackerWatchlist(agent: Agent): Promise<any>;
117
- export declare function walletTrackerAdd(agent: Agent, params: {
118
- wallet_address: string;
119
- label?: string;
120
- }): Promise<any>;
121
- export declare function walletTrackerRemove(agent: Agent, params: {
122
- wallet_address: string;
123
- }): Promise<any>;
124
- export declare function walletTrackerTrades(agent: Agent, params?: {
125
- wallet?: string;
126
- action?: string;
127
- event_type?: string;
128
- limit?: number;
129
- before?: number;
130
- }): Promise<any>;
131
- export declare function walletTrackerSummary(agent: Agent, params?: {
132
- period?: string;
133
- wallet?: string;
134
- }): Promise<any>;
135
- export declare function alphaLeaderboard(agent: Agent, params?: {
136
- limit?: number;
137
- min_tokens?: number;
138
- min_pnl?: number;
139
- }): Promise<any>;
140
- export declare function alphaWallet(agent: Agent, params: {
141
- wallet: string;
142
- }): Promise<any>;
143
- export declare function alphaLinked(agent: Agent, params: {
144
- wallet: string;
145
- }): Promise<any>;
146
- export declare function tokenCapTable(agent: Agent, params: {
147
- mint: string;
148
- }): Promise<any>;
149
- export declare function tokenBuyerQuality(agent: Agent, params: {
150
- mint: string;
151
- }): Promise<any>;
152
- /** Bulk buyer-quality scoring for up to 50 mints. Shares the 5-min LRU cache with the single-mint endpoint. */
153
- export declare function tokenBuyerQualityBatch(agent: Agent, params: {
154
- mints: string[];
155
- }): Promise<any>;
156
- /** Comprehensive per-mint snapshot: price, MC, 24h volume, deployer reputation, KOL activity, age, blacklist status. */
157
- export declare function tokenGet(agent: Agent, params: {
158
- mint: string;
159
- }): Promise<any>;
160
- /** Bulk token snapshot for up to 50 mints — same per-mint shape as tokenGet(). 10-20× cheaper than N sequential calls. */
161
- export declare function tokenBatch(agent: Agent, params: {
162
- mints: string[];
163
- }): Promise<any>;
164
- export declare function copyTradeList(agent: Agent): Promise<any>;
165
- export declare function copyTradeCreate(agent: Agent, params: {
166
- name: string;
167
- source_wallet: string;
168
- is_active?: boolean;
169
- webhook_url?: string;
170
- delivery?: "webhook" | "websocket" | "both";
171
- filters?: Record<string, unknown>;
172
- }): Promise<any>;
173
- export declare function copyTradeGet(agent: Agent, params: {
174
- rule_id: string;
175
- }): Promise<any>;
176
- export declare function copyTradeUpdate(agent: Agent, params: {
177
- rule_id: string;
178
- updates: Record<string, unknown>;
179
- }): Promise<any>;
180
- export declare function copyTradeDelete(agent: Agent, params: {
181
- rule_id: string;
182
- }): Promise<any>;
183
- export declare function coordinationAlertsList(agent: Agent): Promise<any>;
184
- export declare function coordinationAlertsCreate(agent: Agent, params: {
185
- name?: string;
186
- min_kols?: number;
187
- window_minutes?: number;
188
- min_score?: number;
189
- include_majors?: boolean;
190
- cooldown_min?: number;
191
- score_jump_break?: number;
192
- delivery_mode?: "websocket" | "webhook" | "both";
193
- webhook_url?: string;
194
- }): Promise<any>;
195
- export declare function coordinationAlertsGet(agent: Agent, params: {
196
- rule_id: string;
197
- }): Promise<any>;
198
- export declare function coordinationAlertsUpdate(agent: Agent, params: {
199
- rule_id: string;
200
- updates: Record<string, unknown>;
201
- }): Promise<any>;
202
- export declare function coordinationAlertsDelete(agent: Agent, params: {
203
- rule_id: string;
204
- }): Promise<any>;
205
- export declare function kolFirstTouches(agent: Agent, params?: {
206
- since?: string;
207
- before?: string;
208
- limit?: number;
209
- kol?: string;
210
- min_kol_winrate_7d?: number;
211
- min_scout_tier?: "S" | "A" | "B" | "C";
212
- min_n_touches?: number;
213
- strategy?: "scalper" | "day_trader" | "swing_trader" | "hodler" | "mixed";
214
- token_age_max_min?: number;
215
- min_first_buy_sol?: number;
216
- mint_suffix?: string;
217
- preset?: "scout" | "fresh_launch";
218
- include?: string;
219
- }): Promise<any>;
220
- export declare function firstTouchSubscriptionsList(agent: Agent): Promise<any>;
221
- export declare function firstTouchSubscriptionsCreate(agent: Agent, params: {
222
- name?: string;
223
- filters?: {
224
- kol?: string;
225
- mint_suffix?: string;
226
- min_first_buy_sol?: number;
227
- min_scout_tier?: "S" | "A" | "B" | "C";
228
- min_n_touches?: number;
229
- };
230
- delivery_mode?: "websocket" | "webhook" | "both";
231
- webhook_url?: string;
232
- }): Promise<any>;
233
- export declare function firstTouchSubscriptionsGet(agent: Agent, params: {
234
- subscription_id: string;
235
- }): Promise<any>;
236
- export declare function firstTouchSubscriptionsUpdate(agent: Agent, params: {
237
- subscription_id: string;
238
- updates: Record<string, unknown>;
239
- }): Promise<any>;
240
- export declare function firstTouchSubscriptionsDelete(agent: Agent, params: {
241
- subscription_id: string;
242
- }): Promise<any>;
243
- export declare function copyTradeSignals(agent: Agent, params?: {
244
- rule_id?: string;
245
- limit?: number;
246
- since?: string;
247
- }): Promise<any>;
248
- export {};
@@ -1,314 +0,0 @@
1
- /**
2
- * Tool functions — pure logic that calls MadeOnSol API.
3
- * Auth priority: MADEONSOL_API_KEY > SVM_PRIVATE_KEY (x402).
4
- *
5
- * v1.0 breaking change: RAPIDAPI_KEY support has been removed
6
- * (MadeOnSol RapidAPI marketplace was retired 2026-04-19).
7
- * Get a free `msk_` key at https://madeonsol.com/developer.
8
- */
9
- const BASE_URL = "https://madeonsol.com";
10
- let _authMode = null;
11
- let _authHeaders = {};
12
- let _paidFetch = null;
13
- /** Most recent rate-limit headers, populated by every successful API request. */
14
- export let lastRateLimit = {};
15
- function captureRateLimit(res) {
16
- lastRateLimit = {
17
- limit: res.headers.get("X-RateLimit-Limit") ?? undefined,
18
- remaining: res.headers.get("X-RateLimit-Remaining") ?? undefined,
19
- reset: res.headers.get("X-RateLimit-Reset") ?? undefined,
20
- requestId: res.headers.get("X-Request-Id") ?? undefined,
21
- };
22
- }
23
- function getConfig(agent, key) {
24
- return agent.config?.[key] || agent.config?.OTHER_API_KEYS?.[key];
25
- }
26
- export async function initAuth(agent) {
27
- if (_authMode)
28
- return;
29
- const apiKey = getConfig(agent, "MADEONSOL_API_KEY");
30
- const privateKey = getConfig(agent, "SVM_PRIVATE_KEY");
31
- if (apiKey) {
32
- _authMode = "madeonsol";
33
- _authHeaders = { Authorization: `Bearer ${apiKey}` };
34
- _paidFetch = fetch;
35
- console.log("[madeonsol] Using MadeOnSol API key (Bearer auth)");
36
- }
37
- else if (privateKey) {
38
- const { wrapFetchWithPayment } = await import("@x402/fetch");
39
- const { x402Client } = await import("@x402/core/client");
40
- const { ExactSvmScheme } = await import("@x402/svm/exact/client");
41
- const { createKeyPairSignerFromBytes } = await import("@solana/kit");
42
- const { base58 } = await import("@scure/base");
43
- const signer = await createKeyPairSignerFromBytes(base58.decode(privateKey));
44
- const client = new x402Client();
45
- client.register("solana:*", new ExactSvmScheme(signer));
46
- _paidFetch = wrapFetchWithPayment(fetch, client);
47
- _authMode = "x402";
48
- console.log(`[madeonsol] x402 payments enabled, wallet: ${signer.address}`);
49
- }
50
- else {
51
- _authMode = "none";
52
- _paidFetch = fetch;
53
- console.warn("\n[madeonsol] No auth configured — every API call will fail.\n" +
54
- " → Get a free MADEONSOL_API_KEY (200 req/day, no card) at https://madeonsol.com/developer\n" +
55
- " → Or set SVM_PRIVATE_KEY for x402 micropayments.\n");
56
- }
57
- }
58
- /** @deprecated Use initAuth instead */
59
- export async function initPaidFetch(agent) {
60
- await initAuth(agent);
61
- return _paidFetch;
62
- }
63
- async function query(path, params) {
64
- const apiPath = _authMode === "x402" || _authMode === "none"
65
- ? path
66
- : path.replace("/api/x402/", "/api/v1/");
67
- const url = new URL(apiPath, BASE_URL);
68
- if (params) {
69
- for (const [k, v] of Object.entries(params)) {
70
- if (v !== undefined)
71
- url.searchParams.set(k, String(v));
72
- }
73
- }
74
- const res = _authMode === "x402"
75
- ? await _paidFetch(url.toString())
76
- : await fetch(url.toString(), { headers: _authHeaders });
77
- captureRateLimit(res);
78
- if (!res.ok) {
79
- const body = await res.text().catch(() => "");
80
- throw new Error(`MadeOnSol API error ${res.status}: ${body}`);
81
- }
82
- return res.json();
83
- }
84
- export async function kolFeed(agent, params = {}) {
85
- await initAuth(agent);
86
- return query("/api/x402/kol/feed", params);
87
- }
88
- export async function kolCoordination(agent, params = {}) {
89
- await initAuth(agent);
90
- const { include_majors, ...rest } = params;
91
- const flat = { ...rest };
92
- if (include_majors !== undefined)
93
- flat.include_majors = include_majors ? "true" : "false";
94
- return query("/api/x402/kol/coordination", flat);
95
- }
96
- export async function kolLeaderboard(agent, params = {}) {
97
- await initAuth(agent);
98
- return query("/api/x402/kol/leaderboard", params);
99
- }
100
- /**
101
- * Get Pump.fun deployer alerts with KOL buy enrichment.
102
- * The `tier` filter (elite/good/moderate/rising/cold) is PRO/ULTRA only —
103
- * BASIC callers passing it receive HTTP 403.
104
- */
105
- export async function deployerAlerts(agent, params = {}) {
106
- await initAuth(agent);
107
- return query("/api/x402/deployer-hunter/alerts", params);
108
- }
109
- export async function kolPairs(agent, params = {}) {
110
- await initAuth(agent);
111
- return query("/api/x402/kol/pairs", params);
112
- }
113
- export async function kolHotTokens(agent, params = {}) {
114
- await initAuth(agent);
115
- return query("/api/x402/kol/tokens/hot", params);
116
- }
117
- export async function kolTrendingTokens(agent, params = {}) {
118
- await initAuth(agent);
119
- return query("/api/x402/kol/tokens/trending", params);
120
- }
121
- export async function kolTokenEntryOrder(agent, params) {
122
- await initAuth(agent);
123
- const { mint, ...rest } = params;
124
- return query(`/api/x402/kol/tokens/${encodeURIComponent(mint)}/entry-order`, rest);
125
- }
126
- export async function kolCompare(agent, params) {
127
- await initAuth(agent);
128
- return query("/api/x402/kol/compare", { wallets: params.wallets.join(",") });
129
- }
130
- export async function kolAlertsRecent(agent, params = {}) {
131
- await initAuth(agent);
132
- const { types, ...rest } = params;
133
- const flat = { ...rest };
134
- if (types && types.length > 0)
135
- flat.types = types.join(",");
136
- return query("/api/x402/kol/alerts/recent", flat);
137
- }
138
- export async function kolPnl(agent, params) {
139
- const qs = params.period ? `?period=${params.period}` : "";
140
- return restQuery(agent, "GET", `/kol/${params.wallet}/pnl${qs}`);
141
- }
142
- export async function kolTiming(agent, params) {
143
- const qs = params.period ? `?period=${params.period}` : "";
144
- return restQuery(agent, "GET", `/kol/${params.wallet}/timing${qs}`);
145
- }
146
- export async function deployerTrajectory(agent, params) {
147
- return restQuery(agent, "GET", `/deployer-hunter/${params.wallet}/trajectory`);
148
- }
149
- // ── REST helper (webhooks, streaming, alpha, copy-trade, wallet-tracker) ──
150
- async function restQuery(agent, method, path, body) {
151
- await initAuth(agent);
152
- if (_authMode !== "madeonsol") {
153
- throw new Error("MadeOnSol API key required for this endpoint. Get a free `msk_` key at madeonsol.com/developer");
154
- }
155
- const res = await fetch(`${BASE_URL}/api/v1${path}`, {
156
- method,
157
- headers: {
158
- "Content-Type": "application/json",
159
- ..._authHeaders,
160
- },
161
- ...(body ? { body: JSON.stringify(body) } : {}),
162
- });
163
- captureRateLimit(res);
164
- if (!res.ok) {
165
- const text = await res.text().catch(() => "");
166
- throw new Error(`MadeOnSol API error ${res.status}: ${text}`);
167
- }
168
- return res.json();
169
- }
170
- export async function createWebhook(agent, params) {
171
- return restQuery(agent, "POST", "/webhooks", params);
172
- }
173
- export async function listWebhooks(agent) {
174
- return restQuery(agent, "GET", "/webhooks");
175
- }
176
- export async function deleteWebhook(agent, params) {
177
- return restQuery(agent, "DELETE", `/webhooks/${params.id}`);
178
- }
179
- export async function testWebhook(agent, params) {
180
- return restQuery(agent, "POST", "/webhooks/test", params);
181
- }
182
- export async function getStreamToken(agent) {
183
- return restQuery(agent, "POST", "/stream/token");
184
- }
185
- // ── Wallet Tracker ──
186
- export async function walletTrackerWatchlist(agent) {
187
- return restQuery(agent, "GET", "/wallet-tracker/watchlist");
188
- }
189
- export async function walletTrackerAdd(agent, params) {
190
- return restQuery(agent, "POST", "/wallet-tracker/watchlist", params);
191
- }
192
- export async function walletTrackerRemove(agent, params) {
193
- return restQuery(agent, "DELETE", `/wallet-tracker/watchlist/${encodeURIComponent(params.wallet_address)}`);
194
- }
195
- export async function walletTrackerTrades(agent, params = {}) {
196
- const qs = new URLSearchParams();
197
- for (const [k, v] of Object.entries(params)) {
198
- if (v !== undefined)
199
- qs.set(k, String(v));
200
- }
201
- const query = qs.toString() ? `?${qs.toString()}` : "";
202
- return restQuery(agent, "GET", `/wallet-tracker/trades${query}`);
203
- }
204
- export async function walletTrackerSummary(agent, params = {}) {
205
- const qs = new URLSearchParams();
206
- if (params.period)
207
- qs.set("period", params.period);
208
- if (params.wallet)
209
- qs.set("wallet", params.wallet);
210
- const query = qs.toString() ? `?${qs.toString()}` : "";
211
- return restQuery(agent, "GET", `/wallet-tracker/summary${query}`);
212
- }
213
- // ── Alpha Wallet Intelligence ──
214
- export async function alphaLeaderboard(agent, params = {}) {
215
- const qs = new URLSearchParams();
216
- for (const [k, v] of Object.entries(params)) {
217
- if (v !== undefined)
218
- qs.set(k, String(v));
219
- }
220
- const query = qs.toString() ? `?${qs.toString()}` : "";
221
- return restQuery(agent, "GET", `/alpha/leaderboard${query}`);
222
- }
223
- export async function alphaWallet(agent, params) {
224
- return restQuery(agent, "GET", `/alpha/${encodeURIComponent(params.wallet)}`);
225
- }
226
- export async function alphaLinked(agent, params) {
227
- return restQuery(agent, "GET", `/alpha/${encodeURIComponent(params.wallet)}/linked`);
228
- }
229
- // ── Token Quality ──
230
- export async function tokenCapTable(agent, params) {
231
- return restQuery(agent, "GET", `/tokens/${encodeURIComponent(params.mint)}/cap-table`);
232
- }
233
- export async function tokenBuyerQuality(agent, params) {
234
- return restQuery(agent, "GET", `/tokens/${encodeURIComponent(params.mint)}/buyer-quality`);
235
- }
236
- /** Bulk buyer-quality scoring for up to 50 mints. Shares the 5-min LRU cache with the single-mint endpoint. */
237
- export async function tokenBuyerQualityBatch(agent, params) {
238
- return restQuery(agent, "POST", "/tokens/batch/buyer-quality", { mints: params.mints });
239
- }
240
- // ── Token Intelligence (/token/{mint}) ──
241
- /** Comprehensive per-mint snapshot: price, MC, 24h volume, deployer reputation, KOL activity, age, blacklist status. */
242
- export async function tokenGet(agent, params) {
243
- return restQuery(agent, "GET", `/token/${encodeURIComponent(params.mint)}`);
244
- }
245
- /** Bulk token snapshot for up to 50 mints — same per-mint shape as tokenGet(). 10-20× cheaper than N sequential calls. */
246
- export async function tokenBatch(agent, params) {
247
- return restQuery(agent, "POST", "/token/batch", { mints: params.mints });
248
- }
249
- // ── Copy-Trade Rules (PRO/ULTRA) ──
250
- export async function copyTradeList(agent) {
251
- return restQuery(agent, "GET", "/copy-trade/rules");
252
- }
253
- export async function copyTradeCreate(agent, params) {
254
- return restQuery(agent, "POST", "/copy-trade/rules", params);
255
- }
256
- export async function copyTradeGet(agent, params) {
257
- return restQuery(agent, "GET", `/copy-trade/rules/${encodeURIComponent(params.rule_id)}`);
258
- }
259
- export async function copyTradeUpdate(agent, params) {
260
- return restQuery(agent, "PATCH", `/copy-trade/rules/${encodeURIComponent(params.rule_id)}`, params.updates);
261
- }
262
- export async function copyTradeDelete(agent, params) {
263
- return restQuery(agent, "DELETE", `/copy-trade/rules/${encodeURIComponent(params.rule_id)}`);
264
- }
265
- // ── Coordination Alerts (PRO/ULTRA, v1.1) ──
266
- export async function coordinationAlertsList(agent) {
267
- return restQuery(agent, "GET", "/kol/coordination/alerts");
268
- }
269
- export async function coordinationAlertsCreate(agent, params) {
270
- return restQuery(agent, "POST", "/kol/coordination/alerts", params);
271
- }
272
- export async function coordinationAlertsGet(agent, params) {
273
- return restQuery(agent, "GET", `/kol/coordination/alerts/${encodeURIComponent(params.rule_id)}`);
274
- }
275
- export async function coordinationAlertsUpdate(agent, params) {
276
- return restQuery(agent, "PATCH", `/kol/coordination/alerts/${encodeURIComponent(params.rule_id)}`, params.updates);
277
- }
278
- export async function coordinationAlertsDelete(agent, params) {
279
- return restQuery(agent, "DELETE", `/kol/coordination/alerts/${encodeURIComponent(params.rule_id)}`);
280
- }
281
- // ── First-Touch Signal ──
282
- export async function kolFirstTouches(agent, params = {}) {
283
- const qs = new URLSearchParams();
284
- for (const [k, v] of Object.entries(params)) {
285
- if (v !== undefined)
286
- qs.set(k, String(v));
287
- }
288
- const query = qs.toString() ? `?${qs.toString()}` : "";
289
- return restQuery(agent, "GET", `/kol/first-touches${query}`);
290
- }
291
- export async function firstTouchSubscriptionsList(agent) {
292
- return restQuery(agent, "GET", "/kol/first-touches/subscriptions");
293
- }
294
- export async function firstTouchSubscriptionsCreate(agent, params) {
295
- return restQuery(agent, "POST", "/kol/first-touches/subscriptions", params);
296
- }
297
- export async function firstTouchSubscriptionsGet(agent, params) {
298
- return restQuery(agent, "GET", `/kol/first-touches/subscriptions/${encodeURIComponent(params.subscription_id)}`);
299
- }
300
- export async function firstTouchSubscriptionsUpdate(agent, params) {
301
- return restQuery(agent, "PATCH", `/kol/first-touches/subscriptions/${encodeURIComponent(params.subscription_id)}`, params.updates);
302
- }
303
- export async function firstTouchSubscriptionsDelete(agent, params) {
304
- return restQuery(agent, "DELETE", `/kol/first-touches/subscriptions/${encodeURIComponent(params.subscription_id)}`);
305
- }
306
- export async function copyTradeSignals(agent, params = {}) {
307
- const qs = new URLSearchParams();
308
- for (const [k, v] of Object.entries(params)) {
309
- if (v !== undefined)
310
- qs.set(k, String(v));
311
- }
312
- const query = qs.toString() ? `?${qs.toString()}` : "";
313
- return restQuery(agent, "GET", `/copy-trade/signals${query}`);
314
- }