@itzannetos/x402-tools 1.0.2 → 1.0.4
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/.opencode/plugins/x402-tools.ts +30 -0
- package/README.md +28 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ import { join } from "path"
|
|
|
12
12
|
const BASE_URL = "https://agents.402box.io"
|
|
13
13
|
const X_SEARCHER_PATH = "/x_searcher"
|
|
14
14
|
const FIND_PEOPLE_PATH = "/find_people"
|
|
15
|
+
const ALPHA_FINDER_PATH = "/alpha_finder"
|
|
15
16
|
const TIMEOUT_MS = 300000
|
|
16
17
|
|
|
17
18
|
const getPrivateKey = async (): Promise<`0x${string}`> => {
|
|
@@ -114,6 +115,35 @@ export const X402ToolsPlugin: Plugin = async () => {
|
|
|
114
115
|
throw new Error("Unexpected response from Find People")
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
return response.data.data.response
|
|
119
|
+
},
|
|
120
|
+
}),
|
|
121
|
+
alpha_finder: tool({
|
|
122
|
+
description:
|
|
123
|
+
"Market Oracle - Searches the web, GitHub, Reddit, and X to gather intelligence on prediction market events. Helps you make educated decisions on Polymarket and Kalshi.",
|
|
124
|
+
args: {
|
|
125
|
+
query: tool.schema.string(),
|
|
126
|
+
},
|
|
127
|
+
async execute(args) {
|
|
128
|
+
const privateKey = await getPrivateKey()
|
|
129
|
+
const client = createPaymentClient(privateKey)
|
|
130
|
+
|
|
131
|
+
let response
|
|
132
|
+
try {
|
|
133
|
+
response = await client.post(ALPHA_FINDER_PATH, {
|
|
134
|
+
message: args.query,
|
|
135
|
+
})
|
|
136
|
+
} catch (error) {
|
|
137
|
+
if (axios.isAxiosError(error) && error.response?.status === 402) {
|
|
138
|
+
throw new Error("Not enough USDC in your wallet, please top up")
|
|
139
|
+
}
|
|
140
|
+
throw error
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (!response.data?.data?.response) {
|
|
144
|
+
throw new Error("Unexpected response from Market Oracle")
|
|
145
|
+
}
|
|
146
|
+
|
|
117
147
|
return response.data.data.response
|
|
118
148
|
},
|
|
119
149
|
}),
|
package/README.md
CHANGED
|
@@ -58,6 +58,23 @@ Neural and deep search capabilities that go beyond standard search engines to fi
|
|
|
58
58
|
**Output format:**
|
|
59
59
|
Returns structured summaries with key details (career, education, notable works) and numbered source citations for verification.
|
|
60
60
|
|
|
61
|
+
### 📊 `alpha_finder`
|
|
62
|
+
|
|
63
|
+
**Price: 0.03 USDC per request**
|
|
64
|
+
|
|
65
|
+
Market Oracle that searches the web, GitHub, Reddit, and X to gather intelligence on prediction market events.
|
|
66
|
+
|
|
67
|
+
**Use cases:**
|
|
68
|
+
- Evaluate Polymarket and Kalshi event outcomes
|
|
69
|
+
- Track market-moving narratives and rumors
|
|
70
|
+
- Compare sentiment across community sources
|
|
71
|
+
- Surface relevant links and sources fast
|
|
72
|
+
|
|
73
|
+
**Example queries:**
|
|
74
|
+
- "Polymarket odds on the 2026 US election"
|
|
75
|
+
- "Kalshi contract chatter around CPI release"
|
|
76
|
+
- "Narratives driving ETH ETF approval odds"
|
|
77
|
+
|
|
61
78
|
## Prerequisites
|
|
62
79
|
|
|
63
80
|
Before installing this plugin, ensure you have:
|
|
@@ -173,6 +190,16 @@ Use the find_people tool to research "Jane Doe, head of AI at ExampleCorp"
|
|
|
173
190
|
Find information about "Elon Musk, CEO of Tesla"
|
|
174
191
|
```
|
|
175
192
|
|
|
193
|
+
### Using Market Oracle
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
Use the alpha_finder tool to analyze "Polymarket odds on the next Fed rate decision"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
Analyze "Kalshi event chatter around the next CPI release"
|
|
201
|
+
```
|
|
202
|
+
|
|
176
203
|
The AI will automatically use the appropriate tool, handle the payment, and return the results.
|
|
177
204
|
|
|
178
205
|
## How It Works
|
|
@@ -330,4 +357,4 @@ For issues, questions, or contributions:
|
|
|
330
357
|
- X Searcher tool for X/Twitter search
|
|
331
358
|
- Find People tool for OSINT research
|
|
332
359
|
- X402 payment integration
|
|
333
|
-
- Base network support
|
|
360
|
+
- Base network support
|