1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
mihaisc 2022-04-20 06:49:27 -07:00 committed by GitHub
parent f96ccb0c56
commit 548f31ced3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 254 additions and 1683 deletions

1931
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1019,7 +1019,7 @@ export class Pool {
)
let result = null
const maxSwap = await getMaxSwapExactOut(this, poolAddress, tokenInOutMarket.tokenIn)
const maxSwap = await getMaxSwapExactOut(this, poolAddress, tokenInOutMarket.tokenOut)
if (new Decimal(amountsInOutMaxFee.tokenAmountOut).greaterThan(maxSwap)) {
throw new Error(`tokenAmountOut is greater than ${maxSwap.toString()}`)
}
@ -1519,7 +1519,7 @@ export class Pool {
this.config
)
const maxSwap = await getMaxSwapExactOut(this, poolAddress, tokenIn)
const maxSwap = await getMaxSwapExactOut(this, poolAddress, tokenOut)
if (new Decimal(tokenAmountOut).greaterThan(maxSwap)) {
throw new Error(`tokenAmountOut is greater than ${maxSwap.toString()}`)

View File

@ -5,7 +5,7 @@ import { minAbi } from './minAbi'
import LoggerInstance from './Logger'
import { TransactionReceipt } from 'web3-core'
import Web3 from 'web3'
import { GASLIMIT_DEFAULT } from '.'
import { GASLIMIT_DEFAULT } from './Constants'
/**
* Estimate gas cost for approval function