boardroom-inc-protocol-Info/types.ts
2021-04-15 13:04:23 -05:00

38 lines
954 B
TypeScript

import * as t from "io-ts";
export const ProtocolIo = t.type({
cname: t.string,
name: t.string,
description: t.string,
path: t.string,
folder: t.string,
type: t.union([t.literal("snapshot"), t.literal("compoundish")]),
suffix: t.string,
coinGeckoPriceString: t.string,
tokenContractAddress: t.string,
governanceContractAddress: t.union([t.string, t.undefined]),
isEnabled: t.boolean,
hasOnchain: t.boolean,
isHybrid: t.boolean,
hasDelegation: t.boolean,
snapshotSpaceName: t.union([t.string, t.undefined]),
invalidSnapshots: t.union([t.array(t.string), t.undefined]),
branding: t.union([
t.partial({
primaryColor: t.string,
accentColor: t.string,
}),
t.undefined,
]),
discourseForum: t.union([
t.partial({
url: t.string,
categoryId: t.string,
}),
t.undefined,
]),
safeAddress: t.union([t.string, t.null]),
});
export type Protocol = t.TypeOf<typeof ProtocolIo>;