@oceanprotocol/lib 1.0.0-next.28 → 1.0.0-next.30

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.
@@ -59,11 +59,11 @@ export declare class FixedRateExchange {
59
59
  unitsToAmount(token: string, amount: string): Promise<string>;
60
60
  /**
61
61
  * Creates unique exchange identifier.
62
+ * @param {String} baseToken baseToken contract address
62
63
  * @param {String} datatoken Datatoken contract address
63
- * @param {String} owner Owner of the exchange
64
64
  * @return {Promise<string>} exchangeId
65
65
  */
66
- generateExchangeId(baseToken: string, datatoken: string, owner: string): Promise<string>;
66
+ generateExchangeId(baseToken: string, datatoken: string): Promise<string>;
67
67
  /**
68
68
  * Estimate gas cost for buyDT
69
69
  * @param {String} account
@@ -277,32 +277,36 @@ export declare class FixedRateExchange {
277
277
  * Estimate gas cost for collectBT
278
278
  * @param {String} account
279
279
  * @param {String} exchangeId ExchangeId
280
+ * @param {String} amount amount to be collected
280
281
  * @param {Contract} contractInstance optional contract instance
281
282
  * @return {Promise<number>}
282
283
  */
283
- estCollectBT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
284
+ estCollectBT(account: string, exchangeId: string, amount: string, contractInstance?: Contract): Promise<number>;
284
285
  /**
285
- * Collect BaseTokens in the contract (only exchange owner)
286
- * @param {String} exchangeId ExchangeId
286
+ * Collect BaseTokens in the contract (anyone can call this, funds are sent to erc20.paymentCollector)
287
287
  * @param {String} address User address
288
+ * @param {String} exchangeId ExchangeId
289
+ * @param {String} amount amount to be collected
288
290
  * @return {Promise<TransactionReceipt>} transaction receipt
289
291
  */
290
- collectBT(address: string, exchangeId: string): Promise<TransactionReceipt>;
292
+ collectBT(address: string, exchangeId: string, amount: string): Promise<TransactionReceipt>;
291
293
  /**
292
294
  * Estimate gas cost for collecDT
293
295
  * @param {String} account
294
296
  * @param {String} exchangeId ExchangeId
297
+ * @param {String} amount amount to be collected
295
298
  * @param {Contract} contractInstance optional contract instance
296
299
  * @return {Promise<number>}
297
300
  */
298
- estCollectDT(account: string, exchangeId: string, contractInstance?: Contract): Promise<number>;
301
+ estCollectDT(account: string, exchangeId: string, amount: string, contractInstance?: Contract): Promise<number>;
299
302
  /**
300
- * Collect datatokens in the contract (only exchange owner)
301
- * @param {String} exchangeId ExchangeId
303
+ * Collect datatokens in the contract (anyone can call this, funds are sent to erc20.paymentCollector)
302
304
  * @param {String} address User address
305
+ * @param {String} exchangeId ExchangeId
306
+ * @param {String} amount amount to be collected
303
307
  * @return {Promise<TransactionReceipt>} transaction receipt
304
308
  */
305
- collectDT(address: string, exchangeId: string): Promise<TransactionReceipt>;
309
+ collectDT(address: string, exchangeId: string, amount: string): Promise<TransactionReceipt>;
306
310
  /**
307
311
  * Estimate gas cost for collecMarketFee
308
312
  * @param {String} account
@@ -0,0 +1,4 @@
1
+ import Web3 from 'web3';
2
+ export declare const web3: Web3;
3
+ export declare const getTestConfig: (web3: Web3) => Promise<import("../src").Config>;
4
+ export declare const getAddresses: () => any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "1.0.0-next.28",
4
+ "version": "1.0.0-next.30",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "main": "./dist/lib.js",
7
7
  "umd:main": "dist/lib.umd.js",
@@ -57,7 +57,7 @@
57
57
  "web3": "^1.7.1"
58
58
  },
59
59
  "dependencies": {
60
- "@oceanprotocol/contracts": "1.0.0-alpha.22",
60
+ "@oceanprotocol/contracts": "1.0.0-alpha.26",
61
61
  "bignumber.js": "^9.0.2",
62
62
  "cross-fetch": "^3.1.5",
63
63
  "crypto-js": "^4.1.1",
@@ -72,7 +72,7 @@
72
72
  "@types/chai-spies": "^1.0.3",
73
73
  "@types/crypto-js": "^4.1.1",
74
74
  "@types/mocha": "^9.1.0",
75
- "@types/node": "^17.0.21",
75
+ "@types/node": "^17.0.23",
76
76
  "@types/node-fetch": "^3.0.3",
77
77
  "@typescript-eslint/eslint-plugin": "^4.33.0",
78
78
  "@typescript-eslint/parser": "^4.33.0",
@@ -90,13 +90,13 @@
90
90
  "mock-local-storage": "^1.1.20",
91
91
  "nyc": "^15.1.0",
92
92
  "ora": "5.4.1",
93
- "prettier": "^2.3.1",
94
- "release-it": "^14.12.5",
93
+ "prettier": "^2.6.0",
94
+ "release-it": "^14.13.1",
95
95
  "source-map-support": "^0.5.19",
96
96
  "ts-node": "^10.7.0",
97
97
  "ts-node-register": "^1.0.0",
98
98
  "typedoc": "0.22.13",
99
- "typescript": "^4.6.2"
99
+ "typescript": "^4.6.3"
100
100
  },
101
101
  "nyc": {
102
102
  "include": [
@@ -1,3 +0,0 @@
1
- import { Config } from '../../src/models/Config';
2
- declare const _default: Config;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import { Config } from '../../src/models/Config';
2
- declare const _default: Config;
3
- export default _default;