diff --git a/sdks/typescript/pmxt/models.ts b/sdks/typescript/pmxt/models.ts index 5db743cb..832f72af 100644 --- a/sdks/typescript/pmxt/models.ts +++ b/sdks/typescript/pmxt/models.ts @@ -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. @@ -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; }; diff --git a/sdks/typescript/tests/outcome-type.test.ts b/sdks/typescript/tests/outcome-type.test.ts new file mode 100644 index 00000000..f36a539a --- /dev/null +++ b/sdks/typescript/tests/outcome-type.test.ts @@ -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"); + }); +});