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
20 changes: 20 additions & 0 deletions src/api/info/_methods/settledOutcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;

// ============================================================
Expand Down
4 changes: 4 additions & 0 deletions tests/api/info/settledOutcome.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down