mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fix args names
This commit is contained in:
parent
1b90c92d08
commit
6960390720
@ -67,18 +67,18 @@ export class OceanPool extends Pool {
|
|||||||
/**
|
/**
|
||||||
* Create DataToken pool
|
* Create DataToken pool
|
||||||
@param {String} account
|
@param {String} account
|
||||||
* @param {String} token DataToken address
|
* @param {String} dtAddress DataToken address
|
||||||
* @param {String} amount DataToken amount
|
* @param {String} dtAmount DataToken amount
|
||||||
* @param {String} weight DataToken weight
|
* @param {String} dtWeight DataToken weight
|
||||||
* @param {String} oceanAmount Ocean amount
|
* @param {String} oceanAmount Ocean amount
|
||||||
* @param {String} fee Swap fee. E.g. to get a 0.1% swapFee use `0.001`. The maximum allowed swapFee is `0.1` (10%).
|
* @param {String} fee Swap fee. E.g. to get a 0.1% swapFee use `0.001`. The maximum allowed swapFee is `0.1` (10%).
|
||||||
* @return {String}
|
* @return {String}
|
||||||
*/
|
*/
|
||||||
public create(
|
public create(
|
||||||
account: string,
|
account: string,
|
||||||
token: string,
|
dtAddress: string,
|
||||||
amount: string,
|
dtAmount: string,
|
||||||
weight: string,
|
dtWeight: string,
|
||||||
oceanAmount: string,
|
oceanAmount: string,
|
||||||
fee: string
|
fee: string
|
||||||
): SubscribablePromise<PoolCreateProgressStep, TransactionReceipt> {
|
): SubscribablePromise<PoolCreateProgressStep, TransactionReceipt> {
|
||||||
@ -90,7 +90,7 @@ export class OceanPool extends Pool {
|
|||||||
this.logger.error('ERROR: Swap fee too high. The maximum allowed swapFee is 10%')
|
this.logger.error('ERROR: Swap fee too high. The maximum allowed swapFee is 10%')
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
if (parseFloat(weight) > 9 || parseFloat(weight) < 1) {
|
if (parseFloat(dtWeight) > 9 || parseFloat(dtWeight) < 1) {
|
||||||
this.logger.error('ERROR: Weight out of bounds (min 1, max9)')
|
this.logger.error('ERROR: Weight out of bounds (min 1, max9)')
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@ -102,15 +102,15 @@ export class OceanPool extends Pool {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const address = createTxid.events.BPoolRegistered.returnValues[0]
|
const address = createTxid.events.BPoolRegistered.returnValues[0]
|
||||||
const oceanWeight = 10 - parseFloat(weight)
|
const oceanWeight = 10 - parseFloat(dtWeight)
|
||||||
this.dtAddress = token
|
this.dtAddress = dtAddress
|
||||||
observer.next(PoolCreateProgressStep.ApprovingDatatoken)
|
observer.next(PoolCreateProgressStep.ApprovingDatatoken)
|
||||||
let txid
|
let txid
|
||||||
txid = await this.approve(
|
txid = await this.approve(
|
||||||
account,
|
account,
|
||||||
token,
|
dtAddress,
|
||||||
address,
|
address,
|
||||||
this.web3.utils.toWei(String(amount))
|
this.web3.utils.toWei(String(dtAmount))
|
||||||
)
|
)
|
||||||
if (!txid) {
|
if (!txid) {
|
||||||
this.logger.error('ERROR: Failed to call approve DT token')
|
this.logger.error('ERROR: Failed to call approve DT token')
|
||||||
@ -131,9 +131,9 @@ export class OceanPool extends Pool {
|
|||||||
txid = await super.setup(
|
txid = await super.setup(
|
||||||
account,
|
account,
|
||||||
address,
|
address,
|
||||||
token,
|
dtAddress,
|
||||||
this.web3.utils.toWei(String(amount)),
|
this.web3.utils.toWei(String(dtAmount)),
|
||||||
this.web3.utils.toWei(String(weight)),
|
this.web3.utils.toWei(String(dtWeight)),
|
||||||
this.oceanAddress,
|
this.oceanAddress,
|
||||||
this.web3.utils.toWei(String(oceanAmount)),
|
this.web3.utils.toWei(String(oceanAmount)),
|
||||||
this.web3.utils.toWei(String(oceanWeight)),
|
this.web3.utils.toWei(String(oceanWeight)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user