mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
switch over to app config metadataCacheUri
This commit is contained in:
parent
605f77e055
commit
209dd379dc
@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
metadataCacheUri:
|
||||
process.env.METADATACACHE_URI ||
|
||||
'https://aquarius.mainnet.oceanprotocol.com',
|
||||
process.env.METADATACACHE_URI || 'https://aquarius.oceanprotocol.com',
|
||||
|
||||
// List of chainIds which metadata cache queries will return by default.
|
||||
// This preselects the Chains user preferences.
|
||||
|
@ -12,6 +12,7 @@ import {
|
||||
import { AssetSelectionAsset } from '../components/molecules/FormFields/AssetSelection'
|
||||
import { PriceList, getAssetsPriceList } from './subgraph'
|
||||
import axios, { CancelToken, AxiosResponse } from 'axios'
|
||||
import { metadataCacheUri } from '../../app.config'
|
||||
|
||||
function getQueryForAlgorithmDatasets(algorithmDid: string, chainId?: number) {
|
||||
return {
|
||||
@ -49,7 +50,7 @@ export function transformQueryResult(
|
||||
}
|
||||
}
|
||||
|
||||
export function transformChainIdsListToQuery(chainIds: number[]) {
|
||||
export function transformChainIdsListToQuery(chainIds: number[]): string {
|
||||
let chainQuery = ''
|
||||
chainIds.forEach((chainId) => {
|
||||
chainQuery += `chainId:${chainId} OR `
|
||||
@ -61,10 +62,10 @@ export function transformChainIdsListToQuery(chainIds: number[]) {
|
||||
export async function queryMetadata(
|
||||
query: SearchQuery,
|
||||
cancelToken: CancelToken
|
||||
): Promise<any> {
|
||||
): Promise<QueryResult> {
|
||||
try {
|
||||
const response: AxiosResponse<any> = await axios.post(
|
||||
`https://multiaqua.oceanprotocol.com/api/v1/aquarius/assets/ddo/query`,
|
||||
`${metadataCacheUri}/api/v1/aquarius/assets/ddo/query`,
|
||||
{ ...query, cancelToken }
|
||||
)
|
||||
if (!response || response.status !== 200 || !response.data) return
|
||||
@ -84,7 +85,7 @@ export async function retrieveDDO(
|
||||
): Promise<DDO> {
|
||||
try {
|
||||
const response: AxiosResponse<DDO> = await axios.get(
|
||||
`https://multiaqua.oceanprotocol.com/api/v1/aquarius/assets/ddo/${did}`,
|
||||
`${metadataCacheUri}/api/v1/aquarius/assets/ddo/${did}`,
|
||||
{ cancelToken }
|
||||
)
|
||||
if (!response || response.status !== 200 || !response.data) return
|
||||
@ -106,7 +107,7 @@ export async function getAssetsNames(
|
||||
): Promise<Record<string, string>> {
|
||||
try {
|
||||
const response: AxiosResponse<Record<string, string>> = await axios.post(
|
||||
`https://multiaqua.oceanprotocol.com/api/v1/aquarius/assets/names`,
|
||||
`${metadataCacheUri}/api/v1/aquarius/assets/names`,
|
||||
{
|
||||
didList,
|
||||
cancelToken
|
||||
|
Loading…
Reference in New Issue
Block a user