@oceanprotocol/lib 0.20.1 → 0.20.2
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 +21 -0
- package/dist/node/lib.js +1 -1
- package/dist/node/lib.js.map +1 -1
- package/dist/node/lib.module.js +1 -1
- package/dist/node/lib.module.js.map +1 -1
- package/dist/node/lib.umd.js +1 -1
- package/dist/node/lib.umd.js.map +1 -1
- package/dist/node/ocean/Assets.d.ts +1 -1
- package/dist/node/ocean/Compute.d.ts +1 -1
- package/dist/node/ocean/interfaces/Compute.d.ts +3 -0
- package/docs/beginners_guide.md +2 -2
- package/docs/quickstart_simple.md +2 -2
- package/package.json +10 -10
|
@@ -48,7 +48,7 @@ export declare class Assets extends Instantiable {
|
|
|
48
48
|
createAccessServiceAttributes(creator: Account, cost: string, datePublished: string, timeout?: number, providerUri?: string, requiredParameters?: ServiceCustomParametersRequired): Promise<ServiceAccess>;
|
|
49
49
|
initialize(asset: DDO | string, serviceType: string, consumerAddress: string, serviceIndex: number, serviceEndpoint: string, userCustomParameters?: UserCustomParameters): Promise<any>;
|
|
50
50
|
order(asset: DDO | string, serviceType: string, payerAddress: string, serviceIndex?: number, mpAddress?: string, consumerAddress?: string, userCustomParameters?: UserCustomParameters, authService?: string, searchPreviousOrders?: boolean): Promise<string>;
|
|
51
|
-
download(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, destination: string): Promise<string | true>;
|
|
51
|
+
download(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, destination: string, index?: number, userCustomParameters?: UserCustomParameters): Promise<string | true>;
|
|
52
52
|
simpleDownload(dtAddress: string, serviceEndpoint: string, txId: string, account: string): Promise<string>;
|
|
53
53
|
getOrderHistory(account: Account, serviceType?: string, fromBlock?: number): Promise<Order[]>;
|
|
54
54
|
isConsumable(ddo: DDO, consumer?: string, credentialsType?: string, authService?: string): Promise<Consumable>;
|
|
@@ -44,7 +44,7 @@ export declare const ComputeJobStatus: Readonly<{
|
|
|
44
44
|
export declare class Compute extends Instantiable {
|
|
45
45
|
static getInstance(config: InstantiableConfig): Promise<Compute>;
|
|
46
46
|
getComputeAddress(did: string, serviceIndex?: number): Promise<string>;
|
|
47
|
-
start(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, algorithm: ComputeAlgorithm, output?: ComputeOutput, serviceIndex?: string, serviceType?: string, additionalInputs?: ComputeInput[]): Promise<ComputeJob>;
|
|
47
|
+
start(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, algorithm: ComputeAlgorithm, output?: ComputeOutput, serviceIndex?: string, serviceType?: string, additionalInputs?: ComputeInput[], userCustomParameters?: UserCustomParameters): Promise<ComputeJob>;
|
|
48
48
|
stop(consumerAccount: Account, asset: DDO | string, jobId: string): Promise<ComputeJob>;
|
|
49
49
|
delete(consumerAccount: Account, asset: DDO | string, jobId: string): Promise<ComputeJob>;
|
|
50
50
|
status(consumerAccount: Account, did?: string, ddo?: DDO, service?: ServiceCompute, jobId?: string, txId?: string): Promise<ComputeJob[]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Metadata } from '../../ddo/interfaces/Metadata';
|
|
2
2
|
import { MetadataAlgorithm } from '../../ddo/interfaces/MetadataAlgorithm';
|
|
3
|
+
import { UserCustomParameters } from '../../provider/Provider';
|
|
3
4
|
export declare type ComputeResultType = 'algorithmLog' | 'output';
|
|
4
5
|
export interface ComputeResult {
|
|
5
6
|
filename: string;
|
|
@@ -37,6 +38,7 @@ export interface ComputeInput {
|
|
|
37
38
|
documentId: string;
|
|
38
39
|
serviceId: number;
|
|
39
40
|
transferTxId?: string;
|
|
41
|
+
userCustomParameters?: UserCustomParameters;
|
|
40
42
|
}
|
|
41
43
|
export interface ComputeAlgorithm {
|
|
42
44
|
did?: string;
|
|
@@ -47,4 +49,5 @@ export interface ComputeAlgorithm {
|
|
|
47
49
|
algoCustomParameters?: {
|
|
48
50
|
[key: string]: any;
|
|
49
51
|
};
|
|
52
|
+
userCustomParameters?: UserCustomParameters;
|
|
50
53
|
}
|
package/docs/beginners_guide.md
CHANGED
|
@@ -168,8 +168,8 @@ The process of creating and deploying the ERC20 datatokens has been automated by
|
|
|
168
168
|
const Web3 = require("web3");
|
|
169
169
|
const { Ocean, DataTokens } = require("@oceanprotocol/lib");
|
|
170
170
|
|
|
171
|
-
const
|
|
172
|
-
const
|
|
171
|
+
const factoryABI = require("@oceanprotocol/contracts/artifacts/DTFactory.json").abi;
|
|
172
|
+
const datatokensABI = require("@oceanprotocol/contracts/artifacts/DataTokenTemplate.json").abi;
|
|
173
173
|
const { config, contracts, urls } = require("./config");
|
|
174
174
|
|
|
175
175
|
const init = async () => {
|
|
@@ -114,8 +114,8 @@ Now open the `index.js` file in your text editor. Enter the following code and s
|
|
|
114
114
|
const Web3 = require("web3");
|
|
115
115
|
const { Ocean, DataTokens } = require("@oceanprotocol/lib");
|
|
116
116
|
|
|
117
|
-
const
|
|
118
|
-
const
|
|
117
|
+
const factoryABI = require("@oceanprotocol/contracts/artifacts/DTFactory.json").abi;
|
|
118
|
+
const datatokensABI = require("@oceanprotocol/contracts/artifacts/DataTokenTemplate.json").abi;
|
|
119
119
|
const { config, contracts, urls } = require("./config");
|
|
120
120
|
|
|
121
121
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanprotocol/lib",
|
|
3
3
|
"source": "./src/index.ts",
|
|
4
|
-
"version": "0.20.
|
|
4
|
+
"version": "0.20.2",
|
|
5
5
|
"description": "JavaScript client library for Ocean Protocol",
|
|
6
6
|
"main": "./dist/node/lib.js",
|
|
7
7
|
"exports": "./dist/node/lib.js",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"web3-eth-contract": "^1.5.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@truffle/hdwallet-provider": "^
|
|
64
|
-
"@types/chai": "^4.
|
|
63
|
+
"@truffle/hdwallet-provider": "^2.0.0",
|
|
64
|
+
"@types/chai": "^4.3.0",
|
|
65
65
|
"@types/chai-spies": "^1.0.3",
|
|
66
|
-
"@types/crypto-js": "^4.0
|
|
66
|
+
"@types/crypto-js": "^4.1.0",
|
|
67
67
|
"@types/mocha": "^9.0.0",
|
|
68
|
-
"@types/node": "^
|
|
68
|
+
"@types/node": "^17.0.7",
|
|
69
69
|
"@types/node-fetch": "^3.0.3",
|
|
70
70
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
71
71
|
"@typescript-eslint/parser": "^4.33.0",
|
|
@@ -79,16 +79,16 @@
|
|
|
79
79
|
"eslint-plugin-prettier": "^4.0.0",
|
|
80
80
|
"microbundle": "^0.14.2",
|
|
81
81
|
"mocha": "^9.1.3",
|
|
82
|
-
"mock-local-storage": "^1.1.
|
|
82
|
+
"mock-local-storage": "^1.1.19",
|
|
83
83
|
"nyc": "^15.1.0",
|
|
84
84
|
"ora": "5.4.1",
|
|
85
|
-
"prettier": "^2.
|
|
85
|
+
"prettier": "^2.5.1",
|
|
86
86
|
"release-it": "^14.11.8",
|
|
87
|
-
"source-map-support": "^0.5.
|
|
87
|
+
"source-map-support": "^0.5.21",
|
|
88
88
|
"ts-node": "^10.4.0",
|
|
89
89
|
"ts-node-register": "^1.0.0",
|
|
90
|
-
"typedoc": "0.22.
|
|
91
|
-
"typescript": "^4.
|
|
90
|
+
"typedoc": "0.22.10",
|
|
91
|
+
"typescript": "^4.5.4"
|
|
92
92
|
},
|
|
93
93
|
"nyc": {
|
|
94
94
|
"include": [
|