@madeonsol/plugin-madeonsol 0.5.0 → 0.6.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/README.md +20 -19
- package/dist/actions/wallet-tracker.d.ts +3 -0
- package/dist/actions/wallet-tracker.js +84 -0
- package/dist/client.d.ts +34 -0
- package/dist/client.js +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/src/actions/wallet-tracker.ts +119 -0
- package/src/client.ts +32 -0
- package/src/index.ts +4 -0
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @madeonsol/plugin-madeonsol
|
|
2
2
|
|
|
3
|
-
ElizaOS plugin for [MadeOnSol](https://madeonsol.com) — Solana KOL trading intelligence and
|
|
3
|
+
ElizaOS plugin for [MadeOnSol](https://madeonsol.com) — Solana KOL trading intelligence, deployer analytics, and wallet tracking.
|
|
4
4
|
|
|
5
|
-
> Real-time Solana trading intelligence: track 1,000+ KOL wallets with <3s latency, score 6,700+ Pump.fun deployers by reputation, detect multi-KOL coordination signals, and stream every DEX trade. Free tier: 200 requests/day at [madeonsol.com/developer](https://madeonsol.com/developer) — no credit card required.
|
|
5
|
+
> Real-time Solana trading intelligence: track 1,000+ KOL wallets with <3s latency, score 6,700+ Pump.fun deployers by reputation, detect multi-KOL coordination signals, monitor any Solana wallet for swaps and transfers, and stream every DEX trade. Free tier: 200 requests/day at [madeonsol.com/developer](https://madeonsol.com/developer) — no credit card required.
|
|
6
6
|
|
|
7
7
|
## Authentication
|
|
8
8
|
|
|
@@ -11,20 +11,20 @@ Three options (in priority order):
|
|
|
11
11
|
| Method | Setting | Best for |
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| **MadeOnSol API key** (recommended) | `MADEONSOL_API_KEY` | Developers — [get a free key](https://madeonsol.com/developer) |
|
|
14
|
-
| RapidAPI key | `RAPIDAPI_KEY` | RapidAPI subscribers |
|
|
15
14
|
| x402 micropayments | `SVM_PRIVATE_KEY` | AI agents with Solana wallets |
|
|
16
15
|
|
|
17
16
|
## What it does
|
|
18
17
|
|
|
19
18
|
Gives your ElizaOS agent access to MadeOnSol's Solana intelligence API.
|
|
20
19
|
|
|
21
|
-
| Action |
|
|
22
|
-
|
|
20
|
+
| Action | Description |
|
|
21
|
+
|--------|-------------|
|
|
23
22
|
| `GET_KOL_FEED` | Real-time KOL trade feed (1,000+ wallets) |
|
|
24
23
|
| `GET_KOL_COORDINATION` | Multi-KOL convergence signals |
|
|
25
|
-
| `GET_KOL_LEADERBOARD` | KOL PnL/win-rate rankings (180 days of history
|
|
26
|
-
| `GET_DEPLOYER_ALERTS` | Pump.fun deployer alerts
|
|
27
|
-
| `
|
|
24
|
+
| `GET_KOL_LEADERBOARD` | KOL PnL/win-rate rankings (180 days of history) |
|
|
25
|
+
| `GET_DEPLOYER_ALERTS` | Pump.fun deployer alerts with KOL enrichment |
|
|
26
|
+
| `WALLET_TRACKER_WATCHLIST` | List your tracked wallets and remaining capacity |
|
|
27
|
+
| `WALLET_TRACKER_TRADES` | Recent swaps and transfers from your watchlist |
|
|
28
28
|
|
|
29
29
|
## Install
|
|
30
30
|
|
|
@@ -45,10 +45,7 @@ const agent = {
|
|
|
45
45
|
// Option 1: API key (simplest — get one free at madeonsol.com/developer)
|
|
46
46
|
MADEONSOL_API_KEY: "msk_your_api_key_here",
|
|
47
47
|
|
|
48
|
-
// Option 2:
|
|
49
|
-
// RAPIDAPI_KEY: "your_rapidapi_key",
|
|
50
|
-
|
|
51
|
-
// Option 3: x402 micropayments (AI agents)
|
|
48
|
+
// Option 2: x402 micropayments (AI agents)
|
|
52
49
|
// SVM_PRIVATE_KEY: "your_base58_solana_private_key",
|
|
53
50
|
},
|
|
54
51
|
};
|
|
@@ -59,21 +56,25 @@ Your agent can then respond to queries like:
|
|
|
59
56
|
- "Show me the KOL leaderboard this week"
|
|
60
57
|
- "What tokens are multiple KOLs accumulating?"
|
|
61
58
|
- "Any new deployer alerts from Pump.fun?"
|
|
59
|
+
- "Show my wallet tracker watchlist"
|
|
60
|
+
- "What did my tracked wallets trade recently?"
|
|
62
61
|
|
|
63
|
-
##
|
|
62
|
+
## Tiers
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
| Tier | Price | Wallets tracked | Requests/day |
|
|
65
|
+
|------|-------|-----------------|--------------|
|
|
66
|
+
| BASIC | Free | 10 | 200 |
|
|
67
|
+
| PRO | $49/mo | 50 | 10,000 |
|
|
68
|
+
| ULTRA | $199/mo | 100 + WS events | 100,000 |
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
Get a key at [madeonsol.com/developer](https://madeonsol.com/developer).
|
|
70
71
|
|
|
71
72
|
## Also Available
|
|
72
73
|
|
|
73
74
|
| Platform | Package |
|
|
74
75
|
|---|---|
|
|
75
|
-
| TypeScript SDK | [`madeonsol
|
|
76
|
-
| Python (LangChain, CrewAI) | [`madeonsol-x402`](https://
|
|
76
|
+
| TypeScript SDK | [`madeonsol`](https://www.npmjs.com/package/madeonsol) on npm |
|
|
77
|
+
| Python (LangChain, CrewAI) | [`madeonsol-x402`](https://pypi.org/project/madeonsol-x402/) on PyPI |
|
|
77
78
|
| MCP Server (Claude, Cursor) | [`mcp-server-madeonsol`](https://www.npmjs.com/package/mcp-server-madeonsol) |
|
|
78
79
|
| Solana Agent Kit | [`solana-agent-kit-plugin-madeonsol`](https://www.npmjs.com/package/solana-agent-kit-plugin-madeonsol) |
|
|
79
80
|
|
|
@@ -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
|
+
};
|
package/dist/client.d.ts
CHANGED
|
@@ -138,4 +138,38 @@ export declare class MadeOnSolClient {
|
|
|
138
138
|
error?: string;
|
|
139
139
|
status: number;
|
|
140
140
|
}>;
|
|
141
|
+
getWalletTrackerWatchlist(): Promise<{
|
|
142
|
+
data?: unknown;
|
|
143
|
+
error?: string;
|
|
144
|
+
status: number;
|
|
145
|
+
}>;
|
|
146
|
+
addToWatchlist(walletAddress: string, label?: string): Promise<{
|
|
147
|
+
data?: unknown;
|
|
148
|
+
error?: string;
|
|
149
|
+
status: number;
|
|
150
|
+
}>;
|
|
151
|
+
removeFromWatchlist(walletAddress: string): Promise<{
|
|
152
|
+
data?: unknown;
|
|
153
|
+
error?: string;
|
|
154
|
+
status: number;
|
|
155
|
+
}>;
|
|
156
|
+
getWalletTrackerTrades(params?: {
|
|
157
|
+
wallet?: string;
|
|
158
|
+
action?: string;
|
|
159
|
+
event_type?: string;
|
|
160
|
+
limit?: string;
|
|
161
|
+
before?: string;
|
|
162
|
+
}): Promise<{
|
|
163
|
+
data?: unknown;
|
|
164
|
+
error?: string;
|
|
165
|
+
status: number;
|
|
166
|
+
}>;
|
|
167
|
+
getWalletTrackerSummary(params?: {
|
|
168
|
+
period?: string;
|
|
169
|
+
wallet?: string;
|
|
170
|
+
}): Promise<{
|
|
171
|
+
data?: unknown;
|
|
172
|
+
error?: string;
|
|
173
|
+
status: number;
|
|
174
|
+
}>;
|
|
141
175
|
}
|
package/dist/client.js
CHANGED
|
@@ -123,4 +123,33 @@ export class MadeOnSolClient {
|
|
|
123
123
|
getStreamToken() {
|
|
124
124
|
return this.restRequest("POST", "/stream/token");
|
|
125
125
|
}
|
|
126
|
+
// ── Wallet Tracker ──
|
|
127
|
+
getWalletTrackerWatchlist() {
|
|
128
|
+
return this.restRequest("GET", "/wallet-tracker/watchlist");
|
|
129
|
+
}
|
|
130
|
+
addToWatchlist(walletAddress, label) {
|
|
131
|
+
return this.restRequest("POST", "/wallet-tracker/watchlist", { wallet_address: walletAddress, ...(label ? { label } : {}) });
|
|
132
|
+
}
|
|
133
|
+
removeFromWatchlist(walletAddress) {
|
|
134
|
+
return this.restRequest("DELETE", `/wallet-tracker/watchlist/${encodeURIComponent(walletAddress)}`);
|
|
135
|
+
}
|
|
136
|
+
getWalletTrackerTrades(params) {
|
|
137
|
+
const url = new URL(`${this.baseUrl}/api/v1/wallet-tracker/trades`);
|
|
138
|
+
if (params) {
|
|
139
|
+
for (const [k, v] of Object.entries(params)) {
|
|
140
|
+
if (v !== undefined)
|
|
141
|
+
url.searchParams.set(k, v);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return this.restRequest("GET", `/wallet-tracker/trades${url.search}`);
|
|
145
|
+
}
|
|
146
|
+
getWalletTrackerSummary(params) {
|
|
147
|
+
const qs = new URLSearchParams();
|
|
148
|
+
if (params?.period)
|
|
149
|
+
qs.set("period", params.period);
|
|
150
|
+
if (params?.wallet)
|
|
151
|
+
qs.set("wallet", params.wallet);
|
|
152
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
153
|
+
return this.restRequest("GET", `/wallet-tracker/summary${query}`);
|
|
154
|
+
}
|
|
126
155
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,11 @@ import { kolFeedAction } from "./actions/kol-feed.js";
|
|
|
3
3
|
import { kolCoordinationAction } from "./actions/kol-coordination.js";
|
|
4
4
|
import { kolLeaderboardAction } from "./actions/kol-leaderboard.js";
|
|
5
5
|
import { deployerAlertsAction } from "./actions/deployer-alerts.js";
|
|
6
|
+
import { walletTrackerWatchlistAction, walletTrackerTradesAction } from "./actions/wallet-tracker.js";
|
|
6
7
|
/** Key used to store the initialized client on the runtime */
|
|
7
8
|
export declare const MADEONSOL_CLIENT_KEY = "madeonsol:client";
|
|
8
9
|
export declare const madeOnSolPlugin: Plugin;
|
|
9
10
|
export default madeOnSolPlugin;
|
|
10
11
|
export { MadeOnSolClient } from "./client.js";
|
|
11
12
|
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
|
13
|
+
export { walletTrackerWatchlistAction, walletTrackerTradesAction };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { kolFeedAction } from "./actions/kol-feed.js";
|
|
|
2
2
|
import { kolCoordinationAction } from "./actions/kol-coordination.js";
|
|
3
3
|
import { kolLeaderboardAction } from "./actions/kol-leaderboard.js";
|
|
4
4
|
import { deployerAlertsAction } from "./actions/deployer-alerts.js";
|
|
5
|
+
import { walletTrackerWatchlistAction, walletTrackerTradesAction } from "./actions/wallet-tracker.js";
|
|
5
6
|
import { MadeOnSolClient } from "./client.js";
|
|
6
7
|
/** Key used to store the initialized client on the runtime */
|
|
7
8
|
export const MADEONSOL_CLIENT_KEY = "madeonsol:client";
|
|
@@ -13,6 +14,8 @@ export const madeOnSolPlugin = {
|
|
|
13
14
|
kolCoordinationAction,
|
|
14
15
|
kolLeaderboardAction,
|
|
15
16
|
deployerAlertsAction,
|
|
17
|
+
walletTrackerWatchlistAction,
|
|
18
|
+
walletTrackerTradesAction,
|
|
16
19
|
],
|
|
17
20
|
/**
|
|
18
21
|
* Initialize the MadeOnSol client.
|
|
@@ -58,3 +61,4 @@ export const madeOnSolPlugin = {
|
|
|
58
61
|
export default madeOnSolPlugin;
|
|
59
62
|
export { MadeOnSolClient } from "./client.js";
|
|
60
63
|
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
|
64
|
+
export { walletTrackerWatchlistAction, walletTrackerTradesAction };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@madeonsol/plugin-madeonsol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "ElizaOS plugin for MadeOnSol \u00e2\u20ac\u201d Solana KOL intelligence and deployer analytics via x402 micropayments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { Action, IAgentRuntime, Memory, State, HandlerCallback } from "@elizaos/core";
|
|
2
|
+
import { MadeOnSolClient } from "../client.js";
|
|
3
|
+
import { MADEONSOL_CLIENT_KEY } from "../index.js";
|
|
4
|
+
|
|
5
|
+
function getClient(runtime: IAgentRuntime): MadeOnSolClient {
|
|
6
|
+
return ((runtime as unknown as Record<string, unknown>)[MADEONSOL_CLIENT_KEY] as MadeOnSolClient) ?? new MadeOnSolClient();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const walletTrackerWatchlistAction: Action = {
|
|
10
|
+
name: "WALLET_TRACKER_WATCHLIST",
|
|
11
|
+
description:
|
|
12
|
+
"List wallets in your MadeOnSol wallet watchlist with labels and remaining capacity.",
|
|
13
|
+
similes: [
|
|
14
|
+
"wallet watchlist",
|
|
15
|
+
"tracked wallets",
|
|
16
|
+
"my wallets",
|
|
17
|
+
"wallet tracker list",
|
|
18
|
+
"show tracked wallets",
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
validate: async (_runtime: IAgentRuntime, message: Memory): Promise<boolean> => {
|
|
22
|
+
const text = (message.content?.text || "").toLowerCase();
|
|
23
|
+
return /\b(wallet.tracker|watchlist|tracked wallet)/i.test(text) && /\b(list|show|get|my)\b/i.test(text);
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
handler: async (
|
|
27
|
+
runtime: IAgentRuntime,
|
|
28
|
+
_message: Memory,
|
|
29
|
+
_state?: State,
|
|
30
|
+
_options?: unknown,
|
|
31
|
+
callback?: HandlerCallback,
|
|
32
|
+
) => {
|
|
33
|
+
const client = getClient(runtime);
|
|
34
|
+
const result = await client.getWalletTrackerWatchlist();
|
|
35
|
+
|
|
36
|
+
if (result.error) {
|
|
37
|
+
callback?.({ text: `Error: ${result.error}` });
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const data = result.data as { wallets: Array<{ wallet_address: string; label: string | null; added_at: string }>; count: number; limit: number; remaining: number };
|
|
42
|
+
const lines = (data.wallets || []).map(
|
|
43
|
+
(w) => `${w.label ? `[${w.label}] ` : ""}${w.wallet_address}`
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
callback?.({
|
|
47
|
+
text: lines.length
|
|
48
|
+
? `Tracked wallets (${data.count}/${data.limit}):\n${lines.join("\n")}\n${data.remaining} slot(s) remaining.`
|
|
49
|
+
: `No wallets tracked yet. Limit: ${data.limit}.`,
|
|
50
|
+
content: data,
|
|
51
|
+
});
|
|
52
|
+
return undefined;
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
examples: [
|
|
56
|
+
[
|
|
57
|
+
{ name: "user1", content: { text: "Show my wallet tracker watchlist" } },
|
|
58
|
+
{ name: "assistant", content: { text: "Here are your tracked wallets..." } },
|
|
59
|
+
],
|
|
60
|
+
] as Action["examples"],
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const walletTrackerTradesAction: Action = {
|
|
64
|
+
name: "WALLET_TRACKER_TRADES",
|
|
65
|
+
description:
|
|
66
|
+
"Get recent swap and transfer events from wallets in your MadeOnSol watchlist.",
|
|
67
|
+
similes: [
|
|
68
|
+
"wallet tracker trades",
|
|
69
|
+
"tracked wallet activity",
|
|
70
|
+
"watchlist trades",
|
|
71
|
+
"wallet swaps",
|
|
72
|
+
"wallet transfers",
|
|
73
|
+
"what did my tracked wallets do",
|
|
74
|
+
],
|
|
75
|
+
|
|
76
|
+
validate: async (_runtime: IAgentRuntime, message: Memory): Promise<boolean> => {
|
|
77
|
+
const text = (message.content?.text || "").toLowerCase();
|
|
78
|
+
return /\b(wallet.tracker|watchlist|tracked wallet)/i.test(text) && /\b(trade|swap|transfer|activity|buy|sell)\b/i.test(text);
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
handler: async (
|
|
82
|
+
runtime: IAgentRuntime,
|
|
83
|
+
message: Memory,
|
|
84
|
+
_state?: State,
|
|
85
|
+
_options?: unknown,
|
|
86
|
+
callback?: HandlerCallback,
|
|
87
|
+
) => {
|
|
88
|
+
const client = getClient(runtime);
|
|
89
|
+
const text = (message.content?.text || "").toLowerCase();
|
|
90
|
+
const action = text.includes("buy") ? "buy" : text.includes("sell") ? "sell" : undefined;
|
|
91
|
+
|
|
92
|
+
const result = await client.getWalletTrackerTrades({ limit: "20", ...(action ? { action } : {}) });
|
|
93
|
+
|
|
94
|
+
if (result.error) {
|
|
95
|
+
callback?.({ text: `Error: ${result.error}` });
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const data = result.data as { events: Array<{ wallet_address: string; label: string | null; action: string; token_symbol: string | null; sol_amount: number; block_time_iso: string }>; count: number };
|
|
100
|
+
const lines = (data.events || []).slice(0, 15).map(
|
|
101
|
+
(e) => `${e.label || e.wallet_address.slice(0, 8)} ${e.action} ${e.token_symbol || "?"} for ${Number(e.sol_amount).toFixed(2)} SOL`
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
callback?.({
|
|
105
|
+
text: lines.length
|
|
106
|
+
? `Recent wallet tracker events:\n${lines.join("\n")}`
|
|
107
|
+
: "No recent events for your tracked wallets.",
|
|
108
|
+
content: data,
|
|
109
|
+
});
|
|
110
|
+
return undefined;
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
examples: [
|
|
114
|
+
[
|
|
115
|
+
{ name: "user1", content: { text: "What did my tracked wallets trade recently?" } },
|
|
116
|
+
{ name: "assistant", content: { text: "Here are the latest trades from your watchlist..." } },
|
|
117
|
+
],
|
|
118
|
+
] as Action["examples"],
|
|
119
|
+
};
|
package/src/client.ts
CHANGED
|
@@ -157,4 +157,36 @@ export class MadeOnSolClient {
|
|
|
157
157
|
getStreamToken() {
|
|
158
158
|
return this.restRequest("POST", "/stream/token");
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
// ── Wallet Tracker ──
|
|
162
|
+
|
|
163
|
+
getWalletTrackerWatchlist() {
|
|
164
|
+
return this.restRequest("GET", "/wallet-tracker/watchlist");
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
addToWatchlist(walletAddress: string, label?: string) {
|
|
168
|
+
return this.restRequest("POST", "/wallet-tracker/watchlist", { wallet_address: walletAddress, ...(label ? { label } : {}) });
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
removeFromWatchlist(walletAddress: string) {
|
|
172
|
+
return this.restRequest("DELETE", `/wallet-tracker/watchlist/${encodeURIComponent(walletAddress)}`);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
getWalletTrackerTrades(params?: { wallet?: string; action?: string; event_type?: string; limit?: string; before?: string }) {
|
|
176
|
+
const url = new URL(`${this.baseUrl}/api/v1/wallet-tracker/trades`);
|
|
177
|
+
if (params) {
|
|
178
|
+
for (const [k, v] of Object.entries(params)) {
|
|
179
|
+
if (v !== undefined) url.searchParams.set(k, v);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return this.restRequest("GET", `/wallet-tracker/trades${url.search}`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
getWalletTrackerSummary(params?: { period?: string; wallet?: string }) {
|
|
186
|
+
const qs = new URLSearchParams();
|
|
187
|
+
if (params?.period) qs.set("period", params.period);
|
|
188
|
+
if (params?.wallet) qs.set("wallet", params.wallet);
|
|
189
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
190
|
+
return this.restRequest("GET", `/wallet-tracker/summary${query}`);
|
|
191
|
+
}
|
|
160
192
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { kolFeedAction } from "./actions/kol-feed.js";
|
|
|
3
3
|
import { kolCoordinationAction } from "./actions/kol-coordination.js";
|
|
4
4
|
import { kolLeaderboardAction } from "./actions/kol-leaderboard.js";
|
|
5
5
|
import { deployerAlertsAction } from "./actions/deployer-alerts.js";
|
|
6
|
+
import { walletTrackerWatchlistAction, walletTrackerTradesAction } from "./actions/wallet-tracker.js";
|
|
6
7
|
import { MadeOnSolClient } from "./client.js";
|
|
7
8
|
|
|
8
9
|
/** Key used to store the initialized client on the runtime */
|
|
@@ -17,6 +18,8 @@ export const madeOnSolPlugin: Plugin = {
|
|
|
17
18
|
kolCoordinationAction,
|
|
18
19
|
kolLeaderboardAction,
|
|
19
20
|
deployerAlertsAction,
|
|
21
|
+
walletTrackerWatchlistAction,
|
|
22
|
+
walletTrackerTradesAction,
|
|
20
23
|
],
|
|
21
24
|
|
|
22
25
|
/**
|
|
@@ -65,3 +68,4 @@ export const madeOnSolPlugin: Plugin = {
|
|
|
65
68
|
export default madeOnSolPlugin;
|
|
66
69
|
export { MadeOnSolClient } from "./client.js";
|
|
67
70
|
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
|
71
|
+
export { walletTrackerWatchlistAction, walletTrackerTradesAction };
|