@oceanprotocol/lib 0.19.1 → 0.20.1

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 (34) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +1 -1
  3. package/dist/node/balancer/OceanPool.d.ts +2 -1
  4. package/dist/node/balancer/Pool.d.ts +2 -1
  5. package/dist/node/balancer/PoolFactory.d.ts +3 -1
  6. package/dist/node/datatokens/Datatokens.d.ts +3 -1
  7. package/dist/node/ddo/interfaces/Credentials.d.ts +1 -5
  8. package/dist/node/ddo/interfaces/Event.d.ts +7 -0
  9. package/dist/node/ddo/interfaces/index.d.ts +1 -0
  10. package/dist/node/dispenser/Dispenser.d.ts +3 -1
  11. package/dist/node/exchange/FixedRateExchange.d.ts +3 -1
  12. package/dist/node/lib.js +1 -1
  13. package/dist/node/lib.js.map +1 -1
  14. package/dist/node/lib.module.js +1 -1
  15. package/dist/node/lib.module.js.map +1 -1
  16. package/dist/node/lib.umd.js +1 -1
  17. package/dist/node/lib.umd.js.map +1 -1
  18. package/dist/node/metadatacache/MetadataCache.d.ts +1 -1
  19. package/dist/node/metadatacache/OnChainMetaData.d.ts +3 -1
  20. package/dist/node/models/Config.d.ts +2 -0
  21. package/dist/node/ocean/Assets.d.ts +4 -5
  22. package/dist/node/ocean/AssetsCredential.d.ts +5 -5
  23. package/dist/node/ocean/Compute.d.ts +4 -4
  24. package/dist/node/ocean/EventAccessControl.d.ts +9 -0
  25. package/dist/node/ocean/Ocean.d.ts +2 -0
  26. package/dist/node/ocean/interfaces/Compute.d.ts +9 -4
  27. package/dist/node/ocean/utils/WebServiceConnector.d.ts +2 -1
  28. package/dist/node/provider/Provider.d.ts +8 -1
  29. package/dist/node/utils/ConfigHelper.d.ts +4 -0
  30. package/dist/node/utils/ContractUtils.d.ts +5 -0
  31. package/dist/node/utils/index.d.ts +1 -1
  32. package/package.json +13 -13
  33. package/dist/node/utils/GasUtils.d.ts +0 -2
  34. package/docs/parameters.md +0 -63
package/CHANGELOG.md CHANGED
@@ -4,8 +4,66 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.20.1](https://github.com/oceanprotocol/ocean.js/compare/v0.20.0...v0.20.1)
8
+
9
+ - required only validation on user custom parameter [`#1146`](https://github.com/oceanprotocol/ocean.js/pull/1146)
10
+ - add configurable request timeout for HTTP request [`#1145`](https://github.com/oceanprotocol/ocean.js/pull/1145)
11
+
12
+ #### [v0.20.0](https://github.com/oceanprotocol/ocean.js/compare/v0.19.3...v0.20.0)
13
+
14
+ > 29 November 2021
15
+
16
+ - Bump @truffle/hdwallet-provider from 1.6.0 to 1.7.0 [`#1123`](https://github.com/oceanprotocol/ocean.js/pull/1123)
17
+ - Bump release-it from 14.11.7 to 14.11.8 [`#1124`](https://github.com/oceanprotocol/ocean.js/pull/1124)
18
+ - Bump mock-local-storage from 1.1.17 to 1.1.18 [`#1122`](https://github.com/oceanprotocol/ocean.js/pull/1122)
19
+ - configurable web3 params [`#1112`](https://github.com/oceanprotocol/ocean.js/pull/1112)
20
+ - add compute getResult [`#983`](https://github.com/oceanprotocol/ocean.js/pull/983)
21
+ - Bump web3 from 1.6.0 to 1.6.1 [`#1115`](https://github.com/oceanprotocol/ocean.js/pull/1115)
22
+ - Bump microbundle from 0.14.1 to 0.14.2 [`#1118`](https://github.com/oceanprotocol/ocean.js/pull/1118)
23
+ - Release 0.20.0 [`f79194f`](https://github.com/oceanprotocol/ocean.js/commit/f79194faf37e447c07963c1114f0481b0b18030b)
24
+
25
+ #### [v0.19.3](https://github.com/oceanprotocol/ocean.js/compare/v0.19.2...v0.19.3)
26
+
27
+ > 26 November 2021
28
+
29
+ - Feature/issue 1060 change credential type [`#1073`](https://github.com/oceanprotocol/ocean.js/pull/1073)
30
+ - Bump @truffle/hdwallet-provider from 1.5.1 to 1.6.0 [`#1103`](https://github.com/oceanprotocol/ocean.js/pull/1103)
31
+ - Bump @types/node from 16.11.4 to 16.11.7 [`#1108`](https://github.com/oceanprotocol/ocean.js/pull/1108)
32
+ - Bump release-it from 14.11.6 to 14.11.7 [`#1113`](https://github.com/oceanprotocol/ocean.js/pull/1113)
33
+ - Bump typedoc from 0.22.6 to 0.22.9 [`#1114`](https://github.com/oceanprotocol/ocean.js/pull/1114)
34
+ - Bump @types/node from 16.11.2 to 16.11.4 [`#1087`](https://github.com/oceanprotocol/ocean.js/pull/1087)
35
+ - Bump ts-node from 10.3.1 to 10.4.0 [`#1086`](https://github.com/oceanprotocol/ocean.js/pull/1086)
36
+ - Bump @types/node from 16.11.1 to 16.11.2 [`#1085`](https://github.com/oceanprotocol/ocean.js/pull/1085)
37
+ - Bump ts-node from 10.3.0 to 10.3.1 [`#1084`](https://github.com/oceanprotocol/ocean.js/pull/1084)
38
+ - Bump @types/node from 16.11.0 to 16.11.1 [`#1077`](https://github.com/oceanprotocol/ocean.js/pull/1077)
39
+ - Bump mocha from 9.1.2 to 9.1.3 [`#1078`](https://github.com/oceanprotocol/ocean.js/pull/1078)
40
+ - Bump typedoc from 0.22.5 to 0.22.6 [`#1079`](https://github.com/oceanprotocol/ocean.js/pull/1079)
41
+ - Bump @types/node from 16.10.4 to 16.11.0 [`#1074`](https://github.com/oceanprotocol/ocean.js/pull/1074)
42
+ - Bump microbundle from 0.14.0 to 0.14.1 [`#1075`](https://github.com/oceanprotocol/ocean.js/pull/1075)
43
+ - Bump @types/node from 16.10.3 to 16.10.4 [`#1071`](https://github.com/oceanprotocol/ocean.js/pull/1071)
44
+ - Bump typescript from 4.4.3 to 4.4.4 [`#1070`](https://github.com/oceanprotocol/ocean.js/pull/1070)
45
+ - Bump ts-node from 10.2.1 to 10.3.0 [`#1069`](https://github.com/oceanprotocol/ocean.js/pull/1069)
46
+ - Delete parameters.md [`#1063`](https://github.com/oceanprotocol/ocean.js/pull/1063)
47
+ - Bump @truffle/hdwallet-provider from 1.5.0 to 1.5.1 [`#1067`](https://github.com/oceanprotocol/ocean.js/pull/1067)
48
+ - Bump @types/node from 16.10.2 to 16.10.3 [`#1065`](https://github.com/oceanprotocol/ocean.js/pull/1065)
49
+ - Bump microbundle from 0.13.3 to 0.14.0 [`#1066`](https://github.com/oceanprotocol/ocean.js/pull/1066)
50
+ - Bump @typescript-eslint/eslint-plugin from 4.32.0 to 4.33.0 [`#1062`](https://github.com/oceanprotocol/ocean.js/pull/1062)
51
+ - Bump @typescript-eslint/parser from 4.32.0 to 4.33.0 [`#1061`](https://github.com/oceanprotocol/ocean.js/pull/1061)
52
+ - #1060 Event access control validation [`d7a21e7`](https://github.com/oceanprotocol/ocean.js/commit/d7a21e7e342e2094a864e1d1492324d5810f63db)
53
+ - Fix bug [`be79812`](https://github.com/oceanprotocol/ocean.js/commit/be798129f9cb007d603ce78632c75dcc18506796)
54
+ - Fix codeclimate [`bd4f663`](https://github.com/oceanprotocol/ocean.js/commit/bd4f663113597b9d23f44a56b57d5f1fb5ab3e7b)
55
+
56
+ #### [v0.19.2](https://github.com/oceanprotocol/ocean.js/compare/v0.19.1...v0.19.2)
57
+
58
+ > 4 October 2021
59
+
60
+ - Changing files name event.d.ts -> event.ts [`#1058`](https://github.com/oceanprotocol/ocean.js/pull/1058)
61
+ - Release 0.19.2 [`5af26f0`](https://github.com/oceanprotocol/ocean.js/commit/5af26f08e49c9eb357e2ae9cd8e39dc0b3182448)
62
+
7
63
  #### [v0.19.1](https://github.com/oceanprotocol/ocean.js/compare/v0.19.0...v0.19.1)
8
64
 
65
+ > 4 October 2021
66
+
9
67
  - bump contracts + add networks [`#1059`](https://github.com/oceanprotocol/ocean.js/pull/1059)
10
68
  - Bump typedoc from 0.21.9 to 0.22.5 [`#1056`](https://github.com/oceanprotocol/ocean.js/pull/1056)
11
69
  - Bump web3 from 1.5.3 to 1.6.0 [`#1052`](https://github.com/oceanprotocol/ocean.js/pull/1052)
@@ -14,6 +72,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
14
72
  - Bump @typescript-eslint/parser from 4.31.2 to 4.32.0 [`#1044`](https://github.com/oceanprotocol/ocean.js/pull/1044)
15
73
  - Bump @types/node from 16.9.6 to 16.10.1 [`#1043`](https://github.com/oceanprotocol/ocean.js/pull/1043)
16
74
  - Bump mocha from 9.1.1 to 9.1.2 [`#1042`](https://github.com/oceanprotocol/ocean.js/pull/1042)
75
+ - Release 0.19.1 [`606d5c2`](https://github.com/oceanprotocol/ocean.js/commit/606d5c2a0bbe36b1f7bb7b7b79796ef77d6170bb)
17
76
 
18
77
  #### [v0.19.0](https://github.com/oceanprotocol/ocean.js/compare/v0.18.0...v0.19.0)
19
78
 
package/README.md CHANGED
@@ -156,7 +156,7 @@ Running all tests requires running Ocean Protocol components beforehand with [Ba
156
156
  git clone https://github.com/oceanprotocol/barge
157
157
  cd barge
158
158
 
159
- ./start_ocean.sh --with-provider2 --no-dashboard
159
+ ./start_ocean.sh --with-provider2 --no-dashboard --with-rbac
160
160
  ```
161
161
 
162
162
  You can then proceed to run in another terminal.
@@ -3,6 +3,7 @@ import { AbiItem } from 'web3-utils/types';
3
3
  import { TransactionReceipt } from 'web3-core';
4
4
  import { Pool } from './Pool';
5
5
  import { SubscribablePromise, Logger } from '../utils';
6
+ import { ConfigHelperConfig } from '../utils/ConfigHelper';
6
7
  declare type PoolTransactionType = 'swap' | 'join' | 'exit';
7
8
  export interface PoolDetails {
8
9
  poolAddress: string;
@@ -40,7 +41,7 @@ export declare class OceanPool extends Pool {
40
41
  oceanAddress: string;
41
42
  dtAddress: string;
42
43
  startBlock: number;
43
- constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], poolABI?: AbiItem | AbiItem[], factoryAddress?: string, oceanAddress?: string, startBlock?: number);
44
+ constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], poolABI?: AbiItem | AbiItem[], factoryAddress?: string, oceanAddress?: string, config?: ConfigHelperConfig);
44
45
  create(account: string, dtAddress: string, dtAmount: string, dtWeight: string, oceanAmount: string, fee: string): SubscribablePromise<PoolCreateProgressStep, TransactionReceipt>;
45
46
  getDTAddress(poolAddress: string): Promise<string>;
46
47
  getOceanReserve(poolAddress: string): Promise<string>;
@@ -3,6 +3,7 @@ import { AbiItem } from 'web3-utils/types';
3
3
  import { TransactionReceipt } from 'web3-core';
4
4
  import { Logger } from '../utils';
5
5
  import { PoolFactory } from './PoolFactory';
6
+ import { ConfigHelperConfig } from '../utils/ConfigHelper';
6
7
  export interface TokensToAdd {
7
8
  address: string;
8
9
  amount: string;
@@ -10,7 +11,7 @@ export interface TokensToAdd {
10
11
  }
11
12
  export declare class Pool extends PoolFactory {
12
13
  poolABI: AbiItem | AbiItem[];
13
- constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], poolABI?: AbiItem | AbiItem[], factoryAddress?: string);
14
+ constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], poolABI?: AbiItem | AbiItem[], factoryAddress?: string, config?: ConfigHelperConfig);
14
15
  createPool(account: string): Promise<TransactionReceipt>;
15
16
  setup(account: string, poolAddress: string, dataToken: string, dataTokenAmount: string, dataTokenWeight: string, baseToken: string, baseTokenAmount: string, baseTokenWeight: string, swapFee: string): Promise<string>;
16
17
  allowance(tokenAdress: string, owner: string, spender: string): Promise<string>;
@@ -2,12 +2,14 @@ import Web3 from 'web3';
2
2
  import { AbiItem } from 'web3-utils/types';
3
3
  import { Logger } from '../utils';
4
4
  import { TransactionReceipt } from 'web3-core';
5
+ import { ConfigHelperConfig } from '../utils/ConfigHelper';
5
6
  export declare class PoolFactory {
6
7
  GASLIMIT_DEFAULT: number;
7
8
  web3: Web3;
8
9
  factoryABI: AbiItem | AbiItem[];
9
10
  factoryAddress: string;
10
11
  logger: Logger;
11
- constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], factoryAddress?: string);
12
+ config: ConfigHelperConfig;
13
+ constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], factoryAddress?: string, config?: ConfigHelperConfig);
12
14
  createPool(account: string): Promise<TransactionReceipt>;
13
15
  }
@@ -1,5 +1,6 @@
1
1
  import Web3 from 'web3';
2
2
  import { AbiItem } from 'web3-utils/types';
3
+ import { ConfigHelperConfig } from '../utils/ConfigHelper';
3
4
  import { Logger } from '../utils';
4
5
  import { TransactionReceipt } from 'web3-core';
5
6
  export declare class DataTokens {
@@ -10,7 +11,8 @@ export declare class DataTokens {
10
11
  web3: Web3;
11
12
  private logger;
12
13
  startBlock: number;
13
- constructor(factoryAddress: string, factoryABI: AbiItem | AbiItem[], datatokensABI: AbiItem | AbiItem[], web3: Web3, logger: Logger, startBlock?: number);
14
+ private config;
15
+ constructor(factoryAddress: string, factoryABI: AbiItem | AbiItem[], datatokensABI: AbiItem | AbiItem[], web3: Web3, logger: Logger, config?: ConfigHelperConfig);
14
16
  generateDtName(wordList?: {
15
17
  nouns: string[];
16
18
  adjectives: string[];
@@ -1,10 +1,6 @@
1
- export declare enum CredentialType {
2
- address = "address",
3
- credential3Box = "credential3Box"
4
- }
5
1
  export declare type CredentialAction = 'allow' | 'deny';
6
2
  export interface Credential {
7
- type: CredentialType;
3
+ type: string;
8
4
  values: string[];
9
5
  }
10
6
  export interface Credentials {
@@ -0,0 +1,7 @@
1
+ export interface Event {
2
+ blockNo: number;
3
+ contract: string;
4
+ from: string;
5
+ txid: string;
6
+ update: boolean;
7
+ }
@@ -4,6 +4,7 @@ export * from './BestPrice';
4
4
  export * from './Curation';
5
5
  export * from './EditableMetadata';
6
6
  export * from './EditableMetadataLinks';
7
+ export * from './Event';
7
8
  export * from './File';
8
9
  export * from './Metadata';
9
10
  export * from './MetadataAlgorithm';
@@ -4,6 +4,7 @@ import { AbiItem } from 'web3-utils/types';
4
4
  import Web3 from 'web3';
5
5
  import { SubscribablePromise, Logger } from '../utils';
6
6
  import { DataTokens } from '../datatokens/Datatokens';
7
+ import { ConfigHelperConfig } from '../utils/ConfigHelper';
7
8
  export interface DispenserToken {
8
9
  active: boolean;
9
10
  owner: string;
@@ -30,7 +31,8 @@ export declare class OceanDispenser {
30
31
  private logger;
31
32
  datatokens: DataTokens;
32
33
  startBlock: number;
33
- constructor(web3: Web3, logger: Logger, dispenserAddress: string, dispenserABI: AbiItem | AbiItem[], datatokens: DataTokens, startBlock?: number);
34
+ private config;
35
+ constructor(web3: Web3, logger: Logger, dispenserAddress: string, dispenserABI: AbiItem | AbiItem[], datatokens: DataTokens, config?: ConfigHelperConfig);
34
36
  status(dataTokenAddress: string): Promise<DispenserToken>;
35
37
  activate(dataToken: string, maxTokens: string, maxBalance: string, address: string): Promise<TransactionReceipt>;
36
38
  deactivate(dataToken: string, address: string): Promise<TransactionReceipt>;
@@ -4,6 +4,7 @@ import { AbiItem } from 'web3-utils/types';
4
4
  import Web3 from 'web3';
5
5
  import { SubscribablePromise, Logger } from '../utils';
6
6
  import { DataTokens } from '../datatokens/Datatokens';
7
+ import { ConfigHelperConfig } from '../utils/ConfigHelper';
7
8
  export interface FixedPriceExchange {
8
9
  exchangeID?: string;
9
10
  exchangeOwner: string;
@@ -33,7 +34,8 @@ export declare class OceanFixedRateExchange {
33
34
  private logger;
34
35
  datatokens: DataTokens;
35
36
  startBlock: number;
36
- constructor(web3: Web3, logger: Logger, fixedRateExchangeAddress: string, fixedRateExchangeABI: AbiItem | AbiItem[], oceanAddress: string, datatokens: DataTokens, startBlock?: number);
37
+ private config;
38
+ constructor(web3: Web3, logger: Logger, fixedRateExchangeAddress: string, fixedRateExchangeABI: AbiItem | AbiItem[], oceanAddress: string, datatokens: DataTokens, config?: ConfigHelperConfig);
37
39
  create(dataToken: string, rate: string, address: string, amount?: string): SubscribablePromise<FixedRateCreateProgressStep, TransactionReceipt>;
38
40
  createExchange(baseToken: string, dataToken: string, rate: string, address: string, amount?: string): SubscribablePromise<FixedRateCreateProgressStep, TransactionReceipt>;
39
41
  generateExchangeId(dataToken: string, owner: string): Promise<string>;