@madeonsol/plugin-madeonsol 0.1.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/LICENSE +1 -0
- package/README.md +67 -0
- package/dist/actions/deployer-alerts.d.ts +2 -0
- package/dist/actions/deployer-alerts.js +50 -0
- package/dist/actions/kol-coordination.d.ts +2 -0
- package/dist/actions/kol-coordination.js +45 -0
- package/dist/actions/kol-feed.d.ts +2 -0
- package/dist/actions/kol-feed.js +46 -0
- package/dist/actions/kol-leaderboard.d.ts +2 -0
- package/dist/actions/kol-leaderboard.js +45 -0
- package/dist/client.d.ts +58 -0
- package/dist/client.js +45 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +52 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT License
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @madeonsol/plugin-madeonsol
|
|
2
|
+
|
|
3
|
+
ElizaOS plugin for [MadeOnSol](https://madeonsol.com) — Solana KOL trading intelligence and deployer analytics via x402 micropayments.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Gives your ElizaOS agent access to MadeOnSol's x402-gated API endpoints. The agent pays per request with USDC on Solana — no API keys needed.
|
|
8
|
+
|
|
9
|
+
| Action | Endpoint | Price |
|
|
10
|
+
|--------|----------|-------|
|
|
11
|
+
| `GET_KOL_FEED` | Real-time KOL trade feed (946 wallets) | $0.005 USDC |
|
|
12
|
+
| `GET_KOL_COORDINATION` | Multi-KOL convergence signals | $0.02 USDC |
|
|
13
|
+
| `GET_KOL_LEADERBOARD` | KOL PnL/win-rate rankings | $0.005 USDC |
|
|
14
|
+
| `GET_DEPLOYER_ALERTS` | Pump.fun elite deployer alerts | $0.01 USDC |
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @madeonsol/plugin-madeonsol @x402/fetch @x402/svm @x402/core @solana/kit @scure/base
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { madeOnSolPlugin } from "@madeonsol/plugin-madeonsol";
|
|
26
|
+
|
|
27
|
+
const agent = {
|
|
28
|
+
plugins: [madeOnSolPlugin],
|
|
29
|
+
settings: {
|
|
30
|
+
// Required for automatic x402 payments:
|
|
31
|
+
SVM_PRIVATE_KEY: "your_base58_solana_private_key",
|
|
32
|
+
// Optional:
|
|
33
|
+
MADEONSOL_API_URL: "https://madeonsol.com",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The plugin's `init` function automatically:
|
|
39
|
+
1. Creates a Solana signer from `SVM_PRIVATE_KEY`
|
|
40
|
+
2. Registers the x402 payment scheme
|
|
41
|
+
3. Wraps fetch with automatic 402 → pay → retry handling
|
|
42
|
+
|
|
43
|
+
Your agent can then respond to queries like:
|
|
44
|
+
- "What are KOLs buying right now?"
|
|
45
|
+
- "Show me the KOL leaderboard this week"
|
|
46
|
+
- "What tokens are multiple KOLs accumulating?"
|
|
47
|
+
- "Any new deployer alerts from Pump.fun?"
|
|
48
|
+
|
|
49
|
+
Without `SVM_PRIVATE_KEY`, the plugin runs in read-only mode and returns payment requirement info instead of data.
|
|
50
|
+
|
|
51
|
+
## Wallet requirements
|
|
52
|
+
|
|
53
|
+
The wallet needs:
|
|
54
|
+
- ~0.01 SOL for transaction fees
|
|
55
|
+
- USDC balance (even $0.10 covers 20+ requests)
|
|
56
|
+
|
|
57
|
+
## Discovery endpoint
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
GET https://madeonsol.com/api/x402
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Returns all available endpoints, prices, and parameter docs. No payment required.
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
|
@@ -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 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
|
+
const result = await client.getDeployerAlerts({ limit });
|
|
25
|
+
if (result.error) {
|
|
26
|
+
callback?.({ text: result.status === 402
|
|
27
|
+
? "x402 payment required but no wallet configured. Set SVM_PRIVATE_KEY to enable automatic USDC payments."
|
|
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 deployer = a.deployers;
|
|
34
|
+
const mc = a.market_cap_at_alert ? `$${(a.market_cap_at_alert / 1000).toFixed(1)}k` : "?";
|
|
35
|
+
const kols = a.kol_buys ? `${a.kol_buys.count} KOLs buying` : "";
|
|
36
|
+
return `[${deployer?.tier}] ${a.token_symbol || "?"} — MC: ${mc}${kols ? ` | ${kols}` : ""}`;
|
|
37
|
+
});
|
|
38
|
+
callback?.({
|
|
39
|
+
text: `Deployer Alerts:\n${lines.join("\n") || "No recent alerts."}`,
|
|
40
|
+
content: data,
|
|
41
|
+
});
|
|
42
|
+
return undefined;
|
|
43
|
+
},
|
|
44
|
+
examples: [
|
|
45
|
+
[
|
|
46
|
+
{ name: "user1", content: { text: "Show me the latest deployer alerts from Pump.fun" } },
|
|
47
|
+
{ name: "assistant", content: { text: "Here are the latest deployer alerts..." } },
|
|
48
|
+
],
|
|
49
|
+
],
|
|
50
|
+
};
|
|
@@ -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 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
|
+
? "x402 payment required but no wallet configured. Set SVM_PRIVATE_KEY to enable automatic USDC payments."
|
|
28
|
+
: `Error: ${result.error}` });
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const data = result.data;
|
|
32
|
+
const lines = (data.coordination || []).map((t) => `${t.token_symbol}: ${t.kol_count} KOLs ${t.signal} (${t.net_sol_flow > 0 ? "+" : ""}${t.net_sol_flow.toFixed(2)} SOL net)`);
|
|
33
|
+
callback?.({
|
|
34
|
+
text: `KOL convergence signals (${period}):\n${lines.join("\n") || "No coordination signals found."}`,
|
|
35
|
+
content: data,
|
|
36
|
+
});
|
|
37
|
+
return undefined;
|
|
38
|
+
},
|
|
39
|
+
examples: [
|
|
40
|
+
[
|
|
41
|
+
{ name: "user1", content: { text: "What tokens are multiple KOLs accumulating?" } },
|
|
42
|
+
{ name: "assistant", content: { text: "Here are the KOL convergence signals..." } },
|
|
43
|
+
],
|
|
44
|
+
],
|
|
45
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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 946 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
|
+
? "x402 payment required but no wallet configured. Set SVM_PRIVATE_KEY to enable automatic USDC payments."
|
|
29
|
+
: `Error: ${result.error}` });
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const data = result.data;
|
|
33
|
+
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`);
|
|
34
|
+
callback?.({
|
|
35
|
+
text: `Latest KOL trades:\n${lines.join("\n")}`,
|
|
36
|
+
content: data,
|
|
37
|
+
});
|
|
38
|
+
return undefined;
|
|
39
|
+
},
|
|
40
|
+
examples: [
|
|
41
|
+
[
|
|
42
|
+
{ name: "user1", content: { text: "What are the latest KOL trades on Solana?" } },
|
|
43
|
+
{ name: "assistant", content: { text: "Here are the latest KOL trades from MadeOnSol..." } },
|
|
44
|
+
],
|
|
45
|
+
],
|
|
46
|
+
};
|
|
@@ -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
|
+
? "x402 payment required but no wallet configured. Set SVM_PRIVATE_KEY to enable automatic USDC payments."
|
|
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
|
+
};
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MadeOnSol x402 API client.
|
|
3
|
+
* Uses @x402/fetch to automatically handle 402 → sign USDC → retry flow.
|
|
4
|
+
*/
|
|
5
|
+
export interface MadeOnSolClientOptions {
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
/**
|
|
8
|
+
* A fetch function that handles x402 payments automatically.
|
|
9
|
+
* Created via wrapFetchWithPayment() from @x402/fetch.
|
|
10
|
+
* If not provided, uses plain fetch (requests will return 402).
|
|
11
|
+
*/
|
|
12
|
+
fetchFn?: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
export declare class MadeOnSolClient {
|
|
15
|
+
private baseUrl;
|
|
16
|
+
private fetchFn;
|
|
17
|
+
constructor(options?: MadeOnSolClientOptions);
|
|
18
|
+
query<T = unknown>(path: string, params?: Record<string, string | undefined>): Promise<{
|
|
19
|
+
data?: T;
|
|
20
|
+
error?: string;
|
|
21
|
+
status: number;
|
|
22
|
+
}>;
|
|
23
|
+
getKolFeed(params?: {
|
|
24
|
+
limit?: string;
|
|
25
|
+
action?: string;
|
|
26
|
+
kol?: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
data?: unknown;
|
|
29
|
+
error?: string;
|
|
30
|
+
status: number;
|
|
31
|
+
}>;
|
|
32
|
+
getKolCoordination(params?: {
|
|
33
|
+
period?: string;
|
|
34
|
+
min_kols?: string;
|
|
35
|
+
limit?: string;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
data?: unknown;
|
|
38
|
+
error?: string;
|
|
39
|
+
status: number;
|
|
40
|
+
}>;
|
|
41
|
+
getKolLeaderboard(params?: {
|
|
42
|
+
period?: string;
|
|
43
|
+
limit?: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
data?: unknown;
|
|
46
|
+
error?: string;
|
|
47
|
+
status: number;
|
|
48
|
+
}>;
|
|
49
|
+
getDeployerAlerts(params?: {
|
|
50
|
+
since?: string;
|
|
51
|
+
limit?: string;
|
|
52
|
+
offset?: string;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
data?: unknown;
|
|
55
|
+
error?: string;
|
|
56
|
+
status: number;
|
|
57
|
+
}>;
|
|
58
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MadeOnSol x402 API client.
|
|
3
|
+
* Uses @x402/fetch to automatically handle 402 → sign USDC → retry flow.
|
|
4
|
+
*/
|
|
5
|
+
const DEFAULT_BASE = "https://madeonsol.com";
|
|
6
|
+
export class MadeOnSolClient {
|
|
7
|
+
baseUrl;
|
|
8
|
+
fetchFn;
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
this.baseUrl = options.baseUrl || DEFAULT_BASE;
|
|
11
|
+
this.fetchFn = options.fetchFn || globalThis.fetch;
|
|
12
|
+
}
|
|
13
|
+
async query(path, params) {
|
|
14
|
+
const url = new URL(path, this.baseUrl);
|
|
15
|
+
if (params) {
|
|
16
|
+
for (const [k, v] of Object.entries(params)) {
|
|
17
|
+
if (v !== undefined)
|
|
18
|
+
url.searchParams.set(k, v);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const res = await this.fetchFn(url.toString(), { method: "GET" });
|
|
22
|
+
if (res.status === 402) {
|
|
23
|
+
const body = await res.json();
|
|
24
|
+
return { error: `Payment required: ${JSON.stringify(body.accepts?.[0] || body)}`, status: 402 };
|
|
25
|
+
}
|
|
26
|
+
if (!res.ok) {
|
|
27
|
+
const text = await res.text().catch(() => "Unknown error");
|
|
28
|
+
return { error: text, status: res.status };
|
|
29
|
+
}
|
|
30
|
+
const data = await res.json();
|
|
31
|
+
return { data, status: res.status };
|
|
32
|
+
}
|
|
33
|
+
getKolFeed(params) {
|
|
34
|
+
return this.query("/api/x402/kol/feed", params);
|
|
35
|
+
}
|
|
36
|
+
getKolCoordination(params) {
|
|
37
|
+
return this.query("/api/x402/kol/coordination", params);
|
|
38
|
+
}
|
|
39
|
+
getKolLeaderboard(params) {
|
|
40
|
+
return this.query("/api/x402/kol/leaderboard", params);
|
|
41
|
+
}
|
|
42
|
+
getDeployerAlerts(params) {
|
|
43
|
+
return this.query("/api/x402/deployer-hunter/alerts", params);
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
/** Key used to store the initialized client on the runtime */
|
|
7
|
+
export declare const MADEONSOL_CLIENT_KEY = "madeonsol:client";
|
|
8
|
+
export declare const madeOnSolPlugin: Plugin;
|
|
9
|
+
export default madeOnSolPlugin;
|
|
10
|
+
export { MadeOnSolClient } from "./client.js";
|
|
11
|
+
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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 { MadeOnSolClient } from "./client.js";
|
|
6
|
+
/** Key used to store the initialized client on the runtime */
|
|
7
|
+
export const MADEONSOL_CLIENT_KEY = "madeonsol:client";
|
|
8
|
+
export const madeOnSolPlugin = {
|
|
9
|
+
name: "madeonsol",
|
|
10
|
+
description: "Query Solana KOL trading intelligence and deployer analytics from MadeOnSol via x402 micropayments. Tracks 946 KOL wallets and 4000+ Pump.fun deployers.",
|
|
11
|
+
actions: [
|
|
12
|
+
kolFeedAction,
|
|
13
|
+
kolCoordinationAction,
|
|
14
|
+
kolLeaderboardAction,
|
|
15
|
+
deployerAlertsAction,
|
|
16
|
+
],
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the x402 payment-enabled client.
|
|
19
|
+
* Requires SVM_PRIVATE_KEY in the runtime settings for automatic payments.
|
|
20
|
+
* Without it, the plugin still works but requests will return 402 payment info.
|
|
21
|
+
*/
|
|
22
|
+
init: async (_config, runtime) => {
|
|
23
|
+
const baseUrl = String(runtime.getSetting?.("MADEONSOL_API_URL") || "https://madeonsol.com");
|
|
24
|
+
const privateKey = runtime.getSetting?.("SVM_PRIVATE_KEY");
|
|
25
|
+
let fetchFn;
|
|
26
|
+
if (privateKey) {
|
|
27
|
+
try {
|
|
28
|
+
const { wrapFetchWithPayment } = await import("@x402/fetch");
|
|
29
|
+
const { x402Client } = await import("@x402/core/client");
|
|
30
|
+
const { ExactSvmScheme } = await import("@x402/svm/exact/client");
|
|
31
|
+
const { createKeyPairSignerFromBytes } = await import("@solana/kit");
|
|
32
|
+
const { base58 } = await import("@scure/base");
|
|
33
|
+
const signer = await createKeyPairSignerFromBytes(base58.decode(privateKey));
|
|
34
|
+
const client = new x402Client();
|
|
35
|
+
client.register("solana:*", new ExactSvmScheme(signer));
|
|
36
|
+
fetchFn = wrapFetchWithPayment(fetch, client);
|
|
37
|
+
console.log(`[madeonsol] x402 payments enabled, wallet: ${signer.address}`);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
console.warn("[madeonsol] x402 payment setup failed, running in read-only mode:", err);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
console.log("[madeonsol] No SVM_PRIVATE_KEY — running in read-only mode (402 info only)");
|
|
45
|
+
}
|
|
46
|
+
const madeOnSolClient = new MadeOnSolClient({ baseUrl, fetchFn });
|
|
47
|
+
runtime[MADEONSOL_CLIENT_KEY] = madeOnSolClient;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export default madeOnSolPlugin;
|
|
51
|
+
export { MadeOnSolClient } from "./client.js";
|
|
52
|
+
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@madeonsol/plugin-madeonsol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ElizaOS plugin for MadeOnSol — Solana KOL intelligence and deployer analytics via x402 micropayments",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": ["dist", "README.md"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepublishOnly": ""
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"@elizaos/core": ">=1.0.0",
|
|
15
|
+
"@scure/base": ">=1.0.0",
|
|
16
|
+
"@solana/kit": ">=2.0.0",
|
|
17
|
+
"@x402/core": ">=0.1.0",
|
|
18
|
+
"@x402/fetch": ">=0.1.0",
|
|
19
|
+
"@x402/svm": ">=0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"agentConfig": {
|
|
22
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
23
|
+
"pluginParameters": {
|
|
24
|
+
"MADEONSOL_API_URL": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "MadeOnSol API base URL",
|
|
27
|
+
"required": false,
|
|
28
|
+
"default": "https://madeonsol.com"
|
|
29
|
+
},
|
|
30
|
+
"SVM_PRIVATE_KEY": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Solana private key (base58) for automatic x402 USDC payments",
|
|
33
|
+
"required": true,
|
|
34
|
+
"sensitive": true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"elizaos",
|
|
40
|
+
"plugin",
|
|
41
|
+
"solana",
|
|
42
|
+
"kol",
|
|
43
|
+
"x402",
|
|
44
|
+
"madeonsol"
|
|
45
|
+
],
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@elizaos/core": "^2.0.0-alpha.77"
|
|
49
|
+
}
|
|
50
|
+
}
|