@oceanprotocol/lib 0.19.3 → 0.20.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.
- package/CHANGELOG.md +12 -0
- package/dist/node/balancer/OceanPool.d.ts +2 -1
- package/dist/node/balancer/Pool.d.ts +2 -1
- package/dist/node/balancer/PoolFactory.d.ts +3 -1
- package/dist/node/datatokens/Datatokens.d.ts +3 -1
- package/dist/node/dispenser/Dispenser.d.ts +3 -1
- package/dist/node/exchange/FixedRateExchange.d.ts +3 -1
- 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/metadatacache/OnChainMetaData.d.ts +3 -1
- package/dist/node/ocean/Compute.d.ts +2 -2
- package/dist/node/ocean/interfaces/Compute.d.ts +9 -4
- package/dist/node/provider/Provider.d.ts +8 -1
- package/dist/node/utils/ConfigHelper.d.ts +4 -0
- package/dist/node/utils/ContractUtils.d.ts +5 -0
- package/dist/node/utils/index.d.ts +1 -1
- package/package.json +6 -6
- package/dist/node/utils/GasUtils.d.ts +0 -2
|
@@ -4,6 +4,7 @@ import { Contract } from 'web3-eth-contract';
|
|
|
4
4
|
import { AbiItem } from 'web3-utils/types';
|
|
5
5
|
import Web3 from 'web3';
|
|
6
6
|
import { Logger } from '../utils';
|
|
7
|
+
import { ConfigHelperConfig } from '../utils/ConfigHelper';
|
|
7
8
|
import { MetadataCache } from '../metadatacache/MetadataCache';
|
|
8
9
|
export interface rawMetadata {
|
|
9
10
|
flags: number;
|
|
@@ -17,7 +18,8 @@ export declare class OnChainMetadata {
|
|
|
17
18
|
DDOContract: Contract;
|
|
18
19
|
private logger;
|
|
19
20
|
metadataCache: MetadataCache;
|
|
20
|
-
|
|
21
|
+
private config;
|
|
22
|
+
constructor(web3: Web3, logger: Logger, DDOContractAddress: string, DDOContractABI: AbiItem | AbiItem[], metadataCache: MetadataCache, config?: ConfigHelperConfig);
|
|
21
23
|
compressDDO(data: any): Promise<string>;
|
|
22
24
|
publish(did: string, ddo: DDO, consumerAccount: string, encrypt?: boolean, validate?: boolean): Promise<TransactionReceipt>;
|
|
23
25
|
update(did: string, ddo: DDO, consumerAccount: string, encrypt?: boolean, validate?: boolean): Promise<TransactionReceipt>;
|
|
@@ -47,8 +47,8 @@ export declare class Compute extends Instantiable {
|
|
|
47
47
|
start(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, algorithm: ComputeAlgorithm, output?: ComputeOutput, serviceIndex?: string, serviceType?: string, additionalInputs?: ComputeInput[]): 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
|
-
status(consumerAccount: Account, did?: string, ddo?: DDO, service?: ServiceCompute, jobId?: string, txId?: string
|
|
51
|
-
|
|
50
|
+
status(consumerAccount: Account, did?: string, ddo?: DDO, service?: ServiceCompute, jobId?: string, txId?: string): Promise<ComputeJob[]>;
|
|
51
|
+
getResult(consumerAccount: Account, jobId: string, index: number, destination: string, did?: string, ddo?: DDO, service?: ServiceCompute): Promise<any>;
|
|
52
52
|
createServerAttributes(serverId: string, serverType: string, cost: string, cpu: string, gpu: string, memory: string, disk: string, maxExecutionTime: number): Server;
|
|
53
53
|
createContainerAttributes(image: string, tag: string, checksum: string): Container;
|
|
54
54
|
createClusterAttributes(type: string, url: string): Cluster;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import DID from '../DID';
|
|
2
1
|
import { Metadata } from '../../ddo/interfaces/Metadata';
|
|
3
2
|
import { MetadataAlgorithm } from '../../ddo/interfaces/MetadataAlgorithm';
|
|
3
|
+
export declare type ComputeResultType = 'algorithmLog' | 'output';
|
|
4
|
+
export interface ComputeResult {
|
|
5
|
+
filename: string;
|
|
6
|
+
filesize: number;
|
|
7
|
+
type: ComputeResultType;
|
|
8
|
+
index: number;
|
|
9
|
+
}
|
|
4
10
|
export interface ComputeJob {
|
|
5
11
|
owner: string;
|
|
6
12
|
did?: string;
|
|
@@ -9,12 +15,11 @@ export interface ComputeJob {
|
|
|
9
15
|
dateFinished: string;
|
|
10
16
|
status: number;
|
|
11
17
|
statusText: string;
|
|
12
|
-
|
|
13
|
-
resultsUrl: string[];
|
|
14
|
-
resultsDid?: DID;
|
|
18
|
+
results: ComputeResult[];
|
|
15
19
|
inputDID?: string[];
|
|
16
20
|
algoDID?: string;
|
|
17
21
|
agreementId?: string;
|
|
22
|
+
expireTimestamp: number;
|
|
18
23
|
}
|
|
19
24
|
export interface ComputeOutput {
|
|
20
25
|
publishAlgorithmLog?: boolean;
|
|
@@ -9,6 +9,10 @@ export interface ServiceEndpoint {
|
|
|
9
9
|
method: string;
|
|
10
10
|
urlPath: string;
|
|
11
11
|
}
|
|
12
|
+
export interface ComputeLimits {
|
|
13
|
+
algoTimeLimit?: string;
|
|
14
|
+
storageExpiry?: string;
|
|
15
|
+
}
|
|
12
16
|
export interface UserCustomParameters {
|
|
13
17
|
[key: string]: any;
|
|
14
18
|
}
|
|
@@ -19,6 +23,7 @@ export declare class Provider extends Instantiable {
|
|
|
19
23
|
computeAddress: string;
|
|
20
24
|
providerAddress: string;
|
|
21
25
|
providerVersion: string;
|
|
26
|
+
computeLimits: ComputeLimits;
|
|
22
27
|
static getInstance(config: InstantiableConfig): Promise<Provider>;
|
|
23
28
|
setBaseUrl(url: string): Promise<boolean>;
|
|
24
29
|
get url(): string;
|
|
@@ -35,7 +40,8 @@ export declare class Provider extends Instantiable {
|
|
|
35
40
|
computeStart(did: string, consumerAccount: Account, algorithm: ComputeAlgorithm, output?: ComputeOutput, txId?: string, serviceIndex?: string, serviceType?: string, tokenAddress?: string, additionalInputs?: ComputeInput[], userCustomParameters?: UserCustomParameters): Promise<ComputeJob | ComputeJob[]>;
|
|
36
41
|
computeStop(did: string, consumerAccount: Account, jobId: string): Promise<ComputeJob | ComputeJob[]>;
|
|
37
42
|
computeDelete(did: string, consumerAccount: Account, jobId: string): Promise<ComputeJob | ComputeJob[]>;
|
|
38
|
-
computeStatus(did: string, consumerAccount: Account, jobId?: string, txId?: string
|
|
43
|
+
computeStatus(did: string, consumerAccount: Account, jobId?: string, txId?: string): Promise<ComputeJob | ComputeJob[]>;
|
|
44
|
+
computeResult(jobId: string, index: number, destination: string, account: Account): Promise<any>;
|
|
39
45
|
getInitializeEndpoint(): ServiceEndpoint;
|
|
40
46
|
getNonceEndpoint(): ServiceEndpoint;
|
|
41
47
|
getEncryptEndpoint(): ServiceEndpoint;
|
|
@@ -44,6 +50,7 @@ export declare class Provider extends Instantiable {
|
|
|
44
50
|
getComputeStopEndpoint(): ServiceEndpoint;
|
|
45
51
|
getComputeStatusEndpoint(): ServiceEndpoint;
|
|
46
52
|
getComputeDeleteEndpoint(): ServiceEndpoint;
|
|
53
|
+
getComputeResultEndpoint(): ServiceEndpoint;
|
|
47
54
|
getDownloadEndpoint(): ServiceEndpoint;
|
|
48
55
|
isValidProvider(url: string): Promise<boolean>;
|
|
49
56
|
}
|
|
@@ -5,6 +5,10 @@ export interface ConfigHelperConfig extends Config {
|
|
|
5
5
|
subgraphUri: string;
|
|
6
6
|
explorerUri: string;
|
|
7
7
|
oceanTokenSymbol: string;
|
|
8
|
+
transactionBlockTimeout: number;
|
|
9
|
+
transactionConfirmationBlocks: number;
|
|
10
|
+
transactionPollingTimeout: number;
|
|
11
|
+
gasFeeMultiplier: number;
|
|
8
12
|
}
|
|
9
13
|
export declare const configHelperNetworks: ConfigHelperConfig[];
|
|
10
14
|
export declare class ConfigHelper {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Web3 from 'web3';
|
|
2
|
+
import { Contract } from 'web3-eth-contract';
|
|
3
|
+
import { ConfigHelperConfig } from './ConfigHelper';
|
|
4
|
+
export declare function getFairGasPrice(web3: Web3, config: ConfigHelperConfig): Promise<string>;
|
|
5
|
+
export declare function setContractDefaults(contract: Contract, config: ConfigHelperConfig): Contract;
|
|
@@ -4,6 +4,6 @@ export * from './ConversionTypeHelpers';
|
|
|
4
4
|
export * from './GeneratorHelpers';
|
|
5
5
|
export * from './SubscribablePromise';
|
|
6
6
|
export * from './SubscribableObserver';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './ContractUtils';
|
|
8
8
|
export * from './AssetResolverHelper';
|
|
9
9
|
export * from './Datatokens';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanprotocol/lib",
|
|
3
3
|
"source": "./src/index.ts",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.20.0",
|
|
5
5
|
"description": "JavaScript client library for Ocean Protocol",
|
|
6
6
|
"main": "./dist/node/lib.js",
|
|
7
7
|
"exports": "./dist/node/lib.js",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"node-abort-controller": "^2.0.0",
|
|
56
56
|
"save-file": "^2.3.1",
|
|
57
57
|
"uuid": "^8.3.2",
|
|
58
|
-
"web3": "^1.6.
|
|
58
|
+
"web3": "^1.6.1",
|
|
59
59
|
"web3-core": "^1.5.3",
|
|
60
60
|
"web3-eth-contract": "^1.5.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@truffle/hdwallet-provider": "^1.
|
|
63
|
+
"@truffle/hdwallet-provider": "^1.7.0",
|
|
64
64
|
"@types/chai": "^4.2.19",
|
|
65
65
|
"@types/chai-spies": "^1.0.3",
|
|
66
66
|
"@types/crypto-js": "^4.0.1",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"eslint-config-oceanprotocol": "^1.5.0",
|
|
78
78
|
"eslint-config-prettier": "^8.3.0",
|
|
79
79
|
"eslint-plugin-prettier": "^4.0.0",
|
|
80
|
-
"microbundle": "^0.14.
|
|
80
|
+
"microbundle": "^0.14.2",
|
|
81
81
|
"mocha": "^9.1.3",
|
|
82
|
-
"mock-local-storage": "^1.1.
|
|
82
|
+
"mock-local-storage": "^1.1.18",
|
|
83
83
|
"nyc": "^15.1.0",
|
|
84
84
|
"ora": "5.4.1",
|
|
85
85
|
"prettier": "^2.3.1",
|
|
86
|
-
"release-it": "^14.11.
|
|
86
|
+
"release-it": "^14.11.8",
|
|
87
87
|
"source-map-support": "^0.5.19",
|
|
88
88
|
"ts-node": "^10.4.0",
|
|
89
89
|
"ts-node-register": "^1.0.0",
|