Skip to content

Commit

Permalink
fix: zod type
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed Mar 5, 2024
1 parent ece8231 commit e7a198b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/lib/services/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const zValidatorsResponse = z
total_voting_power: zBig,
})
.transform(snakeToCamel);

export type ValidatorsResponse = z.infer<typeof zValidatorsResponse>;

export const getValidators = async (
Expand Down Expand Up @@ -112,15 +111,10 @@ export const getValidators = async (
const zValidatorDataResponse = z
.object({
info: zValidatorData.nullable(),
self_voting_power: z.string(),
total_voting_power: z.string(),
self_voting_power: zBig,
total_voting_power: zBig,
})
.transform(({ info, self_voting_power, total_voting_power }) => ({
info,
selfVotingPower: big(self_voting_power),
totalVotingPower: big(total_voting_power),
}));

.transform(snakeToCamel);
export type ValidatorDataResponse = z.infer<typeof zValidatorDataResponse>;

export const getValidatorData = async (
Expand Down

0 comments on commit e7a198b

Please sign in to comment.