@oceanprotocol/lib 3.4.1 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -8
- package/CodeExamples.md +31 -11
- package/ComputeExamples.md +7 -3
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/types/@types/Asset.d.ts +148 -0
- package/dist/types/@types/Compute.d.ts +71 -0
- package/dist/types/@types/Contracts.d.ts +26 -0
- package/dist/types/@types/DDO/ConsumerParameter.d.ts +37 -0
- package/dist/types/@types/DDO/Credentials.d.ts +8 -0
- package/dist/types/@types/DDO/DDO.d.ts +55 -0
- package/dist/types/@types/DDO/Event.d.ts +27 -0
- package/dist/types/@types/DDO/Metadata.d.ts +141 -0
- package/dist/types/@types/DDO/Service.d.ts +106 -0
- package/dist/types/@types/Datatoken.d.ts +42 -0
- package/dist/types/@types/Dispenser.d.ts +16 -0
- package/dist/types/@types/DownloadResponse.d.ts +4 -0
- package/dist/types/@types/File.d.ts +89 -0
- package/dist/types/@types/FileInfo.d.ts +43 -0
- package/dist/types/@types/FixedPrice.d.ts +51 -0
- package/dist/types/@types/NFT.d.ts +18 -0
- package/dist/types/@types/NFTFactory.d.ts +20 -0
- package/dist/types/@types/Provider.d.ts +33 -0
- package/dist/types/@types/ReturnTypes.d.ts +3 -0
- package/dist/types/@types/Router.d.ts +59 -0
- package/dist/types/@types/index.d.ts +20 -0
- package/dist/types/config/Config.d.ts +162 -0
- package/dist/types/config/ConfigHelper.d.ts +13 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/contracts/AccessList.d.ts +85 -0
- package/dist/types/contracts/AccessListFactory.d.ts +56 -0
- package/dist/types/contracts/Datatoken.d.ts +278 -0
- package/dist/types/contracts/Datatoken4.d.ts +72 -0
- package/dist/types/contracts/Dispenser.d.ts +73 -0
- package/dist/types/contracts/FixedRateExchange.d.ts +209 -0
- package/dist/types/contracts/NFT.d.ts +227 -0
- package/dist/types/contracts/NFTFactory.d.ts +165 -0
- package/dist/types/contracts/Router.d.ts +107 -0
- package/dist/types/contracts/SmartContract.d.ts +46 -0
- package/dist/types/contracts/SmartContractWithAddress.d.ts +17 -0
- package/dist/types/contracts/df/DfRewards.d.ts +31 -0
- package/dist/types/contracts/df/DfStrategyV1.d.ts +21 -0
- package/dist/types/contracts/index.d.ts +20 -0
- package/dist/types/contracts/ve/VeAllocate.d.ts +38 -0
- package/dist/types/contracts/ve/VeFeeDistributor.d.ts +29 -0
- package/dist/types/contracts/ve/VeFeeEstimate.d.ts +14 -0
- package/dist/types/contracts/ve/VeOcean.d.ts +68 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/services/Aquarius.d.ts +53 -0
- package/dist/types/services/Provider.d.ts +197 -0
- package/dist/types/services/index.d.ts +2 -0
- package/dist/types/utils/Assets.d.ts +56 -0
- package/dist/types/utils/Constants.d.ts +4 -0
- package/dist/types/utils/ContractUtils.d.ts +46 -0
- package/dist/types/utils/DatatokenName.d.ts +14 -0
- package/dist/types/utils/DdoHelpers.d.ts +13 -0
- package/dist/types/utils/FetchHelper.d.ts +14 -0
- package/dist/types/utils/General.d.ts +5 -0
- package/dist/types/utils/Logger.d.ts +19 -0
- package/dist/types/utils/OrderUtils.d.ts +20 -0
- package/dist/types/utils/ProviderErrors.d.ts +1 -0
- package/dist/types/utils/SignatureUtils.d.ts +12 -0
- package/dist/types/utils/TokenUtils.d.ts +70 -0
- package/dist/types/utils/index.d.ts +13 -0
- package/dist/types/utils/minAbi.d.ts +38 -0
- package/package.json +2 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { DDO } from '.';
|
|
2
|
+
export interface AssetNft {
|
|
3
|
+
/**
|
|
4
|
+
* Contract address of the deployed ERC721 NFT contract.
|
|
5
|
+
* @type {string}
|
|
6
|
+
*/
|
|
7
|
+
address: string;
|
|
8
|
+
/**
|
|
9
|
+
* Name of NFT set in contract.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Symbol of NFT set in contract.
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
symbol: string;
|
|
18
|
+
/**
|
|
19
|
+
* ETH account address of the NFT owner.
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
owner: string;
|
|
23
|
+
/**
|
|
24
|
+
* State of the asset reflecting the NFT contract value.
|
|
25
|
+
* 0 Active.
|
|
26
|
+
* 1 End-of-life.
|
|
27
|
+
* 2 Deprecated (by another asset).
|
|
28
|
+
* 3 Revoked by publisher.
|
|
29
|
+
* 4 Ordering is temporary disabled.
|
|
30
|
+
* 5 Unlisted in markets.
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
state: 0 | 1 | 2 | 3 | 4 | 5;
|
|
34
|
+
/**
|
|
35
|
+
* Contains the date of NFT creation.
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
created: string;
|
|
39
|
+
/**
|
|
40
|
+
* NFT token URI.
|
|
41
|
+
* @type {string}
|
|
42
|
+
*/
|
|
43
|
+
tokenURI: string;
|
|
44
|
+
}
|
|
45
|
+
export interface Purgatory {
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, asset is in purgatory.
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
*/
|
|
50
|
+
state: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`.
|
|
53
|
+
* @type {string}
|
|
54
|
+
*/
|
|
55
|
+
reason: string;
|
|
56
|
+
}
|
|
57
|
+
export interface AssetDatatoken {
|
|
58
|
+
/**
|
|
59
|
+
* Contract address of the deployed Datatoken contract.
|
|
60
|
+
* @type {string}
|
|
61
|
+
*/
|
|
62
|
+
address: string;
|
|
63
|
+
/**
|
|
64
|
+
* Name of NFT set in contract.
|
|
65
|
+
* @type {string}
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* Symbol of NFT set in contract.
|
|
70
|
+
* @type {string}
|
|
71
|
+
*/
|
|
72
|
+
symbol: string;
|
|
73
|
+
/**
|
|
74
|
+
* ID of the service the datatoken is attached to.
|
|
75
|
+
* @type {string}
|
|
76
|
+
*/
|
|
77
|
+
serviceId: string;
|
|
78
|
+
}
|
|
79
|
+
export interface AssetPrice {
|
|
80
|
+
/**
|
|
81
|
+
* The price of the asset expressed as a number. If 0 then the price is FREE.
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
value: number;
|
|
85
|
+
/**
|
|
86
|
+
* The symbol that the price of the asset is expressed in.
|
|
87
|
+
* @type {string}
|
|
88
|
+
*/
|
|
89
|
+
tokenSymbol?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The address of the token that the price needs to be paid in.
|
|
92
|
+
* @type {string}
|
|
93
|
+
*/
|
|
94
|
+
tokenAddress?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface Stats {
|
|
97
|
+
/**
|
|
98
|
+
* How often an asset was consumed, meaning how often it was either downloaded or used as part of a compute job.
|
|
99
|
+
* @type {number}
|
|
100
|
+
*/
|
|
101
|
+
orders: number;
|
|
102
|
+
/**
|
|
103
|
+
* Contains information about the price of this asset.
|
|
104
|
+
* @type {AssetPrice}
|
|
105
|
+
*/
|
|
106
|
+
price: AssetPrice;
|
|
107
|
+
/**
|
|
108
|
+
* Total amount of veOCEAN allocated on this asset.
|
|
109
|
+
* @type {number}
|
|
110
|
+
*/
|
|
111
|
+
allocated?: number;
|
|
112
|
+
}
|
|
113
|
+
export interface AssetLastEvent {
|
|
114
|
+
tx: string;
|
|
115
|
+
block: number;
|
|
116
|
+
from: string;
|
|
117
|
+
contract: string;
|
|
118
|
+
datetime: string;
|
|
119
|
+
}
|
|
120
|
+
export interface Asset extends DDO {
|
|
121
|
+
/**
|
|
122
|
+
* Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
|
|
123
|
+
* @type {string}
|
|
124
|
+
*/
|
|
125
|
+
nft: AssetNft;
|
|
126
|
+
/**
|
|
127
|
+
* Contains information about the ERC20 Datatokens attached to asset services.
|
|
128
|
+
* @type {string}
|
|
129
|
+
*/
|
|
130
|
+
datatokens: AssetDatatoken[];
|
|
131
|
+
/**
|
|
132
|
+
* Contains information about the last transaction that created or updated the DDO.
|
|
133
|
+
* @type {string}
|
|
134
|
+
*/
|
|
135
|
+
event: AssetLastEvent;
|
|
136
|
+
/**
|
|
137
|
+
* The stats section contains different statistics fields. This section is added by Aquarius
|
|
138
|
+
* @type {Stats}
|
|
139
|
+
*/
|
|
140
|
+
stats: Stats;
|
|
141
|
+
/**
|
|
142
|
+
* Contains information about an asset's purgatory status defined in
|
|
143
|
+
* [`list-purgatory`](https://github.com/oceanprotocol/list-purgatory).
|
|
144
|
+
* Marketplace interfaces are encouraged to prevent certain user actions like downloading on assets in purgatory.
|
|
145
|
+
* @type {Purgatory}
|
|
146
|
+
*/
|
|
147
|
+
purgatory: Purgatory;
|
|
148
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Metadata, MetadataAlgorithm } from '.';
|
|
2
|
+
export type ComputeResultType = 'algorithmLog' | 'output' | 'configrationLog' | 'publishLog';
|
|
3
|
+
export interface ComputeEnvironment {
|
|
4
|
+
id: string;
|
|
5
|
+
cpuNumber: number;
|
|
6
|
+
cpuType: string;
|
|
7
|
+
gpuNumber: number;
|
|
8
|
+
gpuType: string;
|
|
9
|
+
ramGB: number;
|
|
10
|
+
diskGB: number;
|
|
11
|
+
priceMin: number;
|
|
12
|
+
desc: string;
|
|
13
|
+
currentJobs: number;
|
|
14
|
+
maxJobs: number;
|
|
15
|
+
consumerAddress: string;
|
|
16
|
+
storageExpiry: number;
|
|
17
|
+
maxJobDuration: number;
|
|
18
|
+
lastSeen: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ComputeResult {
|
|
21
|
+
filename: string;
|
|
22
|
+
filesize: number;
|
|
23
|
+
type: ComputeResultType;
|
|
24
|
+
index?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ComputeJob {
|
|
27
|
+
owner: string;
|
|
28
|
+
did?: string;
|
|
29
|
+
jobId: string;
|
|
30
|
+
dateCreated: string;
|
|
31
|
+
dateFinished: string;
|
|
32
|
+
status: number;
|
|
33
|
+
statusText: string;
|
|
34
|
+
results: ComputeResult[];
|
|
35
|
+
inputDID?: string[];
|
|
36
|
+
algoDID?: string;
|
|
37
|
+
agreementId?: string;
|
|
38
|
+
expireTimestamp: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ComputeOutput {
|
|
41
|
+
publishAlgorithmLog?: boolean;
|
|
42
|
+
publishOutput?: boolean;
|
|
43
|
+
providerAddress?: string;
|
|
44
|
+
providerUri?: string;
|
|
45
|
+
metadata?: Metadata;
|
|
46
|
+
metadataUri?: string;
|
|
47
|
+
nodeUri?: string;
|
|
48
|
+
owner?: string;
|
|
49
|
+
secretStoreUri?: string;
|
|
50
|
+
whitelist?: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface ComputeAsset {
|
|
53
|
+
documentId: string;
|
|
54
|
+
serviceId: string;
|
|
55
|
+
transferTxId?: string;
|
|
56
|
+
userdata?: {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface ComputeAlgorithm {
|
|
61
|
+
documentId?: string;
|
|
62
|
+
serviceId?: string;
|
|
63
|
+
meta?: MetadataAlgorithm;
|
|
64
|
+
transferTxId?: string;
|
|
65
|
+
algocustomdata?: {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
};
|
|
68
|
+
userdata?: {
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type AbiType = 'function' | 'constructor' | 'event' | 'fallback';
|
|
2
|
+
export type StateMutabilityType = 'pure' | 'view' | 'nonpayable' | 'payable';
|
|
3
|
+
export interface AbiInput {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
indexed?: boolean;
|
|
7
|
+
components?: AbiInput[];
|
|
8
|
+
internalType?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AbiOutput {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
components?: AbiOutput[];
|
|
14
|
+
internalType?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AbiItem {
|
|
17
|
+
anonymous?: boolean;
|
|
18
|
+
constant?: boolean;
|
|
19
|
+
inputs?: AbiInput[];
|
|
20
|
+
name?: string;
|
|
21
|
+
outputs?: AbiOutput[];
|
|
22
|
+
payable?: boolean;
|
|
23
|
+
stateMutability?: StateMutabilityType;
|
|
24
|
+
type: AbiType;
|
|
25
|
+
gas?: number;
|
|
26
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface ConsumerParameter {
|
|
2
|
+
/**
|
|
3
|
+
* Parameter name.
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* Field type.
|
|
9
|
+
* @type {'text' | 'number' | 'boolean' | 'select'}
|
|
10
|
+
*/
|
|
11
|
+
type: 'text' | 'number' | 'boolean' | 'select';
|
|
12
|
+
/**
|
|
13
|
+
* Displayed field label.
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* Defines if customer input for this field is mandatory.
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
21
|
+
required: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Field description.
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
description: string;
|
|
27
|
+
/**
|
|
28
|
+
* Field default value. For select types, string key of default option.
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
default: string;
|
|
32
|
+
/**
|
|
33
|
+
* For select types, a list of options.
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
options?: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Service, Metadata, Credentials, Event } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* DID Descriptor Object.
|
|
4
|
+
* Contains metadata about the asset, and define access in at least one service.
|
|
5
|
+
*/
|
|
6
|
+
export interface DDO {
|
|
7
|
+
/**
|
|
8
|
+
* Contexts used for validation.
|
|
9
|
+
* @type {string[]}
|
|
10
|
+
*/
|
|
11
|
+
'@context': string[];
|
|
12
|
+
/**
|
|
13
|
+
* DID, descentralized ID.
|
|
14
|
+
* Computed as sha256(address of NFT contract + chainId)
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* Version information in SemVer notation
|
|
20
|
+
* referring to the DDO spec version
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
version: string;
|
|
24
|
+
/**
|
|
25
|
+
* NFT contract address
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
nftAddress: string;
|
|
29
|
+
/**
|
|
30
|
+
* ChainId of the network the DDO was published to.
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
chainId: number;
|
|
34
|
+
/**
|
|
35
|
+
* Stores an object describing the asset.
|
|
36
|
+
* @type {Metadata}
|
|
37
|
+
*/
|
|
38
|
+
metadata: Metadata;
|
|
39
|
+
/**
|
|
40
|
+
* Stores an array of services defining access to the asset.
|
|
41
|
+
* @type {Service[]}
|
|
42
|
+
*/
|
|
43
|
+
services: Service[];
|
|
44
|
+
/**
|
|
45
|
+
* Describes the credentials needed to access a dataset
|
|
46
|
+
* in addition to the services definition.
|
|
47
|
+
* @type {Credentials}
|
|
48
|
+
*/
|
|
49
|
+
credentials?: Credentials;
|
|
50
|
+
/**
|
|
51
|
+
* Describes the event of last metadata event
|
|
52
|
+
* @type {Event}
|
|
53
|
+
*/
|
|
54
|
+
event?: Event;
|
|
55
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface Event {
|
|
2
|
+
/**
|
|
3
|
+
* TX id of the last create/update
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
txid?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Block of txid
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
block?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Sender of tx
|
|
14
|
+
* @type {String}
|
|
15
|
+
*/
|
|
16
|
+
from?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Contract
|
|
19
|
+
* @type {String}
|
|
20
|
+
*/
|
|
21
|
+
contract?: string;
|
|
22
|
+
/**
|
|
23
|
+
* datetime of tx
|
|
24
|
+
* @type {String}
|
|
25
|
+
*/
|
|
26
|
+
datetime?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ConsumerParameter } from './ConsumerParameter';
|
|
2
|
+
export interface MetadataAlgorithm {
|
|
3
|
+
/**
|
|
4
|
+
* Programming language used to implement the software.
|
|
5
|
+
* @type {string}
|
|
6
|
+
*/
|
|
7
|
+
language?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Version of the software preferably in SemVer notation.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
version?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Rawcode
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
rawcode?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Object describing the Docker container image.
|
|
20
|
+
* @type {Object}
|
|
21
|
+
*/
|
|
22
|
+
container: {
|
|
23
|
+
/**
|
|
24
|
+
* The command to execute, or script to run inside the Docker image.
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
entrypoint: string;
|
|
28
|
+
/**
|
|
29
|
+
* Name of the Docker image.
|
|
30
|
+
* @type {string}
|
|
31
|
+
*/
|
|
32
|
+
image: string;
|
|
33
|
+
/**
|
|
34
|
+
* Tag of the Docker image.
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
tag: string;
|
|
38
|
+
/**
|
|
39
|
+
* Checksum of the Docker image.
|
|
40
|
+
* @type {string}
|
|
41
|
+
*/
|
|
42
|
+
checksum: string;
|
|
43
|
+
/**
|
|
44
|
+
* Array of objects describing the consumer parameters
|
|
45
|
+
* @type {ConsumerParameter[]}
|
|
46
|
+
*/
|
|
47
|
+
consumerParameters?: ConsumerParameter[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Array of objects describing the consumer parameters
|
|
51
|
+
* @type {ConsumerParameter[]}
|
|
52
|
+
*/
|
|
53
|
+
consumerParameters?: ConsumerParameter[];
|
|
54
|
+
}
|
|
55
|
+
export interface Metadata {
|
|
56
|
+
/**
|
|
57
|
+
* Contains the date of publishing in ISO Date Time
|
|
58
|
+
* @type {string}
|
|
59
|
+
*/
|
|
60
|
+
created: string;
|
|
61
|
+
/**
|
|
62
|
+
* Contains the the date of last update in ISO Date Time
|
|
63
|
+
* @type {string}
|
|
64
|
+
*/
|
|
65
|
+
updated: string;
|
|
66
|
+
/**
|
|
67
|
+
* Descriptive name or title of the asset.
|
|
68
|
+
* @type {string}
|
|
69
|
+
*/
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Details of what the resource is.
|
|
73
|
+
* @type {string}
|
|
74
|
+
*/
|
|
75
|
+
description: string;
|
|
76
|
+
/**
|
|
77
|
+
* Asset type. Includes "dataset" (e.g. csv file), "algorithm" (e.g. Python script).
|
|
78
|
+
* Each type needs a different subset of metadata attributes.
|
|
79
|
+
* @type {'dataset' | 'algorithm'}
|
|
80
|
+
*/
|
|
81
|
+
type: 'dataset' | 'algorithm';
|
|
82
|
+
/**
|
|
83
|
+
* Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).
|
|
84
|
+
* @type {string}
|
|
85
|
+
*/
|
|
86
|
+
author: string;
|
|
87
|
+
/**
|
|
88
|
+
* Short name referencing the license of the asset.
|
|
89
|
+
* If it’s not specified, the following value will be added: “No License Specified”.
|
|
90
|
+
* @type {string}
|
|
91
|
+
*/
|
|
92
|
+
license: string;
|
|
93
|
+
/**
|
|
94
|
+
* Mapping of URL strings for data samples, or links to find out more information.
|
|
95
|
+
* Links may be to either a URL or another asset.
|
|
96
|
+
* @type {string[]}
|
|
97
|
+
*/
|
|
98
|
+
links?: string[];
|
|
99
|
+
/**
|
|
100
|
+
* Array of keywords or tags used to describe this content. Empty by default.
|
|
101
|
+
* @type {string[]}
|
|
102
|
+
*/
|
|
103
|
+
tags?: string[];
|
|
104
|
+
/**
|
|
105
|
+
* Array of categories associated to the asset. Note: recommended to use tags instead of this.
|
|
106
|
+
* @type {string[]}
|
|
107
|
+
*/
|
|
108
|
+
categories?: string[];
|
|
109
|
+
/**
|
|
110
|
+
* The party holding the legal copyright. Empty by default.
|
|
111
|
+
* @type {string}
|
|
112
|
+
*/
|
|
113
|
+
copyrightHolder?: string;
|
|
114
|
+
/**
|
|
115
|
+
*The language of the content. Use one of the language codes from the IETF BCP 47 standard
|
|
116
|
+
* @type {string}
|
|
117
|
+
*/
|
|
118
|
+
contentLanguage?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Information about asset of type algorithm. Required for algorithm assets.
|
|
121
|
+
* @type {MetadataAlgorithm}
|
|
122
|
+
*/
|
|
123
|
+
algorithm?: MetadataAlgorithm;
|
|
124
|
+
/**
|
|
125
|
+
* Stores additional information, this is customizable by publisher
|
|
126
|
+
* @type {any}
|
|
127
|
+
*/
|
|
128
|
+
additionalInformation?: any;
|
|
129
|
+
}
|
|
130
|
+
export interface MetadataProof {
|
|
131
|
+
validatorAddress?: string;
|
|
132
|
+
r?: string;
|
|
133
|
+
s?: string;
|
|
134
|
+
v?: number;
|
|
135
|
+
}
|
|
136
|
+
export interface ValidateMetadata {
|
|
137
|
+
valid: Boolean;
|
|
138
|
+
errors?: Object;
|
|
139
|
+
hash?: string;
|
|
140
|
+
proof?: MetadataProof;
|
|
141
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ConsumerParameter } from './ConsumerParameter';
|
|
2
|
+
import { Credentials } from './Credentials';
|
|
3
|
+
export interface PublisherTrustedAlgorithm {
|
|
4
|
+
/**
|
|
5
|
+
* The DID of the algorithm which is trusted by the publisher.
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
did: string;
|
|
9
|
+
/**
|
|
10
|
+
* Hash of algorithm’s files section.
|
|
11
|
+
* @type {string}
|
|
12
|
+
*/
|
|
13
|
+
filesChecksum: string;
|
|
14
|
+
/**
|
|
15
|
+
* Hash of algorithm’s metadata.algorithm.container section.
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
containerSectionChecksum: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ServiceComputeOptions {
|
|
21
|
+
/**
|
|
22
|
+
* If true, any passed raw text will be allowed to run.
|
|
23
|
+
* Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input.
|
|
24
|
+
* Should be false by default in all implementations.
|
|
25
|
+
* @type {boolean}
|
|
26
|
+
*/
|
|
27
|
+
allowRawAlgorithm: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If true, the algorithm job will have network access.
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
32
|
+
allowNetworkAccess: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If empty, then any published algorithm is allowed.
|
|
35
|
+
* Otherwise, only published algorithms by some publishers are allowed
|
|
36
|
+
* @type {string[]}
|
|
37
|
+
*/
|
|
38
|
+
publisherTrustedAlgorithmPublishers: string[];
|
|
39
|
+
/**
|
|
40
|
+
* If empty, then any published algorithm is allowed. (see below)
|
|
41
|
+
* @type {PublisherTrustedAlgorithm[]}
|
|
42
|
+
*/
|
|
43
|
+
publisherTrustedAlgorithms: PublisherTrustedAlgorithm[];
|
|
44
|
+
}
|
|
45
|
+
export interface Service {
|
|
46
|
+
/**
|
|
47
|
+
* Unique ID
|
|
48
|
+
* @type {string}
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Type of service (access, compute, wss.
|
|
53
|
+
* @type {string}
|
|
54
|
+
*/
|
|
55
|
+
type: 'access' | 'compute' | string;
|
|
56
|
+
/**
|
|
57
|
+
* Encrypted file URLs.
|
|
58
|
+
* @type {string}
|
|
59
|
+
*/
|
|
60
|
+
files: string;
|
|
61
|
+
/**
|
|
62
|
+
* Datatoken address
|
|
63
|
+
* @type {string}
|
|
64
|
+
*/
|
|
65
|
+
datatokenAddress: string;
|
|
66
|
+
/**
|
|
67
|
+
* Provider URL (schema + host).
|
|
68
|
+
* @type {string}
|
|
69
|
+
*/
|
|
70
|
+
serviceEndpoint: string;
|
|
71
|
+
/**
|
|
72
|
+
* Describes the credentials needed to access a service
|
|
73
|
+
* @type {Credentials}
|
|
74
|
+
*/
|
|
75
|
+
credentials?: Credentials;
|
|
76
|
+
/**
|
|
77
|
+
* Describing how long the service can be used after consumption is initiated.
|
|
78
|
+
* @type {number}
|
|
79
|
+
*/
|
|
80
|
+
timeout: number;
|
|
81
|
+
/**
|
|
82
|
+
* Service friendly name
|
|
83
|
+
* @type {string}
|
|
84
|
+
*/
|
|
85
|
+
name?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Service description
|
|
88
|
+
* @type {string}
|
|
89
|
+
*/
|
|
90
|
+
description?: string;
|
|
91
|
+
/**
|
|
92
|
+
* If service is of type compute, holds information about the compute-related privacy settings & resources.
|
|
93
|
+
* @type {ServiceComputeOptions}
|
|
94
|
+
*/
|
|
95
|
+
compute?: ServiceComputeOptions;
|
|
96
|
+
/**
|
|
97
|
+
* Array of objects describing the consumer parameters
|
|
98
|
+
* @type {ConsumerParameter[]}
|
|
99
|
+
*/
|
|
100
|
+
consumerParameters?: ConsumerParameter[];
|
|
101
|
+
/**
|
|
102
|
+
* Stores service specific additional information, this is customizable by publisher
|
|
103
|
+
* @type {any}
|
|
104
|
+
*/
|
|
105
|
+
additionalInformation?: any;
|
|
106
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ProviderFees } from '.';
|
|
2
|
+
export interface DatatokenCreateParams {
|
|
3
|
+
templateIndex: number;
|
|
4
|
+
minter: string;
|
|
5
|
+
paymentCollector: string;
|
|
6
|
+
mpFeeAddress: string;
|
|
7
|
+
feeToken: string;
|
|
8
|
+
feeAmount: string;
|
|
9
|
+
cap: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
symbol?: string;
|
|
12
|
+
filesObject?: any;
|
|
13
|
+
accessListFactory?: string;
|
|
14
|
+
allowAccessList?: string;
|
|
15
|
+
denyAccessList?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ConsumeMarketFee {
|
|
18
|
+
consumeMarketFeeAddress: string;
|
|
19
|
+
consumeMarketFeeToken: string;
|
|
20
|
+
consumeMarketFeeAmount: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PublishingMarketFee {
|
|
23
|
+
publishMarketFeeAddress: string;
|
|
24
|
+
publishMarketFeeToken: string;
|
|
25
|
+
publishMarketFeeAmount: string;
|
|
26
|
+
}
|
|
27
|
+
export interface DatatokenRoles {
|
|
28
|
+
minter: boolean;
|
|
29
|
+
paymentManager: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface OrderParams {
|
|
32
|
+
consumer: string;
|
|
33
|
+
serviceIndex: number;
|
|
34
|
+
_providerFee: ProviderFees;
|
|
35
|
+
_consumeMarketFee: ConsumeMarketFee;
|
|
36
|
+
}
|
|
37
|
+
export interface DispenserParams {
|
|
38
|
+
maxTokens: string;
|
|
39
|
+
maxBalance: string;
|
|
40
|
+
withMint?: boolean;
|
|
41
|
+
allowedSwapper?: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DispenserCreationParams {
|
|
2
|
+
dispenserAddress: string;
|
|
3
|
+
maxTokens: string;
|
|
4
|
+
maxBalance: string;
|
|
5
|
+
withMint?: boolean;
|
|
6
|
+
allowedSwapper?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DispenserToken {
|
|
9
|
+
active: boolean;
|
|
10
|
+
owner: string;
|
|
11
|
+
maxTokens: string;
|
|
12
|
+
maxBalance: string;
|
|
13
|
+
balance: string;
|
|
14
|
+
isMinter: boolean;
|
|
15
|
+
allowedSwapper: string;
|
|
16
|
+
}
|