@oceanprotocol/lib 1.0.0-next.26 → 1.0.0-next.29
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 +24 -0
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/src/@types/Erc721.d.ts +1 -1
- package/dist/src/pools/Router.d.ts +8 -8
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +16 -12
- package/dist/src/utils/ContractUtils.d.ts +1 -1
- package/package.json +3 -3
|
@@ -35,10 +35,10 @@ export declare class Router {
|
|
|
35
35
|
* @return {Promise<TransactionReceipt>} Transaction receipt
|
|
36
36
|
*/
|
|
37
37
|
buyDTBatch(address: string, operations: Operation[]): Promise<TransactionReceipt>;
|
|
38
|
-
/** Check if a token is on
|
|
38
|
+
/** Check if a token is on approved tokens list, if true opfFee is lower in pools with that token/DT
|
|
39
39
|
* @return {Promise<boolean>} true if is on the list.
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
isApprovedToken(address: string): Promise<boolean>;
|
|
42
42
|
/** Check if an address is a side staking contract.
|
|
43
43
|
* @return {Promise<boolean>} true if is a SS contract
|
|
44
44
|
*/
|
|
@@ -60,35 +60,35 @@ export declare class Router {
|
|
|
60
60
|
*/
|
|
61
61
|
isPoolTemplate(address: string): Promise<boolean>;
|
|
62
62
|
/**
|
|
63
|
-
* Estimate gas cost for
|
|
63
|
+
* Estimate gas cost for addApprovedToken
|
|
64
64
|
* @param {String} address
|
|
65
65
|
* @param {String} tokenAddress token address we want to add
|
|
66
66
|
* @param {Contract} routerContract optional contract instance
|
|
67
67
|
* @return {Promise<any>}
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
estGasAddApprovedToken(address: string, tokenAddress: string, contractInstance?: Contract): Promise<any>;
|
|
70
70
|
/**
|
|
71
71
|
* Add a new token to oceanTokens list, pools with baseToken in this list have NO opf Fee
|
|
72
72
|
* @param {String} address caller address
|
|
73
73
|
* @param {String} tokenAddress token address to add
|
|
74
74
|
* @return {Promise<TransactionReceipt>}
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
addApprovedToken(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
77
77
|
/**
|
|
78
|
-
* Estimate gas cost for
|
|
78
|
+
* Estimate gas cost for removeApprovedToken
|
|
79
79
|
* @param {String} address caller address
|
|
80
80
|
* @param {String} tokenAddress token address we want to add
|
|
81
81
|
* @param {Contract} routerContract optional contract instance
|
|
82
82
|
* @return {Promise<any>}
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
estGasRemoveApprovedToken(address: string, tokenAddress: string, contractInstance?: Contract): Promise<any>;
|
|
85
85
|
/**
|
|
86
86
|
* Remove a token from oceanTokens list, pools without baseToken in this list have a opf Fee
|
|
87
87
|
* @param {String} address
|
|
88
88
|
* @param {String} tokenAddress address to remove
|
|
89
89
|
* @return {Promise<TransactionReceipt>}
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
removeApprovedToken(address: string, tokenAddress: string): Promise<TransactionReceipt>;
|
|
92
92
|
/**
|
|
93
93
|
* Estimate gas cost for addSSContract method
|
|
94
94
|
* @param {String} address
|
|
@@ -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
|
|
66
|
+
generateExchangeId(baseToken: string, datatoken: string): Promise<string>;
|
|
67
67
|
/**
|
|
68
68
|
* Estimate gas cost for buyDT
|
|
69
69
|
* @param {String} account
|
|
@@ -119,7 +119,7 @@ export declare class FixedRateExchange {
|
|
|
119
119
|
* Estimate gas cost for setRate
|
|
120
120
|
* @param {String} account
|
|
121
121
|
* @param {String} exchangeId ExchangeId
|
|
122
|
-
* @param {
|
|
122
|
+
* @param {String} newRate New rate
|
|
123
123
|
* @param {Contract} contractInstance optional contract instance
|
|
124
124
|
* @return {Promise<number>}
|
|
125
125
|
*/
|
|
@@ -127,7 +127,7 @@ export declare class FixedRateExchange {
|
|
|
127
127
|
/**
|
|
128
128
|
* Set new rate
|
|
129
129
|
* @param {String} exchangeId ExchangeId
|
|
130
|
-
* @param {
|
|
130
|
+
* @param {String} newRate New rate
|
|
131
131
|
* @param {String} address User account
|
|
132
132
|
* @return {Promise<TransactionReceipt>} transaction receipt
|
|
133
133
|
*/
|
|
@@ -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 (
|
|
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 (
|
|
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
|
|
@@ -7,6 +7,6 @@ export declare function getFairGasPrice(web3: Web3, config: Config): Promise<str
|
|
|
7
7
|
export declare function getErcCreationParams(ercParams: Erc20CreateParams): any;
|
|
8
8
|
export declare function getFreOrderParams(freParams: FreOrderParams): any;
|
|
9
9
|
export declare function getFreCreationParams(freParams: FreCreationParams): any;
|
|
10
|
-
export declare function getPoolCreationParams(poolParams: PoolCreationParams): any
|
|
10
|
+
export declare function getPoolCreationParams(web3: Web3, poolParams: PoolCreationParams): Promise<any>;
|
|
11
11
|
export declare function unitsToAmount(web3: Web3, token: string, amount: string): Promise<string>;
|
|
12
12
|
export declare function amountToUnits(web3: Web3, token: string, amount: string): Promise<string>;
|
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.
|
|
4
|
+
"version": "1.0.0-next.29",
|
|
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.
|
|
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",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"eslint-plugin-prettier": "^4.0.0",
|
|
87
87
|
"fs": "0.0.1-security",
|
|
88
88
|
"microbundle": "^0.14.2",
|
|
89
|
-
"mocha": "^9.2.
|
|
89
|
+
"mocha": "^9.2.2",
|
|
90
90
|
"mock-local-storage": "^1.1.20",
|
|
91
91
|
"nyc": "^15.1.0",
|
|
92
92
|
"ora": "5.4.1",
|