diff --git a/app.config.js b/app.config.js index e90bf96ab..e2dad02f4 100644 --- a/app.config.js +++ b/app.config.js @@ -9,14 +9,6 @@ module.exports = { process.env.NEXT_PUBLIC_METADATACACHE_URI || 'https://v4.aquarius.oceanprotocol.com', - v3MetadataCacheUri: - process.env.NEXT_PUBLIC_V3_METADATACACHE_URI || - 'https://aquarius.oceanprotocol.com', - - v3MarketUri: - process.env.NEXT_PUBLIC_V3_MARKET_URI || - 'https://v3.market.oceanprotocol.com', - // List of chainIds which metadata cache queries will return by default. // This preselects the Chains user preferences. chainIds: [1, 137, 56, 246, 1285], diff --git a/src/@context/Asset.tsx b/src/@context/Asset.tsx index 9bbdeed06..918c9ab14 100644 --- a/src/@context/Asset.tsx +++ b/src/@context/Asset.tsx @@ -9,7 +9,7 @@ import React, { } from 'react' import { Config, LoggerInstance, Purgatory } from '@oceanprotocol/lib' import { CancelToken } from 'axios' -import { checkV3Asset, retrieveAsset } from '@utils/aquarius' +import { retrieveAsset } from '@utils/aquarius' import { useWeb3 } from './Web3' import { useCancelToken } from '@hooks/useCancelToken' import { getOceanConfig, getDevelopmentConfig } from '@utils/ocean' @@ -25,7 +25,6 @@ export interface AssetProviderValue { owner: string error?: string isAssetNetwork: boolean - isV3Asset: boolean isOwner: boolean oceanConfig: Config loading: boolean @@ -53,7 +52,6 @@ function AssetProvider({ const [error, setError] = useState() const [loading, setLoading] = useState(false) const [isAssetNetwork, setIsAssetNetwork] = useState() - const [isV3Asset, setIsV3Asset] = useState() const [oceanConfig, setOceanConfig] = useState() const newCancelToken = useCancelToken() @@ -71,7 +69,6 @@ function AssetProvider({ const asset = await retrieveAsset(did, token) if (!asset) { - setIsV3Asset(await checkV3Asset(did, token)) setError( `\`${did}\`` + '\n\nWe could not find an asset for this DID in the cache. If you just published a new asset, wait some seconds and refresh this page.' @@ -96,7 +93,6 @@ function AssetProvider({ } setTitle(`This asset has been flagged as "${state}" by the publisher`) - setIsV3Asset(await checkV3Asset(did, token)) setError(`\`${did}\`` + `\n\nPublisher Address: ${asset.nft.owner}`) LoggerInstance.error(`[asset] Failed getting asset for ${did}`, asset) return @@ -208,7 +204,6 @@ function AssetProvider({ loading, fetchAsset, isAssetNetwork, - isV3Asset, isOwner, oceanConfig } as AssetProviderValue diff --git a/src/@context/MarketMetadata/_types.ts b/src/@context/MarketMetadata/_types.ts index 62b61b5bc..4d7ebe01c 100644 --- a/src/@context/MarketMetadata/_types.ts +++ b/src/@context/MarketMetadata/_types.ts @@ -26,8 +26,6 @@ export interface AppConfig { classNameLight: string storageKey: string } - v3MetadataCacheUri: string - v3MarketUri: string } export interface SiteContent { siteTitle: string diff --git a/src/@utils/aquarius.ts b/src/@utils/aquarius.ts index 036139f2d..f6546de0a 100644 --- a/src/@utils/aquarius.ts +++ b/src/@utils/aquarius.ts @@ -2,7 +2,7 @@ import { Asset, LoggerInstance } from '@oceanprotocol/lib' import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection' import axios, { CancelToken, AxiosResponse } from 'axios' import { OrdersData_orders as OrdersData } from '../@types/subgraph/OrdersData' -import { metadataCacheUri, v3MetadataCacheUri } from '../../app.config' +import { metadataCacheUri } from '../../app.config' import { SortDirectionOptions, SortTermOptions @@ -145,28 +145,6 @@ export async function retrieveAsset( } } -export async function checkV3Asset( - did: string, - cancelToken: CancelToken -): Promise { - try { - const response: AxiosResponse = await axios.get( - `${v3MetadataCacheUri}/api/v1/aquarius/assets/ddo/${did}`, - { cancelToken } - ) - if (!response || response.status !== 200 || !response.data) return false - - return true - } catch (error) { - if (axios.isCancel(error)) { - LoggerInstance.log(error.message) - } else { - LoggerInstance.error(error.message) - } - return false - } -} - export async function getAssetsNames( didList: string[], cancelToken: CancelToken diff --git a/src/components/Asset/index.tsx b/src/components/Asset/index.tsx index c971fbd03..edc1cf761 100644 --- a/src/components/Asset/index.tsx +++ b/src/components/Asset/index.tsx @@ -5,29 +5,25 @@ import Alert from '@shared/atoms/Alert' import Loader from '@shared/atoms/Loader' import { useAsset } from '@context/Asset' import AssetContent from './AssetContent' -import { v3MarketUri } from 'app.config' export default function AssetDetails({ uri }: { uri: string }): ReactElement { const router = useRouter() - const { asset, title, error, isInPurgatory, loading, isV3Asset } = useAsset() + const { asset, title, error, isInPurgatory, loading } = useAsset() const [pageTitle, setPageTitle] = useState() useEffect(() => { - if (isV3Asset) { - router.push(`${v3MarketUri}${uri}`) - } if (!asset || error) { setPageTitle(title || 'Could not retrieve asset') return } setPageTitle(isInPurgatory ? '' : title) - }, [asset, error, isInPurgatory, isV3Asset, router, title, uri]) + }, [asset, error, isInPurgatory, router, title, uri]) return asset && pageTitle !== undefined && !loading ? ( - ) : error && isV3Asset === false ? ( + ) : error ? (