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
10 changes: 6 additions & 4 deletions src/api/info/_methods/legalCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ export type LegalCheckResponse = {
/** Whether the user is allowed to use the platform. */
userAllowed: boolean;
/**
* Restriction code.
*
* FIXME: meaning of `"n"` / `"a"` unconfirmed.
* Restriction code:
* - `"n"`: No restrictions.
* - `"a"`: Platform actions are blocked.
* - `"o"`: Outcome markets are hidden.
* - `"u"`: Restricted as a UK user.
*/
restrictions?: "n" | "a";
restrictions: "n" | "a" | "o" | "u";
};

// ============================================================
Expand Down
5 changes: 3 additions & 2 deletions tests/api/info/legalCheck.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ runTest({
codeTestFn: async (_t, client) => {
const params: LegalCheckParameters[] = [
{ user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9" },
{ user: "0x0000000000000000000000000000000000000001" }, // acceptedTerms/userAllowed = false
];

const data = await Promise.all(params.map((p) => client.legalCheck(p)));

schemaCoverage(paramsSchema, params);
schemaCoverage(responseSchema, data, [
"#/properties/restrictions/missing",
"#/properties/restrictions/enum/0",
"#/properties/restrictions/enum/1",
"#/properties/restrictions/enum/2",
"#/properties/restrictions/enum/3",
]);
},
});