@oceanprotocol/lib 3.0.3 → 3.1.0

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/lib.js +1 -1
  3. package/dist/lib.js.map +1 -1
  4. package/dist/lib.modern.js +1 -1
  5. package/dist/lib.modern.js.map +1 -1
  6. package/dist/lib.module.js +1 -1
  7. package/dist/lib.module.js.map +1 -1
  8. package/dist/lib.umd.js +1 -1
  9. package/dist/lib.umd.js.map +1 -1
  10. package/dist/src/@types/Asset.d.ts +148 -148
  11. package/dist/src/@types/Compute.d.ts +71 -71
  12. package/dist/src/@types/Contracts.d.ts +26 -26
  13. package/dist/src/@types/DDO/ConsumerParameter.d.ts +37 -37
  14. package/dist/src/@types/DDO/Credentials.d.ts +8 -8
  15. package/dist/src/@types/DDO/DDO.d.ts +55 -55
  16. package/dist/src/@types/DDO/Event.d.ts +27 -27
  17. package/dist/src/@types/DDO/Metadata.d.ts +141 -141
  18. package/dist/src/@types/DDO/Service.d.ts +100 -100
  19. package/dist/src/@types/Datatoken.d.ts +38 -38
  20. package/dist/src/@types/Dispenser.d.ts +16 -16
  21. package/dist/src/@types/DownloadResponse.d.ts +4 -4
  22. package/dist/src/@types/File.d.ts +89 -89
  23. package/dist/src/@types/FileInfo.d.ts +43 -43
  24. package/dist/src/@types/FixedPrice.d.ts +51 -51
  25. package/dist/src/@types/NFT.d.ts +18 -18
  26. package/dist/src/@types/NFTFactory.d.ts +20 -20
  27. package/dist/src/@types/Provider.d.ts +33 -33
  28. package/dist/src/@types/ReturnTypes.d.ts +3 -3
  29. package/dist/src/@types/Router.d.ts +59 -59
  30. package/dist/src/@types/index.d.ts +20 -20
  31. package/dist/src/config/Config.d.ts +153 -153
  32. package/dist/src/config/ConfigHelper.d.ts +12 -12
  33. package/dist/src/config/index.d.ts +2 -2
  34. package/dist/src/contracts/Datatoken.d.ts +278 -260
  35. package/dist/src/contracts/Dispenser.d.ts +73 -73
  36. package/dist/src/contracts/FixedRateExchange.d.ts +209 -209
  37. package/dist/src/contracts/NFT.d.ts +220 -220
  38. package/dist/src/contracts/NFTFactory.d.ts +165 -165
  39. package/dist/src/contracts/Router.d.ts +107 -107
  40. package/dist/src/contracts/SmartContract.d.ts +45 -45
  41. package/dist/src/contracts/SmartContractWithAddress.d.ts +17 -17
  42. package/dist/src/contracts/df/DfRewards.d.ts +31 -31
  43. package/dist/src/contracts/df/DfStrategyV1.d.ts +21 -21
  44. package/dist/src/contracts/index.d.ts +14 -14
  45. package/dist/src/contracts/ve/VeAllocate.d.ts +38 -38
  46. package/dist/src/contracts/ve/VeFeeDistributor.d.ts +29 -29
  47. package/dist/src/contracts/ve/VeFeeEstimate.d.ts +14 -14
  48. package/dist/src/contracts/ve/VeOcean.d.ts +68 -68
  49. package/dist/src/index.d.ts +5 -5
  50. package/dist/src/services/Aquarius.d.ts +53 -53
  51. package/dist/src/services/Provider.d.ts +197 -197
  52. package/dist/src/services/index.d.ts +2 -2
  53. package/dist/src/utils/Constants.d.ts +4 -4
  54. package/dist/src/utils/ContractUtils.d.ts +46 -46
  55. package/dist/src/utils/DatatokenName.d.ts +14 -14
  56. package/dist/src/utils/DdoHelpers.d.ts +13 -13
  57. package/dist/src/utils/FetchHelper.d.ts +14 -14
  58. package/dist/src/utils/General.d.ts +5 -5
  59. package/dist/src/utils/Logger.d.ts +19 -19
  60. package/dist/src/utils/OrderUtils.d.ts +17 -0
  61. package/dist/src/utils/ProviderErrors.d.ts +1 -1
  62. package/dist/src/utils/SignatureUtils.d.ts +12 -12
  63. package/dist/src/utils/TokenUtils.d.ts +70 -70
  64. package/dist/src/utils/index.d.ts +12 -11
  65. package/dist/src/utils/minAbi.d.ts +38 -38
  66. package/dist/test/config.d.ts +19 -19
  67. package/dist/test/integration/CodeExamples.test.d.ts +1 -1
  68. package/dist/test/integration/ComputeExamples.test.d.ts +1 -1
  69. package/dist/test/integration/ComputeFlow.test.d.ts +1 -1
  70. package/dist/test/integration/Provider.test.d.ts +1 -1
  71. package/dist/test/integration/PublishEditConsume.test.d.ts +1 -1
  72. package/dist/test/integration/PublishFlows.test.d.ts +1 -1
  73. package/dist/test/integration/helpers.d.ts +7 -7
  74. package/dist/test/unit/DFRewards.test.d.ts +1 -1
  75. package/dist/test/unit/Datatoken.test.d.ts +1 -1
  76. package/dist/test/unit/Dispenser.test.d.ts +1 -1
  77. package/dist/test/unit/FixedRateExchange.test.d.ts +1 -1
  78. package/dist/test/unit/Nft.test.d.ts +1 -1
  79. package/dist/test/unit/NftFactory.test.d.ts +1 -1
  80. package/dist/test/unit/Router.test.d.ts +1 -1
  81. package/dist/test/unit/veOcean.test.d.ts +1 -1
  82. package/package.json +5 -5
@@ -1,55 +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
- }
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
+ }
@@ -1,27 +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
- }
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
+ }
@@ -1,141 +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
- }
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
+ }
@@ -1,100 +1,100 @@
1
- import { ConsumerParameter } from './ConsumerParameter';
2
- export interface PublisherTrustedAlgorithm {
3
- /**
4
- * The DID of the algorithm which is trusted by the publisher.
5
- * @type {string}
6
- */
7
- did: string;
8
- /**
9
- * Hash of algorithm’s files section.
10
- * @type {string}
11
- */
12
- filesChecksum: string;
13
- /**
14
- * Hash of algorithm’s metadata.algorithm.container section.
15
- * @type {string}
16
- */
17
- containerSectionChecksum: string;
18
- }
19
- export interface ServiceComputeOptions {
20
- /**
21
- * If true, any passed raw text will be allowed to run.
22
- * Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input.
23
- * Should be false by default in all implementations.
24
- * @type {boolean}
25
- */
26
- allowRawAlgorithm: boolean;
27
- /**
28
- * If true, the algorithm job will have network access.
29
- * @type {boolean}
30
- */
31
- allowNetworkAccess: boolean;
32
- /**
33
- * If empty, then any published algorithm is allowed.
34
- * Otherwise, only published algorithms by some publishers are allowed
35
- * @type {string[]}
36
- */
37
- publisherTrustedAlgorithmPublishers: string[];
38
- /**
39
- * If empty, then any published algorithm is allowed. (see below)
40
- * @type {PublisherTrustedAlgorithm[]}
41
- */
42
- publisherTrustedAlgorithms: PublisherTrustedAlgorithm[];
43
- }
44
- export interface Service {
45
- /**
46
- * Unique ID
47
- * @type {string}
48
- */
49
- id: string;
50
- /**
51
- * Type of service (access, compute, wss.
52
- * @type {string}
53
- */
54
- type: 'access' | 'compute' | string;
55
- /**
56
- * Encrypted file URLs.
57
- * @type {string}
58
- */
59
- files: string;
60
- /**
61
- * Datatoken address
62
- * @type {string}
63
- */
64
- datatokenAddress: string;
65
- /**
66
- * Provider URL (schema + host).
67
- * @type {string}
68
- */
69
- serviceEndpoint: string;
70
- /**
71
- * Describing how long the service can be used after consumption is initiated.
72
- * @type {number}
73
- */
74
- timeout: number;
75
- /**
76
- * Service friendly name
77
- * @type {string}
78
- */
79
- name?: string;
80
- /**
81
- * Service description
82
- * @type {string}
83
- */
84
- description?: string;
85
- /**
86
- * If service is of type compute, holds information about the compute-related privacy settings & resources.
87
- * @type {ServiceComputeOptions}
88
- */
89
- compute?: ServiceComputeOptions;
90
- /**
91
- * Array of objects describing the consumer parameters
92
- * @type {ConsumerParameter[]}
93
- */
94
- consumerParameters?: ConsumerParameter[];
95
- /**
96
- * Stores service specific additional information, this is customizable by publisher
97
- * @type {any}
98
- */
99
- additionalInformation?: any;
100
- }
1
+ import { ConsumerParameter } from './ConsumerParameter';
2
+ export interface PublisherTrustedAlgorithm {
3
+ /**
4
+ * The DID of the algorithm which is trusted by the publisher.
5
+ * @type {string}
6
+ */
7
+ did: string;
8
+ /**
9
+ * Hash of algorithm’s files section.
10
+ * @type {string}
11
+ */
12
+ filesChecksum: string;
13
+ /**
14
+ * Hash of algorithm’s metadata.algorithm.container section.
15
+ * @type {string}
16
+ */
17
+ containerSectionChecksum: string;
18
+ }
19
+ export interface ServiceComputeOptions {
20
+ /**
21
+ * If true, any passed raw text will be allowed to run.
22
+ * Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input.
23
+ * Should be false by default in all implementations.
24
+ * @type {boolean}
25
+ */
26
+ allowRawAlgorithm: boolean;
27
+ /**
28
+ * If true, the algorithm job will have network access.
29
+ * @type {boolean}
30
+ */
31
+ allowNetworkAccess: boolean;
32
+ /**
33
+ * If empty, then any published algorithm is allowed.
34
+ * Otherwise, only published algorithms by some publishers are allowed
35
+ * @type {string[]}
36
+ */
37
+ publisherTrustedAlgorithmPublishers: string[];
38
+ /**
39
+ * If empty, then any published algorithm is allowed. (see below)
40
+ * @type {PublisherTrustedAlgorithm[]}
41
+ */
42
+ publisherTrustedAlgorithms: PublisherTrustedAlgorithm[];
43
+ }
44
+ export interface Service {
45
+ /**
46
+ * Unique ID
47
+ * @type {string}
48
+ */
49
+ id: string;
50
+ /**
51
+ * Type of service (access, compute, wss.
52
+ * @type {string}
53
+ */
54
+ type: 'access' | 'compute' | string;
55
+ /**
56
+ * Encrypted file URLs.
57
+ * @type {string}
58
+ */
59
+ files: string;
60
+ /**
61
+ * Datatoken address
62
+ * @type {string}
63
+ */
64
+ datatokenAddress: string;
65
+ /**
66
+ * Provider URL (schema + host).
67
+ * @type {string}
68
+ */
69
+ serviceEndpoint: string;
70
+ /**
71
+ * Describing how long the service can be used after consumption is initiated.
72
+ * @type {number}
73
+ */
74
+ timeout: number;
75
+ /**
76
+ * Service friendly name
77
+ * @type {string}
78
+ */
79
+ name?: string;
80
+ /**
81
+ * Service description
82
+ * @type {string}
83
+ */
84
+ description?: string;
85
+ /**
86
+ * If service is of type compute, holds information about the compute-related privacy settings & resources.
87
+ * @type {ServiceComputeOptions}
88
+ */
89
+ compute?: ServiceComputeOptions;
90
+ /**
91
+ * Array of objects describing the consumer parameters
92
+ * @type {ConsumerParameter[]}
93
+ */
94
+ consumerParameters?: ConsumerParameter[];
95
+ /**
96
+ * Stores service specific additional information, this is customizable by publisher
97
+ * @type {any}
98
+ */
99
+ additionalInformation?: any;
100
+ }