fix: validate types

This commit is contained in:
yj 2021-04-24 19:04:51 -05:00
parent a5dfe215b8
commit 66045979c4
4 changed files with 19 additions and 13 deletions

View File

@ -14,7 +14,7 @@
"claim": {
"isClaimed": false,
"claimer": "",
"signature": "",
"signature": ""
},
"isHybrid": false,
"hasDelegation": false,

4
types.d.ts vendored
View File

@ -8,11 +8,11 @@ export declare const ProtocolIo: t.TypeC<{
folder: t.StringC;
type: t.UnionC<[t.LiteralC<"snapshot">, t.LiteralC<"compoundish">]>;
suffix: t.StringC;
claim: t.TypeC<{
claim: t.UnionC<[t.PartialC<{
isClaimed: t.BooleanC;
claimer: t.StringC;
signature: t.StringC;
}>;
}>, t.UndefinedC]>;
coinGeckoPriceString: t.StringC;
tokenContractAddress: t.StringC;
governanceContractAddress: t.UnionC<[t.StringC, t.UndefinedC]>;

View File

@ -30,11 +30,14 @@ exports.ProtocolIo = t.type({
folder: t.string,
type: t.union([t.literal("snapshot"), t.literal("compoundish")]),
suffix: t.string,
claim: t.type({
claim: t.union([
t.partial({
isClaimed: t.boolean,
claimer: t.string,
signature: t.string,
}),
t.undefined,
]),
coinGeckoPriceString: t.string,
tokenContractAddress: t.string,
governanceContractAddress: t.union([t.string, t.undefined]),

View File

@ -9,11 +9,14 @@ export const ProtocolIo = t.type({
folder: t.string,
type: t.union([t.literal("snapshot"), t.literal("compoundish")]),
suffix: t.string,
claim: t.type({
claim: t.union([
t.partial({
isClaimed: t.boolean,
claimer: t.string,
signature: t.string,
}),
t.undefined,
]),
coinGeckoPriceString: t.string,
tokenContractAddress: t.string,
governanceContractAddress: t.union([t.string, t.undefined]),