solana-agent-kit-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 +45 -0
- package/dist/actions/deployerAlerts.d.ts +41 -0
- package/dist/actions/deployerAlerts.js +24 -0
- package/dist/actions/kolCoordination.d.ts +42 -0
- package/dist/actions/kolCoordination.js +24 -0
- package/dist/actions/kolFeed.d.ts +42 -0
- package/dist/actions/kolFeed.js +24 -0
- package/dist/actions/kolLeaderboard.d.ts +38 -0
- package/dist/actions/kolLeaderboard.js +23 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +26 -0
- package/dist/tools/index.d.ts +26 -0
- package/dist/tools/index.js +57 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT License
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# solana-agent-kit-plugin-madeonsol
|
|
2
|
+
|
|
3
|
+
[Solana Agent Kit](https://github.com/sendaifun/solana-agent-kit) plugin for [MadeOnSol](https://madeonsol.com) — Solana KOL intelligence and deployer analytics via x402 micropayments.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install solana-agent-kit-plugin-madeonsol @x402/fetch @x402/svm @x402/core @solana/kit @scure/base
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { SolanaAgentKit } from "solana-agent-kit";
|
|
15
|
+
import MadeOnSolPlugin from "solana-agent-kit-plugin-madeonsol";
|
|
16
|
+
|
|
17
|
+
const agent = new SolanaAgentKit(privateKey, rpcUrl, {
|
|
18
|
+
SVM_PRIVATE_KEY: "your_solana_private_key_base58",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
agent.use(MadeOnSolPlugin);
|
|
22
|
+
|
|
23
|
+
// Use via methods
|
|
24
|
+
const trades = await agent.methods.kolFeed(agent, { limit: 10, action: "buy" });
|
|
25
|
+
|
|
26
|
+
// Or let the LLM trigger actions via natural language
|
|
27
|
+
// "What are KOLs buying right now?" → MADEONSOL_KOL_FEED_ACTION
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Actions
|
|
31
|
+
|
|
32
|
+
| Action | Price | Triggers on |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `MADEONSOL_KOL_FEED_ACTION` | $0.005 | "kol trades", "what are kols buying" |
|
|
35
|
+
| `MADEONSOL_KOL_COORDINATION_ACTION` | $0.02 | "kol convergence", "tokens kols accumulating" |
|
|
36
|
+
| `MADEONSOL_KOL_LEADERBOARD_ACTION` | $0.005 | "top kols", "kol rankings", "best kol" |
|
|
37
|
+
| `MADEONSOL_DEPLOYER_ALERTS_ACTION` | $0.01 | "deployer alerts", "pump fun launches" |
|
|
38
|
+
|
|
39
|
+
## Config
|
|
40
|
+
|
|
41
|
+
Set `SVM_PRIVATE_KEY` in your agent config for automatic x402 USDC payments. The wallet needs SOL (fees) and USDC on Solana mainnet.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const deployerAlertsAction: {
|
|
3
|
+
name: string;
|
|
4
|
+
similes: string[];
|
|
5
|
+
description: string;
|
|
6
|
+
examples: {
|
|
7
|
+
input: {
|
|
8
|
+
limit: number;
|
|
9
|
+
};
|
|
10
|
+
output: {
|
|
11
|
+
status: string;
|
|
12
|
+
};
|
|
13
|
+
explanation: string;
|
|
14
|
+
}[][];
|
|
15
|
+
schema: z.ZodObject<{
|
|
16
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
since: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
limit: number;
|
|
21
|
+
offset: number;
|
|
22
|
+
since?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
limit?: number | undefined;
|
|
25
|
+
offset?: number | undefined;
|
|
26
|
+
since?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
handler: (agent: unknown, input: {
|
|
29
|
+
limit?: number;
|
|
30
|
+
offset?: number;
|
|
31
|
+
since?: string;
|
|
32
|
+
}) => Promise<{
|
|
33
|
+
status: string;
|
|
34
|
+
result: any;
|
|
35
|
+
message?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
status: string;
|
|
38
|
+
message: string;
|
|
39
|
+
result?: undefined;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { deployerAlerts } from "../tools/index.js";
|
|
3
|
+
export const deployerAlertsAction = {
|
|
4
|
+
name: "MADEONSOL_DEPLOYER_ALERTS_ACTION",
|
|
5
|
+
similes: ["deployer alerts", "pump fun launches", "new token alerts", "elite deployer tokens"],
|
|
6
|
+
description: "Get real-time alerts from elite Pump.fun deployers with KOL buy enrichment. Costs $0.01 USDC per request.",
|
|
7
|
+
examples: [
|
|
8
|
+
[{ input: { limit: 10 }, output: { status: "success" }, explanation: "Get the 10 most recent deployer alerts" }],
|
|
9
|
+
],
|
|
10
|
+
schema: z.object({
|
|
11
|
+
limit: z.number().min(1).max(100).default(10).describe("Number of alerts"),
|
|
12
|
+
offset: z.number().min(0).default(0).describe("Pagination offset"),
|
|
13
|
+
since: z.string().optional().describe("ISO8601 timestamp to filter alerts after"),
|
|
14
|
+
}),
|
|
15
|
+
handler: async (agent, input) => {
|
|
16
|
+
try {
|
|
17
|
+
const data = await deployerAlerts(agent, input);
|
|
18
|
+
return { status: "success", result: data };
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
return { status: "error", message: err.message };
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const kolCoordinationAction: {
|
|
3
|
+
name: string;
|
|
4
|
+
similes: string[];
|
|
5
|
+
description: string;
|
|
6
|
+
examples: {
|
|
7
|
+
input: {
|
|
8
|
+
period: string;
|
|
9
|
+
min_kols: number;
|
|
10
|
+
};
|
|
11
|
+
output: {
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
explanation: string;
|
|
15
|
+
}[][];
|
|
16
|
+
schema: z.ZodObject<{
|
|
17
|
+
period: z.ZodDefault<z.ZodEnum<["1h", "6h", "24h", "7d"]>>;
|
|
18
|
+
min_kols: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
limit: number;
|
|
22
|
+
period: "24h" | "1h" | "6h" | "7d";
|
|
23
|
+
min_kols: number;
|
|
24
|
+
}, {
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
period?: "24h" | "1h" | "6h" | "7d" | undefined;
|
|
27
|
+
min_kols?: number | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
handler: (agent: unknown, input: {
|
|
30
|
+
period?: string;
|
|
31
|
+
min_kols?: number;
|
|
32
|
+
limit?: number;
|
|
33
|
+
}) => Promise<{
|
|
34
|
+
status: string;
|
|
35
|
+
result: any;
|
|
36
|
+
message?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
status: string;
|
|
39
|
+
message: string;
|
|
40
|
+
result?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { kolCoordination } from "../tools/index.js";
|
|
3
|
+
export const kolCoordinationAction = {
|
|
4
|
+
name: "MADEONSOL_KOL_COORDINATION_ACTION",
|
|
5
|
+
similes: ["kol convergence", "what tokens are kols accumulating", "kol coordination", "smart money convergence"],
|
|
6
|
+
description: "Get KOL convergence signals — tokens being accumulated by multiple KOLs simultaneously. Costs $0.02 USDC per request.",
|
|
7
|
+
examples: [
|
|
8
|
+
[{ input: { period: "24h", min_kols: 3 }, output: { status: "success" }, explanation: "Get tokens where 3+ KOLs are converging in the last 24 hours" }],
|
|
9
|
+
],
|
|
10
|
+
schema: z.object({
|
|
11
|
+
period: z.enum(["1h", "6h", "24h", "7d"]).default("24h").describe("Time period"),
|
|
12
|
+
min_kols: z.number().min(2).max(50).default(3).describe("Minimum KOLs converging"),
|
|
13
|
+
limit: z.number().min(1).max(50).default(20).describe("Number of results"),
|
|
14
|
+
}),
|
|
15
|
+
handler: async (agent, input) => {
|
|
16
|
+
try {
|
|
17
|
+
const data = await kolCoordination(agent, input);
|
|
18
|
+
return { status: "success", result: data };
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
return { status: "error", message: err.message };
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const kolFeedAction: {
|
|
3
|
+
name: string;
|
|
4
|
+
similes: string[];
|
|
5
|
+
description: string;
|
|
6
|
+
examples: {
|
|
7
|
+
input: {
|
|
8
|
+
limit: number;
|
|
9
|
+
action: string;
|
|
10
|
+
};
|
|
11
|
+
output: {
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
explanation: string;
|
|
15
|
+
}[][];
|
|
16
|
+
schema: z.ZodObject<{
|
|
17
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
action: z.ZodOptional<z.ZodEnum<["buy", "sell"]>>;
|
|
19
|
+
kol: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
limit: number;
|
|
22
|
+
action?: "buy" | "sell" | undefined;
|
|
23
|
+
kol?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
action?: "buy" | "sell" | undefined;
|
|
27
|
+
kol?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
handler: (agent: unknown, input: {
|
|
30
|
+
limit?: number;
|
|
31
|
+
action?: string;
|
|
32
|
+
kol?: string;
|
|
33
|
+
}) => Promise<{
|
|
34
|
+
status: string;
|
|
35
|
+
result: any;
|
|
36
|
+
message?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
status: string;
|
|
39
|
+
message: string;
|
|
40
|
+
result?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { kolFeed } from "../tools/index.js";
|
|
3
|
+
export const kolFeedAction = {
|
|
4
|
+
name: "MADEONSOL_KOL_FEED_ACTION",
|
|
5
|
+
similes: ["kol trades", "what are kols buying", "kol feed", "smart money trades", "kol activity"],
|
|
6
|
+
description: "Get real-time Solana KOL trades from 946 tracked wallets via MadeOnSol x402 API. Costs $0.005 USDC per request.",
|
|
7
|
+
examples: [
|
|
8
|
+
[{ input: { limit: 10, action: "buy" }, output: { status: "success" }, explanation: "Fetch the 10 most recent KOL buy trades" }],
|
|
9
|
+
],
|
|
10
|
+
schema: z.object({
|
|
11
|
+
limit: z.number().min(1).max(100).default(10).describe("Number of trades"),
|
|
12
|
+
action: z.enum(["buy", "sell"]).optional().describe("Filter by trade type"),
|
|
13
|
+
kol: z.string().optional().describe("Filter by KOL wallet address"),
|
|
14
|
+
}),
|
|
15
|
+
handler: async (agent, input) => {
|
|
16
|
+
try {
|
|
17
|
+
const data = await kolFeed(agent, input);
|
|
18
|
+
return { status: "success", result: data };
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
return { status: "error", message: err.message };
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const kolLeaderboardAction: {
|
|
3
|
+
name: string;
|
|
4
|
+
similes: string[];
|
|
5
|
+
description: string;
|
|
6
|
+
examples: {
|
|
7
|
+
input: {
|
|
8
|
+
period: string;
|
|
9
|
+
limit: number;
|
|
10
|
+
};
|
|
11
|
+
output: {
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
explanation: string;
|
|
15
|
+
}[][];
|
|
16
|
+
schema: z.ZodObject<{
|
|
17
|
+
period: z.ZodDefault<z.ZodEnum<["today", "7d", "30d"]>>;
|
|
18
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
limit: number;
|
|
21
|
+
period: "7d" | "today" | "30d";
|
|
22
|
+
}, {
|
|
23
|
+
limit?: number | undefined;
|
|
24
|
+
period?: "7d" | "today" | "30d" | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
handler: (agent: unknown, input: {
|
|
27
|
+
period?: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}) => Promise<{
|
|
30
|
+
status: string;
|
|
31
|
+
result: any;
|
|
32
|
+
message?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
status: string;
|
|
35
|
+
message: string;
|
|
36
|
+
result?: undefined;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { kolLeaderboard } from "../tools/index.js";
|
|
3
|
+
export const kolLeaderboardAction = {
|
|
4
|
+
name: "MADEONSOL_KOL_LEADERBOARD_ACTION",
|
|
5
|
+
similes: ["kol leaderboard", "top kols", "best performing kols", "kol rankings", "kol pnl"],
|
|
6
|
+
description: "Get KOL performance rankings by PnL and win rate. Costs $0.005 USDC per request.",
|
|
7
|
+
examples: [
|
|
8
|
+
[{ input: { period: "7d", limit: 10 }, output: { status: "success" }, explanation: "Get the top 10 KOLs by PnL this week" }],
|
|
9
|
+
],
|
|
10
|
+
schema: z.object({
|
|
11
|
+
period: z.enum(["today", "7d", "30d"]).default("7d").describe("Time period"),
|
|
12
|
+
limit: z.number().min(1).max(50).default(20).describe("Number of KOLs"),
|
|
13
|
+
}),
|
|
14
|
+
handler: async (agent, input) => {
|
|
15
|
+
try {
|
|
16
|
+
const data = await kolLeaderboard(agent, input);
|
|
17
|
+
return { status: "success", result: data };
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
return { status: "error", message: err.message };
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { kolFeedAction } from "./actions/kolFeed.js";
|
|
2
|
+
import { kolCoordinationAction } from "./actions/kolCoordination.js";
|
|
3
|
+
import { kolLeaderboardAction } from "./actions/kolLeaderboard.js";
|
|
4
|
+
import { deployerAlertsAction } from "./actions/deployerAlerts.js";
|
|
5
|
+
import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts } from "./tools/index.js";
|
|
6
|
+
declare const MadeOnSolPlugin: {
|
|
7
|
+
name: string;
|
|
8
|
+
methods: {
|
|
9
|
+
kolFeed: typeof kolFeed;
|
|
10
|
+
kolCoordination: typeof kolCoordination;
|
|
11
|
+
kolLeaderboard: typeof kolLeaderboard;
|
|
12
|
+
deployerAlerts: typeof deployerAlerts;
|
|
13
|
+
};
|
|
14
|
+
actions: ({
|
|
15
|
+
name: string;
|
|
16
|
+
similes: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
examples: {
|
|
19
|
+
input: {
|
|
20
|
+
limit: number;
|
|
21
|
+
action: string;
|
|
22
|
+
};
|
|
23
|
+
output: {
|
|
24
|
+
status: string;
|
|
25
|
+
};
|
|
26
|
+
explanation: string;
|
|
27
|
+
}[][];
|
|
28
|
+
schema: import("zod").ZodObject<{
|
|
29
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
30
|
+
action: import("zod").ZodOptional<import("zod").ZodEnum<["buy", "sell"]>>;
|
|
31
|
+
kol: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
33
|
+
limit: number;
|
|
34
|
+
action?: "buy" | "sell" | undefined;
|
|
35
|
+
kol?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
limit?: number | undefined;
|
|
38
|
+
action?: "buy" | "sell" | undefined;
|
|
39
|
+
kol?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
handler: (agent: unknown, input: {
|
|
42
|
+
limit?: number;
|
|
43
|
+
action?: string;
|
|
44
|
+
kol?: string;
|
|
45
|
+
}) => Promise<{
|
|
46
|
+
status: string;
|
|
47
|
+
result: any;
|
|
48
|
+
message?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
status: string;
|
|
51
|
+
message: string;
|
|
52
|
+
result?: undefined;
|
|
53
|
+
}>;
|
|
54
|
+
} | {
|
|
55
|
+
name: string;
|
|
56
|
+
similes: string[];
|
|
57
|
+
description: string;
|
|
58
|
+
examples: {
|
|
59
|
+
input: {
|
|
60
|
+
period: string;
|
|
61
|
+
min_kols: number;
|
|
62
|
+
};
|
|
63
|
+
output: {
|
|
64
|
+
status: string;
|
|
65
|
+
};
|
|
66
|
+
explanation: string;
|
|
67
|
+
}[][];
|
|
68
|
+
schema: import("zod").ZodObject<{
|
|
69
|
+
period: import("zod").ZodDefault<import("zod").ZodEnum<["1h", "6h", "24h", "7d"]>>;
|
|
70
|
+
min_kols: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
71
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
72
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
73
|
+
limit: number;
|
|
74
|
+
period: "24h" | "1h" | "6h" | "7d";
|
|
75
|
+
min_kols: number;
|
|
76
|
+
}, {
|
|
77
|
+
limit?: number | undefined;
|
|
78
|
+
period?: "24h" | "1h" | "6h" | "7d" | undefined;
|
|
79
|
+
min_kols?: number | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
handler: (agent: unknown, input: {
|
|
82
|
+
period?: string;
|
|
83
|
+
min_kols?: number;
|
|
84
|
+
limit?: number;
|
|
85
|
+
}) => Promise<{
|
|
86
|
+
status: string;
|
|
87
|
+
result: any;
|
|
88
|
+
message?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
status: string;
|
|
91
|
+
message: string;
|
|
92
|
+
result?: undefined;
|
|
93
|
+
}>;
|
|
94
|
+
} | {
|
|
95
|
+
name: string;
|
|
96
|
+
similes: string[];
|
|
97
|
+
description: string;
|
|
98
|
+
examples: {
|
|
99
|
+
input: {
|
|
100
|
+
period: string;
|
|
101
|
+
limit: number;
|
|
102
|
+
};
|
|
103
|
+
output: {
|
|
104
|
+
status: string;
|
|
105
|
+
};
|
|
106
|
+
explanation: string;
|
|
107
|
+
}[][];
|
|
108
|
+
schema: import("zod").ZodObject<{
|
|
109
|
+
period: import("zod").ZodDefault<import("zod").ZodEnum<["today", "7d", "30d"]>>;
|
|
110
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
111
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
112
|
+
limit: number;
|
|
113
|
+
period: "7d" | "today" | "30d";
|
|
114
|
+
}, {
|
|
115
|
+
limit?: number | undefined;
|
|
116
|
+
period?: "7d" | "today" | "30d" | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
handler: (agent: unknown, input: {
|
|
119
|
+
period?: string;
|
|
120
|
+
limit?: number;
|
|
121
|
+
}) => Promise<{
|
|
122
|
+
status: string;
|
|
123
|
+
result: any;
|
|
124
|
+
message?: undefined;
|
|
125
|
+
} | {
|
|
126
|
+
status: string;
|
|
127
|
+
message: string;
|
|
128
|
+
result?: undefined;
|
|
129
|
+
}>;
|
|
130
|
+
} | {
|
|
131
|
+
name: string;
|
|
132
|
+
similes: string[];
|
|
133
|
+
description: string;
|
|
134
|
+
examples: {
|
|
135
|
+
input: {
|
|
136
|
+
limit: number;
|
|
137
|
+
};
|
|
138
|
+
output: {
|
|
139
|
+
status: string;
|
|
140
|
+
};
|
|
141
|
+
explanation: string;
|
|
142
|
+
}[][];
|
|
143
|
+
schema: import("zod").ZodObject<{
|
|
144
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
145
|
+
offset: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
146
|
+
since: import("zod").ZodOptional<import("zod").ZodString>;
|
|
147
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
148
|
+
limit: number;
|
|
149
|
+
offset: number;
|
|
150
|
+
since?: string | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
limit?: number | undefined;
|
|
153
|
+
offset?: number | undefined;
|
|
154
|
+
since?: string | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
handler: (agent: unknown, input: {
|
|
157
|
+
limit?: number;
|
|
158
|
+
offset?: number;
|
|
159
|
+
since?: string;
|
|
160
|
+
}) => Promise<{
|
|
161
|
+
status: string;
|
|
162
|
+
result: any;
|
|
163
|
+
message?: undefined;
|
|
164
|
+
} | {
|
|
165
|
+
status: string;
|
|
166
|
+
message: string;
|
|
167
|
+
result?: undefined;
|
|
168
|
+
}>;
|
|
169
|
+
})[];
|
|
170
|
+
initialize(_agent: unknown): void;
|
|
171
|
+
};
|
|
172
|
+
export default MadeOnSolPlugin;
|
|
173
|
+
export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts };
|
|
174
|
+
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { kolFeedAction } from "./actions/kolFeed.js";
|
|
2
|
+
import { kolCoordinationAction } from "./actions/kolCoordination.js";
|
|
3
|
+
import { kolLeaderboardAction } from "./actions/kolLeaderboard.js";
|
|
4
|
+
import { deployerAlertsAction } from "./actions/deployerAlerts.js";
|
|
5
|
+
import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts } from "./tools/index.js";
|
|
6
|
+
const MadeOnSolPlugin = {
|
|
7
|
+
name: "madeonsol",
|
|
8
|
+
methods: {
|
|
9
|
+
kolFeed,
|
|
10
|
+
kolCoordination,
|
|
11
|
+
kolLeaderboard,
|
|
12
|
+
deployerAlerts,
|
|
13
|
+
},
|
|
14
|
+
actions: [
|
|
15
|
+
kolFeedAction,
|
|
16
|
+
kolCoordinationAction,
|
|
17
|
+
kolLeaderboardAction,
|
|
18
|
+
deployerAlertsAction,
|
|
19
|
+
],
|
|
20
|
+
initialize(_agent) {
|
|
21
|
+
// No-op — payment setup is lazy in tool functions
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default MadeOnSolPlugin;
|
|
25
|
+
export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts };
|
|
26
|
+
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool functions — pure logic that calls MadeOnSol x402 API.
|
|
3
|
+
* These are called by Action handlers and can also be used directly via agent.methods.
|
|
4
|
+
*/
|
|
5
|
+
type Agent = any;
|
|
6
|
+
export declare function initPaidFetch(agent: Agent): Promise<typeof fetch>;
|
|
7
|
+
export declare function kolFeed(agent: Agent, params?: {
|
|
8
|
+
limit?: number;
|
|
9
|
+
action?: string;
|
|
10
|
+
kol?: string;
|
|
11
|
+
}): Promise<any>;
|
|
12
|
+
export declare function kolCoordination(agent: Agent, params?: {
|
|
13
|
+
period?: string;
|
|
14
|
+
min_kols?: number;
|
|
15
|
+
limit?: number;
|
|
16
|
+
}): Promise<any>;
|
|
17
|
+
export declare function kolLeaderboard(agent: Agent, params?: {
|
|
18
|
+
period?: string;
|
|
19
|
+
limit?: number;
|
|
20
|
+
}): Promise<any>;
|
|
21
|
+
export declare function deployerAlerts(agent: Agent, params?: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
since?: string;
|
|
24
|
+
offset?: number;
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool functions — pure logic that calls MadeOnSol x402 API.
|
|
3
|
+
* These are called by Action handlers and can also be used directly via agent.methods.
|
|
4
|
+
*/
|
|
5
|
+
const BASE_URL = "https://madeonsol.com";
|
|
6
|
+
async function query(paidFetch, path, params) {
|
|
7
|
+
const url = new URL(path, BASE_URL);
|
|
8
|
+
if (params) {
|
|
9
|
+
for (const [k, v] of Object.entries(params)) {
|
|
10
|
+
if (v !== undefined)
|
|
11
|
+
url.searchParams.set(k, String(v));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const res = await paidFetch(url.toString());
|
|
15
|
+
if (!res.ok) {
|
|
16
|
+
const body = await res.text().catch(() => "");
|
|
17
|
+
throw new Error(`MadeOnSol API error ${res.status}: ${body}`);
|
|
18
|
+
}
|
|
19
|
+
return res.json();
|
|
20
|
+
}
|
|
21
|
+
let _paidFetch = null;
|
|
22
|
+
export async function initPaidFetch(agent) {
|
|
23
|
+
if (_paidFetch)
|
|
24
|
+
return _paidFetch;
|
|
25
|
+
const privateKey = agent.config?.SVM_PRIVATE_KEY || agent.config?.OTHER_API_KEYS?.SVM_PRIVATE_KEY;
|
|
26
|
+
if (!privateKey) {
|
|
27
|
+
console.warn("[madeonsol] No SVM_PRIVATE_KEY in agent config — x402 payments disabled");
|
|
28
|
+
_paidFetch = fetch;
|
|
29
|
+
return _paidFetch;
|
|
30
|
+
}
|
|
31
|
+
const { wrapFetchWithPayment } = await import("@x402/fetch");
|
|
32
|
+
const { x402Client } = await import("@x402/core/client");
|
|
33
|
+
const { ExactSvmScheme } = await import("@x402/svm/exact/client");
|
|
34
|
+
const { createKeyPairSignerFromBytes } = await import("@solana/kit");
|
|
35
|
+
const { base58 } = await import("@scure/base");
|
|
36
|
+
const signer = await createKeyPairSignerFromBytes(base58.decode(privateKey));
|
|
37
|
+
const client = new x402Client();
|
|
38
|
+
client.register("solana:*", new ExactSvmScheme(signer));
|
|
39
|
+
_paidFetch = wrapFetchWithPayment(fetch, client);
|
|
40
|
+
return _paidFetch;
|
|
41
|
+
}
|
|
42
|
+
export async function kolFeed(agent, params = {}) {
|
|
43
|
+
const f = await initPaidFetch(agent);
|
|
44
|
+
return query(f, "/api/x402/kol/feed", params);
|
|
45
|
+
}
|
|
46
|
+
export async function kolCoordination(agent, params = {}) {
|
|
47
|
+
const f = await initPaidFetch(agent);
|
|
48
|
+
return query(f, "/api/x402/kol/coordination", params);
|
|
49
|
+
}
|
|
50
|
+
export async function kolLeaderboard(agent, params = {}) {
|
|
51
|
+
const f = await initPaidFetch(agent);
|
|
52
|
+
return query(f, "/api/x402/kol/leaderboard", params);
|
|
53
|
+
}
|
|
54
|
+
export async function deployerAlerts(agent, params = {}) {
|
|
55
|
+
const f = await initPaidFetch(agent);
|
|
56
|
+
return query(f, "/api/x402/deployer-hunter/alerts", params);
|
|
57
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solana-agent-kit-plugin-madeonsol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Solana Agent Kit plugin for MadeOnSol — 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
|
+
"keywords": ["solana", "agent-kit", "x402", "kol", "trading", "madeonsol"],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/LamboPoewert/solana-agent-kit-plugin-madeonsol"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"solana-agent-kit": ">=2.0.0",
|
|
21
|
+
"@x402/fetch": ">=0.1.0",
|
|
22
|
+
"@x402/core": ">=0.1.0",
|
|
23
|
+
"@x402/svm": ">=0.1.0",
|
|
24
|
+
"@solana/kit": ">=2.0.0",
|
|
25
|
+
"@scure/base": ">=1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"zod": "^3.24.0"
|
|
29
|
+
}
|
|
30
|
+
}
|