From f259a3e6be39bca3c4f871b29e82f05dd1f5ac72 Mon Sep 17 00:00:00 2001 From: DrPresident Date: Thu, 21 Nov 2024 11:33:39 -0600 Subject: [PATCH] feat: types --- src/contracts/services/moneyMarket.ts | 3 ++- src/types/contracts/moneyMarket/model.ts | 16 ++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/contracts/services/moneyMarket.ts b/src/contracts/services/moneyMarket.ts index 99efd8b..6c4009f 100644 --- a/src/contracts/services/moneyMarket.ts +++ b/src/contracts/services/moneyMarket.ts @@ -13,6 +13,7 @@ import { BatchMoneyMarketGetMarkets, ContractAndPagination, Pagination, ParsedConfigResponse, ParsedGetCollateralResponse, ParsedGetMarketsResponse, + ParsedRewardPoolsResponse, } from '~/types/contracts/moneyMarket/model'; import { Contract } from '~/types/contracts/shared/index'; import { @@ -729,7 +730,7 @@ async function batchQueryMoneyMarketPublicLogs({ })); } -const parseBatchQueryMoneyMarketRewardPools = (responses: any) => ( +const parseBatchQueryMoneyMarketRewardPools = (responses: any): ParsedRewardPoolsResponse[] => ( responses.map((response: any) => ({ debtMarket: response.id, blockHeight: response.blockHeight, diff --git a/src/types/contracts/moneyMarket/model.ts b/src/types/contracts/moneyMarket/model.ts index 1039651..9960051 100644 --- a/src/types/contracts/moneyMarket/model.ts +++ b/src/types/contracts/moneyMarket/model.ts @@ -166,7 +166,7 @@ type PaginatedPublicLogs = { } type RewardPool = { - id: string, + rewardPoolId: string, amount: string, token: string, start: string, @@ -174,14 +174,10 @@ type RewardPool = { rate: string, } -type PaginatedRewardPools = { - page: number, - pageSize: number, - totalPages: number, - totalItems: number, - blockHeight: number, - debtMarket: string, - data: RewardPool[], +type ParsedRewardPoolsResponse = { + debtMarket: string, + blockHeight: string, + rewardPools: RewardPool[], } export type { @@ -200,5 +196,5 @@ export type { PublicLog, PaginatedPublicLogs, RewardPool, - PaginatedRewardPools, + ParsedRewardPoolsResponse, };