mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Fixing estSetAllowedSwapper
This commit is contained in:
parent
caf83190b6
commit
b9e89bb335
@ -197,6 +197,7 @@ export class FixedRateExchange {
|
||||
consumeMarketAddress,
|
||||
consumeMarketFeeFormatted
|
||||
)
|
||||
console.log('estGas', estGas)
|
||||
try {
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.buyDT(
|
||||
@ -294,6 +295,7 @@ export class FixedRateExchange {
|
||||
consumeMarketAddress,
|
||||
consumeMarketFeeFormatted
|
||||
)
|
||||
console.log('estGas', estGas)
|
||||
try {
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.sellDT(
|
||||
@ -371,6 +373,7 @@ export class FixedRateExchange {
|
||||
newRate: string
|
||||
): Promise<TransactionReceipt> {
|
||||
const estGas = await this.estSetRate(address, exchangeId, newRate)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.setRate(exchangeId, this.web3.utils.toWei(newRate))
|
||||
.send({
|
||||
@ -400,7 +403,7 @@ export class FixedRateExchange {
|
||||
let estGas
|
||||
try {
|
||||
estGas = await fixedRate.methods
|
||||
.setRate(exchangeId, newAllowedSwapper)
|
||||
.setAllowedSwapper(exchangeId, newAllowedSwapper)
|
||||
.estimateGas({ from: account }, (err, estGas) => (err ? gasLimitDefault : estGas))
|
||||
} catch (e) {
|
||||
estGas = gasLimitDefault
|
||||
@ -421,6 +424,7 @@ export class FixedRateExchange {
|
||||
newAllowedSwapper: string
|
||||
): Promise<TransactionReceipt> {
|
||||
const estGas = await this.estSetAllowedSwapper(address, exchangeId, newAllowedSwapper)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.setAllowedSwapper(exchangeId, newAllowedSwapper)
|
||||
.send({
|
||||
@ -471,6 +475,7 @@ export class FixedRateExchange {
|
||||
if (exchange.active === true) return null
|
||||
|
||||
const estGas = await this.estActivate(address, exchangeId)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.toggleExchangeState(exchangeId)
|
||||
.send({
|
||||
@ -521,6 +526,7 @@ export class FixedRateExchange {
|
||||
if (exchange.active === false) return null
|
||||
|
||||
const estGas = await this.estDeactivate(address, exchangeId)
|
||||
console.log('estGas', estGas)
|
||||
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.toggleExchangeState(exchangeId)
|
||||
@ -776,6 +782,7 @@ export class FixedRateExchange {
|
||||
if (exchange.withMint === true) return null
|
||||
|
||||
const estGas = await this.estActivateMint(address, exchangeId)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.toggleMintState(exchangeId, true)
|
||||
.send({
|
||||
@ -805,7 +812,9 @@ export class FixedRateExchange {
|
||||
estGas = await fixedRate.methods
|
||||
.toggleMintState(exchangeId)
|
||||
.estimateGas({ from: account }, (err, estGas) => (err ? gasLimitDefault : estGas))
|
||||
console.log('### estGas', estGas)
|
||||
} catch (e) {
|
||||
console.log('e', e)
|
||||
estGas = gasLimitDefault
|
||||
}
|
||||
return estGas
|
||||
@ -826,6 +835,7 @@ export class FixedRateExchange {
|
||||
if (exchange.withMint === false) return null
|
||||
|
||||
const estGas = await this.estDeactivate(address, exchangeId)
|
||||
console.log('estGas', estGas)
|
||||
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.toggleMintState(exchangeId, false)
|
||||
@ -889,6 +899,7 @@ export class FixedRateExchange {
|
||||
if (!exchange) return null
|
||||
|
||||
const estGas = await this.estCollectBT(address, exchangeId, amount)
|
||||
console.log('estGas', estGas)
|
||||
const fixedrate: FixedPriceExchange = await this.fixedRateContract.methods
|
||||
.getExchange(exchangeId)
|
||||
.call()
|
||||
@ -958,6 +969,7 @@ export class FixedRateExchange {
|
||||
if (!exchange) return null
|
||||
|
||||
const estGas = await this.estCollectDT(address, exchangeId, amount)
|
||||
console.log('estGas', estGas)
|
||||
const fixedrate: FixedPriceExchange = await this.fixedRateContract.methods
|
||||
.getExchange(exchangeId)
|
||||
.call()
|
||||
@ -1015,6 +1027,7 @@ export class FixedRateExchange {
|
||||
if (!exchange) return null
|
||||
|
||||
const estGas = await this.estCollectMarketFee(address, exchangeId)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.collectMarketFee(exchangeId)
|
||||
.send({
|
||||
@ -1064,6 +1077,7 @@ export class FixedRateExchange {
|
||||
if (!exchange) return null
|
||||
|
||||
const estGas = await this.estCollectOceanFee(address, exchangeId)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.collectOceanFee(exchangeId)
|
||||
.send({
|
||||
@ -1161,6 +1175,7 @@ export class FixedRateExchange {
|
||||
exchangeId,
|
||||
this.web3.utils.toWei(newMarketFee)
|
||||
)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.updateMarketFee(exchangeId, this.web3.utils.toWei(newMarketFee))
|
||||
.send({
|
||||
@ -1215,6 +1230,7 @@ export class FixedRateExchange {
|
||||
exchangeId,
|
||||
newMarketFeeCollector
|
||||
)
|
||||
console.log('estGas', estGas)
|
||||
const trxReceipt = await this.fixedRateContract.methods
|
||||
.updateMarketFeeCollector(exchangeId, newMarketFeeCollector)
|
||||
.send({
|
||||
|
Loading…
x
Reference in New Issue
Block a user