@oceanprotocol/lib 1.0.0-next.18 → 1.0.0-next.21

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.
@@ -86,11 +86,15 @@ export interface Metadata {
86
86
  */
87
87
  links?: string[];
88
88
  /**
89
- * Mapping of URL strings for data samples, or links to find out more information.
90
- * Links may be to either a URL or another asset.
89
+ * Array of keywords or tags used to describe this content. Empty by default.
91
90
  * @type {string[]}
92
91
  */
93
92
  tags?: string[];
93
+ /**
94
+ * Array of categories associated to the asset. Note: recommended to use tags instead of this.
95
+ * @type {string[]}
96
+ */
97
+ categories?: string[];
94
98
  /**
95
99
  * The party holding the legal copyright. Empty by default.
96
100
  * @type {string}
@@ -19,7 +19,7 @@ export interface FreOrderParams {
19
19
  }
20
20
  export interface PriceAndFees {
21
21
  baseTokenAmount: string;
22
- baseTokenAmountBeforeFee: string;
23
22
  oceanFeeAmount: string;
24
23
  marketFeeAmount: string;
24
+ consumeMarketFeeAmount: string;
25
25
  }
@@ -82,6 +82,12 @@ export declare class Pool {
82
82
  * @return {String}
83
83
  */
84
84
  getDatatoken(poolAddress: string): Promise<string>;
85
+ /**
86
+ * Get getMarketFee
87
+ * @param {String} poolAddress
88
+ * @return {String}
89
+ */
90
+ getMarketFee(poolAddress: string): Promise<string>;
85
91
  /**
86
92
  * Get marketFeeCollector of this pool
87
93
  * @param {String} poolAddress
@@ -203,22 +209,24 @@ export declare class Pool {
203
209
  */
204
210
  collectMarketFee(address: string, poolAddress: string): Promise<TransactionReceipt>;
205
211
  /**
206
- * Estimate gas cost for updateMarketFeeCollector
212
+ * Estimate gas cost for updatePublishMarketFee
207
213
  * @param {String} address
208
214
  * @param {String} poolAddress
209
- * @param {String} newCollector new market fee collector address
215
+ * @param {String} newPublishMarketAddress new market address
216
+ * @param {String} newPublishMarketSwapFee new market swap fee
210
217
  * @param {Contract} contractInstance optional contract instance
211
218
  * @return {Promise<number>}
212
219
  */
213
- estUpdateMarketFeeCollector(address: string, poolAddress: string, newCollector: string, contractInstance?: Contract): Promise<number>;
220
+ estUpdatePublishMarketFee(address: string, poolAddress: string, newPublishMarketAddress: string, newPublishMarketSwapFee: string, contractInstance?: Contract): Promise<number>;
214
221
  /**
215
- * updateMarketFeeCollector - updates marketFeeCollector - can be called only by the marketFeeCollector
222
+ * updatePublishMarketFee - sets a new newPublishMarketAddress and new newPublishMarketSwapFee- can be called only by the marketFeeCollector
216
223
  * @param {String} address
217
224
  * @param {String} poolAddress
218
- * @param {String} newCollector new market fee collector address
225
+ * @param {String} newPublishMarketAddress new market fee collector address
226
+ * @param {String} newPublishMarketSwapFee fee recieved by the publisher market when a dt is swaped from a pool, percent
219
227
  * @return {TransactionReceipt}
220
228
  */
221
- updateMarketFeeCollector(address: string, poolAddress: string, newCollector: string): Promise<TransactionReceipt>;
229
+ updatePublishMarketFee(address: string, poolAddress: string, newPublishMarketAddress: string, newPublishMarketSwapFee: string): Promise<TransactionReceipt>;
222
230
  /**
223
231
  * Estimate gas cost for swapExactAmountIn
224
232
  * @param {String} address
@@ -69,37 +69,45 @@ export declare class FixedRateExchange {
69
69
  * @param {String} account
70
70
  * @param {String} dtAmount datatoken amount we want to buy
71
71
  * @param {String} datatokenAddress datatokenAddress
72
+ * @param {String} consumeMarketAddress consumeMarketAddress
73
+ * @param {String} consumeMarketFee fee recieved by the consume market when a dt is bought from a fixed rate exchange, percent
72
74
  * @param {Contract} contractInstance optional contract instance
73
75
  * @return {Promise<number>}
74
76
  */
75
- estBuyDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, contractInstance?: Contract): Promise<number>;
77
+ estBuyDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, consumeMarketAddress: string, consumeMarketFee: string, contractInstance?: Contract): Promise<number>;
76
78
  /**
77
79
  * Atomic swap
78
80
  * @param {String} exchangeId ExchangeId
79
81
  * @param {String} datatokenAmount Amount of datatokens
80
82
  * @param {String} maxBaseTokenAmount max amount of baseToken we want to pay for datatokenAmount
81
83
  * @param {String} address User address
84
+ * @param {String} consumeMarketAddress consumeMarketAddress
85
+ * @param {String} consumeMarketFee consumeMarketFee
82
86
  * @return {Promise<TransactionReceipt>} transaction receipt
83
87
  */
84
- buyDT(address: string, exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string): Promise<TransactionReceipt>;
88
+ buyDT(address: string, exchangeId: string, datatokenAmount: string, maxBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string): Promise<TransactionReceipt>;
85
89
  /**
86
90
  * Estimate gas cost for sellDT
87
91
  * @param {String} account
88
92
  * @param {String} dtAmount datatoken amount we want to sell
89
93
  * @param {String} datatokenAddress datatokenAddress
94
+ * @param {String} consumeMarketAddress consumeMarketAddress
95
+ * @param {String} consumeMarketFee consumeMarketFee
90
96
  * @param {Contract} contractInstance optional contract instance
91
97
  * @return {Promise<number>}
92
98
  */
93
- estSellDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, contractInstance?: Contract): Promise<number>;
99
+ estSellDT(account: string, datatokenAddress: string, dtAmount: string, maxBaseTokenAmount: string, consumeMarketAddress: string, consumeMarketFee: string, contractInstance?: Contract): Promise<number>;
94
100
  /**
95
101
  * Atomic swap
96
102
  * @param {String} exchangeId ExchangeId
97
103
  * @param {String} datatokenAmount Amount of datatokens
98
104
  * @param {String} minBaseTokenAmount min amount of baseToken we want to receive back
99
105
  * @param {String} address User address
106
+ * @param {String} consumeMarketAddress consumeMarketAddress
107
+ * @param {String} consumeMarketFee consumeMarketFee
100
108
  * @return {Promise<TransactionReceipt>} transaction receipt
101
109
  */
102
- sellDT(address: string, exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string): Promise<TransactionReceipt>;
110
+ sellDT(address: string, exchangeId: string, datatokenAmount: string, minBaseTokenAmount: string, consumeMarketAddress?: string, consumeMarketFee?: string): Promise<TransactionReceipt>;
103
111
  /**
104
112
  * Gets total number of exchanges
105
113
  * @param {String} exchangeId ExchangeId
@@ -199,16 +207,18 @@ export declare class FixedRateExchange {
199
207
  * calcBaseInGivenOutDT - Calculates how many base tokens are needed to get specified amount of datatokens
200
208
  * @param {String} exchangeId ExchangeId
201
209
  * @param {string} datatokenAmount Amount of datatokens user wants to buy
210
+ * @param {String} consumeMarketFee consumeMarketFee
202
211
  * @return {Promise<PriceAndFees>} how many base tokens are needed and fees
203
212
  */
204
- calcBaseInGivenOutDT(exchangeId: string, datatokenAmount: string): Promise<PriceAndFees>;
213
+ calcBaseInGivenOutDT(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<PriceAndFees>;
205
214
  /**
206
215
  * getBTOut - returns amount in baseToken that user will receive for datatokenAmount sold
207
216
  * @param {String} exchangeId ExchangeId
208
217
  * @param {Number} datatokenAmount Amount of datatokens
218
+ * @param {String} consumeMarketFee consumeMarketFee
209
219
  * @return {Promise<string>} Amount of baseTokens user will receive
210
220
  */
211
- getAmountBTOut(exchangeId: string, datatokenAmount: string): Promise<string>;
221
+ getAmountBTOut(exchangeId: string, datatokenAmount: string, consumeMarketFee?: string): Promise<string>;
212
222
  /**
213
223
  * Get exchange details
214
224
  * @param {String} exchangeId ExchangeId
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.18",
4
+ "version": "1.0.0-next.21",
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.0"
58
58
  },
59
59
  "dependencies": {
60
- "@oceanprotocol/contracts": "1.0.0-alpha.19",
60
+ "@oceanprotocol/contracts": "1.0.0-alpha.21",
61
61
  "bignumber.js": "^9.0.2",
62
62
  "cross-fetch": "^3.1.5",
63
63
  "crypto-js": "^4.1.1",
@@ -70,9 +70,9 @@
70
70
  "@truffle/hdwallet-provider": "^2.0.3",
71
71
  "@types/chai": "^4.2.19",
72
72
  "@types/chai-spies": "^1.0.3",
73
- "@types/crypto-js": "^4.1.0",
73
+ "@types/crypto-js": "^4.1.1",
74
74
  "@types/mocha": "^9.1.0",
75
- "@types/node": "^17.0.17",
75
+ "@types/node": "^17.0.18",
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",