@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.
@@ -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 activeStatuses = new Set(['EMPTY', 'PLACED']);
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 activeStatuses.has(w.status) && betStatus === 'OPEN';
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
- type: { type: 'string', description: 'Bet type (e.g. USDC, XP). Optional.' },
395
- amount: { type: 'number', description: 'Initial wager amount (optional)' },
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
- options,
412
- type: args.type ?? 'USDC',
413
- amount: args.amount,
414
- expiresAt: args.expiresAt,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solworks/poll-mcp",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "MCP server for Poll.fun. See documentation at https://dev.poll.fun",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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
- options: ['Yes', 'No'],
73
- type: 'USDC',
74
- amount: 10,
75
- expiresAt: undefined,
72
+ expectedUserCount: 2,
73
+ minimumVoteCount: 2,
74
+ customOptionFor: 'Yes',
75
+ customOptionAgainst: 'No',
76
+ minimumWagerAmount: 10,
77
+ allWagersDueBy: undefined,
76
78
  });
77
79
  });
78
80