mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
use priceList interface instead of any for return type
This commit is contained in:
parent
d52d644850
commit
1696fb2c44
@ -10,7 +10,7 @@ import {
|
||||
SearchQuery
|
||||
} from '@oceanprotocol/lib/dist/node/metadatacache/MetadataCache'
|
||||
import { AssetSelectionAsset } from '../components/molecules/FormFields/AssetSelection'
|
||||
import { getAssetPrices } from './subgraph'
|
||||
import { PriceList, getAssetPrices } from './subgraph'
|
||||
import axios, { CancelToken, AxiosResponse } from 'axios'
|
||||
|
||||
// TODO: import directly from ocean.js somehow.
|
||||
@ -113,7 +113,7 @@ export async function transformDDOToAssetSelection(
|
||||
): Promise<AssetSelectionAsset[]> {
|
||||
const source = axios.CancelToken.source()
|
||||
const didList: string[] = []
|
||||
const priceList: any = await getAssetPrices(ddoList)
|
||||
const priceList: PriceList = await getAssetPrices(ddoList)
|
||||
const symbolList: any = {}
|
||||
for (const ddo of ddoList) {
|
||||
didList.push(ddo.id)
|
||||
|
@ -3,6 +3,10 @@ import { DDO } from '@oceanprotocol/lib'
|
||||
import { getApolloClientInstance } from '../providers/ApolloClientProvider'
|
||||
import BigNumber from 'bignumber.js'
|
||||
|
||||
export interface PriceList {
|
||||
[key: string]: string
|
||||
}
|
||||
|
||||
const freQuery = gql`
|
||||
query AssetFrePrice($datatoken_in: [String!]) {
|
||||
fixedRateExchanges(orderBy: id, where: { datatoken_in: $datatoken_in }) {
|
||||
@ -85,8 +89,8 @@ export async function getPreviousOrders(
|
||||
}
|
||||
}
|
||||
|
||||
export async function getAssetPrices(assets: DDO[]): Promise<any> {
|
||||
const priceList: any = {}
|
||||
export async function getAssetPrices(assets: DDO[]): Promise<PriceList> {
|
||||
const priceList: PriceList = {}
|
||||
const didDTMap: any = {}
|
||||
const dataTokenList: string[] = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user