Skip to content

Commit

Permalink
refactor: remove C2D
Browse files Browse the repository at this point in the history
  • Loading branch information
tom1145 committed May 16, 2024
1 parent 932dfb2 commit 1fa147a
Show file tree
Hide file tree
Showing 48 changed files with 39 additions and 3,290 deletions.
12 changes: 0 additions & 12 deletions src/@types/Compute.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { ComputeJob } from '@oceanprotocol/lib'
import { OrdersData_orders_datatoken as OrdersDatatoken } from '../@types/subgraph/OrdersData'

// declaring into global scope to be able to use this as
// ambiant types despite the above imports
declare global {
interface ComputeJobMetaData extends ComputeJob {
assetName: string
assetDtSymbol: string
networkId: number
}

interface AlgorithmOption {
did: string
name: string
Expand All @@ -23,11 +16,6 @@ declare global {
createdTimestamp: number
}

interface ComputeResults {
computeJobs: ComputeJobMetaData[]
isLoaded: boolean
}

interface totalPriceMap {
value: string
symbol: string
Expand Down
6 changes: 2 additions & 4 deletions src/@types/aquarius/SearchQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ export enum SortTermOptions {
// and gets imported in components.

export enum FilterByTypeOptions {
Data = 'dataset',
Algorithm = 'algorithm'
Data = 'dataset'
}

export enum FilterByAccessOptions {
Download = 'access',
Compute = 'compute'
Download = 'access'
}

declare global {
Expand Down
37 changes: 0 additions & 37 deletions src/@utils/aquarius/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Asset, LoggerInstance } from '@oceanprotocol/lib'
import { AssetSelectionAsset } from '@shared/FormInput/InputElement/AssetSelection'
import axios, { CancelToken, AxiosResponse } from 'axios'
import { OrdersData_orders as OrdersData } from '../../@types/subgraph/OrdersData'
import { metadataCacheUri } from '../../../app.config'
import {
SortDirectionOptions,
SortTermOptions
} from '../../@types/aquarius/SearchQuery'
import { transformAssetToAssetSelection } from '../assetConvertor'

export interface UserSales {
id: string
Expand Down Expand Up @@ -206,41 +204,6 @@ export async function getAssetsFromDids(
}
}

export async function getAlgorithmDatasetsForCompute(
algorithmId: string,
datasetProviderUri: string,
datasetChainId?: number,
cancelToken?: CancelToken
): Promise<AssetSelectionAsset[]> {
const baseQueryParams = {
chainIds: [datasetChainId],
nestedQuery: {
must: {
match: {
'services.compute.publisherTrustedAlgorithms.did': {
query: algorithmId
}
}
}
},
sortOptions: {
sortBy: SortTermOptions.Created,
sortDirection: SortDirectionOptions.Descending
}
} as BaseQueryParams

const query = generateBaseQuery(baseQueryParams)
const computeDatasets = await queryMetadata(query, cancelToken)
if (computeDatasets?.totalResults === 0) return []

const datasets = await transformAssetToAssetSelection(
datasetProviderUri,
computeDatasets.results,
[]
)
return datasets
}

export async function getPublishedAssets(
accountId: string,
chainIds: number[],
Expand Down
Loading

0 comments on commit 1fa147a

Please sign in to comment.