mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fix getFairGasPrice
This commit is contained in:
parent
8b1842e1e9
commit
41881ac6eb
@ -69,6 +69,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.deployERC721Contract,
|
||||
nftData.name,
|
||||
nftData.symbol,
|
||||
@ -194,6 +195,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.add721TokenTemplate,
|
||||
templateAddress
|
||||
)
|
||||
@ -232,6 +234,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.disable721TokenTemplate,
|
||||
templateIndex
|
||||
)
|
||||
@ -272,6 +275,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.reactivate721TokenTemplate,
|
||||
templateIndex
|
||||
)
|
||||
@ -308,6 +312,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.addTokenTemplate,
|
||||
templateAddress
|
||||
)
|
||||
@ -350,6 +355,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.disableTokenTemplate,
|
||||
templateIndex
|
||||
)
|
||||
@ -393,6 +399,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.reactivateTokenTemplate,
|
||||
templateIndex
|
||||
)
|
||||
@ -432,6 +439,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.startMultipleTokenOrder,
|
||||
orders
|
||||
)
|
||||
@ -468,6 +476,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.createNftWithErc20,
|
||||
nftCreateData,
|
||||
ercCreateData
|
||||
@ -509,6 +518,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.createNftWithErc20WithPool,
|
||||
nftCreateData,
|
||||
ercCreateData,
|
||||
@ -551,6 +561,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.createNftWithErc20WithFixedRate,
|
||||
nftCreateData,
|
||||
ercCreateData,
|
||||
@ -595,6 +606,7 @@ export class NftFactory extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.createNftWithErc20WithDispenser,
|
||||
nftCreateData,
|
||||
ercCreateData,
|
||||
|
@ -59,6 +59,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.create,
|
||||
dtAddress,
|
||||
this.web3.utils.toWei(maxTokens),
|
||||
@ -98,6 +99,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.activate,
|
||||
dtAddress,
|
||||
this.web3.utils.toWei(maxTokens),
|
||||
@ -129,6 +131,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.deactivate,
|
||||
dtAddress
|
||||
)
|
||||
@ -160,6 +163,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.setAllowedSwapper,
|
||||
dtAddress,
|
||||
newAllowedSwapper
|
||||
@ -197,6 +201,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.dispense,
|
||||
dtAddress,
|
||||
this.web3.utils.toWei(amount),
|
||||
@ -228,6 +233,7 @@ export class Dispenser extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.ownerWithdraw,
|
||||
dtAddress
|
||||
)
|
||||
|
@ -70,6 +70,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.buyDT,
|
||||
exchangeId,
|
||||
dtAmountFormatted,
|
||||
@ -127,6 +128,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.sellDT,
|
||||
exchangeId,
|
||||
dtAmountFormatted,
|
||||
@ -173,6 +175,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.setRate,
|
||||
exchangeId,
|
||||
this.web3.utils.toWei(newRate)
|
||||
@ -206,6 +209,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.setAllowedSwapper,
|
||||
exchangeId,
|
||||
newAllowedSwapper
|
||||
@ -238,6 +242,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.toggleExchangeState,
|
||||
exchangeId
|
||||
)
|
||||
@ -270,6 +275,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.toggleExchangeState,
|
||||
exchangeId
|
||||
)
|
||||
@ -504,6 +510,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.toggleMintState,
|
||||
exchangeId,
|
||||
true
|
||||
@ -538,6 +545,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.toggleMintState,
|
||||
exchangeId,
|
||||
false
|
||||
@ -582,6 +590,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.collectBT,
|
||||
exchangeId,
|
||||
amountWei
|
||||
@ -626,6 +635,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.collectDT,
|
||||
exchangeId,
|
||||
amountWei
|
||||
@ -658,6 +668,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.collectMarketFee,
|
||||
exchangeId
|
||||
)
|
||||
@ -690,6 +701,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.collectOceanFee,
|
||||
exchangeId
|
||||
)
|
||||
@ -750,6 +762,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.updateMarketFee,
|
||||
exchangeId,
|
||||
this.web3.utils.toWei(newMarketFee)
|
||||
@ -783,6 +796,7 @@ export class FixedRateExchange extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.updateMarketFeeCollector,
|
||||
exchangeId,
|
||||
newMarketFeeCollector
|
||||
|
@ -35,6 +35,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.buyDTBatch,
|
||||
operations
|
||||
)
|
||||
@ -110,6 +111,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.addApprovedToken,
|
||||
tokenAddress
|
||||
)
|
||||
@ -143,6 +145,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.removeApprovedToken,
|
||||
tokenAddress
|
||||
)
|
||||
@ -175,6 +178,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.addSSContract,
|
||||
tokenAddress
|
||||
)
|
||||
@ -207,6 +211,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.removeSSContract,
|
||||
tokenAddress
|
||||
)
|
||||
@ -239,6 +244,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.addFixedRateContract,
|
||||
tokenAddress
|
||||
)
|
||||
@ -272,6 +278,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.removeFixedRateContract,
|
||||
tokenAddress
|
||||
)
|
||||
@ -305,6 +312,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.addDispenserContract,
|
||||
tokenAddress
|
||||
)
|
||||
@ -337,6 +345,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.removeDispenserContract,
|
||||
tokenAddress
|
||||
)
|
||||
@ -392,6 +401,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.updateOPCFee,
|
||||
newSwapOceanFee,
|
||||
newSwapNonOceanFee,
|
||||
@ -428,6 +438,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.addPoolTemplate,
|
||||
templateAddress
|
||||
)
|
||||
@ -461,6 +472,7 @@ export class Router extends SmartContractWithAddress {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
this.contract.methods.removePoolTemplate,
|
||||
templateAddress
|
||||
)
|
||||
|
@ -73,6 +73,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.approve,
|
||||
spender,
|
||||
this.web3.utils.toWei(amount)
|
||||
@ -128,6 +129,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.createFixedRate,
|
||||
fixedRateParams.fixedRateAddress,
|
||||
[
|
||||
@ -189,6 +191,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.createDispenser,
|
||||
dispenserAddress,
|
||||
dispenserParams.maxTokens,
|
||||
@ -275,6 +278,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.addMinter,
|
||||
minter
|
||||
)
|
||||
@ -314,6 +318,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.removeMinter,
|
||||
minter
|
||||
)
|
||||
@ -352,6 +357,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.addPaymentManager,
|
||||
paymentManager
|
||||
)
|
||||
@ -390,6 +396,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.removePaymentManager,
|
||||
paymentManager
|
||||
)
|
||||
@ -435,6 +442,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.setPaymentCollector,
|
||||
paymentCollector
|
||||
)
|
||||
@ -498,6 +506,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.transfer,
|
||||
toAddress,
|
||||
amount
|
||||
@ -546,6 +555,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.startOrder,
|
||||
consumer,
|
||||
serviceIndex,
|
||||
@ -585,6 +595,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.reuseOrder,
|
||||
orderTxId,
|
||||
providerFees
|
||||
@ -622,6 +633,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.buyFromFreAndOrder,
|
||||
orderParams,
|
||||
freContractParams
|
||||
@ -657,6 +669,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.buyFromDispenserAndOrder,
|
||||
orderParams,
|
||||
dispenserContract
|
||||
@ -691,6 +704,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.setData,
|
||||
value
|
||||
)
|
||||
@ -725,6 +739,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.cleanPermissions
|
||||
)
|
||||
|
||||
@ -834,6 +849,7 @@ export class Datatoken extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
dtContract.methods.setPublishingMarketFee,
|
||||
publishMarketFeeAddress,
|
||||
publishMarketFeeToken,
|
||||
|
@ -67,6 +67,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.createERC20,
|
||||
templateIndex,
|
||||
[name, symbol],
|
||||
@ -108,6 +109,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.addManager,
|
||||
manager
|
||||
)
|
||||
@ -145,6 +147,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.removeManager,
|
||||
manager
|
||||
)
|
||||
@ -183,6 +186,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.addToCreateERC20List,
|
||||
datatokenDeployer
|
||||
)
|
||||
@ -223,6 +227,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.removeFromCreateERC20List,
|
||||
datatokenDeployer
|
||||
)
|
||||
@ -260,6 +265,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.addToMetadataList,
|
||||
metadataUpdater
|
||||
)
|
||||
@ -300,6 +306,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.removeFromMetadataList,
|
||||
metadataUpdater
|
||||
)
|
||||
@ -336,6 +343,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.addTo725StoreList,
|
||||
storeUpdater
|
||||
)
|
||||
@ -377,6 +385,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.removeFrom725StoreList,
|
||||
storeUpdater
|
||||
)
|
||||
@ -414,6 +423,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.cleanPermissions
|
||||
)
|
||||
|
||||
@ -457,6 +467,7 @@ export class Nft extends SmartContract {
|
||||
nftOwner,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.transferFrom,
|
||||
nftOwner,
|
||||
nftReceiver,
|
||||
@ -503,6 +514,7 @@ export class Nft extends SmartContract {
|
||||
nftOwner,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.safeTransferFrom,
|
||||
nftOwner,
|
||||
nftReceiver,
|
||||
@ -553,6 +565,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.setMetaData,
|
||||
metadataState,
|
||||
metadataDecryptorUrl,
|
||||
@ -598,6 +611,7 @@ export class Nft extends SmartContract {
|
||||
metadataUpdater,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.setMetaDataAndTokenURI,
|
||||
sanitizedMetadataAndTokenURI
|
||||
)
|
||||
@ -635,6 +649,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.setMetaDataState,
|
||||
metadataState
|
||||
)
|
||||
@ -667,6 +682,7 @@ export class Nft extends SmartContract {
|
||||
address,
|
||||
estGas + 1,
|
||||
this.web3,
|
||||
this.config,
|
||||
nftContract.methods.setTokenURI,
|
||||
'1',
|
||||
data
|
||||
|
@ -109,6 +109,7 @@ export async function sendTx(
|
||||
from: string,
|
||||
estGas: any,
|
||||
web3: Web3,
|
||||
config: Config,
|
||||
functionToSend: Function,
|
||||
...args: any[]
|
||||
): Promise<any> {
|
||||
@ -128,7 +129,7 @@ export async function sendTx(
|
||||
.toString(10)
|
||||
} catch (err) {
|
||||
LoggerInstance.log('EIP 1559 not supported by network')
|
||||
sendTxValue.gasPrice = await this.getFairGasPrice()
|
||||
sendTxValue.gasPrice = await getFairGasPrice(web3, config)
|
||||
}
|
||||
|
||||
const trxReceipt = await functionToSend.apply(null, args).send(sendTxValue)
|
||||
|
Loading…
x
Reference in New Issue
Block a user