@madeonsol/plugin-madeonsol 1.4.0 → 1.5.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.
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const deployerAlertsAction: Action;
@@ -0,0 +1,55 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ export const deployerAlertsAction = {
7
+ name: "GET_DEPLOYER_ALERTS",
8
+ description: "Get real-time Pump.fun deployer alerts from MadeOnSol. Shows new token launches from tracked elite/good deployers with stats, market cap, and KOL buy enrichment.",
9
+ similes: [
10
+ "deployer alerts",
11
+ "pump fun launches",
12
+ "new token alerts",
13
+ "deployer tracker",
14
+ "elite deployer tokens",
15
+ ],
16
+ validate: async (_runtime, message) => {
17
+ const text = (message.content?.text || "").toLowerCase();
18
+ return /\b(deployer|pump\.?fun|launch|new token)/i.test(text) && /\b(alert|track|monitor|latest|recent)/i.test(text);
19
+ },
20
+ handler: async (runtime, message, _state, _options, callback) => {
21
+ const client = getClient(runtime);
22
+ const text = (message.content?.text || "").toLowerCase();
23
+ const limit = text.match(/\b(\d+)\s*(alert|token|launch)/)?.[1] || "10";
24
+ // Best-effort tier inference from the user's prompt — only sent to the API
25
+ // when the user explicitly mentioned a tier. The tier filter requires
26
+ // PRO/ULTRA on the caller's API key.
27
+ const tierMatch = text.match(/\b(elite|good|moderate|rising|cold)\b/);
28
+ const tier = tierMatch?.[1];
29
+ const result = await client.getDeployerAlerts(tier ? { limit, tier } : { limit });
30
+ if (result.error) {
31
+ callback?.({ text: result.status === 402
32
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
33
+ : `Error: ${result.error}` });
34
+ return undefined;
35
+ }
36
+ const data = result.data;
37
+ const lines = (data.alerts || []).slice(0, 10).map((a) => {
38
+ const deployer = a.deployers;
39
+ const mc = a.market_cap_at_alert ? `$${(a.market_cap_at_alert / 1000).toFixed(1)}k` : "?";
40
+ const kols = a.kol_buys ? `${a.kol_buys.count} KOLs buying` : "";
41
+ return `[${deployer?.tier}] ${a.token_symbol || "?"} — MC: ${mc}${kols ? ` | ${kols}` : ""}`;
42
+ });
43
+ callback?.({
44
+ text: `Deployer Alerts:\n${lines.join("\n") || "No recent alerts."}`,
45
+ content: data,
46
+ });
47
+ return undefined;
48
+ },
49
+ examples: [
50
+ [
51
+ { name: "user1", content: { text: "Show me the latest deployer alerts from Pump.fun" } },
52
+ { name: "assistant", content: { text: "Here are the latest deployer alerts..." } },
53
+ ],
54
+ ],
55
+ };
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const kolAlertsRecentAction: Action;
@@ -0,0 +1,48 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ export const kolAlertsRecentAction = {
7
+ name: "GET_KOL_ALERTS_RECENT",
8
+ description: "Get live KOL alerts from MadeOnSol — consensus clusters, fresh-token KOL buys, and heating-up wallets in one unified stream.",
9
+ similes: [
10
+ "kol alerts",
11
+ "recent alerts",
12
+ "kol signals",
13
+ "whats happening now",
14
+ "live kol feed",
15
+ ],
16
+ validate: async (_runtime, message) => {
17
+ const text = (message.content?.text || "").toLowerCase();
18
+ return /\b(kol|smart money)\b/.test(text) && /\b(alert|signal|recent|live|now)\b/.test(text);
19
+ },
20
+ handler: async (runtime, message, _state, _options, callback) => {
21
+ const client = getClient(runtime);
22
+ const text = (message.content?.text || "").toLowerCase();
23
+ const window = text.includes("1h") ? "1h" : text.includes("6h") ? "6h" : text.includes("24h") ? "24h" : text.includes("5m") ? "5m" : "15m";
24
+ const result = await client.getKolAlertsRecent({ window, limit: "20" });
25
+ if (result.error) {
26
+ callback?.({ text: result.status === 402
27
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
28
+ : `Error: ${result.error}` });
29
+ return undefined;
30
+ }
31
+ const data = result.data;
32
+ const lines = (data.alerts || []).slice(0, 10).map((a) => {
33
+ const subject = a.token_symbol || a.kol_name || "—";
34
+ return `[${a.severity}] ${a.type}: ${subject}`;
35
+ });
36
+ callback?.({
37
+ text: `KOL alerts (${window}):\n${lines.join("\n") || "No alerts in window."}`,
38
+ content: data,
39
+ });
40
+ return undefined;
41
+ },
42
+ examples: [
43
+ [
44
+ { name: "user1", content: { text: "What are the recent KOL alerts?" } },
45
+ { name: "assistant", content: { text: "Here are the live KOL alerts..." } },
46
+ ],
47
+ ],
48
+ };
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const kolCompareAction: Action;
@@ -0,0 +1,57 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ const ADDR_RE = /\b[1-9A-HJ-NP-Za-km-z]{32,44}\b/g;
7
+ export const kolCompareAction = {
8
+ name: "GET_KOL_COMPARE",
9
+ description: "Compare 2-5 Solana KOL wallets side-by-side on MadeOnSol — strategy, winrates, ROI, percentile. PRO+ adds overlap tokens (bought by 2+ in last 30d).",
10
+ similes: [
11
+ "compare kols",
12
+ "compare wallets",
13
+ "kol comparison",
14
+ "side by side kols",
15
+ "who is better kol",
16
+ ],
17
+ validate: async (_runtime, message) => {
18
+ const text = message.content?.text || "";
19
+ const matches = text.match(ADDR_RE) ?? [];
20
+ return /\bcompare\b/i.test(text) && matches.length >= 2;
21
+ },
22
+ handler: async (runtime, message, _state, _options, callback) => {
23
+ const client = getClient(runtime);
24
+ const wallets = ((message.content?.text || "").match(ADDR_RE) ?? []).slice(0, 5);
25
+ if (wallets.length < 2) {
26
+ callback?.({ text: "Please include at least 2 wallet addresses to compare." });
27
+ return undefined;
28
+ }
29
+ const result = await client.getKolCompare(wallets);
30
+ if (result.error) {
31
+ callback?.({ text: result.status === 402
32
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
33
+ : `Error: ${result.error}` });
34
+ return undefined;
35
+ }
36
+ const data = result.data;
37
+ const lines = (data.profiles || []).map((p) => {
38
+ const who = p.name || `${p.wallet_address.slice(0, 4)}…${p.wallet_address.slice(-4)}`;
39
+ const wr = p.winrate_7d != null ? `${p.winrate_7d.toFixed(1)}%` : "—";
40
+ const pnl = p.pnl_30d != null ? `${p.pnl_30d > 0 ? "+" : ""}${p.pnl_30d.toFixed(1)} SOL` : "—";
41
+ return `${who} [${p.strategy_tag || "mixed"}] winrate 7d: ${wr}, PnL 30d: ${pnl}`;
42
+ });
43
+ const overlap = (data.overlap || []).slice(0, 5).map((o) => `${o.token_symbol || "?"} (${o.wallets.length} wallets)`);
44
+ callback?.({
45
+ text: `KOL comparison:\n${lines.join("\n")}` +
46
+ (overlap.length ? `\n\nOverlap (30d): ${overlap.join(", ")}` : ""),
47
+ content: data,
48
+ });
49
+ return undefined;
50
+ },
51
+ examples: [
52
+ [
53
+ { name: "user1", content: { text: "Compare these two KOLs: ABC...123 and DEF...456" } },
54
+ { name: "assistant", content: { text: "Here's the side-by-side comparison..." } },
55
+ ],
56
+ ],
57
+ };
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const kolCoordinationAction: Action;
@@ -0,0 +1,50 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ export const kolCoordinationAction = {
7
+ name: "GET_KOL_COORDINATION",
8
+ description: "Get KOL convergence signals from MadeOnSol — tokens being accumulated by multiple KOLs simultaneously. Shows which tokens smart money is converging on.",
9
+ similes: [
10
+ "kol convergence",
11
+ "what tokens are kols accumulating",
12
+ "kol coordination",
13
+ "smart money convergence",
14
+ "multiple kols buying",
15
+ ],
16
+ validate: async (_runtime, message) => {
17
+ const text = (message.content?.text || "").toLowerCase();
18
+ return /\b(kol|smart money)\b/.test(text) && /\b(converg|coordinat|accumul|same token|multiple)/i.test(text);
19
+ },
20
+ handler: async (runtime, message, _state, _options, callback) => {
21
+ const client = getClient(runtime);
22
+ const text = (message.content?.text || "").toLowerCase();
23
+ const period = text.includes("1h") ? "1h" : text.includes("7d") ? "7d" : text.includes("6h") ? "6h" : "24h";
24
+ const result = await client.getKolCoordination({ period, limit: "10" });
25
+ if (result.error) {
26
+ callback?.({ text: result.status === 402
27
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
28
+ : `Error: ${result.error}` });
29
+ return undefined;
30
+ }
31
+ const data = result.data;
32
+ const lines = (data.coordination || []).map((t) => {
33
+ const score = t.coordination_score != null ? ` · score ${t.coordination_score}/100` : "";
34
+ const peak = t.peak_kols != null ? ` · peak ${t.peak_kols}` : "";
35
+ const exited = t.exited_count ? ` · ${t.exited_count} exited` : "";
36
+ return `${t.token_symbol}: ${t.kol_count} KOLs ${t.signal} (${t.net_sol_flow > 0 ? "+" : ""}${t.net_sol_flow.toFixed(2)} SOL net)${score}${peak}${exited}`;
37
+ });
38
+ callback?.({
39
+ text: `KOL convergence signals (${period}):\n${lines.join("\n") || "No coordination signals found."}`,
40
+ content: data,
41
+ });
42
+ return undefined;
43
+ },
44
+ examples: [
45
+ [
46
+ { name: "user1", content: { text: "What tokens are multiple KOLs accumulating?" } },
47
+ { name: "assistant", content: { text: "Here are the KOL convergence signals..." } },
48
+ ],
49
+ ],
50
+ };
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const kolFeedAction: Action;
@@ -0,0 +1,55 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ export const kolFeedAction = {
7
+ name: "GET_KOL_FEED",
8
+ description: "Get the real-time Solana KOL trade feed from MadeOnSol. Shows latest buys and sells from 1,000+ tracked KOL wallets with deployer enrichment.",
9
+ similes: [
10
+ "kol trades",
11
+ "what are kols buying",
12
+ "solana kol feed",
13
+ "kol activity",
14
+ "smart money trades",
15
+ "what did kols trade",
16
+ ],
17
+ validate: async (_runtime, message) => {
18
+ const text = (message.content?.text || "").toLowerCase();
19
+ return /\b(kol|smart money)\b/.test(text) && /\b(feed|trade|buy|sell|activit)/i.test(text);
20
+ },
21
+ handler: async (runtime, message, _state, _options, callback) => {
22
+ const client = getClient(runtime);
23
+ const text = (message.content?.text || "").toLowerCase();
24
+ const action = text.includes("buy") ? "buy" : text.includes("sell") ? "sell" : undefined;
25
+ const result = await client.getKolFeed({ limit: "10", ...(action ? { action } : {}) });
26
+ if (result.error) {
27
+ callback?.({ text: result.status === 402
28
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
29
+ : `Error: ${result.error}` });
30
+ return undefined;
31
+ }
32
+ const data = result.data;
33
+ const fmtMc = (mc) => {
34
+ if (mc == null || !isFinite(mc) || mc <= 0)
35
+ return "";
36
+ if (mc >= 1e6)
37
+ return ` @ MC $${(mc / 1e6).toFixed(2)}M`;
38
+ if (mc >= 1e3)
39
+ return ` @ MC $${(mc / 1e3).toFixed(1)}K`;
40
+ return ` @ MC $${mc.toFixed(0)}`;
41
+ };
42
+ const lines = (data.trades || []).slice(0, 10).map((t) => `${t.kol_name || "Unknown"} ${t.action === "buy" ? "bought" : "sold"} ${t.token_symbol || "?"} for ${Number(t.sol_amount).toFixed(2)} SOL${fmtMc(t.market_cap_usd_at_trade)}`);
43
+ callback?.({
44
+ text: `Latest KOL trades:\n${lines.join("\n")}`,
45
+ content: data,
46
+ });
47
+ return undefined;
48
+ },
49
+ examples: [
50
+ [
51
+ { name: "user1", content: { text: "What are the latest KOL trades on Solana?" } },
52
+ { name: "assistant", content: { text: "Here are the latest KOL trades from MadeOnSol..." } },
53
+ ],
54
+ ],
55
+ };
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const kolLeaderboardAction: Action;
@@ -0,0 +1,45 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ export const kolLeaderboardAction = {
7
+ name: "GET_KOL_LEADERBOARD",
8
+ description: "Get KOL performance rankings from MadeOnSol — top Solana KOLs ranked by PnL, volume, and win rate.",
9
+ similes: [
10
+ "kol leaderboard",
11
+ "best performing kols",
12
+ "top kol traders",
13
+ "kol rankings",
14
+ "who is the best kol",
15
+ ],
16
+ validate: async (_runtime, message) => {
17
+ const text = (message.content?.text || "").toLowerCase();
18
+ return /\b(kol|smart money)\b/.test(text) && /\b(leaderboard|ranking|top|best|perform|pnl|win rate)/i.test(text);
19
+ },
20
+ handler: async (runtime, message, _state, _options, callback) => {
21
+ const client = getClient(runtime);
22
+ const text = (message.content?.text || "").toLowerCase();
23
+ const period = text.includes("today") ? "today" : text.includes("30d") || text.includes("month") ? "30d" : "7d";
24
+ const result = await client.getKolLeaderboard({ period, limit: "10" });
25
+ if (result.error) {
26
+ callback?.({ text: result.status === 402
27
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
28
+ : `Error: ${result.error}` });
29
+ return undefined;
30
+ }
31
+ const data = result.data;
32
+ const lines = (data.leaderboard || []).map((k, i) => `${i + 1}. ${k.name}: ${k.pnl_sol > 0 ? "+" : ""}${k.pnl_sol.toFixed(2)} SOL PnL (${k.buy_count}B/${k.sell_count}S${k.win_rate != null ? `, ${(k.win_rate * 100).toFixed(0)}% WR` : ""})`);
33
+ callback?.({
34
+ text: `KOL Leaderboard (${period}):\n${lines.join("\n") || "No data for this period."}`,
35
+ content: data,
36
+ });
37
+ return undefined;
38
+ },
39
+ examples: [
40
+ [
41
+ { name: "user1", content: { text: "Show me the top performing KOLs this week" } },
42
+ { name: "assistant", content: { text: "Here are the top KOLs by PnL..." } },
43
+ ],
44
+ ],
45
+ };
@@ -0,0 +1,2 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const kolTokenEntryOrderAction: Action;
@@ -0,0 +1,53 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ const MINT_RE = /\b([1-9A-HJ-NP-Za-km-z]{32,44})\b/;
7
+ export const kolTokenEntryOrderAction = {
8
+ name: "GET_KOL_TOKEN_ENTRY_ORDER",
9
+ description: "Get the ranked order of KOL first-buyers for a specific Solana token from MadeOnSol. Shows who entered first and how quickly others followed.",
10
+ similes: [
11
+ "who bought first",
12
+ "first kol buyers",
13
+ "kol entry order",
14
+ "token entry ranking",
15
+ "who entered first",
16
+ ],
17
+ validate: async (_runtime, message) => {
18
+ const text = message.content?.text || "";
19
+ return /\b(first|entry|entered|order)\b/i.test(text) && MINT_RE.test(text);
20
+ },
21
+ handler: async (runtime, message, _state, _options, callback) => {
22
+ const client = getClient(runtime);
23
+ const mint = (message.content?.text || "").match(MINT_RE)?.[1];
24
+ if (!mint) {
25
+ callback?.({ text: "Please include a token mint address." });
26
+ return undefined;
27
+ }
28
+ const result = await client.getKolTokenEntryOrder(mint, { limit: "20" });
29
+ if (result.error) {
30
+ callback?.({ text: result.status === 402
31
+ ? "Authentication required. Set MADEONSOL_API_KEY — free at https://madeonsol.com/developer — or SVM_PRIVATE_KEY."
32
+ : `Error: ${result.error}` });
33
+ return undefined;
34
+ }
35
+ const data = result.data;
36
+ const lines = (data.entries || []).slice(0, 10).map((e) => {
37
+ const who = e.kol_name || `${e.wallet_address.slice(0, 4)}…${e.wallet_address.slice(-4)}`;
38
+ const when = e.seconds_after_first === 0 ? "first" : `+${e.seconds_after_first}s`;
39
+ return `#${e.rank} ${who} — ${e.sol_amount.toFixed(2)} SOL (${when})`;
40
+ });
41
+ callback?.({
42
+ text: `KOL entry order for ${mint.slice(0, 8)}…:\n${lines.join("\n") || "No KOL buys recorded."}`,
43
+ content: data,
44
+ });
45
+ return undefined;
46
+ },
47
+ examples: [
48
+ [
49
+ { name: "user1", content: { text: "Who were the first KOLs to buy 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU?" } },
50
+ { name: "assistant", content: { text: "Here's the KOL entry order for that token..." } },
51
+ ],
52
+ ],
53
+ };
@@ -0,0 +1,3 @@
1
+ import type { Action } from "@elizaos/core";
2
+ export declare const walletTrackerWatchlistAction: Action;
3
+ export declare const walletTrackerTradesAction: Action;
@@ -0,0 +1,84 @@
1
+ import { MadeOnSolClient } from "../client.js";
2
+ import { MADEONSOL_CLIENT_KEY } from "../index.js";
3
+ function getClient(runtime) {
4
+ return runtime[MADEONSOL_CLIENT_KEY] ?? new MadeOnSolClient();
5
+ }
6
+ export const walletTrackerWatchlistAction = {
7
+ name: "WALLET_TRACKER_WATCHLIST",
8
+ description: "List wallets in your MadeOnSol wallet watchlist with labels and remaining capacity.",
9
+ similes: [
10
+ "wallet watchlist",
11
+ "tracked wallets",
12
+ "my wallets",
13
+ "wallet tracker list",
14
+ "show tracked wallets",
15
+ ],
16
+ validate: async (_runtime, message) => {
17
+ const text = (message.content?.text || "").toLowerCase();
18
+ return /\b(wallet.tracker|watchlist|tracked wallet)/i.test(text) && /\b(list|show|get|my)\b/i.test(text);
19
+ },
20
+ handler: async (runtime, _message, _state, _options, callback) => {
21
+ const client = getClient(runtime);
22
+ const result = await client.getWalletTrackerWatchlist();
23
+ if (result.error) {
24
+ callback?.({ text: `Error: ${result.error}` });
25
+ return undefined;
26
+ }
27
+ const data = result.data;
28
+ const lines = (data.wallets || []).map((w) => `${w.label ? `[${w.label}] ` : ""}${w.wallet_address}`);
29
+ callback?.({
30
+ text: lines.length
31
+ ? `Tracked wallets (${data.count}/${data.limit}):\n${lines.join("\n")}\n${data.remaining} slot(s) remaining.`
32
+ : `No wallets tracked yet. Limit: ${data.limit}.`,
33
+ content: data,
34
+ });
35
+ return undefined;
36
+ },
37
+ examples: [
38
+ [
39
+ { name: "user1", content: { text: "Show my wallet tracker watchlist" } },
40
+ { name: "assistant", content: { text: "Here are your tracked wallets..." } },
41
+ ],
42
+ ],
43
+ };
44
+ export const walletTrackerTradesAction = {
45
+ name: "WALLET_TRACKER_TRADES",
46
+ description: "Get recent swap and transfer events from wallets in your MadeOnSol watchlist.",
47
+ similes: [
48
+ "wallet tracker trades",
49
+ "tracked wallet activity",
50
+ "watchlist trades",
51
+ "wallet swaps",
52
+ "wallet transfers",
53
+ "what did my tracked wallets do",
54
+ ],
55
+ validate: async (_runtime, message) => {
56
+ const text = (message.content?.text || "").toLowerCase();
57
+ return /\b(wallet.tracker|watchlist|tracked wallet)/i.test(text) && /\b(trade|swap|transfer|activity|buy|sell)\b/i.test(text);
58
+ },
59
+ handler: async (runtime, message, _state, _options, callback) => {
60
+ const client = getClient(runtime);
61
+ const text = (message.content?.text || "").toLowerCase();
62
+ const action = text.includes("buy") ? "buy" : text.includes("sell") ? "sell" : undefined;
63
+ const result = await client.getWalletTrackerTrades({ limit: "20", ...(action ? { action } : {}) });
64
+ if (result.error) {
65
+ callback?.({ text: `Error: ${result.error}` });
66
+ return undefined;
67
+ }
68
+ const data = result.data;
69
+ const lines = (data.events || []).slice(0, 15).map((e) => `${e.label || e.wallet_address.slice(0, 8)} ${e.action} ${e.token_symbol || "?"} for ${Number(e.sol_amount).toFixed(2)} SOL`);
70
+ callback?.({
71
+ text: lines.length
72
+ ? `Recent wallet tracker events:\n${lines.join("\n")}`
73
+ : "No recent events for your tracked wallets.",
74
+ content: data,
75
+ });
76
+ return undefined;
77
+ },
78
+ examples: [
79
+ [
80
+ { name: "user1", content: { text: "What did my tracked wallets trade recently?" } },
81
+ { name: "assistant", content: { text: "Here are the latest trades from your watchlist..." } },
82
+ ],
83
+ ],
84
+ };
@@ -0,0 +1,404 @@
1
+ /**
2
+ * MadeOnSol API client.
3
+ * Two auth modes: MadeOnSol API key (`msk_`, recommended) or x402 micropayments.
4
+ *
5
+ * v1.0 breaking change: RapidAPI auth has been removed (marketplace retired 2026-04-19).
6
+ * Get a free `msk_` key at https://madeonsol.com/developer.
7
+ */
8
+ export interface MadeOnSolClientOptions {
9
+ baseUrl?: string;
10
+ /** MadeOnSol API key — get one free at https://madeonsol.com/developer. Preferred. */
11
+ apiKey?: string;
12
+ /** x402 payment-enabled fetch (for AI agents with SVM_PRIVATE_KEY). */
13
+ fetchFn?: typeof fetch;
14
+ }
15
+ export interface RateLimitInfo {
16
+ limit?: string;
17
+ remaining?: string;
18
+ reset?: string;
19
+ requestId?: string;
20
+ }
21
+ export declare class MadeOnSolClient {
22
+ private baseUrl;
23
+ private fetchFn;
24
+ private authMode;
25
+ private authHeaders;
26
+ /** Most recent rate-limit headers, populated by every request. */
27
+ lastRateLimit: RateLimitInfo;
28
+ constructor(options?: MadeOnSolClientOptions);
29
+ private captureRateLimit;
30
+ query<T = unknown>(path: string, params?: Record<string, string | undefined>): Promise<{
31
+ data?: T;
32
+ error?: string;
33
+ status: number;
34
+ }>;
35
+ getKolFeed(params?: {
36
+ limit?: string;
37
+ before?: string;
38
+ action?: string;
39
+ kol?: string;
40
+ min_sol?: string;
41
+ token_age_max_min?: string;
42
+ exclude_sells?: string;
43
+ min_kol_winrate?: string;
44
+ strategy?: string;
45
+ }): Promise<{
46
+ data?: unknown;
47
+ error?: string;
48
+ status: number;
49
+ }>;
50
+ getKolCoordination(params?: {
51
+ period?: string;
52
+ min_kols?: string;
53
+ limit?: string;
54
+ /** v1.1 — include WIF/BONK/POPCAT etc. ("true" | "false", default "false") */
55
+ include_majors?: string;
56
+ /** v1.1 — peak-density window in minutes (1-60, default 15) */
57
+ window_minutes?: string;
58
+ /** v1.1 — minimum composite coordination_score (0-100) */
59
+ min_score?: string;
60
+ min_avg_winrate?: string;
61
+ unique_strategies?: string;
62
+ }): Promise<{
63
+ data?: unknown;
64
+ error?: string;
65
+ status: number;
66
+ }>;
67
+ getKolLeaderboard(params?: {
68
+ period?: string;
69
+ limit?: string;
70
+ }): Promise<{
71
+ data?: unknown;
72
+ error?: string;
73
+ status: number;
74
+ }>;
75
+ /**
76
+ * Get deployer alerts. The `tier` filter (elite/good/moderate/rising/cold)
77
+ * is PRO/ULTRA only — BASIC callers passing it receive HTTP 403.
78
+ * Cursor-paginated via `before` (preferred over `offset` at scale).
79
+ */
80
+ getDeployerAlerts(params?: {
81
+ since?: string;
82
+ before?: string;
83
+ limit?: string;
84
+ offset?: string;
85
+ tier?: string;
86
+ alert_type?: string;
87
+ priority?: string;
88
+ min_kol_buys?: string;
89
+ }): Promise<{
90
+ data?: unknown;
91
+ error?: string;
92
+ status: number;
93
+ }>;
94
+ getKolPairs(params?: {
95
+ period?: string;
96
+ min_shared?: string;
97
+ limit?: string;
98
+ }): Promise<{
99
+ data?: unknown;
100
+ error?: string;
101
+ status: number;
102
+ }>;
103
+ getKolHotTokens(params?: {
104
+ period?: string;
105
+ min_kols?: string;
106
+ limit?: string;
107
+ }): Promise<{
108
+ data?: unknown;
109
+ error?: string;
110
+ status: number;
111
+ }>;
112
+ getKolTrendingTokens(params?: {
113
+ period?: string;
114
+ min_kols?: string;
115
+ limit?: string;
116
+ }): Promise<{
117
+ data?: unknown;
118
+ error?: string;
119
+ status: number;
120
+ }>;
121
+ getKolTokenEntryOrder(mint: string, params?: {
122
+ limit?: string;
123
+ }): Promise<{
124
+ data?: unknown;
125
+ error?: string;
126
+ status: number;
127
+ }>;
128
+ getKolCompare(wallets: string[]): Promise<{
129
+ data?: unknown;
130
+ error?: string;
131
+ status: number;
132
+ }>;
133
+ getKolAlertsRecent(params?: {
134
+ window?: string;
135
+ types?: string;
136
+ min_severity?: string;
137
+ limit?: string;
138
+ }): Promise<{
139
+ data?: unknown;
140
+ error?: string;
141
+ status: number;
142
+ }>;
143
+ getKolPnl(wallet: string, params?: {
144
+ period?: string;
145
+ }): Promise<{
146
+ data?: unknown;
147
+ error?: string;
148
+ status: number;
149
+ }>;
150
+ getKolTiming(wallet: string, params?: {
151
+ period?: string;
152
+ }): Promise<{
153
+ data?: unknown;
154
+ error?: string;
155
+ status: number;
156
+ }>;
157
+ getDeployerTrajectory(wallet: string): Promise<{
158
+ data?: unknown;
159
+ error?: string;
160
+ status: number;
161
+ }>;
162
+ private restRequest;
163
+ createWebhook(params: {
164
+ url: string;
165
+ events: string[];
166
+ filters?: Record<string, unknown>;
167
+ }): Promise<{
168
+ data?: unknown;
169
+ error?: string;
170
+ status: number;
171
+ }>;
172
+ listWebhooks(): Promise<{
173
+ data?: unknown;
174
+ error?: string;
175
+ status: number;
176
+ }>;
177
+ deleteWebhook(id: number): Promise<{
178
+ data?: unknown;
179
+ error?: string;
180
+ status: number;
181
+ }>;
182
+ testWebhook(webhookId: number): Promise<{
183
+ data?: unknown;
184
+ error?: string;
185
+ status: number;
186
+ }>;
187
+ getStreamToken(): Promise<{
188
+ data?: unknown;
189
+ error?: string;
190
+ status: number;
191
+ }>;
192
+ getWalletTrackerWatchlist(): Promise<{
193
+ data?: unknown;
194
+ error?: string;
195
+ status: number;
196
+ }>;
197
+ addToWatchlist(walletAddress: string, label?: string): Promise<{
198
+ data?: unknown;
199
+ error?: string;
200
+ status: number;
201
+ }>;
202
+ removeFromWatchlist(walletAddress: string): Promise<{
203
+ data?: unknown;
204
+ error?: string;
205
+ status: number;
206
+ }>;
207
+ getWalletTrackerTrades(params?: {
208
+ wallet?: string;
209
+ action?: string;
210
+ event_type?: string;
211
+ limit?: string;
212
+ before?: string;
213
+ }): Promise<{
214
+ data?: unknown;
215
+ error?: string;
216
+ status: number;
217
+ }>;
218
+ getWalletTrackerSummary(params?: {
219
+ period?: string;
220
+ wallet?: string;
221
+ }): Promise<{
222
+ data?: unknown;
223
+ error?: string;
224
+ status: number;
225
+ }>;
226
+ getAlphaLeaderboard(params?: {
227
+ limit?: string;
228
+ min_tokens?: string;
229
+ min_pnl?: string;
230
+ }): Promise<{
231
+ data?: unknown;
232
+ error?: string;
233
+ status: number;
234
+ }>;
235
+ getAlphaWallet(wallet: string): Promise<{
236
+ data?: unknown;
237
+ error?: string;
238
+ status: number;
239
+ }>;
240
+ getAlphaLinked(wallet: string): Promise<{
241
+ data?: unknown;
242
+ error?: string;
243
+ status: number;
244
+ }>;
245
+ getTokenCapTable(mint: string): Promise<{
246
+ data?: unknown;
247
+ error?: string;
248
+ status: number;
249
+ }>;
250
+ getTokenBuyerQuality(mint: string): Promise<{
251
+ data?: unknown;
252
+ error?: string;
253
+ status: number;
254
+ }>;
255
+ /** Bulk buyer-quality scoring for up to 50 mints. Shares the single-mint 5-min LRU cache. */
256
+ getTokenBuyerQualityBatch(mints: string[]): Promise<{
257
+ data?: unknown;
258
+ error?: string;
259
+ status: number;
260
+ }>;
261
+ /** Comprehensive per-mint snapshot: price, MC, volume, deployer, KOL activity, age, blacklist. */
262
+ getToken(mint: string): Promise<{
263
+ data?: unknown;
264
+ error?: string;
265
+ status: number;
266
+ }>;
267
+ /** Bulk lookup of up to 50 mints — same per-mint shape as getToken(). 10-20× cheaper than N sequential calls. */
268
+ getTokenBatch(mints: string[]): Promise<{
269
+ data?: unknown;
270
+ error?: string;
271
+ status: number;
272
+ }>;
273
+ copyTradeList(): Promise<{
274
+ data?: unknown;
275
+ error?: string;
276
+ status: number;
277
+ }>;
278
+ copyTradeCreate(params: {
279
+ name: string;
280
+ source_wallet: string;
281
+ is_active?: boolean;
282
+ webhook_url?: string;
283
+ delivery?: "webhook" | "websocket" | "both";
284
+ filters?: Record<string, unknown>;
285
+ }): Promise<{
286
+ data?: unknown;
287
+ error?: string;
288
+ status: number;
289
+ }>;
290
+ copyTradeGet(ruleId: string): Promise<{
291
+ data?: unknown;
292
+ error?: string;
293
+ status: number;
294
+ }>;
295
+ copyTradeUpdate(ruleId: string, updates: Record<string, unknown>): Promise<{
296
+ data?: unknown;
297
+ error?: string;
298
+ status: number;
299
+ }>;
300
+ copyTradeDelete(ruleId: string): Promise<{
301
+ data?: unknown;
302
+ error?: string;
303
+ status: number;
304
+ }>;
305
+ coordinationAlertsList(): Promise<{
306
+ data?: unknown;
307
+ error?: string;
308
+ status: number;
309
+ }>;
310
+ coordinationAlertsCreate(params: {
311
+ name?: string;
312
+ min_kols?: number;
313
+ window_minutes?: number;
314
+ min_score?: number;
315
+ include_majors?: boolean;
316
+ cooldown_min?: number;
317
+ score_jump_break?: number;
318
+ delivery_mode?: "websocket" | "webhook" | "both";
319
+ webhook_url?: string;
320
+ }): Promise<{
321
+ data?: unknown;
322
+ error?: string;
323
+ status: number;
324
+ }>;
325
+ coordinationAlertsGet(ruleId: string): Promise<{
326
+ data?: unknown;
327
+ error?: string;
328
+ status: number;
329
+ }>;
330
+ coordinationAlertsUpdate(ruleId: string, updates: Record<string, unknown>): Promise<{
331
+ data?: unknown;
332
+ error?: string;
333
+ status: number;
334
+ }>;
335
+ coordinationAlertsDelete(ruleId: string): Promise<{
336
+ data?: unknown;
337
+ error?: string;
338
+ status: number;
339
+ }>;
340
+ firstTouches(params?: {
341
+ since?: string;
342
+ before?: string;
343
+ limit?: number;
344
+ kol?: string;
345
+ min_kol_winrate_7d?: number;
346
+ min_scout_tier?: "S" | "A" | "B" | "C";
347
+ min_n_touches?: number;
348
+ strategy?: "scalper" | "day_trader" | "swing_trader" | "hodler" | "mixed";
349
+ token_age_max_min?: number;
350
+ min_first_buy_sol?: number;
351
+ mint_suffix?: string;
352
+ preset?: "scout" | "fresh_launch";
353
+ include?: string;
354
+ }): Promise<{
355
+ data?: unknown;
356
+ error?: string;
357
+ status: number;
358
+ }>;
359
+ firstTouchSubscriptionsList(): Promise<{
360
+ data?: unknown;
361
+ error?: string;
362
+ status: number;
363
+ }>;
364
+ firstTouchSubscriptionsCreate(params: {
365
+ name?: string;
366
+ filters?: {
367
+ kol?: string;
368
+ mint_suffix?: string;
369
+ min_first_buy_sol?: number;
370
+ min_scout_tier?: "S" | "A" | "B" | "C";
371
+ min_n_touches?: number;
372
+ };
373
+ delivery_mode?: "websocket" | "webhook" | "both";
374
+ webhook_url?: string;
375
+ }): Promise<{
376
+ data?: unknown;
377
+ error?: string;
378
+ status: number;
379
+ }>;
380
+ firstTouchSubscriptionsGet(id: string): Promise<{
381
+ data?: unknown;
382
+ error?: string;
383
+ status: number;
384
+ }>;
385
+ firstTouchSubscriptionsUpdate(id: string, updates: Record<string, unknown>): Promise<{
386
+ data?: unknown;
387
+ error?: string;
388
+ status: number;
389
+ }>;
390
+ firstTouchSubscriptionsDelete(id: string): Promise<{
391
+ data?: unknown;
392
+ error?: string;
393
+ status: number;
394
+ }>;
395
+ copyTradeSignals(params?: {
396
+ rule_id?: string;
397
+ limit?: string;
398
+ since?: string;
399
+ }): Promise<{
400
+ data?: unknown;
401
+ error?: string;
402
+ status: number;
403
+ }>;
404
+ }
package/dist/client.js ADDED
@@ -0,0 +1,282 @@
1
+ /**
2
+ * MadeOnSol API client.
3
+ * Two auth modes: MadeOnSol API key (`msk_`, recommended) or x402 micropayments.
4
+ *
5
+ * v1.0 breaking change: RapidAPI auth has been removed (marketplace retired 2026-04-19).
6
+ * Get a free `msk_` key at https://madeonsol.com/developer.
7
+ */
8
+ const DEFAULT_BASE = "https://madeonsol.com";
9
+ export class MadeOnSolClient {
10
+ baseUrl;
11
+ fetchFn;
12
+ authMode;
13
+ authHeaders;
14
+ /** Most recent rate-limit headers, populated by every request. */
15
+ lastRateLimit = {};
16
+ constructor(options = {}) {
17
+ this.baseUrl = options.baseUrl || DEFAULT_BASE;
18
+ this.fetchFn = options.fetchFn || globalThis.fetch;
19
+ this.authHeaders = {};
20
+ if (options.apiKey) {
21
+ this.authMode = "madeonsol";
22
+ this.authHeaders = { Authorization: `Bearer ${options.apiKey}` };
23
+ }
24
+ else if (options.fetchFn) {
25
+ this.authMode = "x402";
26
+ }
27
+ else {
28
+ this.authMode = "none";
29
+ console.warn("\n[madeonsol] MadeOnSolClient constructed without apiKey or fetchFn — every request will fail.\n" +
30
+ " → Get a free key (200 req/day, no card) at https://madeonsol.com/developer\n" +
31
+ " → Then: new MadeOnSolClient({ apiKey: process.env.MADEONSOL_API_KEY })\n");
32
+ }
33
+ }
34
+ captureRateLimit(res) {
35
+ this.lastRateLimit = {
36
+ limit: res.headers.get("X-RateLimit-Limit") ?? undefined,
37
+ remaining: res.headers.get("X-RateLimit-Remaining") ?? undefined,
38
+ reset: res.headers.get("X-RateLimit-Reset") ?? undefined,
39
+ requestId: res.headers.get("X-Request-Id") ?? undefined,
40
+ };
41
+ }
42
+ async query(path, params) {
43
+ const apiPath = this.authMode === "x402" || this.authMode === "none"
44
+ ? path
45
+ : path.replace("/api/x402/", "/api/v1/");
46
+ const url = new URL(apiPath, this.baseUrl);
47
+ if (params) {
48
+ for (const [k, v] of Object.entries(params)) {
49
+ if (v !== undefined)
50
+ url.searchParams.set(k, v);
51
+ }
52
+ }
53
+ const res = this.authMode === "x402"
54
+ ? await this.fetchFn(url.toString(), { method: "GET" })
55
+ : await this.fetchFn(url.toString(), { method: "GET", headers: this.authHeaders });
56
+ this.captureRateLimit(res);
57
+ if (res.status === 402) {
58
+ const body = await res.json();
59
+ return { error: `Payment required: ${JSON.stringify(body.accepts?.[0] || body)}`, status: 402 };
60
+ }
61
+ if (!res.ok) {
62
+ const text = await res.text().catch(() => "Unknown error");
63
+ return { error: text, status: res.status };
64
+ }
65
+ const data = await res.json();
66
+ return { data, status: res.status };
67
+ }
68
+ getKolFeed(params) {
69
+ return this.query("/api/x402/kol/feed", params);
70
+ }
71
+ getKolCoordination(params) {
72
+ return this.query("/api/x402/kol/coordination", params);
73
+ }
74
+ getKolLeaderboard(params) {
75
+ return this.query("/api/x402/kol/leaderboard", params);
76
+ }
77
+ /**
78
+ * Get deployer alerts. The `tier` filter (elite/good/moderate/rising/cold)
79
+ * is PRO/ULTRA only — BASIC callers passing it receive HTTP 403.
80
+ * Cursor-paginated via `before` (preferred over `offset` at scale).
81
+ */
82
+ getDeployerAlerts(params) {
83
+ return this.query("/api/x402/deployer-hunter/alerts", params);
84
+ }
85
+ getKolPairs(params) {
86
+ return this.query("/api/x402/kol/pairs", params);
87
+ }
88
+ getKolHotTokens(params) {
89
+ return this.query("/api/x402/kol/tokens/hot", params);
90
+ }
91
+ getKolTrendingTokens(params) {
92
+ return this.query("/api/x402/kol/tokens/trending", params);
93
+ }
94
+ getKolTokenEntryOrder(mint, params) {
95
+ return this.query(`/api/x402/kol/tokens/${encodeURIComponent(mint)}/entry-order`, params);
96
+ }
97
+ getKolCompare(wallets) {
98
+ return this.query("/api/x402/kol/compare", { wallets: wallets.join(",") });
99
+ }
100
+ getKolAlertsRecent(params) {
101
+ return this.query("/api/x402/kol/alerts/recent", params);
102
+ }
103
+ getKolPnl(wallet, params) {
104
+ const qs = params?.period ? `?period=${params.period}` : "";
105
+ return this.restRequest("GET", `/kol/${wallet}/pnl${qs}`);
106
+ }
107
+ getKolTiming(wallet, params) {
108
+ const qs = params?.period ? `?period=${params.period}` : "";
109
+ return this.restRequest("GET", `/kol/${wallet}/timing${qs}`);
110
+ }
111
+ getDeployerTrajectory(wallet) {
112
+ return this.restRequest("GET", `/deployer-hunter/${wallet}/trajectory`);
113
+ }
114
+ // ── REST helper (used by webhooks, streaming, alpha, copy-trade, wallet-tracker) ──
115
+ async restRequest(method, path, body) {
116
+ if (this.authMode !== "madeonsol") {
117
+ return { error: "MadeOnSol API key required for this endpoint. Get a free `msk_` key at https://madeonsol.com/developer", status: 401 };
118
+ }
119
+ const res = await this.fetchFn(`${this.baseUrl}/api/v1${path}`, {
120
+ method,
121
+ headers: {
122
+ "Content-Type": "application/json",
123
+ ...this.authHeaders,
124
+ },
125
+ ...(body ? { body: JSON.stringify(body) } : {}),
126
+ });
127
+ this.captureRateLimit(res);
128
+ if (!res.ok) {
129
+ const text = await res.text().catch(() => "Unknown error");
130
+ return { error: text, status: res.status };
131
+ }
132
+ return { data: await res.json(), status: res.status };
133
+ }
134
+ // ── Webhook management (PRO/ULTRA) ──
135
+ createWebhook(params) {
136
+ return this.restRequest("POST", "/webhooks", params);
137
+ }
138
+ listWebhooks() {
139
+ return this.restRequest("GET", "/webhooks");
140
+ }
141
+ deleteWebhook(id) {
142
+ return this.restRequest("DELETE", `/webhooks/${id}`);
143
+ }
144
+ testWebhook(webhookId) {
145
+ return this.restRequest("POST", "/webhooks/test", { webhook_id: webhookId });
146
+ }
147
+ getStreamToken() {
148
+ return this.restRequest("POST", "/stream/token");
149
+ }
150
+ // ── Wallet Tracker ──
151
+ getWalletTrackerWatchlist() {
152
+ return this.restRequest("GET", "/wallet-tracker/watchlist");
153
+ }
154
+ addToWatchlist(walletAddress, label) {
155
+ return this.restRequest("POST", "/wallet-tracker/watchlist", { wallet_address: walletAddress, ...(label ? { label } : {}) });
156
+ }
157
+ removeFromWatchlist(walletAddress) {
158
+ return this.restRequest("DELETE", `/wallet-tracker/watchlist/${encodeURIComponent(walletAddress)}`);
159
+ }
160
+ getWalletTrackerTrades(params) {
161
+ const qs = new URLSearchParams();
162
+ if (params) {
163
+ for (const [k, v] of Object.entries(params)) {
164
+ if (v !== undefined)
165
+ qs.set(k, v);
166
+ }
167
+ }
168
+ const query = qs.toString() ? `?${qs.toString()}` : "";
169
+ return this.restRequest("GET", `/wallet-tracker/trades${query}`);
170
+ }
171
+ getWalletTrackerSummary(params) {
172
+ const qs = new URLSearchParams();
173
+ if (params?.period)
174
+ qs.set("period", params.period);
175
+ if (params?.wallet)
176
+ qs.set("wallet", params.wallet);
177
+ const query = qs.toString() ? `?${qs.toString()}` : "";
178
+ return this.restRequest("GET", `/wallet-tracker/summary${query}`);
179
+ }
180
+ // ── Alpha Wallet Intelligence ──
181
+ getAlphaLeaderboard(params) {
182
+ const qs = new URLSearchParams();
183
+ if (params)
184
+ for (const [k, v] of Object.entries(params))
185
+ if (v !== undefined)
186
+ qs.set(k, v);
187
+ const query = qs.toString() ? `?${qs.toString()}` : "";
188
+ return this.restRequest("GET", `/alpha/leaderboard${query}`);
189
+ }
190
+ getAlphaWallet(wallet) {
191
+ return this.restRequest("GET", `/alpha/wallet/${encodeURIComponent(wallet)}`);
192
+ }
193
+ getAlphaLinked(wallet) {
194
+ return this.restRequest("GET", `/alpha/${encodeURIComponent(wallet)}/linked`);
195
+ }
196
+ // ── Token Quality ──
197
+ getTokenCapTable(mint) {
198
+ return this.restRequest("GET", `/tokens/${encodeURIComponent(mint)}/cap-table`);
199
+ }
200
+ getTokenBuyerQuality(mint) {
201
+ return this.restRequest("GET", `/tokens/${encodeURIComponent(mint)}/buyer-quality`);
202
+ }
203
+ /** Bulk buyer-quality scoring for up to 50 mints. Shares the single-mint 5-min LRU cache. */
204
+ getTokenBuyerQualityBatch(mints) {
205
+ return this.restRequest("POST", "/tokens/batch/buyer-quality", { mints });
206
+ }
207
+ // ── Token intelligence (/token/{mint}) ──
208
+ /** Comprehensive per-mint snapshot: price, MC, volume, deployer, KOL activity, age, blacklist. */
209
+ getToken(mint) {
210
+ return this.restRequest("GET", `/token/${encodeURIComponent(mint)}`);
211
+ }
212
+ /** Bulk lookup of up to 50 mints — same per-mint shape as getToken(). 10-20× cheaper than N sequential calls. */
213
+ getTokenBatch(mints) {
214
+ return this.restRequest("POST", "/token/batch", { mints });
215
+ }
216
+ // ── Copy-Trade Rules (PRO/ULTRA) ──
217
+ copyTradeList() {
218
+ return this.restRequest("GET", "/copy-trade/rules");
219
+ }
220
+ copyTradeCreate(params) {
221
+ return this.restRequest("POST", "/copy-trade/rules", params);
222
+ }
223
+ copyTradeGet(ruleId) {
224
+ return this.restRequest("GET", `/copy-trade/rules/${encodeURIComponent(ruleId)}`);
225
+ }
226
+ copyTradeUpdate(ruleId, updates) {
227
+ return this.restRequest("PATCH", `/copy-trade/rules/${encodeURIComponent(ruleId)}`, updates);
228
+ }
229
+ copyTradeDelete(ruleId) {
230
+ return this.restRequest("DELETE", `/copy-trade/rules/${encodeURIComponent(ruleId)}`);
231
+ }
232
+ // ── Coordination alerts (PRO/ULTRA, v1.1) ──
233
+ coordinationAlertsList() {
234
+ return this.restRequest("GET", "/kol/coordination/alerts");
235
+ }
236
+ coordinationAlertsCreate(params) {
237
+ return this.restRequest("POST", "/kol/coordination/alerts", params);
238
+ }
239
+ coordinationAlertsGet(ruleId) {
240
+ return this.restRequest("GET", `/kol/coordination/alerts/${encodeURIComponent(ruleId)}`);
241
+ }
242
+ coordinationAlertsUpdate(ruleId, updates) {
243
+ return this.restRequest("PATCH", `/kol/coordination/alerts/${encodeURIComponent(ruleId)}`, updates);
244
+ }
245
+ coordinationAlertsDelete(ruleId) {
246
+ return this.restRequest("DELETE", `/kol/coordination/alerts/${encodeURIComponent(ruleId)}`);
247
+ }
248
+ // ── First-touch signal ──
249
+ firstTouches(params) {
250
+ const qs = new URLSearchParams();
251
+ if (params)
252
+ for (const [k, v] of Object.entries(params))
253
+ if (v !== undefined)
254
+ qs.set(k, String(v));
255
+ const query = qs.toString() ? `?${qs.toString()}` : "";
256
+ return this.restRequest("GET", `/kol/first-touches${query}`);
257
+ }
258
+ firstTouchSubscriptionsList() {
259
+ return this.restRequest("GET", "/kol/first-touches/subscriptions");
260
+ }
261
+ firstTouchSubscriptionsCreate(params) {
262
+ return this.restRequest("POST", "/kol/first-touches/subscriptions", params);
263
+ }
264
+ firstTouchSubscriptionsGet(id) {
265
+ return this.restRequest("GET", `/kol/first-touches/subscriptions/${encodeURIComponent(id)}`);
266
+ }
267
+ firstTouchSubscriptionsUpdate(id, updates) {
268
+ return this.restRequest("PATCH", `/kol/first-touches/subscriptions/${encodeURIComponent(id)}`, updates);
269
+ }
270
+ firstTouchSubscriptionsDelete(id) {
271
+ return this.restRequest("DELETE", `/kol/first-touches/subscriptions/${encodeURIComponent(id)}`);
272
+ }
273
+ copyTradeSignals(params) {
274
+ const qs = new URLSearchParams();
275
+ if (params)
276
+ for (const [k, v] of Object.entries(params))
277
+ if (v !== undefined)
278
+ qs.set(k, v);
279
+ const query = qs.toString() ? `?${qs.toString()}` : "";
280
+ return this.restRequest("GET", `/copy-trade/signals${query}`);
281
+ }
282
+ }
@@ -0,0 +1,17 @@
1
+ import type { Plugin } from "@elizaos/core";
2
+ import { kolFeedAction } from "./actions/kol-feed.js";
3
+ import { kolCoordinationAction } from "./actions/kol-coordination.js";
4
+ import { kolLeaderboardAction } from "./actions/kol-leaderboard.js";
5
+ import { deployerAlertsAction } from "./actions/deployer-alerts.js";
6
+ import { walletTrackerWatchlistAction, walletTrackerTradesAction } from "./actions/wallet-tracker.js";
7
+ import { kolTokenEntryOrderAction } from "./actions/kol-token-entry-order.js";
8
+ import { kolCompareAction } from "./actions/kol-compare.js";
9
+ import { kolAlertsRecentAction } from "./actions/kol-alerts-recent.js";
10
+ /** Key used to store the initialized client on the runtime */
11
+ export declare const MADEONSOL_CLIENT_KEY = "madeonsol:client";
12
+ export declare const madeOnSolPlugin: Plugin;
13
+ export default madeOnSolPlugin;
14
+ export { MadeOnSolClient } from "./client.js";
15
+ export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
16
+ export { walletTrackerWatchlistAction, walletTrackerTradesAction };
17
+ export { kolTokenEntryOrderAction, kolCompareAction, kolAlertsRecentAction };
package/dist/index.js ADDED
@@ -0,0 +1,72 @@
1
+ import { kolFeedAction } from "./actions/kol-feed.js";
2
+ import { kolCoordinationAction } from "./actions/kol-coordination.js";
3
+ import { kolLeaderboardAction } from "./actions/kol-leaderboard.js";
4
+ import { deployerAlertsAction } from "./actions/deployer-alerts.js";
5
+ import { walletTrackerWatchlistAction, walletTrackerTradesAction } from "./actions/wallet-tracker.js";
6
+ import { kolTokenEntryOrderAction } from "./actions/kol-token-entry-order.js";
7
+ import { kolCompareAction } from "./actions/kol-compare.js";
8
+ import { kolAlertsRecentAction } from "./actions/kol-alerts-recent.js";
9
+ import { MadeOnSolClient } from "./client.js";
10
+ /** Key used to store the initialized client on the runtime */
11
+ export const MADEONSOL_CLIENT_KEY = "madeonsol:client";
12
+ export const madeOnSolPlugin = {
13
+ name: "madeonsol",
14
+ description: "Query Solana KOL trading intelligence and deployer analytics from MadeOnSol. Tracks 1,000+ KOL wallets and 6,700+ Pump.fun deployers.",
15
+ actions: [
16
+ kolFeedAction,
17
+ kolCoordinationAction,
18
+ kolLeaderboardAction,
19
+ deployerAlertsAction,
20
+ walletTrackerWatchlistAction,
21
+ walletTrackerTradesAction,
22
+ kolTokenEntryOrderAction,
23
+ kolCompareAction,
24
+ kolAlertsRecentAction,
25
+ ],
26
+ /**
27
+ * Initialize the MadeOnSol client.
28
+ * Auth priority: MADEONSOL_API_KEY > SVM_PRIVATE_KEY (x402).
29
+ * Get a free `msk_` API key at madeonsol.com/developer — no wallet needed.
30
+ *
31
+ * v1.0 breaking change: RAPIDAPI_KEY support has been removed
32
+ * (MadeOnSol RapidAPI marketplace was retired 2026-04-19).
33
+ */
34
+ init: async (_config, runtime) => {
35
+ const baseUrl = String(runtime.getSetting?.("MADEONSOL_API_URL") || "https://madeonsol.com");
36
+ const apiKey = runtime.getSetting?.("MADEONSOL_API_KEY");
37
+ const privateKey = runtime.getSetting?.("SVM_PRIVATE_KEY");
38
+ let fetchFn;
39
+ if (apiKey) {
40
+ console.log("[madeonsol] Using MadeOnSol API key (Bearer auth)");
41
+ }
42
+ else if (privateKey) {
43
+ try {
44
+ const { wrapFetchWithPayment } = await import("@x402/fetch");
45
+ const { x402Client } = await import("@x402/core/client");
46
+ const { ExactSvmScheme } = await import("@x402/svm/exact/client");
47
+ const { createKeyPairSignerFromBytes } = await import("@solana/kit");
48
+ const { base58 } = await import("@scure/base");
49
+ const signer = await createKeyPairSignerFromBytes(base58.decode(privateKey));
50
+ const client = new x402Client();
51
+ client.register("solana:*", new ExactSvmScheme(signer));
52
+ fetchFn = wrapFetchWithPayment(fetch, client);
53
+ console.log(`[madeonsol] x402 payments enabled, wallet: ${signer.address}`);
54
+ }
55
+ catch (err) {
56
+ console.warn("[madeonsol] x402 payment setup failed:", err);
57
+ }
58
+ }
59
+ else {
60
+ console.warn("[madeonsol] No auth configured — every API call will fail.\n" +
61
+ " → Get a free MADEONSOL_API_KEY (200 req/day, no card) at https://madeonsol.com/developer\n" +
62
+ " → Or set SVM_PRIVATE_KEY for x402 micropayments.");
63
+ }
64
+ const madeOnSolClient = new MadeOnSolClient({ baseUrl, apiKey, fetchFn });
65
+ runtime[MADEONSOL_CLIENT_KEY] = madeOnSolClient;
66
+ },
67
+ };
68
+ export default madeOnSolPlugin;
69
+ export { MadeOnSolClient } from "./client.js";
70
+ export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
71
+ export { walletTrackerWatchlistAction, walletTrackerTradesAction };
72
+ export { kolTokenEntryOrderAction, kolCompareAction, kolAlertsRecentAction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madeonsol/plugin-madeonsol",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "ElizaOS plugin for MadeOnSol — Solana KOL intelligence and deployer analytics via x402 micropayments",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",