Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dev-169-listevents-open-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/client": patch
---

Default `listEvents` to open events when `closed` is omitted.
4 changes: 3 additions & 1 deletion packages/client/src/actions/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { snakeCase, toDataSearchParams, toSearchParams } from './params';

const ListEventsRequestSchema = z.object({
ascending: z.boolean().optional(),
closed: z.boolean().optional(),
closed: z.boolean().default(false),
cursor: PaginationCursorSchema.optional(),
pageSize: PageSizeSchema.optional(),
cyom: z.boolean().optional(),
Expand Down Expand Up @@ -135,6 +135,8 @@ export const ListEventsError = makeErrorGuard(
/**
* Lists events.
*
* Defaults to open events. Pass `closed: true` to list settled events.
*
* @remarks
* This is a low-level function. Most SDK consumers should prefer the client instance API.
*
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/decorators/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export type DiscoveryActions = {
/**
* Lists events.
*
* Defaults to open events. Pass `closed: true` to list settled events.
*
* @throws {@link ListEventsError}
* Thrown on failure.
*
Expand Down
Loading