diff --git a/.changeset/breezy-dodos-explode.md b/.changeset/breezy-dodos-explode.md new file mode 100644 index 0000000..5f54765 --- /dev/null +++ b/.changeset/breezy-dodos-explode.md @@ -0,0 +1,5 @@ +--- +"@shadeprotocol/shadejs": patch +--- + +Money market interface, pending tests and docs diff --git a/.changeset/lovely-dogs-pretend.md b/.changeset/lovely-dogs-pretend.md deleted file mode 100644 index 25f9b2a..0000000 --- a/.changeset/lovely-dogs-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@shadeprotocol/shadejs": minor ---- - -Money market interface pending tests and docs diff --git a/src/contracts/services/moneyMarket.ts b/src/contracts/services/moneyMarket.ts index 972ec62..36010f8 100644 --- a/src/contracts/services/moneyMarket.ts +++ b/src/contracts/services/moneyMarket.ts @@ -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 @@ -319,7 +320,7 @@ function batchQueryMoneyMarketConfig$({ lcdEndpoint, chainId, moneyMarketContracts, - batchSize = SERVICE_BATCH_SIZE.PAIR_INFO, + batchSize, minBlockHeightValidationOptions, blockHeight, }:{ @@ -407,7 +408,7 @@ function batchQueryMoneyMarketGetMarkets$({ lcdEndpoint, chainId, moneyMarketContracts, - batchSize = SERVICE_BATCH_SIZE.PAIR_INFO, + batchSize, minBlockHeightValidationOptions, blockHeight, }:{ @@ -501,7 +502,7 @@ function batchQueryMoneyMarketGetCollateral$({ lcdEndpoint, chainId, moneyMarketContracts, - batchSize = SERVICE_BATCH_SIZE.PAIR_INFO, + batchSize, minBlockHeightValidationOptions, blockHeight, }:{ diff --git a/src/types/contracts/moneyMarket/model.ts b/src/types/contracts/moneyMarket/model.ts index 62db041..18f6c5c 100644 --- a/src/types/contracts/moneyMarket/model.ts +++ b/src/types/contracts/moneyMarket/model.ts @@ -15,9 +15,7 @@ type ParsedPagination = { pageSize: number, totalPages: number, totalItems: number, - data: { - [token: string]: T - }, + data: T, } type ParsedConfigResponse = { @@ -85,7 +83,7 @@ type ParsedMarketResponse = { interestAccrualEnabled: boolean, } -type ParsedGetMarketsResponse = ParsedPagination; +type ParsedGetMarketsResponse = ParsedPagination>; type BatchMoneyMarketGetMarket = { moneyMarketContractAddress: string, @@ -110,7 +108,7 @@ type ParsedCollateralReponse = { liquidationEnabled: boolean, } -type ParsedGetCollateralResponse = ParsedPagination; +type ParsedGetCollateralResponse = ParsedPagination>; type BatchMoneyMarketGetCollateral = { moneyMarketContractAddress: string,