Skip to content

Commit

Permalink
Merge branch 'money-market-reward-pools' into borrowe-rewards-fe
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPresident committed Nov 27, 2024
2 parents 878257c + 6c90022 commit 9aa494a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/contracts/services/moneyMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import {
BatchQueryParsedResponse,
BatchQueryParams,
BatchQueryParsedResponseItem,
} from '~/types/contracts/batchQuery/model';
import { sendSecretClientContractQuery$ } from '~/client/services/clientServices';
import { ConfigResponse, GetCollateralResponse, GetMarketsResponse } from '~/types/contracts/moneyMarket/response';
Expand All @@ -19,6 +20,7 @@ import {
ContractAndPagination,
Pagination, ParsedConfigResponse, ParsedGetCollateralResponse, ParsedGetMarketsResponse,
ParsedRewardPoolsResponse,
RewardPoolResponse,
} from '~/types/contracts/moneyMarket/model';
import { Contract } from '~/types/contracts/shared/index';
import { MinBlockHeightValidationOptions } from '~/types';
Expand Down Expand Up @@ -735,10 +737,10 @@ async function batchQueryMoneyMarketPublicLogs({
const parseBatchQueryMoneyMarketRewardPools = (
responses: BatchQueryParsedResponse,
): ParsedRewardPoolsResponse[] => (
responses.map((response: any) => ({
debtMarket: response.id,
responses.map((response: BatchQueryParsedResponseItem) => ({
debtMarket: response.id.toString(),
blockHeight: response.blockHeight,
rewardPools: response.response.map((pool: any) => ({
rewardPools: response.response.map((pool: RewardPoolResponse) => ({
rewardPoolId: pool.id,
amount: pool.amount,
token: pool.token,
Expand Down
10 changes: 10 additions & 0 deletions src/types/contracts/moneyMarket/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ type RewardPool = {
rate: string,
}

type RewardPoolResponse = {
id: string,
amount: string,
token: string,
start: string,
end: string,
rate: string,
}

type ParsedRewardPoolsResponse = {
debtMarket: string,
blockHeight: number,
Expand All @@ -196,5 +205,6 @@ export type {
PublicLog,
PaginatedPublicLogs,
RewardPool,
RewardPoolResponse,
ParsedRewardPoolsResponse,
};

0 comments on commit 9aa494a

Please sign in to comment.