Skip to content

Commit

Permalink
chore: small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SissonJ committed Aug 23, 2024
1 parent f316a95 commit 95444a5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-dodos-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shadeprotocol/shadejs": patch
---

Money market interface, pending tests and docs
5 changes: 0 additions & 5 deletions .changeset/lovely-dogs-pretend.md

This file was deleted.

17 changes: 9 additions & 8 deletions src/contracts/services/moneyMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ import {
ContractAndPagination,
Pagination, ParsedConfigResponse, ParsedGetCollateralResponse, ParsedGetMarketsResponse,
} from '~/types/contracts/moneyMarket/model';
import { msgQueryMoneyMarketCollaterals, msgQueryMoneyMarketConfig, msgQueryMoneyMarketMarkets } from '../definitions/moneyMarket';
import { SERVICE_BATCH_SIZE } from './config';
import { Contract } from '../../types/contracts/shared/index';
import { Contract } from '~/types/contracts/shared/index';
import {
BatchQueryParams, BatchQueryParsedResponse, MinBlockHeightValidationOptions, batchQuery$,
} from '../..';
BatchQueryParams, BatchQueryParsedResponse,
} from '~/types/contracts/batchQuery/model';
import { MinBlockHeightValidationOptions } from '~/types';
import { batchQuery$ } from './batchQuery';
import { msgQueryMoneyMarketCollaterals, msgQueryMoneyMarketConfig, msgQueryMoneyMarketMarkets } from '../definitions/moneyMarket';

/**
* Parses the get markets query into a cleaner data model
Expand Down Expand Up @@ -319,7 +320,7 @@ function batchQueryMoneyMarketConfig$({
lcdEndpoint,
chainId,
moneyMarketContracts,
batchSize = SERVICE_BATCH_SIZE.PAIR_INFO,
batchSize,
minBlockHeightValidationOptions,
blockHeight,
}:{
Expand Down Expand Up @@ -407,7 +408,7 @@ function batchQueryMoneyMarketGetMarkets$({
lcdEndpoint,
chainId,
moneyMarketContracts,
batchSize = SERVICE_BATCH_SIZE.PAIR_INFO,
batchSize,
minBlockHeightValidationOptions,
blockHeight,
}:{
Expand Down Expand Up @@ -501,7 +502,7 @@ function batchQueryMoneyMarketGetCollateral$({
lcdEndpoint,
chainId,
moneyMarketContracts,
batchSize = SERVICE_BATCH_SIZE.PAIR_INFO,
batchSize,
minBlockHeightValidationOptions,
blockHeight,
}:{
Expand Down
8 changes: 3 additions & 5 deletions src/types/contracts/moneyMarket/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ type ParsedPagination<T> = {
pageSize: number,
totalPages: number,
totalItems: number,
data: {
[token: string]: T
},
data: T,
}

type ParsedConfigResponse = {
Expand Down Expand Up @@ -85,7 +83,7 @@ type ParsedMarketResponse = {
interestAccrualEnabled: boolean,
}

type ParsedGetMarketsResponse = ParsedPagination<ParsedMarketResponse>;
type ParsedGetMarketsResponse = ParsedPagination<Record<string, ParsedMarketResponse>>;

type BatchMoneyMarketGetMarket = {
moneyMarketContractAddress: string,
Expand All @@ -110,7 +108,7 @@ type ParsedCollateralReponse = {
liquidationEnabled: boolean,
}

type ParsedGetCollateralResponse = ParsedPagination<ParsedCollateralReponse>;
type ParsedGetCollateralResponse = ParsedPagination<Record<string, ParsedCollateralReponse>>;

type BatchMoneyMarketGetCollateral = {
moneyMarketContractAddress: string,
Expand Down

0 comments on commit 95444a5

Please sign in to comment.