1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

merge fixes

This commit is contained in:
Matthias Kretschmann 2022-01-11 19:58:39 +00:00
parent 38ce25225f
commit a084c038c5
Signed by: m
GPG Key ID: 606EEEF3C479A91F
7 changed files with 10 additions and 20 deletions

View File

@ -5,13 +5,6 @@ import {
ProviderInstance
} from '@oceanprotocol/lib'
export interface FileInfo {
index: number
valid: boolean
contentType: string
contentLength: string
}
export async function getEncryptedFiles(
files: FileMetadata[],
providerUrl: string
@ -41,13 +34,13 @@ export async function getFileInfo(
url: string,
providerUrl: string,
cancelToken: CancelToken
): Promise<FileInfo[]> {
): Promise<FileMetadata[]> {
try {
// TODO: what was the point of this?
// if (url instanceof DID) postBody = { did: url.getDid() }
// else postBody = { url }
const postBody = { url, type: 'url' }
const response: AxiosResponse<FileInfo[]> = await axios.post(
const response: AxiosResponse<FileMetadata[]> = await axios.post(
`${providerUrl}/api/services/fileinfo`,
postBody,
{ cancelToken }

View File

@ -4,7 +4,7 @@ import classNames from 'classnames/bind'
import cleanupContentType from '@utils/cleanupContentType'
import styles from './index.module.css'
import Loader from '@shared/atoms/Loader'
import { FileMetadata } from '@utils/provider'
import { FileMetadata } from '@oceanprotocol/lib'
const cx = classNames.bind(styles)

View File

@ -2,7 +2,7 @@ import React, { ReactElement } from 'react'
import { prettySize } from './utils'
import cleanupContentType from '@utils/cleanupContentType'
import styles from './Info.module.css'
import { FileMetadata } from '@utils/provider'
import { FileMetadata } from '@oceanprotocol/lib'
export default function FileInfo({
file,
@ -13,7 +13,7 @@ export default function FileInfo({
}): ReactElement {
return (
<div className={styles.info}>
<h3 className={styles.url}>{(file as any).url}</h3>
<h3 className={styles.url}>{file.url}</h3>
<ul>
<li className={styles.success}> URL confirmed</li>
{file.contentLength && <li>{prettySize(+file.contentLength)}</li>}

View File

@ -5,7 +5,8 @@ import {
ComputeOutput,
Asset,
DDO,
PublisherTrustedAlgorithm
PublisherTrustedAlgorithm,
FileMetadata
} from '@oceanprotocol/lib'
import { toast } from 'react-toastify'
import Price from '@shared/Price'
@ -14,7 +15,6 @@ import Alert from '@shared/atoms/Alert'
import { useSiteMetadata } from '@hooks/useSiteMetadata'
import { useWeb3 } from '@context/Web3'
import { usePricing } from '@hooks/usePricing'
import { useAsset } from '@context/Asset'
import {
generateBaseQuery,
getFilterTerm,
@ -36,7 +36,6 @@ import ComputeJobs from '../../../Profile/History/ComputeJobs'
import { useCancelToken } from '@hooks/useCancelToken'
import { useIsMounted } from '@hooks/useIsMounted'
import { SortTermOptions } from '../../../../@types/aquarius/SearchQuery'
import { FileMetadata } from '@utils/provider'
export default function Compute({
ddo,

View File

@ -16,8 +16,7 @@ import { secondsToString } from '@utils/ddo'
import AlgorithmDatasetsListForCompute from './Compute/AlgorithmDatasetsListForCompute'
import styles from './Consume.module.css'
import { useIsMounted } from '@hooks/useIsMounted'
import { FileMetadata } from '@utils/provider'
import { Asset } from '@oceanprotocol/lib'
import { Asset, FileMetadata } from '@oceanprotocol/lib'
const previousOrderQuery = gql`
query PreviousOrder($id: String!, $account: String!) {

View File

@ -1,7 +1,7 @@
import React, { ReactElement, useState, useEffect } from 'react'
import Compute from './Compute'
import Consume from './Consume'
import { Asset, LoggerInstance } from '@oceanprotocol/lib'
import { Asset, FileMetadata, LoggerInstance } from '@oceanprotocol/lib'
import Tabs, { TabsItem } from '@shared/atoms/Tabs'
import { compareAsBN } from '@utils/numbers'
import Pool from './Pool'
@ -9,7 +9,7 @@ import Trade from './Trade'
import { useAsset } from '@context/Asset'
import { useWeb3 } from '@context/Web3'
import Web3Feedback from '@shared/Web3Feedback'
import { FileMetadata, getFileInfo } from '@utils/provider'
import { getFileInfo } from '@utils/provider'
import { getOceanConfig } from '@utils/ocean'
import { useCancelToken } from '@hooks/useCancelToken'
import { useIsMounted } from '@hooks/useIsMounted'

View File

@ -154,7 +154,6 @@ export async function transformPublishFormToDdo(
nftAddress,
version: '4.0.0',
chainId,
nftAddress,
metadata: newMetadata,
services: [newService]
// Only added for DDO preview, reflecting Asset response,