Skip to content

Commit

Permalink
feat: types
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPresident committed Nov 21, 2024
1 parent 57e129c commit f259a3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/contracts/services/moneyMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 6 additions & 10 deletions src/types/contracts/moneyMarket/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,18 @@ type PaginatedPublicLogs = {
}

type RewardPool = {
id: string,
rewardPoolId: string,
amount: string,
token: string,
start: string,
end: string,
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 {
Expand All @@ -200,5 +196,5 @@ export type {
PublicLog,
PaginatedPublicLogs,
RewardPool,
PaginatedRewardPools,
ParsedRewardPoolsResponse,
};

0 comments on commit f259a3e

Please sign in to comment.