mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
use SmartContract.getFairGasPrice()
This commit is contained in:
parent
ef2e85f811
commit
43008ad619
@ -4,7 +4,6 @@ import { AbiItem } from 'web3-utils'
|
||||
import ERC721Factory from '@oceanprotocol/contracts/artifacts/contracts/ERC721Factory.sol/ERC721Factory.json'
|
||||
import {
|
||||
LoggerInstance,
|
||||
getFairGasPrice,
|
||||
generateDtName,
|
||||
getFreCreationParams,
|
||||
getErcCreationParams,
|
||||
@ -104,7 +103,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
let tokenAddress = null
|
||||
@ -245,7 +244,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -300,7 +299,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -356,7 +355,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -404,7 +403,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -458,7 +457,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -517,7 +516,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -565,7 +564,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.startMultipleTokenOrder(orders).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -622,7 +621,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -686,7 +685,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -749,7 +748,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -813,7 +812,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
|
@ -2,7 +2,7 @@ import { AbiItem } from 'web3-utils'
|
||||
import { TransactionReceipt } from 'web3-eth'
|
||||
import Decimal from 'decimal.js'
|
||||
import DispenserAbi from '@oceanprotocol/contracts/artifacts/contracts/pools/dispenser/Dispenser.sol/Dispenser.json'
|
||||
import { LoggerInstance, getFairGasPrice, estimateGas } from '../../utils/'
|
||||
import { LoggerInstance, estimateGas } from '../../utils/'
|
||||
import { Datatoken, SmartContractWithAddress } from '..'
|
||||
import { DispenserToken } from '../../@types'
|
||||
|
||||
@ -94,7 +94,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -154,7 +154,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -193,7 +193,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.deactivate(dtAddress).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -247,7 +247,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -308,7 +308,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -348,7 +348,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.ownerWithdraw(dtAddress).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
|
@ -2,7 +2,7 @@ import FixedRateExchangeAbi from '@oceanprotocol/contracts/artifacts/contracts/p
|
||||
import { TransactionReceipt } from 'web3-core'
|
||||
import { Contract } from 'web3-eth-contract'
|
||||
import { AbiItem } from 'web3-utils/types'
|
||||
import { LoggerInstance, getFairGasPrice, estimateGas, ZERO_ADDRESS } from '../../utils'
|
||||
import { LoggerInstance, estimateGas, ZERO_ADDRESS } from '../../utils'
|
||||
import { PriceAndFees, FeesInfo, FixedPriceExchange } from '../../@types'
|
||||
import { SmartContractWithAddress } from '..'
|
||||
|
||||
@ -108,7 +108,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -200,7 +200,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -267,7 +267,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -319,7 +319,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -362,7 +362,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -407,7 +407,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -656,7 +656,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -709,7 +709,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -775,7 +775,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.collectBT(exchangeId, amountWei).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -841,7 +841,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.collectDT(exchangeId, amountWei).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -884,7 +884,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.collectMarketFee(exchangeId).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -927,7 +927,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.collectOceanFee(exchangeId).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -1022,7 +1022,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -1074,7 +1074,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import Decimal from 'decimal.js'
|
||||
import BigNumber from 'bignumber.js'
|
||||
import Bpool from '@oceanprotocol/contracts/artifacts/contracts/pools/balancer/BPool.sol/BPool.json'
|
||||
import {
|
||||
getFairGasPrice,
|
||||
setContractDefaults,
|
||||
LoggerInstance,
|
||||
estimateGas,
|
||||
@ -104,7 +103,7 @@ export class Pool extends SmartContract {
|
||||
result = await pool.methods.setSwapFee(this.web3.utils.toWei(fee)).send({
|
||||
from: account,
|
||||
gas: estGas,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to set pool swap fee: ${e.message}`)
|
||||
@ -589,7 +588,7 @@ export class Pool extends SmartContract {
|
||||
result = await pool.methods.collectOPC().send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to swap exact amount in : ${e.message}`)
|
||||
@ -645,7 +644,7 @@ export class Pool extends SmartContract {
|
||||
result = await pool.methods.collectMarketFee().send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to swap exact amount in : ${e.message}`)
|
||||
@ -722,7 +721,7 @@ export class Pool extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to updatePublishMarketFee : ${e.message}`)
|
||||
@ -872,7 +871,7 @@ export class Pool extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to swap exact amount in : ${e.message}`)
|
||||
@ -1018,7 +1017,7 @@ export class Pool extends SmartContract {
|
||||
.send({
|
||||
from: account,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to swap exact amount out: ${e.message}`)
|
||||
@ -1108,7 +1107,7 @@ export class Pool extends SmartContract {
|
||||
.send({
|
||||
from: account,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to pay tokens in order to \
|
||||
@ -1202,7 +1201,7 @@ export class Pool extends SmartContract {
|
||||
.send({
|
||||
from: account,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error(`ERROR: Failed to pay pool shares into the pool: ${e.message}`)
|
||||
|
@ -2,7 +2,7 @@ import { Contract } from 'web3-eth-contract'
|
||||
import { TransactionReceipt } from 'web3-core'
|
||||
import { AbiItem } from 'web3-utils'
|
||||
import FactoryRouter from '@oceanprotocol/contracts/artifacts/contracts/pools/FactoryRouter.sol/FactoryRouter.json'
|
||||
import { getFairGasPrice, estimateGas } from '../../utils'
|
||||
import { estimateGas } from '../../utils'
|
||||
import { Operation } from '../../@types'
|
||||
import { SmartContractWithAddress } from '..'
|
||||
|
||||
@ -44,7 +44,7 @@ export class Router extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.buyDTBatch(operations).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -131,7 +131,7 @@ export class Router extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.addApprovedToken(tokenAddress).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -178,7 +178,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -218,7 +218,7 @@ export class Router extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.addSSContract(tokenAddress).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -261,7 +261,7 @@ export class Router extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.removeSSContract(tokenAddress).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -306,7 +306,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -355,7 +355,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -400,7 +400,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -449,7 +449,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -527,7 +527,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -570,7 +570,7 @@ export class Router extends SmartContractWithAddress {
|
||||
const trxReceipt = await this.contract.methods.addPoolTemplate(templateAddress).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -615,7 +615,7 @@ export class Router extends SmartContractWithAddress {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
|
@ -2,7 +2,7 @@ import { AbiItem } from 'web3-utils/types'
|
||||
import { TransactionReceipt } from 'web3-core'
|
||||
import { Contract } from 'web3-eth-contract'
|
||||
import SideStakingAbi from '@oceanprotocol/contracts/artifacts/contracts/pools/ssContracts/SideStaking.sol/SideStaking.json'
|
||||
import { LoggerInstance, getFairGasPrice, estimateGas } from '../../utils'
|
||||
import { LoggerInstance, estimateGas } from '../../utils'
|
||||
import { SmartContract } from '..'
|
||||
|
||||
export class SideStaking extends SmartContract {
|
||||
@ -280,7 +280,7 @@ export class SideStaking extends SmartContract {
|
||||
result = await sideStaking.methods.getVesting(datatokenAddress).send({
|
||||
from: account,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error('ERROR: Failed to join swap pool amount out')
|
||||
@ -347,7 +347,7 @@ export class SideStaking extends SmartContract {
|
||||
.send({
|
||||
from: account,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
} catch (e) {
|
||||
LoggerInstance.error('ERROR: Failed to join swap pool amount out')
|
||||
|
@ -7,7 +7,6 @@ import ERC20Template from '@oceanprotocol/contracts/artifacts/contracts/template
|
||||
import ERC20TemplateEnterprise from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20TemplateEnterprise.sol/ERC20TemplateEnterprise.json'
|
||||
import {
|
||||
LoggerInstance,
|
||||
getFairGasPrice,
|
||||
setContractDefaults,
|
||||
getFreOrderParams,
|
||||
estimateGas,
|
||||
@ -112,7 +111,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -253,7 +252,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -344,7 +343,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
@ -387,7 +386,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} else {
|
||||
@ -444,7 +443,7 @@ export class Datatoken extends SmartContract {
|
||||
const trxReceipt = await dtContract.methods.addMinter(minter).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -502,7 +501,7 @@ export class Datatoken extends SmartContract {
|
||||
const trxReceipt = await dtContract.methods.removeMinter(minter).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -561,7 +560,7 @@ export class Datatoken extends SmartContract {
|
||||
const trxReceipt = await dtContract.methods.addPaymentManager(paymentManager).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -622,7 +621,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -690,7 +689,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -779,7 +778,7 @@ export class Datatoken extends SmartContract {
|
||||
const trxReceipt = await dtContract.methods.transfer(toAddress, amount).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -864,7 +863,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -927,7 +926,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -991,7 +990,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -1053,7 +1052,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
} catch (e) {
|
||||
@ -1110,7 +1109,7 @@ export class Datatoken extends SmartContract {
|
||||
const trxReceipt = await dtContract.methods.setData(value).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -1159,7 +1158,7 @@ export class Datatoken extends SmartContract {
|
||||
const trxReceipt = await dtContract.methods.cleanPermissions().send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -1318,7 +1317,7 @@ export class Datatoken extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@ import { TransactionReceipt } from 'web3-eth'
|
||||
import ERC721Template from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC721Template.sol/ERC721Template.json'
|
||||
import {
|
||||
LoggerInstance,
|
||||
getFairGasPrice,
|
||||
generateDtName,
|
||||
setContractDefaults,
|
||||
estimateGas
|
||||
@ -127,7 +126,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
let tokenAddress = null
|
||||
@ -183,7 +182,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.addManager(manager).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -232,7 +231,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.removeManager(manager).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -292,7 +291,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -359,7 +358,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -417,7 +416,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.addToMetadataList(metadataUpdater).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -486,7 +485,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -544,7 +543,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.addTo725StoreList(storeUpdater).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -608,7 +607,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -662,7 +661,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.cleanPermissions().send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -737,7 +736,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: nftOwner,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -812,7 +811,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: nftOwner,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -908,7 +907,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -975,7 +974,7 @@ export class Nft extends SmartContract {
|
||||
.send({
|
||||
from: metadataUpdater,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -1037,7 +1036,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.setMetaDataState(metadataState).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
|
||||
return trxReceipt
|
||||
@ -1082,7 +1081,7 @@ export class Nft extends SmartContract {
|
||||
const trxReceipt = await nftContract.methods.setTokenURI('1', data).send({
|
||||
from: address,
|
||||
gas: estGas + 1,
|
||||
gasPrice: await getFairGasPrice(this.web3, this.config)
|
||||
gasPrice: await this.getFairGasPrice()
|
||||
})
|
||||
return trxReceipt
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user