@solworks/poll-mcp 0.1.18 → 0.1.19
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 +10 -9
- package/package.json +1 -1
- package/tests/unit/tools/bets.test.ts +6 -4
package/dist/tools/index.js
CHANGED
|
@@ -189,11 +189,11 @@ export const TOOL_DEFINITIONS = {
|
|
|
189
189
|
const active = args.active;
|
|
190
190
|
let wagers = await client.getMyWagers();
|
|
191
191
|
if (active) {
|
|
192
|
-
const
|
|
192
|
+
const activeBetStatuses = new Set(['Draft', 'Pending', 'Resolving']);
|
|
193
193
|
wagers = wagers.filter((w) => {
|
|
194
194
|
const bet = w.ProgramBet;
|
|
195
195
|
const betStatus = bet?.status;
|
|
196
|
-
return
|
|
196
|
+
return w.status === 'Open' && activeBetStatuses.has(betStatus ?? '');
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
if (wagers.length === 0)
|
|
@@ -391,9 +391,8 @@ export const TOOL_DEFINITIONS = {
|
|
|
391
391
|
items: { type: 'string' },
|
|
392
392
|
description: 'List of answer options',
|
|
393
393
|
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
expiresAt: { type: 'string', description: 'Expiration date in ISO format (optional)' },
|
|
394
|
+
amount: { type: 'number', description: 'Minimum wager amount in USDC (optional, defaults to 0.01)' },
|
|
395
|
+
expiresAt: { type: 'string', description: 'Wager deadline in ISO format (optional)' },
|
|
397
396
|
},
|
|
398
397
|
required: ['question', 'options'],
|
|
399
398
|
},
|
|
@@ -408,10 +407,12 @@ export const TOOL_DEFINITIONS = {
|
|
|
408
407
|
try {
|
|
409
408
|
const bet = await client.createBet({
|
|
410
409
|
question,
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
410
|
+
expectedUserCount: 2,
|
|
411
|
+
minimumVoteCount: 2,
|
|
412
|
+
customOptionFor: options[0],
|
|
413
|
+
customOptionAgainst: options[1],
|
|
414
|
+
minimumWagerAmount: args.amount,
|
|
415
|
+
allWagersDueBy: args.expiresAt,
|
|
415
416
|
});
|
|
416
417
|
return textResult(`Bet created successfully!\n Question: ${bet.question}\n Options: ${Array.isArray(bet.options) ? bet.options.join(', ') : 'For / Against'}\n Status: ${bet.status}\n Address: ${bet.betAddress}`);
|
|
417
418
|
}
|
package/package.json
CHANGED
|
@@ -69,10 +69,12 @@ describe('Bet tool handlers', () => {
|
|
|
69
69
|
expect(result.content[0].text).toContain('Will SOL hit 200?');
|
|
70
70
|
expect(createBetFn).toHaveBeenCalledWith({
|
|
71
71
|
question: 'Will SOL hit 200?',
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
expectedUserCount: 2,
|
|
73
|
+
minimumVoteCount: 2,
|
|
74
|
+
customOptionFor: 'Yes',
|
|
75
|
+
customOptionAgainst: 'No',
|
|
76
|
+
minimumWagerAmount: 10,
|
|
77
|
+
allWagersDueBy: undefined,
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
80
|
|