1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Update OceanPool.ts

This commit is contained in:
Alex Coseru 2020-10-05 23:22:51 +03:00 committed by GitHub
parent bca3202814
commit e1c7eeb6ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ export class OceanPool extends Pool {
* @param {String} token DataToken address
* @param {String} amount DataToken amount
* @param {String} weight DataToken weight
* @param {String} fee Swap fee (as float)
* @param {String} fee Swap fee. 0.1=10% fee(max allowed)
* @return {String}
*/
public async createDTPool(
@ -66,6 +66,10 @@ export class OceanPool extends Pool {
console.error('oceanAddress is not defined')
return null
}
if (parseFloat(fee) > 0.1) {
console.error('Swap fee to high')
return null
}
if (parseFloat(weight) > 9 || parseFloat(weight) < 1) {
console.error('Weight out of bounds (min 1, max9)')
return null