@seekdaseek/plugin-agentfeed 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/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @seekdaseek/plugin-agentfeed
2
+
3
+ Live crypto market data for [elizaOS](https://github.com/elizaOS/eliza) trading agents, paid per-call in USDC over the [x402 protocol](https://x402.org) on Solana.
4
+
5
+ No API keys. No subscriptions. No signup. Your agent holds a wallet, and pays $0.001–$0.01 per call only when it actually needs data.
6
+
7
+ Backed by [AgentFeed](https://x402.ochinimus.app) — multi-exchange liquidation collection (Bybit + OKX WebSocket), Bybit v5 positioning, Pyth prices, and Helius DAS on-chain data.
8
+
9
+ ## What your agent can ask for
10
+
11
+ | Action | Data | Price |
12
+ |---|---|---|
13
+ | `AGENTFEED_GET_TRADE_CONTEXT` | Full market state: prices, funding, fear/greed, positioning, liquidations | $0.01 |
14
+ | `AGENTFEED_GET_LIQUIDATIONS` | Recent SOL/BTC liquidation prints, filterable | $0.003 |
15
+ | `AGENTFEED_GET_LIQUIDATION_STATS` | 1h/24h totals, long/short split, biggest print | $0.004 |
16
+ | `AGENTFEED_GET_POSITIONING` | Long/short ratio + open interest with 1h/24h deltas | $0.004 |
17
+ | `AGENTFEED_GET_FUNDING_RATE` | SOL + BTC perp funding rates | $0.002 |
18
+ | `AGENTFEED_GET_MARKET_SNAPSHOT` | Compact market snapshot | $0.003 |
19
+ | `AGENTFEED_GET_SOL_PRICE` | SOL spot via Pyth | $0.001 |
20
+ | `AGENTFEED_GET_BTC_PRICE` | BTC spot via Pyth | $0.001 |
21
+ | `AGENTFEED_GET_TOKEN_RISK` | Rug-risk scan: mint/freeze authority, holder concentration | $0.01 |
22
+ | `AGENTFEED_GET_TOKEN_METADATA` | SPL token metadata via Helius DAS | $0.005 |
23
+ | `AGENTFEED_GET_WALLET_HOLDINGS` | Wallet portfolio via Helius DAS | $0.008 |
24
+
25
+ ## Quickstart
26
+
27
+ ```bash
28
+ npm install @seekdaseek/plugin-agentfeed
29
+ ```
30
+
31
+ Character config:
32
+
33
+ ```json
34
+ {
35
+ "name": "TraderAgent",
36
+ "plugins": ["@seekdaseek/plugin-agentfeed"],
37
+ "settings": {
38
+ "secrets": {
39
+ "AGENTFEED_PRIVATE_KEY": "<base58 private key OR solana-keygen JSON array>"
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Fund the wallet with USDC on Solana mainnet. **$1 of USDC ≈ 100–1000 calls.** A tiny amount of SOL is not required — x402 exact-SVM settlement is handled by the facilitator.
46
+
47
+ Then just talk to your agent:
48
+
49
+ > "How much got liquidated in the last 24 hours?"
50
+ > "What's the long/short ratio on SOL?"
51
+ > "Is this token a rug: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
52
+ > "Give me the full trade context before we size this position."
53
+
54
+ ## Built-in spend guard
55
+
56
+ Agents with funded wallets and buggy loops are a drained-wallet incident waiting to happen. This plugin refuses to pay blind:
57
+
58
+ - Before paying any endpoint, the plugin reads the live 402 quote and **refuses any price above `AGENTFEED_MAX_SPEND_PER_CALL`** (default `$0.02`).
59
+ - Approved quotes are cached for 10 minutes, so steady-state calls cost a single request.
60
+ - No `Provider` is registered — the plugin never silently injects paid data into every prompt. Data is fetched only when an action explicitly fires.
61
+
62
+ ## Settings
63
+
64
+ | Setting | Required | Default | Description |
65
+ |---|---|---|---|
66
+ | `AGENTFEED_PRIVATE_KEY` | yes | — | Payer wallet key (base58 string or JSON byte array). Must hold USDC on Solana mainnet. |
67
+ | `AGENTFEED_BASE_URL` | no | `https://x402.ochinimus.app` | API base URL. |
68
+ | `AGENTFEED_MAX_SPEND_PER_CALL` | no | `0.02` | USD cap per call; higher quotes are refused. |
69
+
70
+ ## Security notes
71
+
72
+ - Use a **dedicated hot wallet** for the agent with only the USDC you're willing to spend. Never your main wallet.
73
+ - The private key never leaves the process; payments are signed locally and settled through the x402 facilitator.
74
+
75
+ ## Also available over MCP
76
+
77
+ The same data is exposed as MCP tools (x402-gated) — see the [AgentFeed manifest](https://x402.ochinimus.app/.well-known/x402.json).
78
+
79
+ ## License
80
+
81
+ MIT — [seekdaseek](https://github.com/seekdaseek)
@@ -0,0 +1,61 @@
1
+ import { Service, IAgentRuntime, Plugin } from '@elizaos/core';
2
+
3
+ interface PaidResult {
4
+ ok: boolean;
5
+ status: number;
6
+ data: unknown;
7
+ paidUsd?: number;
8
+ settlement?: unknown;
9
+ error?: string;
10
+ }
11
+ declare class AgentFeedService extends Service {
12
+ protected runtime: IAgentRuntime;
13
+ static serviceType: string;
14
+ capabilityDescription: string;
15
+ private payFetch;
16
+ private baseUrl;
17
+ private maxSpendUsd;
18
+ private payerAddress;
19
+ /** path -> { usd, checkedAt } of last approved quote */
20
+ private approvedQuotes;
21
+ /** lifetime spend counter for this process (informational) */
22
+ private totalSpentUsd;
23
+ constructor(runtime: IAgentRuntime);
24
+ static start(runtime: IAgentRuntime): Promise<AgentFeedService>;
25
+ stop(): Promise<void>;
26
+ private getSettingStr;
27
+ private init;
28
+ /** Extract the max USD price from a 402 response body (x402 "accepts" array). */
29
+ private quoteFromBody;
30
+ /**
31
+ * Spend guard. Returns the approved quote in USD, or throws if over cap /
32
+ * unquotable. Cached per path for QUOTE_TTL_MS.
33
+ */
34
+ private preflight;
35
+ /** Paid GET against AgentFeed. Guard first, then x402 pay-and-retry fetch. */
36
+ paidGet(path: string): Promise<PaidResult>;
37
+ get spentUsd(): number;
38
+ get payer(): string;
39
+ }
40
+
41
+ interface EndpointDef {
42
+ /** Path template. `:mint` / `:wallet` are filled from the message. */
43
+ path: string;
44
+ /** Expected price in USD (informational; guard uses live quote). */
45
+ usd: number;
46
+ /** elizaOS action name (SCREAMING_SNAKE). */
47
+ action: string;
48
+ /** Alternative trigger phrases. */
49
+ similes: string[];
50
+ /** Action description shown to the LLM. */
51
+ description: string;
52
+ /** Natural-language examples that should trigger this action. */
53
+ triggers: string[];
54
+ /** Which param the path needs, if any. */
55
+ param?: 'mint' | 'wallet';
56
+ }
57
+ declare const ENDPOINTS: EndpointDef[];
58
+
59
+ declare const agentfeedPlugin: Plugin;
60
+
61
+ export { AgentFeedService, ENDPOINTS, agentfeedPlugin, agentfeedPlugin as default };
package/dist/index.js ADDED
@@ -0,0 +1,355 @@
1
+ // src/service.ts
2
+ import { Service, logger } from "@elizaos/core";
3
+ import { createKeyPairSignerFromBytes } from "@solana/kit";
4
+ import { toClientSvmSigner } from "@x402/svm";
5
+ import { ExactSvmScheme } from "@x402/svm/exact/client";
6
+ import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from "@x402/fetch";
7
+ import bs58 from "bs58";
8
+ var DEFAULT_BASE_URL = "https://x402.ochinimus.app";
9
+ var DEFAULT_MAX_SPEND_USD = 0.02;
10
+ var QUOTE_TTL_MS = 10 * 60 * 1e3;
11
+ var USDC_DECIMALS = 6;
12
+ var AgentFeedService = class _AgentFeedService extends Service {
13
+ constructor(runtime) {
14
+ super(runtime);
15
+ this.runtime = runtime;
16
+ }
17
+ runtime;
18
+ static serviceType = "agentfeed";
19
+ capabilityDescription = "Pays for and fetches live crypto market data (liquidations, positioning, funding, prices, token risk) from the AgentFeed x402 API on Solana.";
20
+ payFetch;
21
+ baseUrl = DEFAULT_BASE_URL;
22
+ maxSpendUsd = DEFAULT_MAX_SPEND_USD;
23
+ payerAddress = "";
24
+ /** path -> { usd, checkedAt } of last approved quote */
25
+ approvedQuotes = /* @__PURE__ */ new Map();
26
+ /** lifetime spend counter for this process (informational) */
27
+ totalSpentUsd = 0;
28
+ static async start(runtime) {
29
+ const svc = new _AgentFeedService(runtime);
30
+ await svc.init();
31
+ return svc;
32
+ }
33
+ async stop() {
34
+ }
35
+ getSettingStr(key) {
36
+ const v = this.runtime.getSetting(key);
37
+ return typeof v === "string" && v.length > 0 ? v : void 0;
38
+ }
39
+ async init() {
40
+ this.baseUrl = (this.getSettingStr("AGENTFEED_BASE_URL") || DEFAULT_BASE_URL).replace(/\/+$/, "");
41
+ const cap = Number(this.getSettingStr("AGENTFEED_MAX_SPEND_PER_CALL"));
42
+ this.maxSpendUsd = Number.isFinite(cap) && cap > 0 ? cap : DEFAULT_MAX_SPEND_USD;
43
+ const rawKey = this.getSettingStr("AGENTFEED_PRIVATE_KEY");
44
+ if (!rawKey) {
45
+ throw new Error(
46
+ "plugin-agentfeed: AGENTFEED_PRIVATE_KEY is not set. Provide a base58 private key or a solana-keygen JSON byte array for a wallet holding USDC on Solana mainnet."
47
+ );
48
+ }
49
+ const bytes = parseKey(rawKey);
50
+ const keypair = await createKeyPairSignerFromBytes(bytes);
51
+ this.payerAddress = keypair.address;
52
+ const signer = toClientSvmSigner(keypair);
53
+ this.payFetch = wrapFetchWithPaymentFromConfig(fetch, {
54
+ schemes: [{ network: "solana:*", client: new ExactSvmScheme(signer) }]
55
+ });
56
+ logger.info(
57
+ `[agentfeed] ready \u2014 payer ${this.payerAddress.slice(0, 4)}\u2026${this.payerAddress.slice(-4)}, base ${this.baseUrl}, cap $${this.maxSpendUsd}/call`
58
+ );
59
+ }
60
+ /** Extract the max USD price from a 402 response body (x402 "accepts" array). */
61
+ quoteFromBody(body) {
62
+ const accepts = body?.accepts;
63
+ if (!Array.isArray(accepts) || accepts.length === 0) return null;
64
+ let maxUsd = 0;
65
+ for (const a of accepts) {
66
+ const raw = a?.maxAmountRequired ?? a?.amount ?? a?.maxAmount;
67
+ const n = Number(raw);
68
+ if (Number.isFinite(n) && n > 0) {
69
+ maxUsd = Math.max(maxUsd, n / 10 ** USDC_DECIMALS);
70
+ }
71
+ }
72
+ return maxUsd > 0 ? maxUsd : null;
73
+ }
74
+ /**
75
+ * Spend guard. Returns the approved quote in USD, or throws if over cap /
76
+ * unquotable. Cached per path for QUOTE_TTL_MS.
77
+ */
78
+ async preflight(path) {
79
+ const cached = this.approvedQuotes.get(path);
80
+ if (cached && Date.now() - cached.checkedAt < QUOTE_TTL_MS) return cached.usd;
81
+ const res = await fetch(this.baseUrl + path, { method: "GET" });
82
+ if (res.status !== 402) {
83
+ this.approvedQuotes.set(path, { usd: 0, checkedAt: Date.now() });
84
+ return 0;
85
+ }
86
+ let quoted = null;
87
+ const prHeader = res.headers.get("payment-required") || res.headers.get("x-payment-required");
88
+ if (prHeader) {
89
+ try {
90
+ quoted = this.quoteFromBody(JSON.parse(atob(prHeader)));
91
+ } catch {
92
+ }
93
+ }
94
+ if (quoted === null) {
95
+ try {
96
+ quoted = this.quoteFromBody(await res.json());
97
+ } catch {
98
+ }
99
+ }
100
+ if (quoted === null) {
101
+ throw new Error(`AgentFeed returned 402 for ${path} but the quote could not be parsed; refusing to pay blind.`);
102
+ }
103
+ if (quoted > this.maxSpendUsd) {
104
+ throw new Error(
105
+ `AgentFeed quoted $${quoted} for ${path}, above the configured cap of $${this.maxSpendUsd} (AGENTFEED_MAX_SPEND_PER_CALL). Call refused.`
106
+ );
107
+ }
108
+ this.approvedQuotes.set(path, { usd: quoted, checkedAt: Date.now() });
109
+ return quoted;
110
+ }
111
+ /** Paid GET against AgentFeed. Guard first, then x402 pay-and-retry fetch. */
112
+ async paidGet(path) {
113
+ try {
114
+ const quotedUsd = await this.preflight(path);
115
+ const res = await this.payFetch(this.baseUrl + path, { method: "GET" });
116
+ let settlement;
117
+ const settleHeader = res.headers.get("payment-response") || res.headers.get("x-payment-response");
118
+ if (settleHeader) {
119
+ try {
120
+ settlement = decodePaymentResponseHeader(settleHeader);
121
+ } catch {
122
+ settlement = settleHeader.slice(0, 120);
123
+ }
124
+ }
125
+ const data = await res.json().catch(() => null);
126
+ if (!res.ok) {
127
+ return { ok: false, status: res.status, data, error: `AgentFeed HTTP ${res.status}` };
128
+ }
129
+ if (settlement) this.totalSpentUsd += quotedUsd;
130
+ return { ok: true, status: res.status, data, paidUsd: settlement ? quotedUsd : 0, settlement };
131
+ } catch (e) {
132
+ return { ok: false, status: 0, data: null, error: e?.message || String(e) };
133
+ }
134
+ }
135
+ get spentUsd() {
136
+ return this.totalSpentUsd;
137
+ }
138
+ get payer() {
139
+ return this.payerAddress;
140
+ }
141
+ };
142
+ function parseKey(raw) {
143
+ const trimmed = raw.trim();
144
+ if (trimmed.startsWith("[")) {
145
+ const arr = JSON.parse(trimmed);
146
+ if (!Array.isArray(arr)) throw new Error("AGENTFEED_PRIVATE_KEY JSON must be a byte array");
147
+ return Uint8Array.from(arr);
148
+ }
149
+ return bs58.decode(trimmed);
150
+ }
151
+
152
+ // src/endpoints.ts
153
+ var ENDPOINTS = [
154
+ {
155
+ path: "/api/trade-context",
156
+ usd: 0.01,
157
+ action: "AGENTFEED_GET_TRADE_CONTEXT",
158
+ similes: ["GET_TRADE_CONTEXT", "MARKET_CONTEXT", "FULL_MARKET_STATE"],
159
+ description: "Fetch the full crypto market state in one paid call ($0.01): SOL+BTC prices, funding rates, fear/greed index, long/short positioning, open interest, and recent liquidation summary. Use when the agent needs a complete trading picture before making or explaining a decision.",
160
+ triggers: [
161
+ "what's the current trade context",
162
+ "give me the full market state",
163
+ "should I be long or short SOL right now, check the data",
164
+ "pull the trading context before we decide"
165
+ ]
166
+ },
167
+ {
168
+ path: "/api/liquidations",
169
+ usd: 3e-3,
170
+ action: "AGENTFEED_GET_LIQUIDATIONS",
171
+ similes: ["GET_RECENT_LIQUIDATIONS", "RECENT_LIQUIDATIONS", "LIQUIDATION_FEED"],
172
+ description: "Fetch recent SOL/BTC perp liquidation prints ($0.003): side, size, price, exchange, timestamp. Use for questions about recent liquidations, cascades, or big liquidation prints.",
173
+ triggers: [
174
+ "any big liquidations in the last hour",
175
+ "show me recent SOL liquidations",
176
+ "was there a liquidation cascade"
177
+ ]
178
+ },
179
+ {
180
+ path: "/api/liquidation-stats",
181
+ usd: 4e-3,
182
+ action: "AGENTFEED_GET_LIQUIDATION_STATS",
183
+ similes: ["GET_LIQUIDATION_STATS", "LIQUIDATION_TOTALS"],
184
+ description: 'Fetch aggregated liquidation stats ($0.004): 1h/24h totals, long vs short split, biggest single print. Use for "how much got liquidated" style questions.',
185
+ triggers: [
186
+ "how much got liquidated today",
187
+ "longs or shorts getting rekt more",
188
+ "liquidation totals last 24h"
189
+ ]
190
+ },
191
+ {
192
+ path: "/api/positioning",
193
+ usd: 4e-3,
194
+ action: "AGENTFEED_GET_POSITIONING",
195
+ similes: ["GET_POSITIONING", "LONG_SHORT_RATIO", "OPEN_INTEREST"],
196
+ description: "Fetch SOL+BTC long/short account ratio and open interest with 1h/24h OI deltas ($0.004). Use for positioning, crowding, or OI questions.",
197
+ triggers: [
198
+ "what's the long/short ratio on SOL",
199
+ "is open interest rising or falling",
200
+ "how crowded is the long side"
201
+ ]
202
+ },
203
+ {
204
+ path: "/api/funding-rate",
205
+ usd: 2e-3,
206
+ action: "AGENTFEED_GET_FUNDING_RATE",
207
+ similes: ["GET_FUNDING_RATE", "FUNDING_RATES", "PERP_FUNDING"],
208
+ description: "Fetch current SOL and BTC perp funding rates ($0.002). Use for funding questions or carry-cost checks.",
209
+ triggers: [
210
+ "what's SOL funding right now",
211
+ "are funding rates positive or negative"
212
+ ]
213
+ },
214
+ {
215
+ path: "/api/market-snapshot",
216
+ usd: 3e-3,
217
+ action: "AGENTFEED_GET_MARKET_SNAPSHOT",
218
+ similes: ["GET_MARKET_SNAPSHOT", "MARKET_SNAPSHOT"],
219
+ description: "Fetch a compact market snapshot ($0.003): SOL+BTC prices plus key market gauges in one call. Cheaper than trade-context; use for quick price/market checks that need more than a single price.",
220
+ triggers: [
221
+ "quick market snapshot",
222
+ "how's the market looking"
223
+ ]
224
+ },
225
+ {
226
+ path: "/api/sol-price",
227
+ usd: 1e-3,
228
+ action: "AGENTFEED_GET_SOL_PRICE",
229
+ similes: ["GET_SOL_PRICE", "SOL_PRICE"],
230
+ description: "Fetch live SOL spot price via Pyth ($0.001). Use for a plain SOL price check.",
231
+ triggers: ["what's SOL trading at", "SOL price"]
232
+ },
233
+ {
234
+ path: "/api/btc-price",
235
+ usd: 1e-3,
236
+ action: "AGENTFEED_GET_BTC_PRICE",
237
+ similes: ["GET_BTC_PRICE", "BTC_PRICE"],
238
+ description: "Fetch live BTC spot price via Pyth ($0.001). Use for a plain BTC price check.",
239
+ triggers: ["what's bitcoin at", "BTC price"]
240
+ },
241
+ {
242
+ path: "/api/token-risk/:mint",
243
+ usd: 0.01,
244
+ action: "AGENTFEED_GET_TOKEN_RISK",
245
+ similes: ["GET_TOKEN_RISK", "RUG_CHECK", "TOKEN_SAFETY"],
246
+ description: "Rug-risk scan for an SPL token mint ($0.01): mint/freeze authority status, top-holder concentration, risk flags. The message must contain a Solana mint address. Use before an agent buys or recommends any token.",
247
+ triggers: [
248
+ "is this token a rug: <mint>",
249
+ "run a risk check on <mint>",
250
+ "check mint and freeze authority for <mint>"
251
+ ],
252
+ param: "mint"
253
+ },
254
+ {
255
+ path: "/api/token-metadata/:mint",
256
+ usd: 5e-3,
257
+ action: "AGENTFEED_GET_TOKEN_METADATA",
258
+ similes: ["GET_TOKEN_METADATA", "TOKEN_INFO"],
259
+ description: "Fetch SPL token metadata via Helius DAS ($0.005): name, symbol, supply, decimals. The message must contain a Solana mint address.",
260
+ triggers: ["what token is <mint>", "token info for <mint>"],
261
+ param: "mint"
262
+ },
263
+ {
264
+ path: "/api/wallet-holdings/:wallet",
265
+ usd: 8e-3,
266
+ action: "AGENTFEED_GET_WALLET_HOLDINGS",
267
+ similes: ["GET_WALLET_HOLDINGS", "WALLET_PORTFOLIO"],
268
+ description: "Fetch a Solana wallet's token holdings via Helius DAS ($0.008). The message must contain a Solana wallet address.",
269
+ triggers: ["what does this wallet hold: <address>", "portfolio of <address>"],
270
+ param: "wallet"
271
+ }
272
+ ];
273
+ var BASE58_RE = /\b[1-9A-HJ-NP-Za-km-z]{32,44}\b/;
274
+
275
+ // src/actions.ts
276
+ function buildExamples(def) {
277
+ return def.triggers.slice(0, 2).map((t) => [
278
+ {
279
+ name: "{{user1}}",
280
+ content: { text: t.replace("<mint>", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v").replace("<address>", "4a8o45skRPcyjAdyR8yES215Swvh8uTpZD6KLarhxCJ7") }
281
+ },
282
+ {
283
+ name: "{{agent}}",
284
+ content: {
285
+ text: "Pulling live data from AgentFeed\u2026",
286
+ actions: [def.action]
287
+ }
288
+ }
289
+ ]);
290
+ }
291
+ function makeAction(def) {
292
+ return {
293
+ name: def.action,
294
+ similes: def.similes,
295
+ description: def.description,
296
+ validate: async (_runtime, message) => {
297
+ const text = message?.content?.text ?? "";
298
+ if (def.param) return BASE58_RE.test(text);
299
+ return true;
300
+ },
301
+ handler: async (runtime, message, _state, _options, callback) => {
302
+ const svc = runtime.getService(AgentFeedService.serviceType);
303
+ if (!svc) {
304
+ await callback?.({
305
+ text: "AgentFeed service is not available \u2014 check that AGENTFEED_PRIVATE_KEY is configured."
306
+ });
307
+ return false;
308
+ }
309
+ let path = def.path;
310
+ if (def.param) {
311
+ const m = (message?.content?.text ?? "").match(BASE58_RE);
312
+ if (!m) {
313
+ await callback?.({
314
+ text: `I need a Solana ${def.param} address in the message to run this lookup.`
315
+ });
316
+ return false;
317
+ }
318
+ path = path.replace(`:${def.param}`, m[0]);
319
+ }
320
+ const result = await svc.paidGet(path);
321
+ if (!result.ok) {
322
+ await callback?.({
323
+ text: `AgentFeed call failed: ${result.error ?? `HTTP ${result.status}`}`
324
+ });
325
+ return false;
326
+ }
327
+ const paidNote = result.paidUsd ? ` (paid $${result.paidUsd} via x402)` : "";
328
+ await callback?.({
329
+ text: `AgentFeed ${def.path} result${paidNote}:
330
+ \`\`\`json
331
+ ${JSON.stringify(result.data, null, 2).slice(0, 3500)}
332
+ \`\`\``,
333
+ data: { agentfeed: { path: def.path, result: result.data, paidUsd: result.paidUsd ?? 0 } }
334
+ });
335
+ return true;
336
+ },
337
+ examples: buildExamples(def)
338
+ };
339
+ }
340
+ var agentfeedActions = ENDPOINTS.map(makeAction);
341
+
342
+ // src/index.ts
343
+ var agentfeedPlugin = {
344
+ name: "agentfeed",
345
+ description: "Live crypto market data for trading agents \u2014 liquidations, long/short positioning, open interest, funding rates, SOL/BTC prices, and SPL token rug-risk checks. Each call is paid on the fly in USDC via the x402 protocol on Solana ($0.001\u2013$0.01 per call). Requires a funded Solana wallet.",
346
+ services: [AgentFeedService],
347
+ actions: agentfeedActions
348
+ };
349
+ var index_default = agentfeedPlugin;
350
+ export {
351
+ AgentFeedService,
352
+ ENDPOINTS,
353
+ agentfeedPlugin,
354
+ index_default as default
355
+ };
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@seekdaseek/plugin-agentfeed",
3
+ "version": "0.1.0",
4
+ "description": "elizaOS plugin for AgentFeed — paid crypto market data (liquidations, positioning, funding, token risk) over x402 micropayments on Solana. $0.001–$0.01 per call in USDC, no API keys, no subscriptions.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsup src/index.ts --format esm --dts --clean",
21
+ "dev": "tsup src/index.ts --format esm --dts --watch",
22
+ "test": "node --test"
23
+ },
24
+ "keywords": [
25
+ "elizaos",
26
+ "elizaos-plugins",
27
+ "x402",
28
+ "solana",
29
+ "crypto",
30
+ "market-data",
31
+ "liquidations",
32
+ "trading",
33
+ "ai-agents",
34
+ "micropayments"
35
+ ],
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/seekdaseek/plugin-agentfeed.git"
39
+ },
40
+ "license": "MIT",
41
+ "dependencies": {
42
+ "@solana/kit": "^7.0.0",
43
+ "@x402/fetch": "^2.17.0",
44
+ "@x402/svm": "^2.17.0",
45
+ "bs58": "^6.0.0"
46
+ },
47
+ "peerDependencies": {
48
+ "@elizaos/core": ">=1.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@elizaos/core": "^1.0.0",
52
+ "tsup": "^8.0.0",
53
+ "typescript": "^5.4.0"
54
+ },
55
+ "agentConfig": {
56
+ "pluginType": "elizaos:plugin:1.0.0",
57
+ "pluginParameters": {
58
+ "AGENTFEED_PRIVATE_KEY": {
59
+ "type": "string",
60
+ "description": "Solana private key of the paying wallet (base58 string OR JSON byte array). Wallet must hold USDC on Solana mainnet. Fund with $1 of USDC = ~100-1000 calls."
61
+ },
62
+ "AGENTFEED_BASE_URL": {
63
+ "type": "string",
64
+ "description": "AgentFeed API base URL. Default: https://x402.ochinimus.app"
65
+ },
66
+ "AGENTFEED_MAX_SPEND_PER_CALL": {
67
+ "type": "string",
68
+ "description": "Safety cap in USD per single API call. Any 402 quote above this is refused. Default: 0.02"
69
+ }
70
+ }
71
+ }
72
+ }