From d1c2effff68a7c0d2b312e305a575cb285ebc0d1 Mon Sep 17 00:00:00 2001 From: nktkas Date: Sun, 2 Aug 2026 03:37:26 +0300 Subject: [PATCH] refactor(api/settledOutcome): add `question` and `deployer` fields Co-authored-by: Claude Opus 5 (1M context) --- src/api/info/_methods/settledOutcome.ts | 20 ++++++++++++++++++++ tests/api/info/settledOutcome.test.ts | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/src/api/info/_methods/settledOutcome.ts b/src/api/info/_methods/settledOutcome.ts index eae2ef46..efeb809b 100644 --- a/src/api/info/_methods/settledOutcome.ts +++ b/src/api/info/_methods/settledOutcome.ts @@ -42,6 +42,11 @@ export type SettledOutcomeResponse = { }[]; /** Quote token for this outcome. */ quoteToken: string; + /** + * Address of the deployer; absent for outcomes not deployed from a template. + * @pattern ^0x[a-fA-F0-9]{40}$ + */ + deployer?: `0x${string}`; }; /** * Settlement fraction. @@ -50,6 +55,21 @@ export type SettledOutcomeResponse = { settleFraction: string; /** Settlement details. */ details: string; + /** Question that the outcome is a named outcome of. */ + question?: { + /** Question identifier, keyed by whether the question is still active or already settled. */ + question: { + /** Identifier of an active question. */ + active: number; + } | { + /** Identifier of a settled question. */ + settled: number; + }; + /** Name of the question. */ + name: string; + /** Description of the question. */ + description: string; + }; } | null; // ============================================================ diff --git a/tests/api/info/settledOutcome.test.ts b/tests/api/info/settledOutcome.test.ts index a2d2ca4a..043ac2e7 100644 --- a/tests/api/info/settledOutcome.test.ts +++ b/tests/api/info/settledOutcome.test.ts @@ -15,6 +15,10 @@ runTest({ const params: SettledOutcomeParameters[] = [ { outcome: 100 }, { outcome: 999999999 }, + { outcome: 10200 }, // question absent + { outcome: 10207 }, // question.question = settled + { outcome: 10235 }, // question.question = active + { outcome: 10970 }, // spec.deployer present ]; const data = await Promise.all(params.map((p) => client.settledOutcome(p)));