From e7a198be83dfe525d000b564b3fad381e93e2e00 Mon Sep 17 00:00:00 2001 From: songwongtp <16089160+songwongtp@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:56:47 +0700 Subject: [PATCH] fix: zod type --- src/lib/services/validator.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib/services/validator.ts b/src/lib/services/validator.ts index 3cb9cde6c..a3e50e814 100644 --- a/src/lib/services/validator.ts +++ b/src/lib/services/validator.ts @@ -84,7 +84,6 @@ const zValidatorsResponse = z total_voting_power: zBig, }) .transform(snakeToCamel); - export type ValidatorsResponse = z.infer; export const getValidators = async ( @@ -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; export const getValidatorData = async (