Skip to content

Commit

Permalink
ALL-5214 - Fix XDC estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel committed Feb 26, 2024
1 parent 2eed221 commit 64a4eec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tatumio",
"version": "2.2.50",
"version": "2.2.51",
"license": "MIT",
"repository": "https://github.com/tatumio/tatum-js",
"scripts": {
Expand Down
15 changes: 14 additions & 1 deletion packages/blockchain/xdc/src/lib/services/xdc.web3.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import { evmBasedWeb3 } from '@tatumio/shared-blockchain-evm-based'
import Web3 from 'web3'
import { EvmBasedBlockchain } from '@tatumio/shared-core'
import BigNumber from 'bignumber.js'

export const xdcWeb3 = (args: { blockchain: EvmBasedBlockchain; client?: Web3 }) => {
return evmBasedWeb3(args)
const evmBasedWeb3Result = evmBasedWeb3(args)

return {
...evmBasedWeb3Result,
async getGasPriceInWei(): Promise<string> {
try {
const gasPriceInWei = await evmBasedWeb3Result.getGasPriceInWei()
return BigNumber(gasPriceInWei).times(2).toString()
} catch (e) {
return '20000000000'
}
},
}
}

0 comments on commit 64a4eec

Please sign in to comment.