Skip to content
Open
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
7 changes: 5 additions & 2 deletions sdks/typescript/pmxt/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,9 @@ export interface UnifiedEvent {
// Advanced Filtering Types
// ----------------------------------------------------------------------------

/** Supported outcome labels for binary and up/down markets. */
export type OutcomeType = 'yes' | 'no' | 'up' | 'down';

/**
* Advanced criteria for filtering markets.
* Supports text search, numeric ranges, dates, categories, and price filters.
Expand Down Expand Up @@ -908,14 +911,14 @@ export interface MarketFilterCriteria {

/** Filter by outcome price (for binary markets) */
price?: {
outcome: 'yes' | 'no' | 'up' | 'down';
outcome: OutcomeType;
min?: number;
max?: number;
};

/** Filter by 24-hour price change */
priceChange24h?: {
outcome: 'yes' | 'no' | 'up' | 'down';
outcome: OutcomeType;
min?: number;
max?: number;
};
Expand Down
14 changes: 14 additions & 0 deletions sdks/typescript/tests/outcome-type.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { MarketFilterCriteria, OutcomeType } from "../pmxt/models";

describe("OutcomeType", () => {
it("is exported for reuse in market filters", () => {
const outcome: OutcomeType = "yes";
const criteria: MarketFilterCriteria = {
price: { outcome },
priceChange24h: { outcome },
};

expect(criteria.price?.outcome).toBe("yes");
expect(criteria.priceChange24h?.outcome).toBe("yes");
});
});