@oceanprotocol/lib 5.0.3 → 5.0.5
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 +49 -1
- package/Cheatsheet.md +326 -0
- package/CodeExamples.md +2 -2
- package/ComputeExamples.md +3 -3
- package/README.md +33 -7
- package/dist/lib.cjs +1 -1
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.mjs +1 -1
- package/dist/lib.module.mjs.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/types/@types/Compute.d.ts +7 -0
- package/dist/types/config/Config.d.ts +6 -0
- package/dist/types/contracts/EnterpriseFeeCollector.d.ts +33 -0
- package/dist/types/contracts/index.d.ts +1 -0
- package/dist/types/services/Provider.d.ts +4 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/docs/README.md +10 -7
- package/docs/classes/Escrow.md +285 -0
- package/docs/classes/Provider.md +75 -10
- package/docs/interfaces/ComputeEnvironment.md +68 -75
- package/docs/interfaces/ComputeJob.md +34 -1
- package/docs/interfaces/ComputeResourcesRequest.md +6 -2
- package/docs/interfaces/ProviderComputeInitializeResults.md +14 -1
- package/package.json +3 -3
|
@@ -6,62 +6,31 @@
|
|
|
6
6
|
|
|
7
7
|
### Properties
|
|
8
8
|
|
|
9
|
-
- [consumerAddress](ComputeEnvironment.md#consumeraddress)
|
|
10
|
-
- [totalCpu](ComputeEnvironment.md#totalCpu)
|
|
11
|
-
- [maxCpu](ComputeEnvironment.md#maxCpu)
|
|
12
|
-
- [totalRam](ComputeEnvironment.md#totalRam)
|
|
13
|
-
- [maxRam](ComputeEnvironment.md#maxRam)
|
|
14
|
-
- [maxDisk](ComputeEnvironment.md#maxDisk)
|
|
15
|
-
- [currentJobs](ComputeEnvironment.md#currentjobs)
|
|
16
|
-
- [description](ComputeEnvironment.md#description)
|
|
17
|
-
- [fees](ComputeEnvironment.md#ComputeEnvFeesStructure)
|
|
18
9
|
- [id](ComputeEnvironment.md#id)
|
|
19
|
-
- [
|
|
10
|
+
- [description](ComputeEnvironment.md#description)
|
|
11
|
+
- [consumerAddress](ComputeEnvironment.md#consumeraddress)
|
|
12
|
+
- [storageExpiry](ComputeEnvironment.md#storageexpiry)
|
|
13
|
+
- [minJobDuration](ComputeEnvironment.md#minjobduration)
|
|
20
14
|
- [maxJobDuration](ComputeEnvironment.md#maxjobduration)
|
|
21
15
|
- [maxJobs](ComputeEnvironment.md#maxjobs)
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
16
|
+
- [runningJobs](ComputeEnvironment.md#runningjobs)
|
|
17
|
+
- [runningfreeJobs](ComputeEnvironment.md#runningfreejobs)
|
|
18
|
+
- [fees](ComputeEnvironment.md#fees)
|
|
19
|
+
- [resources](ComputeEnvironment.md#resources)
|
|
24
20
|
- [free](ComputeEnvironment.md#free)
|
|
21
|
+
- [platform](ComputeEnvironment.md#platform)
|
|
25
22
|
|
|
26
23
|
## Properties
|
|
27
24
|
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
• **consumerAddress**: `string`
|
|
31
|
-
|
|
32
|
-
#### Defined in
|
|
33
|
-
|
|
34
|
-
[@types/Compute.ts:68](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L68)
|
|
35
|
-
|
|
36
|
-
___
|
|
37
|
-
|
|
38
|
-
### totalCpu
|
|
39
|
-
|
|
40
|
-
• **totalCpu**: `number`
|
|
41
|
-
|
|
42
|
-
#### Defined in
|
|
43
|
-
|
|
44
|
-
[@types/Compute.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L58)
|
|
45
|
-
|
|
46
|
-
___
|
|
47
|
-
|
|
48
|
-
### maxCpu
|
|
49
|
-
|
|
50
|
-
• **maxCpu**: `number`
|
|
51
|
-
|
|
52
|
-
#### Defined in
|
|
53
|
-
|
|
54
|
-
[@types/Compute.ts:59](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L59)
|
|
55
|
-
|
|
56
|
-
___
|
|
25
|
+
### id
|
|
57
26
|
|
|
58
|
-
|
|
27
|
+
• **id**: `string`
|
|
59
28
|
|
|
60
|
-
|
|
29
|
+
Unique identifier for the compute environment
|
|
61
30
|
|
|
62
31
|
#### Defined in
|
|
63
32
|
|
|
64
|
-
[@types/Compute.ts:
|
|
33
|
+
[@types/Compute.ts:88](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L88)
|
|
65
34
|
|
|
66
35
|
___
|
|
67
36
|
|
|
@@ -69,79 +38,95 @@ ___
|
|
|
69
38
|
|
|
70
39
|
• **description**: `string`
|
|
71
40
|
|
|
41
|
+
Description of the compute environment
|
|
42
|
+
|
|
72
43
|
#### Defined in
|
|
73
44
|
|
|
74
|
-
[@types/Compute.ts:
|
|
45
|
+
[@types/Compute.ts:89](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L89)
|
|
75
46
|
|
|
76
47
|
___
|
|
77
48
|
|
|
78
|
-
###
|
|
49
|
+
### consumerAddress
|
|
50
|
+
|
|
51
|
+
• **consumerAddress**: `string`
|
|
79
52
|
|
|
80
|
-
|
|
53
|
+
Consumer address for the compute environment
|
|
81
54
|
|
|
82
55
|
#### Defined in
|
|
83
56
|
|
|
84
|
-
[@types/Compute.ts:
|
|
57
|
+
[@types/Compute.ts:90](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L90)
|
|
85
58
|
|
|
86
59
|
___
|
|
87
60
|
|
|
88
|
-
###
|
|
61
|
+
### storageExpiry
|
|
62
|
+
|
|
63
|
+
• `Optional` **storageExpiry**: `number`
|
|
89
64
|
|
|
90
|
-
|
|
65
|
+
Amount of seconds for storage
|
|
91
66
|
|
|
92
67
|
#### Defined in
|
|
93
68
|
|
|
94
|
-
[@types/Compute.ts:
|
|
69
|
+
[@types/Compute.ts:91](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L91)
|
|
95
70
|
|
|
96
71
|
___
|
|
97
72
|
|
|
98
|
-
###
|
|
73
|
+
### minJobDuration
|
|
99
74
|
|
|
100
|
-
• **
|
|
75
|
+
• `Optional` **minJobDuration**: `number`
|
|
76
|
+
|
|
77
|
+
Minimum billable seconds for a paid job
|
|
101
78
|
|
|
102
79
|
#### Defined in
|
|
103
80
|
|
|
104
|
-
[@types/Compute.ts:
|
|
81
|
+
[@types/Compute.ts:92](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L92)
|
|
105
82
|
|
|
106
83
|
___
|
|
107
84
|
|
|
108
|
-
###
|
|
85
|
+
### maxJobDuration
|
|
109
86
|
|
|
110
|
-
• **
|
|
87
|
+
• `Optional` **maxJobDuration**: `number`
|
|
88
|
+
|
|
89
|
+
Maximum duration in seconds for a paid job
|
|
111
90
|
|
|
112
91
|
#### Defined in
|
|
113
92
|
|
|
114
|
-
[@types/Compute.ts:
|
|
93
|
+
[@types/Compute.ts:93](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L93)
|
|
115
94
|
|
|
116
95
|
___
|
|
117
96
|
|
|
118
|
-
###
|
|
97
|
+
### maxJobs
|
|
98
|
+
|
|
99
|
+
• `Optional` **maxJobs**: `number`
|
|
119
100
|
|
|
120
|
-
|
|
101
|
+
Maximum number of simultaneous paid jobs
|
|
121
102
|
|
|
122
103
|
#### Defined in
|
|
123
104
|
|
|
124
|
-
[@types/Compute.ts:
|
|
105
|
+
[@types/Compute.ts:94](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L94)
|
|
125
106
|
|
|
126
107
|
___
|
|
127
108
|
|
|
128
|
-
###
|
|
109
|
+
### runningJobs
|
|
110
|
+
|
|
111
|
+
• **runningJobs**: `number`
|
|
129
112
|
|
|
130
|
-
|
|
113
|
+
Amount of running jobs (paid jobs)
|
|
131
114
|
|
|
132
115
|
#### Defined in
|
|
133
116
|
|
|
134
|
-
[@types/Compute.ts:
|
|
117
|
+
[@types/Compute.ts:95](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L95)
|
|
135
118
|
|
|
136
119
|
___
|
|
137
120
|
|
|
138
|
-
###
|
|
121
|
+
### runningfreeJobs
|
|
122
|
+
|
|
123
|
+
• `Optional` **runningfreeJobs**: `number`
|
|
139
124
|
|
|
140
|
-
|
|
125
|
+
Amount of running jobs (free jobs)
|
|
141
126
|
|
|
142
127
|
#### Defined in
|
|
143
128
|
|
|
144
|
-
[@types/Compute.ts:
|
|
129
|
+
[@types/Compute.ts:96](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L96)
|
|
145
130
|
|
|
146
131
|
___
|
|
147
132
|
|
|
@@ -149,36 +134,44 @@ ___
|
|
|
149
134
|
|
|
150
135
|
• **fees**: `ComputeEnvFeesStructure`
|
|
151
136
|
|
|
137
|
+
Fee structure for the compute environment
|
|
138
|
+
|
|
152
139
|
#### Defined in
|
|
153
140
|
|
|
154
|
-
[@types/Compute.ts:
|
|
141
|
+
[@types/Compute.ts:97](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L97)
|
|
155
142
|
|
|
156
143
|
___
|
|
157
144
|
|
|
158
|
-
###
|
|
145
|
+
### resources
|
|
146
|
+
|
|
147
|
+
• `Optional` **resources**: `ComputeResource[]`
|
|
159
148
|
|
|
160
|
-
|
|
149
|
+
Available compute resources (CPU, memory, storage)
|
|
161
150
|
|
|
162
151
|
#### Defined in
|
|
163
152
|
|
|
164
|
-
[@types/Compute.ts:
|
|
153
|
+
[@types/Compute.ts:98](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L98)
|
|
165
154
|
|
|
166
155
|
___
|
|
167
156
|
|
|
168
|
-
###
|
|
157
|
+
### free
|
|
158
|
+
|
|
159
|
+
• `Optional` **free**: `ComputeEnvironmentFreeOptions`
|
|
169
160
|
|
|
170
|
-
|
|
161
|
+
Free compute environment options
|
|
171
162
|
|
|
172
163
|
#### Defined in
|
|
173
164
|
|
|
174
|
-
[@types/Compute.ts:
|
|
165
|
+
[@types/Compute.ts:99](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L99)
|
|
175
166
|
|
|
176
167
|
___
|
|
177
168
|
|
|
178
169
|
### platform
|
|
179
170
|
|
|
180
|
-
• **platform**: `RunningPlatform
|
|
171
|
+
• `Optional` **platform**: `RunningPlatform`
|
|
172
|
+
|
|
173
|
+
Platform information (architecture, OS)
|
|
181
174
|
|
|
182
175
|
#### Defined in
|
|
183
176
|
|
|
184
|
-
[@types/Compute.ts:
|
|
177
|
+
[@types/Compute.ts:100](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L100)
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
- [results](ComputeJob.md#results)
|
|
19
19
|
- [status](ComputeJob.md#status)
|
|
20
20
|
- [statusText](ComputeJob.md#statustext)
|
|
21
|
+
- [metadata](ComputeJob.md#metadata)
|
|
22
|
+
- [terminationDetails](ComputeJob.md#terminationdetails)
|
|
21
23
|
|
|
22
24
|
## Properties
|
|
23
25
|
|
|
@@ -137,4 +139,35 @@ ___
|
|
|
137
139
|
|
|
138
140
|
#### Defined in
|
|
139
141
|
|
|
140
|
-
[@types/Compute.ts:
|
|
142
|
+
[@types/Compute.ts:121](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L121)
|
|
143
|
+
|
|
144
|
+
___
|
|
145
|
+
|
|
146
|
+
### metadata
|
|
147
|
+
|
|
148
|
+
• `Optional` **metadata**: `ComputeJobMetadata`
|
|
149
|
+
|
|
150
|
+
Custom metadata associated with the compute job
|
|
151
|
+
|
|
152
|
+
#### Defined in
|
|
153
|
+
|
|
154
|
+
[@types/Compute.ts:127](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L127)
|
|
155
|
+
|
|
156
|
+
___
|
|
157
|
+
|
|
158
|
+
### terminationDetails
|
|
159
|
+
|
|
160
|
+
• `Optional` **terminationDetails**: `object`
|
|
161
|
+
|
|
162
|
+
Details about job termination
|
|
163
|
+
|
|
164
|
+
#### Type declaration
|
|
165
|
+
|
|
166
|
+
| Name | Type | Description |
|
|
167
|
+
| :------ | :------ | :------ |
|
|
168
|
+
| `exitCode?` | `number` | Exit code of the terminated job |
|
|
169
|
+
| `OOMKilled?` | `boolean` | Whether the job was killed due to out-of-memory |
|
|
170
|
+
|
|
171
|
+
#### Defined in
|
|
172
|
+
|
|
173
|
+
[@types/Compute.ts:128](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L128)
|
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
|
|
16
16
|
• **id**: `string`
|
|
17
17
|
|
|
18
|
+
Resource identifier (e.g., 'cpu', 'ram', 'disk')
|
|
19
|
+
|
|
18
20
|
#### Defined in
|
|
19
21
|
|
|
20
|
-
[@types/Compute.ts:
|
|
22
|
+
[@types/Compute.ts:50](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L50)
|
|
21
23
|
|
|
22
24
|
___
|
|
23
25
|
|
|
@@ -25,6 +27,8 @@ ___
|
|
|
25
27
|
|
|
26
28
|
• **amount**: `number`
|
|
27
29
|
|
|
30
|
+
Amount of the specified resource to request. DISK and RAM are in GB, CPU is in number of cores.
|
|
31
|
+
|
|
28
32
|
#### Defined in
|
|
29
33
|
|
|
30
|
-
[@types/Compute.ts:
|
|
34
|
+
[@types/Compute.ts:51](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Compute.ts#L51)
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
- [algorithm](ProviderComputeInitializeResults.md#algorithm)
|
|
10
10
|
- [datasets](ProviderComputeInitializeResults.md#datasets)
|
|
11
|
+
- [payment](ProviderComputeInitializeResults.md#payment)
|
|
11
12
|
|
|
12
13
|
## Properties
|
|
13
14
|
|
|
@@ -27,4 +28,16 @@ ___
|
|
|
27
28
|
|
|
28
29
|
#### Defined in
|
|
29
30
|
|
|
30
|
-
[@types/Provider.ts:
|
|
31
|
+
[@types/Provider.ts:36](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Provider.ts#L36)
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
### payment
|
|
36
|
+
|
|
37
|
+
• `Optional` **payment**: `ProviderComputeInitializePayment`
|
|
38
|
+
|
|
39
|
+
Payment information for compute initialization including escrow address, chain ID, payee, token, amount, and minimum lock seconds
|
|
40
|
+
|
|
41
|
+
#### Defined in
|
|
42
|
+
|
|
43
|
+
[@types/Provider.ts:37](https://github.com/oceanprotocol/ocean.js/blob/main/src/@types/Provider.ts#L37)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanprotocol/lib",
|
|
3
3
|
"source": "./src/index.ts",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.5",
|
|
5
5
|
"description": "JavaScript client library for Ocean Protocol",
|
|
6
6
|
"main": "./dist/lib.cjs",
|
|
7
7
|
"umd:main": "dist/lib.umd.js",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@oasisprotocol/sapphire-paratime": "^1.3.2",
|
|
60
|
-
"@oceanprotocol/contracts": "^2.
|
|
61
|
-
"@oceanprotocol/ddo-js": "^0.1.
|
|
60
|
+
"@oceanprotocol/contracts": "^2.5.0",
|
|
61
|
+
"@oceanprotocol/ddo-js": "^0.1.4",
|
|
62
62
|
"@rdfjs/dataset": "^2.0.2",
|
|
63
63
|
"@rdfjs/formats-common": "^3.1.0",
|
|
64
64
|
"@zazuko/env-node": "^2.1.4",
|