@solworks/poll-mcp 0.1.16 → 0.1.17
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/dist/tools/index.js +12 -7
- package/package.json +1 -1
package/dist/tools/index.js
CHANGED
|
@@ -187,7 +187,15 @@ export const TOOL_DEFINITIONS = {
|
|
|
187
187
|
async handler(args, client) {
|
|
188
188
|
try {
|
|
189
189
|
const active = args.active;
|
|
190
|
-
|
|
190
|
+
let wagers = await client.getMyWagers();
|
|
191
|
+
if (active) {
|
|
192
|
+
const activeStatuses = new Set(['EMPTY', 'PLACED']);
|
|
193
|
+
wagers = wagers.filter((w) => {
|
|
194
|
+
const bet = w.ProgramBet;
|
|
195
|
+
const betStatus = bet?.status;
|
|
196
|
+
return activeStatuses.has(w.status) && betStatus === 'OPEN';
|
|
197
|
+
});
|
|
198
|
+
}
|
|
191
199
|
if (wagers.length === 0)
|
|
192
200
|
return textResult('No wagers found.');
|
|
193
201
|
const lines = wagers.map((w, i) => {
|
|
@@ -294,13 +302,10 @@ export const TOOL_DEFINITIONS = {
|
|
|
294
302
|
try {
|
|
295
303
|
const page = args.page;
|
|
296
304
|
const notifications = await client.getNotifications({ page });
|
|
297
|
-
|
|
298
|
-
if (display.length === 0)
|
|
305
|
+
if (notifications.length === 0)
|
|
299
306
|
return textResult('No notifications found.');
|
|
300
|
-
const lines =
|
|
307
|
+
const lines = notifications.map((n, i) => `${i + 1}. [${n.readAt ? 'Read' : 'Unread'}] ${n.title}${n.description ? ` — ${n.description}` : ''} (${n.createdAt})`);
|
|
301
308
|
let text = `Notifications:\n${lines.join('\n')}`;
|
|
302
|
-
if (notifications.length > 20)
|
|
303
|
-
text += `\n\n(Showing 20 of ${notifications.length})`;
|
|
304
309
|
return textResult(text);
|
|
305
310
|
}
|
|
306
311
|
catch (err) {
|
|
@@ -365,7 +370,7 @@ export const TOOL_DEFINITIONS = {
|
|
|
365
370
|
const history = await client.getProbabilityHistory(betAddress);
|
|
366
371
|
if (history.length === 0)
|
|
367
372
|
return textResult('No probability history available.');
|
|
368
|
-
const lines = history.map((p) => ` ${p.timestamp}: ${
|
|
373
|
+
const lines = history.map((p) => ` ${p.timestamp}: For ${p.probability.toFixed(1)}% / Against ${(p.againstProbability ?? (100 - p.probability)).toFixed(1)}%`);
|
|
369
374
|
return textResult(`Probability History for ${betAddress}:\n${lines.join('\n')}`);
|
|
370
375
|
}
|
|
371
376
|
catch (err) {
|