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

add getDTMaxAddLiquidity and getOceanMaxAddLiquidity

This commit is contained in:
alexcos20 2020-10-12 04:07:13 -07:00
parent d2b770a982
commit f856ef7058

View File

@ -351,6 +351,23 @@ export class OceanPool extends Pool {
return this.calcSingleOutGivenPoolIn(poolAddress, this.oceanAddress, poolShares)
}
/**
* Returns max DT amount that you can add to the pool
* @param poolAddress
*/
public async getDTMaxAddLiquidity(poolAddress: string): Promise<string> {
const dtAddress = await this.getDTAddress(poolAddress)
return this.getMaxAddLiquidity(poolAddress, dtAddress)
}
/**
* Returns max Ocean amount that you can add to the pool
* @param poolAddress
*/
public async getOceanMaxAddLiquidity(poolAddress: string): Promise<string> {
return this.getMaxAddLiquidity(poolAddress, this.oceanAddress)
}
/**
* Returns max amount of tokens that you can add to the pool
* @param poolAddress