Skip to content

fix(client): accept copied event market URLs#99

Merged
cesarenaldi merged 2 commits into
mainfrom
fix/dev-168-market-event-url
Jun 5, 2026
Merged

fix(client): accept copied event market URLs#99
cesarenaldi merged 2 commits into
mainfrom
fix/dev-168-market-event-url

Conversation

@cesarenaldi
Copy link
Copy Markdown
Collaborator

@cesarenaldi cesarenaldi commented Jun 5, 2026

Summary

  • accept copied market URLs shaped like /event/{slug} in fetchMarket(url: ...)
  • also supports selected-market URLs shaped like /event/{eventSlug}/{marketSlug} by using the final slug
  • update market URL examples and the existing market URL integration test

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm test:client:integration packages/client/tests/integration/markets.test.ts

Note

Low Risk
Localized URL parsing for market lookup only; no auth or API contract changes beyond accepting additional user input shapes.

Overview
fetchMarket({ url }) now accepts Polymarket links copied from the site that use the /event/... path, not only /market/{slug}.

parsePolymarketSlugUrl gains a market-specific branch: when resolving a market, /event/{slug} uses that segment as the market slug, and /event/{eventSlug}/{marketSlug} prefers the second segment when present (at most one extra path segment). Other shapes still fail with UserInputError. Docs/examples and the integration test were updated to use event-style URLs; the negative test now rejects a tag URL instead of a plain event URL.

Reviewed by Cursor Bugbot for commit a75a6fd. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a75a6fd. Configure here.

Comment thread packages/client/src/polymarket-url.ts
@cesarenaldi cesarenaldi merged commit d00d70f into main Jun 5, 2026
8 checks passed
@cesarenaldi cesarenaldi deleted the fix/dev-168-market-event-url branch June 5, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant