mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix publish with pool
This commit is contained in:
parent
2504eba886
commit
7cac17d906
9
src/@types/DDO/Credentials.d.ts
vendored
9
src/@types/DDO/Credentials.d.ts
vendored
@ -1,9 +0,0 @@
|
||||
interface Credential {
|
||||
type: string
|
||||
values: string[]
|
||||
}
|
||||
|
||||
interface Credentials {
|
||||
allow: Credential[]
|
||||
deny: Credential[]
|
||||
}
|
16
src/@types/DDO/Metadata.d.ts
vendored
16
src/@types/DDO/Metadata.d.ts
vendored
@ -10,19 +10,3 @@ interface MetadataAlgorithm {
|
||||
version?: string
|
||||
container: MetadataAlgorithmContainer
|
||||
}
|
||||
|
||||
interface Metadata {
|
||||
created: string
|
||||
updated: string
|
||||
name: string
|
||||
description: string
|
||||
type: 'dataset' | 'algorithm' | string
|
||||
author: string
|
||||
license: string
|
||||
links?: string[]
|
||||
tags?: string[]
|
||||
copyrightHolder?: string
|
||||
contentLanguage?: string
|
||||
algorithm?: MetadataAlgorithm
|
||||
additionalInformation?: any
|
||||
}
|
||||
|
30
src/@types/DDO/Services.d.ts
vendored
30
src/@types/DDO/Services.d.ts
vendored
@ -1,30 +0,0 @@
|
||||
interface PublisherTrustedAlgorithm {
|
||||
did: string
|
||||
filesChecksum: string
|
||||
containerSectionChecksum: string
|
||||
}
|
||||
|
||||
interface ServiceComputeOptions {
|
||||
namespace: string
|
||||
cpu?: number
|
||||
gpu?: number
|
||||
gpuType?: string
|
||||
memory?: string
|
||||
volumeSize?: string
|
||||
allowRawAlgorithm: boolean
|
||||
allowNetworkAccess: boolean
|
||||
publisherTrustedAlgorithmPublishers: string[]
|
||||
publisherTrustedAlgorithms: PublisherTrustedAlgorithm[]
|
||||
}
|
||||
|
||||
interface Service {
|
||||
id: string
|
||||
type: 'access' | 'compute' | string
|
||||
files: string
|
||||
datatokenAddress: string
|
||||
serviceEndpoint: string
|
||||
timeout: number
|
||||
name?: string
|
||||
description?: string
|
||||
compute?: ServiceComputeOptions
|
||||
}
|
10
src/@types/DDO/index.d.ts
vendored
10
src/@types/DDO/index.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
// DDO spec
|
||||
interface DDO {
|
||||
'@context': string[]
|
||||
id: string
|
||||
version: string
|
||||
chainId: number
|
||||
metadata: Metadata
|
||||
services: Service[]
|
||||
credentials?: Credentials
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
import { ServiceComputeOptions } from '@oceanprotocol/lib'
|
||||
import { DataTokenOptions } from '@utils/datatokens'
|
||||
import { NftOptions } from '@utils/nft'
|
||||
import { ReactElement } from 'react'
|
||||
@ -28,7 +29,7 @@ export interface FormPublishData {
|
||||
}
|
||||
metadata: {
|
||||
nft: NftOptions
|
||||
type: 'Dataset' | 'Algorithm' | string
|
||||
type: 'dataset' | 'algorithm'
|
||||
name: string
|
||||
description: string
|
||||
author: string
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { generateDid } from '@oceanprotocol/lib'
|
||||
import { DDO, generateDid, Metadata, Service } from '@oceanprotocol/lib'
|
||||
import { mapTimeoutStringToSeconds } from '@utils/ddo'
|
||||
import { getEncryptedFiles } from '@utils/provider'
|
||||
import slugify from 'slugify'
|
||||
@ -127,6 +127,7 @@ export async function transformPublishFormToDdo(
|
||||
files[0].valid &&
|
||||
(await getEncryptedFiles(file, providerUrl.url))
|
||||
|
||||
// TODO: fix id
|
||||
const newService: Service = {
|
||||
id: 'notAnId',
|
||||
type: access,
|
||||
@ -144,6 +145,7 @@ export async function transformPublishFormToDdo(
|
||||
id: did,
|
||||
version: '4.0.0',
|
||||
chainId,
|
||||
nftAddress,
|
||||
metadata: newMetadata,
|
||||
services: [newService]
|
||||
// Only added for DDO preview, reflecting Asset response,
|
||||
|
Loading…
x
Reference in New Issue
Block a user