@oceanprotocol/lib 0.20.2 → 1.0.0-next.11
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 +126 -0
- package/README.md +1 -1
- package/dist/lib.js +2 -0
- package/dist/lib.js.map +1 -0
- package/dist/lib.modern.js +2 -0
- package/dist/lib.modern.js.map +1 -0
- package/dist/lib.module.js +2 -0
- package/dist/lib.module.js.map +1 -0
- package/dist/lib.umd.js +2 -0
- package/dist/lib.umd.js.map +1 -0
- package/dist/src/@types/Asset.d.ts +119 -0
- package/dist/{node/ocean/interfaces → src/@types}/Compute.d.ts +13 -12
- package/dist/src/@types/DDO/Credentials.d.ts +8 -0
- package/dist/src/@types/DDO/DDO.d.ts +58 -0
- package/dist/src/@types/DDO/Event.d.ts +27 -0
- package/dist/src/@types/DDO/Metadata.d.ts +126 -0
- package/dist/src/@types/DDO/Service.d.ts +124 -0
- package/dist/src/@types/Dispenser.d.ts +7 -0
- package/dist/src/@types/DownloadResponse.d.ts +4 -0
- package/dist/src/@types/Erc20.d.ts +11 -0
- package/dist/src/@types/Erc721.d.ts +12 -0
- package/dist/src/@types/FileMetadata.d.ts +38 -0
- package/dist/src/@types/FixedPrice.d.ts +19 -0
- package/dist/src/@types/Pool.d.ts +36 -0
- package/dist/src/@types/Provider.d.ts +16 -0
- package/dist/src/@types/Router.d.ts +59 -0
- package/dist/src/@types/index.d.ts +14 -0
- package/dist/src/aquarius/Aquarius.d.ts +36 -0
- package/dist/src/aquarius/index.d.ts +1 -0
- package/dist/src/factories/NFTFactory.d.ts +273 -0
- package/dist/src/factories/index.d.ts +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/models/Config.d.ts +166 -0
- package/dist/src/models/index.d.ts +1 -0
- package/dist/src/pools/Router.d.ts +229 -0
- package/dist/src/pools/balancer/Pool.d.ts +408 -0
- package/dist/src/pools/balancer/index.d.ts +1 -0
- package/dist/src/pools/dispenser/Dispenser.d.ts +146 -0
- package/dist/src/pools/dispenser/index.d.ts +1 -0
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +375 -0
- package/dist/src/pools/fixedRate/index.d.ts +1 -0
- package/dist/src/pools/index.d.ts +3 -0
- package/dist/src/pools/ssContracts/SideStaking.d.ts +132 -0
- package/dist/src/pools/ssContracts/index.d.ts +1 -0
- package/dist/src/provider/Provider.d.ts +142 -0
- package/dist/src/provider/index.d.ts +1 -0
- package/dist/src/tokens/Datatoken.d.ts +362 -0
- package/dist/src/tokens/NFT.d.ts +355 -0
- package/dist/src/tokens/index.d.ts +2 -0
- package/dist/src/utils/ConfigHelper.d.ts +6 -0
- package/dist/src/utils/Constants.d.ts +2 -0
- package/dist/src/utils/ContractUtils.d.ts +11 -0
- package/dist/src/utils/ConversionTypeHelper.d.ts +3 -0
- package/dist/src/utils/DatatokenName.d.ts +11 -0
- package/dist/src/utils/DdoHelpers.d.ts +2 -0
- package/dist/src/utils/FetchHelper.d.ts +6 -0
- package/dist/{node → src}/utils/Logger.d.ts +0 -0
- package/dist/src/utils/SignatureUtils.d.ts +8 -0
- package/dist/src/utils/TokenUtils.d.ts +39 -0
- package/dist/src/utils/index.d.ts +9 -0
- package/dist/src/utils/minAbi.d.ts +2 -0
- package/dist/test/TestContractHandler.d.ts +44 -0
- package/dist/test/integration/ComputeFlow.test.d.ts +1 -0
- package/dist/test/integration/Provider.test.d.ts +1 -0
- package/dist/test/integration/PublishFlows.test.d.ts +1 -0
- package/dist/test/integration/SimplePublishConsumeFlow.test.d.ts +1 -0
- package/dist/test/integration/config.d.ts +3 -0
- package/dist/test/unit/NftFactory.test.d.ts +1 -0
- package/dist/test/unit/config.d.ts +3 -0
- package/dist/test/unit/pools/Router.test.d.ts +1 -0
- package/dist/test/unit/pools/balancer/Pool.test.d.ts +1 -0
- package/dist/test/unit/pools/dispenser/Dispenser.test.d.ts +1 -0
- package/dist/test/unit/pools/fixedRate/FixedRateExchange.test.d.ts +1 -0
- package/dist/test/unit/pools/ssContracts/SideStaking.test.d.ts +1 -0
- package/dist/test/unit/tokens/Datatoken.test.d.ts +1 -0
- package/dist/test/unit/tokens/Nft.test.d.ts +1 -0
- package/docs/beginners_guide.md +4 -4
- package/docs/overview.md +100 -9
- package/docs/quickstart_marketplace.md +34 -33
- package/docs/quickstart_simple.md +18 -16
- package/package.json +41 -33
- package/dist/node/Instantiable.abstract.d.ts +0 -25
- package/dist/node/balancer/OceanPool.d.ts +0 -95
- package/dist/node/balancer/Pool.d.ts +0 -56
- package/dist/node/balancer/PoolFactory.d.ts +0 -15
- package/dist/node/datatokens/ContractEvent.d.ts +0 -19
- package/dist/node/datatokens/ContractHandler.d.ts +0 -12
- package/dist/node/datatokens/Datatokens.d.ts +0 -44
- package/dist/node/datatokens/EventHandler.d.ts +0 -19
- package/dist/node/datatokens/Network.d.ts +0 -5
- package/dist/node/datatokens/Web3Provider.d.ts +0 -5
- package/dist/node/datatokens/contracts/ContractBase.d.ts +0 -27
- package/dist/node/ddo/DDO.d.ts +0 -36
- package/dist/node/ddo/interfaces/AdditionalInformation.d.ts +0 -16
- package/dist/node/ddo/interfaces/Authentication.d.ts +0 -4
- package/dist/node/ddo/interfaces/BestPrice.d.ts +0 -10
- package/dist/node/ddo/interfaces/Consumable.d.ts +0 -5
- package/dist/node/ddo/interfaces/Credentials.d.ts +0 -9
- package/dist/node/ddo/interfaces/Curation.d.ts +0 -6
- package/dist/node/ddo/interfaces/DataTokenInfo.d.ts +0 -10
- package/dist/node/ddo/interfaces/EditableMetadata.d.ts +0 -9
- package/dist/node/ddo/interfaces/EditableMetadataLinks.d.ts +0 -5
- package/dist/node/ddo/interfaces/Event.d.ts +0 -7
- package/dist/node/ddo/interfaces/File.d.ts +0 -13
- package/dist/node/ddo/interfaces/Metadata.d.ts +0 -15
- package/dist/node/ddo/interfaces/MetadataAlgorithm.d.ts +0 -12
- package/dist/node/ddo/interfaces/MetadataMain.d.ts +0 -12
- package/dist/node/ddo/interfaces/Proof.d.ts +0 -6
- package/dist/node/ddo/interfaces/PublicKey.d.ts +0 -8
- package/dist/node/ddo/interfaces/PurgatoryData.d.ts +0 -4
- package/dist/node/ddo/interfaces/Service.d.ts +0 -99
- package/dist/node/ddo/interfaces/ServicePrices.d.ts +0 -4
- package/dist/node/ddo/interfaces/Status.d.ts +0 -5
- package/dist/node/ddo/interfaces/index.d.ts +0 -17
- package/dist/node/dispenser/Dispenser.d.ts +0 -44
- package/dist/node/exchange/FixedRateExchange.d.ts +0 -59
- package/dist/node/index.d.ts +0 -1
- package/dist/node/lib.d.ts +0 -15
- package/dist/node/lib.js +0 -2
- package/dist/node/lib.js.map +0 -1
- package/dist/node/lib.module.js +0 -2
- package/dist/node/lib.module.js.map +0 -1
- package/dist/node/lib.umd.js +0 -2
- package/dist/node/lib.umd.js.map +0 -1
- package/dist/node/metadatacache/MetadataCache.d.ts +0 -41
- package/dist/node/metadatacache/OnChainMetaData.d.ts +0 -31
- package/dist/node/models/Config.d.ts +0 -31
- package/dist/node/ocean/Account.d.ts +0 -16
- package/dist/node/ocean/Accounts.d.ts +0 -9
- package/dist/node/ocean/Assets.d.ts +0 -56
- package/dist/node/ocean/AssetsCredential.d.ts +0 -6
- package/dist/node/ocean/Compute.d.ts +0 -75
- package/dist/node/ocean/DID.d.ts +0 -8
- package/dist/node/ocean/EventAccessControl.d.ts +0 -9
- package/dist/node/ocean/Ocean.d.ts +0 -34
- package/dist/node/ocean/OceanAuth.d.ts +0 -15
- package/dist/node/ocean/Versions.d.ts +0 -25
- package/dist/node/ocean/utils/SignatureUtils.d.ts +0 -13
- package/dist/node/ocean/utils/Utils.d.ts +0 -8
- package/dist/node/ocean/utils/WebServiceConnector.d.ts +0 -16
- package/dist/node/provider/Provider.d.ts +0 -56
- package/dist/node/utils/AssetResolverHelper.d.ts +0 -8
- package/dist/node/utils/ConfigHelper.d.ts +0 -17
- package/dist/node/utils/ContractUtils.d.ts +0 -5
- package/dist/node/utils/ConversionTypeHelpers.d.ts +0 -8
- package/dist/node/utils/Datatokens.d.ts +0 -7
- package/dist/node/utils/GeneratorHelpers.d.ts +0 -1
- package/dist/node/utils/PromiseResolver.d.ts +0 -3
- package/dist/node/utils/SubscribableObserver.d.ts +0 -12
- package/dist/node/utils/SubscribablePromise.d.ts +0 -14
- package/dist/node/utils/Timeout.d.ts +0 -1
- package/dist/node/utils/index.d.ts +0 -9
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { DDO } from './DDO/DDO';
|
|
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
|
+
* @type {number}
|
|
31
|
+
*/
|
|
32
|
+
state: 0 | 1 | 2 | 3 | 4;
|
|
33
|
+
/**
|
|
34
|
+
* Contains the date of NFT creation.
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
created: string;
|
|
38
|
+
/**
|
|
39
|
+
* NFT token URI.
|
|
40
|
+
* @type {string}
|
|
41
|
+
*/
|
|
42
|
+
tokenURI: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Purgatory {
|
|
45
|
+
/**
|
|
46
|
+
* If `true`, asset is in purgatory.
|
|
47
|
+
* @type {boolean}
|
|
48
|
+
*/
|
|
49
|
+
state: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`.
|
|
52
|
+
* @type {string}
|
|
53
|
+
*/
|
|
54
|
+
reason: string;
|
|
55
|
+
}
|
|
56
|
+
export interface AssetDatatoken {
|
|
57
|
+
/**
|
|
58
|
+
* Contract address of the deployed ERC20 contract.
|
|
59
|
+
* @type {string}
|
|
60
|
+
*/
|
|
61
|
+
address: string;
|
|
62
|
+
/**
|
|
63
|
+
* Name of NFT set in contract.
|
|
64
|
+
* @type {string}
|
|
65
|
+
*/
|
|
66
|
+
name: string;
|
|
67
|
+
/**
|
|
68
|
+
* Symbol of NFT set in contract.
|
|
69
|
+
* @type {string}
|
|
70
|
+
*/
|
|
71
|
+
symbol: string;
|
|
72
|
+
/**
|
|
73
|
+
* ID of the service the datatoken is attached to.
|
|
74
|
+
* @type {string}
|
|
75
|
+
*/
|
|
76
|
+
serviceId: string;
|
|
77
|
+
}
|
|
78
|
+
export interface AssetLastEvent {
|
|
79
|
+
tx: string;
|
|
80
|
+
block: number;
|
|
81
|
+
from: string;
|
|
82
|
+
contract: string;
|
|
83
|
+
datetime: string;
|
|
84
|
+
}
|
|
85
|
+
export interface Asset extends DDO {
|
|
86
|
+
/**
|
|
87
|
+
* Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
|
|
88
|
+
* @type {string}
|
|
89
|
+
*/
|
|
90
|
+
nft: AssetNft;
|
|
91
|
+
/**
|
|
92
|
+
* Contains information about the ERC20 datatokens attached to asset services.
|
|
93
|
+
* @type {string}
|
|
94
|
+
*/
|
|
95
|
+
datatokens: AssetDatatoken[];
|
|
96
|
+
/**
|
|
97
|
+
* Contains information about the last transaction that created or updated the DDO.
|
|
98
|
+
* @type {string}
|
|
99
|
+
*/
|
|
100
|
+
event: AssetLastEvent;
|
|
101
|
+
/**
|
|
102
|
+
* The stats section contains different statistics fields.
|
|
103
|
+
* @type {string}
|
|
104
|
+
*/
|
|
105
|
+
stats: {
|
|
106
|
+
/**
|
|
107
|
+
* How often an asset was consumed, meaning how often it was either downloaded or used as part of a compute job.
|
|
108
|
+
* @type {string}
|
|
109
|
+
*/
|
|
110
|
+
consume: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Contains information about an asset's purgatory status defined in
|
|
114
|
+
* [`list-purgatory`](https://github.com/oceanprotocol/list-purgatory).
|
|
115
|
+
* Marketplace interfaces are encouraged to prevent certain user actions like adding liquidity on assets in purgatory.
|
|
116
|
+
* @type {Purgatory}
|
|
117
|
+
*/
|
|
118
|
+
purgatory: Purgatory;
|
|
119
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Metadata } from '
|
|
2
|
-
import { MetadataAlgorithm } from '../../ddo/interfaces/MetadataAlgorithm';
|
|
3
|
-
import { UserCustomParameters } from '../../provider/Provider';
|
|
1
|
+
import { Metadata, MetadataAlgorithm } from './DDO/Metadata';
|
|
4
2
|
export declare type ComputeResultType = 'algorithmLog' | 'output';
|
|
5
3
|
export interface ComputeResult {
|
|
6
4
|
filename: string;
|
|
7
5
|
filesize: number;
|
|
8
6
|
type: ComputeResultType;
|
|
9
|
-
index
|
|
7
|
+
index?: number;
|
|
10
8
|
}
|
|
11
9
|
export interface ComputeJob {
|
|
12
10
|
owner: string;
|
|
@@ -34,20 +32,23 @@ export interface ComputeOutput {
|
|
|
34
32
|
secretStoreUri?: string;
|
|
35
33
|
whitelist?: string[];
|
|
36
34
|
}
|
|
37
|
-
export interface
|
|
35
|
+
export interface ComputeAsset {
|
|
38
36
|
documentId: string;
|
|
39
|
-
serviceId:
|
|
37
|
+
serviceId: string;
|
|
40
38
|
transferTxId?: string;
|
|
41
|
-
|
|
39
|
+
userdata?: {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
};
|
|
42
42
|
}
|
|
43
43
|
export interface ComputeAlgorithm {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
documentId?: string;
|
|
45
|
+
serviceId?: string;
|
|
46
46
|
meta?: MetadataAlgorithm;
|
|
47
47
|
transferTxId?: string;
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
algocustomdata?: {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
};
|
|
51
|
+
userdata?: {
|
|
50
52
|
[key: string]: any;
|
|
51
53
|
};
|
|
52
|
-
userCustomParameters?: UserCustomParameters;
|
|
53
54
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Service } from './Service';
|
|
2
|
+
import { Metadata } from './Metadata';
|
|
3
|
+
import { Credentials } from './Credentials';
|
|
4
|
+
import { Event } from './Event';
|
|
5
|
+
/**
|
|
6
|
+
* DID Descriptor Object.
|
|
7
|
+
* Contains metadata about the asset, and define access in at least one service.
|
|
8
|
+
*/
|
|
9
|
+
export interface DDO {
|
|
10
|
+
/**
|
|
11
|
+
* Contexts used for validation.
|
|
12
|
+
* @type {string[]}
|
|
13
|
+
*/
|
|
14
|
+
'@context': string[];
|
|
15
|
+
/**
|
|
16
|
+
* DID, descentralized ID.
|
|
17
|
+
* Computed as sha256(address of ERC721 contract + chainId)
|
|
18
|
+
* @type {string}
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Version information in SemVer notation
|
|
23
|
+
* referring to the DDO spec version
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
version: string;
|
|
27
|
+
/**
|
|
28
|
+
* NFT contract address
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
nftAddress: string;
|
|
32
|
+
/**
|
|
33
|
+
* ChainId of the network the DDO was published to.
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
chainId: number;
|
|
37
|
+
/**
|
|
38
|
+
* Stores an object describing the asset.
|
|
39
|
+
* @type {Metadata}
|
|
40
|
+
*/
|
|
41
|
+
metadata: Metadata;
|
|
42
|
+
/**
|
|
43
|
+
* Stores an array of services defining access to the asset.
|
|
44
|
+
* @type {Service[]}
|
|
45
|
+
*/
|
|
46
|
+
services: Service[];
|
|
47
|
+
/**
|
|
48
|
+
* Describes the credentials needed to access a dataset
|
|
49
|
+
* in addition to the services definition.
|
|
50
|
+
* @type {Credentials}
|
|
51
|
+
*/
|
|
52
|
+
credentials?: Credentials;
|
|
53
|
+
/**
|
|
54
|
+
* Describes the event of last metadata event
|
|
55
|
+
* @type {Event}
|
|
56
|
+
*/
|
|
57
|
+
event?: Event;
|
|
58
|
+
}
|
|
@@ -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,126 @@
|
|
|
1
|
+
export interface MetadataAlgorithm {
|
|
2
|
+
/**
|
|
3
|
+
* Language used to implement the software.
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
language?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Version of the software preferably in SemVer notation.
|
|
9
|
+
* @type {string}
|
|
10
|
+
*/
|
|
11
|
+
version?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Rawcode
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
rawcode?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Object describing the Docker container image.
|
|
19
|
+
* @type {Object}
|
|
20
|
+
*/
|
|
21
|
+
container: {
|
|
22
|
+
/**
|
|
23
|
+
* The command to execute, or script to run inside the Docker image.
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
entrypoint: string;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the Docker image.
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
image: string;
|
|
32
|
+
/**
|
|
33
|
+
* Tag of the Docker image.
|
|
34
|
+
* @type {string}
|
|
35
|
+
*/
|
|
36
|
+
tag: string;
|
|
37
|
+
/**
|
|
38
|
+
* Checksum of the Docker image.
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
checksum: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface Metadata {
|
|
45
|
+
/**
|
|
46
|
+
* Contains the date of publishing in ISO Date Time
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
created: string;
|
|
50
|
+
/**
|
|
51
|
+
* Contains the the date of last update in ISO Date Time
|
|
52
|
+
* @type {string}
|
|
53
|
+
*/
|
|
54
|
+
updated: string;
|
|
55
|
+
/**
|
|
56
|
+
* Descriptive name or title of the asset.
|
|
57
|
+
* @type {string}
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* Details of what the resource is.
|
|
62
|
+
* @type {string}
|
|
63
|
+
*/
|
|
64
|
+
description: string;
|
|
65
|
+
/**
|
|
66
|
+
* Asset type. Includes "dataset" (e.g. csv file), "algorithm" (e.g. Python script).
|
|
67
|
+
* Each type needs a different subset of metadata attributes.
|
|
68
|
+
* @type {'dataset' | 'algorithm'}
|
|
69
|
+
*/
|
|
70
|
+
type: 'dataset' | 'algorithm';
|
|
71
|
+
/**
|
|
72
|
+
* Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).
|
|
73
|
+
* @type {string}
|
|
74
|
+
*/
|
|
75
|
+
author: string;
|
|
76
|
+
/**
|
|
77
|
+
* Short name referencing the license of the asset.
|
|
78
|
+
* If it’s not specified, the following value will be added: “No License Specified”.
|
|
79
|
+
* @type {string}
|
|
80
|
+
*/
|
|
81
|
+
license: string;
|
|
82
|
+
/**
|
|
83
|
+
* Mapping of URL strings for data samples, or links to find out more information.
|
|
84
|
+
* Links may be to either a URL or another asset.
|
|
85
|
+
* @type {string[]}
|
|
86
|
+
*/
|
|
87
|
+
links?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Mapping of URL strings for data samples, or links to find out more information.
|
|
90
|
+
* Links may be to either a URL or another asset.
|
|
91
|
+
* @type {string[]}
|
|
92
|
+
*/
|
|
93
|
+
tags?: string[];
|
|
94
|
+
/**
|
|
95
|
+
* The party holding the legal copyright. Empty by default.
|
|
96
|
+
* @type {string}
|
|
97
|
+
*/
|
|
98
|
+
copyrightHolder?: string;
|
|
99
|
+
/**
|
|
100
|
+
*The language of the content. Use one of the language codes from the IETF BCP 47 standard
|
|
101
|
+
* @type {string}
|
|
102
|
+
*/
|
|
103
|
+
contentLanguage?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Information about asset of typealgorithm
|
|
106
|
+
* @type {MetadataAlgorithm}
|
|
107
|
+
*/
|
|
108
|
+
algorithm?: MetadataAlgorithm;
|
|
109
|
+
/**
|
|
110
|
+
* Stores additional information, this is customizable by publisher
|
|
111
|
+
* @type {any}
|
|
112
|
+
*/
|
|
113
|
+
additionalInformation?: any;
|
|
114
|
+
}
|
|
115
|
+
export interface MetadataProof {
|
|
116
|
+
validatorAddress?: string;
|
|
117
|
+
r?: string;
|
|
118
|
+
s?: string;
|
|
119
|
+
v?: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ValidateMetadata {
|
|
122
|
+
valid: Boolean;
|
|
123
|
+
errors?: Object;
|
|
124
|
+
hash?: string;
|
|
125
|
+
proof?: MetadataProof;
|
|
126
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export interface PublisherTrustedAlgorithm {
|
|
2
|
+
/**
|
|
3
|
+
* The DID of the algorithm which is trusted by the publisher.
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
did: string;
|
|
7
|
+
/**
|
|
8
|
+
* Hash of algorithm’s files section.
|
|
9
|
+
* @type {string}
|
|
10
|
+
*/
|
|
11
|
+
filesChecksum: string;
|
|
12
|
+
/**
|
|
13
|
+
* Hash of algorithm’s metadata.algorithm.container section.
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
containerSectionChecksum: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ServiceComputeOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Namespaced used for the compute job.
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
namespace: string;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum number of CPUs allocated for a job
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
cpu?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Maximum number of GPUs allocated for a job
|
|
31
|
+
* @type {number}
|
|
32
|
+
*/
|
|
33
|
+
gpu?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Type of GPU (if any)
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
gpuType?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum amount of memory allocated for a job.
|
|
41
|
+
* You can express memory as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, k.
|
|
42
|
+
* You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.
|
|
43
|
+
* For example, the following represent roughly the same value: 128974848, 129e6, 129M, 123Mi
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
memory?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Amount of disk space allocated.
|
|
49
|
+
* You can express it as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, k.
|
|
50
|
+
* You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
volumeSize?: string;
|
|
54
|
+
/**
|
|
55
|
+
* If true, any passed raw text will be allowed to run.
|
|
56
|
+
* Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input.
|
|
57
|
+
* Should be false by default in all implementations.
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
*/
|
|
60
|
+
allowRawAlgorithm: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If true, the algorithm job will have network access.
|
|
63
|
+
* @type {boolean}
|
|
64
|
+
*/
|
|
65
|
+
allowNetworkAccess: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* If empty, then any published algorithm is allowed.
|
|
68
|
+
* Otherwise, only published algorithms by some publishers are allowed
|
|
69
|
+
* @type {string[]}
|
|
70
|
+
*/
|
|
71
|
+
publisherTrustedAlgorithmPublishers: string[];
|
|
72
|
+
/**
|
|
73
|
+
* If empty, then any published algorithm is allowed. (see below)
|
|
74
|
+
* @type {PublisherTrustedAlgorithm[]}
|
|
75
|
+
*/
|
|
76
|
+
publisherTrustedAlgorithms: PublisherTrustedAlgorithm[];
|
|
77
|
+
}
|
|
78
|
+
export interface Service {
|
|
79
|
+
/**
|
|
80
|
+
* Unique ID
|
|
81
|
+
* @type {string}
|
|
82
|
+
*/
|
|
83
|
+
id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Type of service (access, compute, wss.
|
|
86
|
+
* @type {string}
|
|
87
|
+
*/
|
|
88
|
+
type: 'access' | 'compute' | string;
|
|
89
|
+
/**
|
|
90
|
+
* Encrypted file URLs.
|
|
91
|
+
* @type {string}
|
|
92
|
+
*/
|
|
93
|
+
files: string;
|
|
94
|
+
/**
|
|
95
|
+
* Datatoken address
|
|
96
|
+
* @type {string}
|
|
97
|
+
*/
|
|
98
|
+
datatokenAddress: string;
|
|
99
|
+
/**
|
|
100
|
+
* Provider URL (schema + host).
|
|
101
|
+
* @type {string}
|
|
102
|
+
*/
|
|
103
|
+
serviceEndpoint: string;
|
|
104
|
+
/**
|
|
105
|
+
* Describing how long the service can be used after consumption is initiated.
|
|
106
|
+
* @type {number}
|
|
107
|
+
*/
|
|
108
|
+
timeout: number;
|
|
109
|
+
/**
|
|
110
|
+
* Service friendly name
|
|
111
|
+
* @type {string}
|
|
112
|
+
*/
|
|
113
|
+
name?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Service description
|
|
116
|
+
* @type {string}
|
|
117
|
+
*/
|
|
118
|
+
description?: string;
|
|
119
|
+
/**
|
|
120
|
+
* If service is of typecompute, holds information about the compute-related privacy settings & resources.
|
|
121
|
+
* @type {ServiceComputeOptions}
|
|
122
|
+
*/
|
|
123
|
+
compute?: ServiceComputeOptions;
|
|
124
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MetadataProof } from '.';
|
|
2
|
+
export interface MetadataAndTokenURI {
|
|
3
|
+
metaDataState: number;
|
|
4
|
+
metaDataDecryptorUrl: string;
|
|
5
|
+
metaDataDecryptorAddress: string;
|
|
6
|
+
flags: string;
|
|
7
|
+
data: string;
|
|
8
|
+
metaDataHash: string;
|
|
9
|
+
tokenId: number;
|
|
10
|
+
tokenURI: string;
|
|
11
|
+
metadataProofs: MetadataProof[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface FileMetadata {
|
|
2
|
+
/**
|
|
3
|
+
* File URL.
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
type: string;
|
|
7
|
+
/**
|
|
8
|
+
* File format, if applicable.
|
|
9
|
+
* @type {string}
|
|
10
|
+
* @example "text/csv"
|
|
11
|
+
*/
|
|
12
|
+
contentType?: string;
|
|
13
|
+
/**
|
|
14
|
+
* File content length.
|
|
15
|
+
* @type {[type]}
|
|
16
|
+
*/
|
|
17
|
+
contentLength?: string;
|
|
18
|
+
/**
|
|
19
|
+
* File index.
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
index?: number;
|
|
23
|
+
/**
|
|
24
|
+
* File URL.
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
url?: string;
|
|
28
|
+
/**
|
|
29
|
+
* HTTP method used
|
|
30
|
+
* @type {string}
|
|
31
|
+
*/
|
|
32
|
+
method?: string;
|
|
33
|
+
/**
|
|
34
|
+
* check if file exists
|
|
35
|
+
* @type {boolean}
|
|
36
|
+
*/
|
|
37
|
+
valid?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface FreCreationParams {
|
|
2
|
+
fixedRateAddress: string;
|
|
3
|
+
baseTokenAddress: string;
|
|
4
|
+
owner: string;
|
|
5
|
+
marketFeeCollector: string;
|
|
6
|
+
baseTokenDecimals: number;
|
|
7
|
+
datatokenDecimals: number;
|
|
8
|
+
fixedRate: string;
|
|
9
|
+
marketFee: number;
|
|
10
|
+
withMint?: boolean;
|
|
11
|
+
allowedConsumer?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FreOrderParams {
|
|
14
|
+
exchangeContract: string;
|
|
15
|
+
exchangeId: string;
|
|
16
|
+
maxBaseTokenAmount: string;
|
|
17
|
+
swapMarketFee: string;
|
|
18
|
+
marketFeeAddress: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface PoolCreationParams {
|
|
2
|
+
ssContract: string;
|
|
3
|
+
baseTokenAddress: string;
|
|
4
|
+
baseTokenSender: string;
|
|
5
|
+
publisherAddress: string;
|
|
6
|
+
marketFeeCollector: string;
|
|
7
|
+
poolTemplateAddress: string;
|
|
8
|
+
rate: string;
|
|
9
|
+
baseTokenDecimals: number;
|
|
10
|
+
vestingAmount: string;
|
|
11
|
+
vestedBlocks: number;
|
|
12
|
+
initialBaseTokenLiquidity: string;
|
|
13
|
+
swapFeeLiquidityProvider: number;
|
|
14
|
+
swapFeeMarketRunner: number;
|
|
15
|
+
}
|
|
16
|
+
export interface CurrentFees {
|
|
17
|
+
tokens: string[];
|
|
18
|
+
amounts: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface TokenInOutMarket {
|
|
21
|
+
tokenIn: string;
|
|
22
|
+
tokenOut: string;
|
|
23
|
+
marketFeeAddress: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AmountsInMaxFee {
|
|
26
|
+
tokenAmountIn: string;
|
|
27
|
+
minAmountOut: string;
|
|
28
|
+
swapMarketFee: string;
|
|
29
|
+
maxPrice?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AmountsOutMaxFee {
|
|
32
|
+
tokenAmountOut: string;
|
|
33
|
+
maxAmountIn: string;
|
|
34
|
+
swapMarketFee: string;
|
|
35
|
+
maxPrice?: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ProviderFees {
|
|
2
|
+
providerFeeAddress: string;
|
|
3
|
+
providerFeeToken: string;
|
|
4
|
+
providerFeeAmount: string;
|
|
5
|
+
v: string;
|
|
6
|
+
r: string;
|
|
7
|
+
s: string;
|
|
8
|
+
providerData: string;
|
|
9
|
+
validUntil: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ProviderInitialize {
|
|
12
|
+
datatoken: string;
|
|
13
|
+
nonce: string;
|
|
14
|
+
computeAddress: string;
|
|
15
|
+
providerFee: ProviderFees;
|
|
16
|
+
}
|