solana-agent-kit-plugin-madeonsol 0.7.0 → 1.0.1
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 +63 -1
- package/dist/actions/deployerAlerts.d.ts +1 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.js +13 -2
- package/dist/tools/index.d.ts +54 -2
- package/dist/tools/index.js +78 -31
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
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
|
+
## Quick start (10 seconds)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install solana-agent-kit-plugin-madeonsol
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { SolanaAgentKit } from "solana-agent-kit";
|
|
15
|
+
import MadeOnSolPlugin from "solana-agent-kit-plugin-madeonsol";
|
|
16
|
+
const agent = new SolanaAgentKit(privateKey, rpcUrl, { MADEONSOL_API_KEY: "msk_..." }); // free key: https://madeonsol.com/developer
|
|
17
|
+
agent.use(MadeOnSolPlugin);
|
|
18
|
+
const trades = await agent.methods.kolFeed(agent, { limit: 5, action: "buy" });
|
|
19
|
+
```
|
|
20
|
+
|
|
7
21
|
## Authentication
|
|
8
22
|
|
|
9
23
|
Two options (in priority order):
|
|
@@ -13,6 +27,8 @@ Two options (in priority order):
|
|
|
13
27
|
| **MadeOnSol API key** (recommended) | `MADEONSOL_API_KEY` | Developers — [get a free key](https://madeonsol.com/developer) |
|
|
14
28
|
| x402 micropayments | `SVM_PRIVATE_KEY` | AI agents with Solana wallets |
|
|
15
29
|
|
|
30
|
+
> **v1.0 breaking change:** RapidAPI auth (`RAPIDAPI_KEY`) has been removed. The MadeOnSol RapidAPI marketplace was retired on 2026-04-19. Get a free `msk_` key at [madeonsol.com/developer](https://madeonsol.com/developer).
|
|
31
|
+
|
|
16
32
|
## Install
|
|
17
33
|
|
|
18
34
|
```bash
|
|
@@ -61,13 +77,59 @@ const events = await agent.methods.walletTrackerTrades(agent, { limit: 50 });
|
|
|
61
77
|
| `MADEONSOL_WALLET_TRACKER_TRADES_ACTION` | "wallet tracker trades", "watchlist activity" |
|
|
62
78
|
| `MADEONSOL_WALLET_TRACKER_SUMMARY_ACTION` | "wallet tracker summary", "tracked wallet stats" |
|
|
63
79
|
|
|
80
|
+
## Additional methods (v1.0+)
|
|
81
|
+
|
|
82
|
+
These are exposed via `agent.methods.*` (no LLM action wrappers — call directly):
|
|
83
|
+
|
|
84
|
+
### Alpha Wallet Intelligence
|
|
85
|
+
|
|
86
|
+
Scored from 47,000+ early-buyer records (wallets seen in the first 20 buyers of Pump.fun tokens).
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
await agent.methods.alphaLeaderboard(agent, { limit: 100 }); // BASIC=25, PRO=100, ULTRA=500
|
|
90
|
+
await agent.methods.alphaWallet(agent, { wallet: "WALLET" }); // ULTRA only — full breakdown + bot signals
|
|
91
|
+
await agent.methods.alphaLinked(agent, { wallet: "WALLET" }); // ULTRA only — co-bought 3+ tokens within 2s
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Token Quality
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
await agent.methods.tokenCapTable(agent, { mint: "MINT" }); // PRO=10, ULTRA=20 first non-deployer buyers
|
|
98
|
+
await agent.methods.tokenBuyerQuality(agent, { mint: "MINT" }); // 0–100 buyer-quality score (5-min cached)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Copy-Trade Rules (PRO/ULTRA)
|
|
102
|
+
|
|
103
|
+
Server-side rules that fire signals when a watched source wallet trades. Delivered via webhook (HMAC-signed) and/or WebSocket.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
await agent.methods.copyTradeList(agent);
|
|
107
|
+
await agent.methods.copyTradeCreate(agent, {
|
|
108
|
+
name: "Track Whale",
|
|
109
|
+
source_wallet: "WALLET",
|
|
110
|
+
delivery: "webhook",
|
|
111
|
+
webhook_url: "https://you.com/hook",
|
|
112
|
+
});
|
|
113
|
+
await agent.methods.copyTradeSignals(agent, { limit: 50 }); // up to 7 days
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Rate-limit headers
|
|
117
|
+
|
|
118
|
+
Every successful request populates a module-level `lastRateLimit` (limit / remaining / reset / requestId):
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
import { lastRateLimit } from "solana-agent-kit-plugin-madeonsol";
|
|
122
|
+
await agent.methods.kolFeed(agent, { limit: 10 });
|
|
123
|
+
console.log(lastRateLimit); // { limit: "10000", remaining: "9999", reset: "...", requestId: "..." }
|
|
124
|
+
```
|
|
125
|
+
|
|
64
126
|
## Tiers
|
|
65
127
|
|
|
66
128
|
| Tier | Price | Wallets tracked | Requests/day |
|
|
67
129
|
|------|-------|-----------------|--------------|
|
|
68
130
|
| BASIC | Free | 10 | 200 |
|
|
69
131
|
| PRO | $49/mo | 50 | 10,000 |
|
|
70
|
-
| ULTRA | $
|
|
132
|
+
| ULTRA | $149/mo | 100 + WS events | 100,000 |
|
|
71
133
|
|
|
72
134
|
Get a key at [madeonsol.com/developer](https://madeonsol.com/developer).
|
|
73
135
|
|
|
@@ -24,8 +24,8 @@ export declare const deployerAlertsAction: {
|
|
|
24
24
|
tier?: "elite" | "good" | "moderate" | "rising" | "cold" | undefined;
|
|
25
25
|
}, {
|
|
26
26
|
limit?: number | undefined;
|
|
27
|
-
offset?: number | undefined;
|
|
28
27
|
since?: string | undefined;
|
|
28
|
+
offset?: number | undefined;
|
|
29
29
|
tier?: "elite" | "good" | "moderate" | "rising" | "cold" | undefined;
|
|
30
30
|
}>;
|
|
31
31
|
handler: (agent: unknown, input: {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { walletTrackerWatchlistAction, walletTrackerAddAction, walletTrackerRemo
|
|
|
8
8
|
import { kolTokenEntryOrderAction } from "./actions/kolTokenEntryOrder.js";
|
|
9
9
|
import { kolCompareAction } from "./actions/kolCompare.js";
|
|
10
10
|
import { kolAlertsRecentAction } from "./actions/kolAlertsRecent.js";
|
|
11
|
-
import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary } from "./tools/index.js";
|
|
11
|
+
import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary, alphaLeaderboard, alphaWallet, alphaLinked, tokenCapTable, tokenBuyerQuality, copyTradeList, copyTradeCreate, copyTradeGet, copyTradeUpdate, copyTradeDelete, copyTradeSignals } from "./tools/index.js";
|
|
12
12
|
declare const MadeOnSolPlugin: {
|
|
13
13
|
name: string;
|
|
14
14
|
methods: {
|
|
@@ -31,6 +31,17 @@ declare const MadeOnSolPlugin: {
|
|
|
31
31
|
walletTrackerRemove: typeof walletTrackerRemove;
|
|
32
32
|
walletTrackerTrades: typeof walletTrackerTrades;
|
|
33
33
|
walletTrackerSummary: typeof walletTrackerSummary;
|
|
34
|
+
alphaLeaderboard: typeof alphaLeaderboard;
|
|
35
|
+
alphaWallet: typeof alphaWallet;
|
|
36
|
+
alphaLinked: typeof alphaLinked;
|
|
37
|
+
tokenCapTable: typeof tokenCapTable;
|
|
38
|
+
tokenBuyerQuality: typeof tokenBuyerQuality;
|
|
39
|
+
copyTradeList: typeof copyTradeList;
|
|
40
|
+
copyTradeCreate: typeof copyTradeCreate;
|
|
41
|
+
copyTradeGet: typeof copyTradeGet;
|
|
42
|
+
copyTradeUpdate: typeof copyTradeUpdate;
|
|
43
|
+
copyTradeDelete: typeof copyTradeDelete;
|
|
44
|
+
copyTradeSignals: typeof copyTradeSignals;
|
|
34
45
|
};
|
|
35
46
|
actions: ({
|
|
36
47
|
name: string;
|
|
@@ -173,8 +184,8 @@ declare const MadeOnSolPlugin: {
|
|
|
173
184
|
tier?: "elite" | "good" | "moderate" | "rising" | "cold" | undefined;
|
|
174
185
|
}, {
|
|
175
186
|
limit?: number | undefined;
|
|
176
|
-
offset?: number | undefined;
|
|
177
187
|
since?: string | undefined;
|
|
188
|
+
offset?: number | undefined;
|
|
178
189
|
tier?: "elite" | "good" | "moderate" | "rising" | "cold" | undefined;
|
|
179
190
|
}>;
|
|
180
191
|
handler: (agent: unknown, input: {
|
|
@@ -552,6 +563,6 @@ declare const MadeOnSolPlugin: {
|
|
|
552
563
|
initialize(_agent: unknown): void;
|
|
553
564
|
};
|
|
554
565
|
export default MadeOnSolPlugin;
|
|
555
|
-
export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary };
|
|
566
|
+
export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary, alphaLeaderboard, alphaWallet, alphaLinked, tokenCapTable, tokenBuyerQuality, copyTradeList, copyTradeCreate, copyTradeGet, copyTradeUpdate, copyTradeDelete, copyTradeSignals, };
|
|
556
567
|
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction, kolPnlAction, kolTrendingTokensAction, kolTokenEntryOrderAction, kolCompareAction, kolAlertsRecentAction };
|
|
557
568
|
export { walletTrackerWatchlistAction, walletTrackerAddAction, walletTrackerRemoveAction, walletTrackerTradesAction, walletTrackerSummaryAction };
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { walletTrackerWatchlistAction, walletTrackerAddAction, walletTrackerRemo
|
|
|
8
8
|
import { kolTokenEntryOrderAction } from "./actions/kolTokenEntryOrder.js";
|
|
9
9
|
import { kolCompareAction } from "./actions/kolCompare.js";
|
|
10
10
|
import { kolAlertsRecentAction } from "./actions/kolAlertsRecent.js";
|
|
11
|
-
import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary } from "./tools/index.js";
|
|
11
|
+
import { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary, alphaLeaderboard, alphaWallet, alphaLinked, tokenCapTable, tokenBuyerQuality, copyTradeList, copyTradeCreate, copyTradeGet, copyTradeUpdate, copyTradeDelete, copyTradeSignals, } from "./tools/index.js";
|
|
12
12
|
const MadeOnSolPlugin = {
|
|
13
13
|
name: "madeonsol",
|
|
14
14
|
methods: {
|
|
@@ -31,6 +31,17 @@ const MadeOnSolPlugin = {
|
|
|
31
31
|
walletTrackerRemove,
|
|
32
32
|
walletTrackerTrades,
|
|
33
33
|
walletTrackerSummary,
|
|
34
|
+
alphaLeaderboard,
|
|
35
|
+
alphaWallet,
|
|
36
|
+
alphaLinked,
|
|
37
|
+
tokenCapTable,
|
|
38
|
+
tokenBuyerQuality,
|
|
39
|
+
copyTradeList,
|
|
40
|
+
copyTradeCreate,
|
|
41
|
+
copyTradeGet,
|
|
42
|
+
copyTradeUpdate,
|
|
43
|
+
copyTradeDelete,
|
|
44
|
+
copyTradeSignals,
|
|
34
45
|
},
|
|
35
46
|
actions: [
|
|
36
47
|
kolFeedAction,
|
|
@@ -53,6 +64,6 @@ const MadeOnSolPlugin = {
|
|
|
53
64
|
},
|
|
54
65
|
};
|
|
55
66
|
export default MadeOnSolPlugin;
|
|
56
|
-
export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary };
|
|
67
|
+
export { kolFeed, kolCoordination, kolLeaderboard, deployerAlerts, kolPnl, kolTrendingTokens, kolTokenEntryOrder, kolCompare, kolAlertsRecent, createWebhook, listWebhooks, deleteWebhook, testWebhook, getStreamToken, walletTrackerWatchlist, walletTrackerAdd, walletTrackerRemove, walletTrackerTrades, walletTrackerSummary, alphaLeaderboard, alphaWallet, alphaLinked, tokenCapTable, tokenBuyerQuality, copyTradeList, copyTradeCreate, copyTradeGet, copyTradeUpdate, copyTradeDelete, copyTradeSignals, };
|
|
57
68
|
export { kolFeedAction, kolCoordinationAction, kolLeaderboardAction, deployerAlertsAction, kolPnlAction, kolTrendingTokensAction, kolTokenEntryOrderAction, kolCompareAction, kolAlertsRecentAction };
|
|
58
69
|
export { walletTrackerWatchlistAction, walletTrackerAddAction, walletTrackerRemoveAction, walletTrackerTradesAction, walletTrackerSummaryAction };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool functions — pure logic that calls MadeOnSol API.
|
|
3
|
-
* Auth priority: MADEONSOL_API_KEY >
|
|
4
|
-
*
|
|
3
|
+
* Auth priority: MADEONSOL_API_KEY > SVM_PRIVATE_KEY (x402).
|
|
4
|
+
*
|
|
5
|
+
* v1.0 breaking change: RAPIDAPI_KEY support has been removed
|
|
6
|
+
* (MadeOnSol RapidAPI marketplace was retired 2026-04-19).
|
|
7
|
+
* Get a free `msk_` key at https://madeonsol.com/developer.
|
|
5
8
|
*/
|
|
6
9
|
type Agent = any;
|
|
10
|
+
export interface RateLimitInfo {
|
|
11
|
+
limit?: string;
|
|
12
|
+
remaining?: string;
|
|
13
|
+
reset?: string;
|
|
14
|
+
requestId?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Most recent rate-limit headers, populated by every successful API request. */
|
|
17
|
+
export declare let lastRateLimit: RateLimitInfo;
|
|
7
18
|
export declare function initAuth(agent: Agent): Promise<void>;
|
|
8
19
|
/** @deprecated Use initAuth instead */
|
|
9
20
|
export declare function initPaidFetch(agent: Agent): Promise<typeof fetch>;
|
|
@@ -103,4 +114,45 @@ export declare function walletTrackerSummary(agent: Agent, params?: {
|
|
|
103
114
|
period?: string;
|
|
104
115
|
wallet?: string;
|
|
105
116
|
}): Promise<any>;
|
|
117
|
+
export declare function alphaLeaderboard(agent: Agent, params?: {
|
|
118
|
+
limit?: number;
|
|
119
|
+
min_tokens?: number;
|
|
120
|
+
min_pnl?: number;
|
|
121
|
+
}): Promise<any>;
|
|
122
|
+
export declare function alphaWallet(agent: Agent, params: {
|
|
123
|
+
wallet: string;
|
|
124
|
+
}): Promise<any>;
|
|
125
|
+
export declare function alphaLinked(agent: Agent, params: {
|
|
126
|
+
wallet: string;
|
|
127
|
+
}): Promise<any>;
|
|
128
|
+
export declare function tokenCapTable(agent: Agent, params: {
|
|
129
|
+
mint: string;
|
|
130
|
+
}): Promise<any>;
|
|
131
|
+
export declare function tokenBuyerQuality(agent: Agent, params: {
|
|
132
|
+
mint: string;
|
|
133
|
+
}): Promise<any>;
|
|
134
|
+
export declare function copyTradeList(agent: Agent): Promise<any>;
|
|
135
|
+
export declare function copyTradeCreate(agent: Agent, params: {
|
|
136
|
+
name: string;
|
|
137
|
+
source_wallet: string;
|
|
138
|
+
is_active?: boolean;
|
|
139
|
+
webhook_url?: string;
|
|
140
|
+
delivery?: "webhook" | "websocket" | "both";
|
|
141
|
+
filters?: Record<string, unknown>;
|
|
142
|
+
}): Promise<any>;
|
|
143
|
+
export declare function copyTradeGet(agent: Agent, params: {
|
|
144
|
+
rule_id: string;
|
|
145
|
+
}): Promise<any>;
|
|
146
|
+
export declare function copyTradeUpdate(agent: Agent, params: {
|
|
147
|
+
rule_id: string;
|
|
148
|
+
updates: Record<string, unknown>;
|
|
149
|
+
}): Promise<any>;
|
|
150
|
+
export declare function copyTradeDelete(agent: Agent, params: {
|
|
151
|
+
rule_id: string;
|
|
152
|
+
}): Promise<any>;
|
|
153
|
+
export declare function copyTradeSignals(agent: Agent, params?: {
|
|
154
|
+
rule_id?: string;
|
|
155
|
+
limit?: number;
|
|
156
|
+
since?: string;
|
|
157
|
+
}): Promise<any>;
|
|
106
158
|
export {};
|
package/dist/tools/index.js
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool functions — pure logic that calls MadeOnSol API.
|
|
3
|
-
* Auth priority: MADEONSOL_API_KEY >
|
|
4
|
-
*
|
|
3
|
+
* Auth priority: MADEONSOL_API_KEY > SVM_PRIVATE_KEY (x402).
|
|
4
|
+
*
|
|
5
|
+
* v1.0 breaking change: RAPIDAPI_KEY support has been removed
|
|
6
|
+
* (MadeOnSol RapidAPI marketplace was retired 2026-04-19).
|
|
7
|
+
* Get a free `msk_` key at https://madeonsol.com/developer.
|
|
5
8
|
*/
|
|
6
9
|
const BASE_URL = "https://madeonsol.com";
|
|
7
|
-
const RAPIDAPI_HOST = "madeonsol-solana-kol-tracker-tools-api.p.rapidapi.com";
|
|
8
10
|
let _authMode = null;
|
|
9
11
|
let _authHeaders = {};
|
|
10
12
|
let _paidFetch = null;
|
|
13
|
+
/** Most recent rate-limit headers, populated by every successful API request. */
|
|
14
|
+
export let lastRateLimit = {};
|
|
15
|
+
function captureRateLimit(res) {
|
|
16
|
+
lastRateLimit = {
|
|
17
|
+
limit: res.headers.get("X-RateLimit-Limit") ?? undefined,
|
|
18
|
+
remaining: res.headers.get("X-RateLimit-Remaining") ?? undefined,
|
|
19
|
+
reset: res.headers.get("X-RateLimit-Reset") ?? undefined,
|
|
20
|
+
requestId: res.headers.get("X-Request-Id") ?? undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
11
23
|
function getConfig(agent, key) {
|
|
12
24
|
return agent.config?.[key] || agent.config?.OTHER_API_KEYS?.[key];
|
|
13
25
|
}
|
|
@@ -15,7 +27,6 @@ export async function initAuth(agent) {
|
|
|
15
27
|
if (_authMode)
|
|
16
28
|
return;
|
|
17
29
|
const apiKey = getConfig(agent, "MADEONSOL_API_KEY");
|
|
18
|
-
const rapidApiKey = getConfig(agent, "RAPIDAPI_KEY");
|
|
19
30
|
const privateKey = getConfig(agent, "SVM_PRIVATE_KEY");
|
|
20
31
|
if (apiKey) {
|
|
21
32
|
_authMode = "madeonsol";
|
|
@@ -23,12 +34,6 @@ export async function initAuth(agent) {
|
|
|
23
34
|
_paidFetch = fetch;
|
|
24
35
|
console.log("[madeonsol] Using MadeOnSol API key (Bearer auth)");
|
|
25
36
|
}
|
|
26
|
-
else if (rapidApiKey) {
|
|
27
|
-
_authMode = "rapidapi";
|
|
28
|
-
_authHeaders = { "x-rapidapi-key": rapidApiKey, "x-rapidapi-host": RAPIDAPI_HOST };
|
|
29
|
-
_paidFetch = fetch;
|
|
30
|
-
console.log("[madeonsol] Using RapidAPI key");
|
|
31
|
-
}
|
|
32
37
|
else if (privateKey) {
|
|
33
38
|
const { wrapFetchWithPayment } = await import("@x402/fetch");
|
|
34
39
|
const { x402Client } = await import("@x402/core/client");
|
|
@@ -45,7 +50,9 @@ export async function initAuth(agent) {
|
|
|
45
50
|
else {
|
|
46
51
|
_authMode = "none";
|
|
47
52
|
_paidFetch = fetch;
|
|
48
|
-
console.warn("[madeonsol] No auth configured
|
|
53
|
+
console.warn("\n[madeonsol] No auth configured — every API call will fail.\n" +
|
|
54
|
+
" → Get a free MADEONSOL_API_KEY (200 req/day, no card) at https://madeonsol.com/developer\n" +
|
|
55
|
+
" → Or set SVM_PRIVATE_KEY for x402 micropayments.\n");
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
/** @deprecated Use initAuth instead */
|
|
@@ -67,6 +74,7 @@ async function query(path, params) {
|
|
|
67
74
|
const res = _authMode === "x402"
|
|
68
75
|
? await _paidFetch(url.toString())
|
|
69
76
|
: await fetch(url.toString(), { headers: _authHeaders });
|
|
77
|
+
captureRateLimit(res);
|
|
70
78
|
if (!res.ok) {
|
|
71
79
|
const body = await res.text().catch(() => "");
|
|
72
80
|
throw new Error(`MadeOnSol API error ${res.status}: ${body}`);
|
|
@@ -134,11 +142,11 @@ export async function kolTiming(agent, params) {
|
|
|
134
142
|
export async function deployerTrajectory(agent, params) {
|
|
135
143
|
return restQuery(agent, "GET", `/deployer-hunter/${params.wallet}/trajectory`);
|
|
136
144
|
}
|
|
137
|
-
// ──
|
|
145
|
+
// ── REST helper (webhooks, streaming, alpha, copy-trade, wallet-tracker) ──
|
|
138
146
|
async function restQuery(agent, method, path, body) {
|
|
139
147
|
await initAuth(agent);
|
|
140
|
-
if (_authMode !== "madeonsol"
|
|
141
|
-
throw new Error("API key
|
|
148
|
+
if (_authMode !== "madeonsol") {
|
|
149
|
+
throw new Error("MadeOnSol API key required for this endpoint. Get a free `msk_` key at madeonsol.com/developer");
|
|
142
150
|
}
|
|
143
151
|
const res = await fetch(`${BASE_URL}/api/v1${path}`, {
|
|
144
152
|
method,
|
|
@@ -148,6 +156,7 @@ async function restQuery(agent, method, path, body) {
|
|
|
148
156
|
},
|
|
149
157
|
...(body ? { body: JSON.stringify(body) } : {}),
|
|
150
158
|
});
|
|
159
|
+
captureRateLimit(res);
|
|
151
160
|
if (!res.ok) {
|
|
152
161
|
const text = await res.text().catch(() => "");
|
|
153
162
|
throw new Error(`MadeOnSol API error ${res.status}: ${text}`);
|
|
@@ -180,30 +189,68 @@ export async function walletTrackerRemove(agent, params) {
|
|
|
180
189
|
return restQuery(agent, "DELETE", `/wallet-tracker/watchlist/${encodeURIComponent(params.wallet_address)}`);
|
|
181
190
|
}
|
|
182
191
|
export async function walletTrackerTrades(agent, params = {}) {
|
|
183
|
-
|
|
184
|
-
const url = new URL(`${BASE_URL}/api/v1/wallet-tracker/trades`);
|
|
192
|
+
const qs = new URLSearchParams();
|
|
185
193
|
for (const [k, v] of Object.entries(params)) {
|
|
186
194
|
if (v !== undefined)
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
const res = await fetch(url.toString(), { headers: { "Content-Type": "application/json", ..._authHeaders } });
|
|
190
|
-
if (!res.ok) {
|
|
191
|
-
const text = await res.text().catch(() => "");
|
|
192
|
-
throw new Error(`MadeOnSol API error ${res.status}: ${text}`);
|
|
195
|
+
qs.set(k, String(v));
|
|
193
196
|
}
|
|
194
|
-
|
|
197
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
198
|
+
return restQuery(agent, "GET", `/wallet-tracker/trades${query}`);
|
|
195
199
|
}
|
|
196
200
|
export async function walletTrackerSummary(agent, params = {}) {
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
const qs = new URLSearchParams();
|
|
202
|
+
if (params.period)
|
|
203
|
+
qs.set("period", params.period);
|
|
204
|
+
if (params.wallet)
|
|
205
|
+
qs.set("wallet", params.wallet);
|
|
206
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
207
|
+
return restQuery(agent, "GET", `/wallet-tracker/summary${query}`);
|
|
208
|
+
}
|
|
209
|
+
// ── Alpha Wallet Intelligence ──
|
|
210
|
+
export async function alphaLeaderboard(agent, params = {}) {
|
|
211
|
+
const qs = new URLSearchParams();
|
|
199
212
|
for (const [k, v] of Object.entries(params)) {
|
|
200
213
|
if (v !== undefined)
|
|
201
|
-
|
|
214
|
+
qs.set(k, String(v));
|
|
202
215
|
}
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
216
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
217
|
+
return restQuery(agent, "GET", `/alpha/leaderboard${query}`);
|
|
218
|
+
}
|
|
219
|
+
export async function alphaWallet(agent, params) {
|
|
220
|
+
return restQuery(agent, "GET", `/alpha/wallet/${encodeURIComponent(params.wallet)}`);
|
|
221
|
+
}
|
|
222
|
+
export async function alphaLinked(agent, params) {
|
|
223
|
+
return restQuery(agent, "GET", `/alpha/wallet/${encodeURIComponent(params.wallet)}/linked`);
|
|
224
|
+
}
|
|
225
|
+
// ── Token Quality ──
|
|
226
|
+
export async function tokenCapTable(agent, params) {
|
|
227
|
+
return restQuery(agent, "GET", `/token/${encodeURIComponent(params.mint)}/cap-table`);
|
|
228
|
+
}
|
|
229
|
+
export async function tokenBuyerQuality(agent, params) {
|
|
230
|
+
return restQuery(agent, "GET", `/token/${encodeURIComponent(params.mint)}/buyer-quality`);
|
|
231
|
+
}
|
|
232
|
+
// ── Copy-Trade Rules (PRO/ULTRA) ──
|
|
233
|
+
export async function copyTradeList(agent) {
|
|
234
|
+
return restQuery(agent, "GET", "/copy-trade/rules");
|
|
235
|
+
}
|
|
236
|
+
export async function copyTradeCreate(agent, params) {
|
|
237
|
+
return restQuery(agent, "POST", "/copy-trade/rules", params);
|
|
238
|
+
}
|
|
239
|
+
export async function copyTradeGet(agent, params) {
|
|
240
|
+
return restQuery(agent, "GET", `/copy-trade/rules/${encodeURIComponent(params.rule_id)}`);
|
|
241
|
+
}
|
|
242
|
+
export async function copyTradeUpdate(agent, params) {
|
|
243
|
+
return restQuery(agent, "PATCH", `/copy-trade/rules/${encodeURIComponent(params.rule_id)}`, params.updates);
|
|
244
|
+
}
|
|
245
|
+
export async function copyTradeDelete(agent, params) {
|
|
246
|
+
return restQuery(agent, "DELETE", `/copy-trade/rules/${encodeURIComponent(params.rule_id)}`);
|
|
247
|
+
}
|
|
248
|
+
export async function copyTradeSignals(agent, params = {}) {
|
|
249
|
+
const qs = new URLSearchParams();
|
|
250
|
+
for (const [k, v] of Object.entries(params)) {
|
|
251
|
+
if (v !== undefined)
|
|
252
|
+
qs.set(k, String(v));
|
|
207
253
|
}
|
|
208
|
-
|
|
254
|
+
const query = qs.toString() ? `?${qs.toString()}` : "";
|
|
255
|
+
return restQuery(agent, "GET", `/copy-trade/signals${query}`);
|
|
209
256
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-agent-kit-plugin-madeonsol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Solana Agent Kit plugin for MadeOnSol — KOL intelligence and deployer analytics via x402 micropayments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,4 +37,4 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"zod": "^3.24.0"
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|