File tree Expand file tree Collapse file tree 2 files changed +11
-29
lines changed
Expand file tree Collapse file tree 2 files changed +11
-29
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ android {
8989 applicationId " com.walletconnect.web3wallet.rnsample"
9090 minSdkVersion rootProject. ext. minSdkVersion
9191 targetSdkVersion rootProject. ext. targetSdkVersion
92- versionCode 50
92+ versionCode 51
9393 versionName " 1.0"
9494 resValue " string" , " build_config_package" , " com.walletconnect.web3wallet.rnsample"
9595 }
Original file line number Diff line number Diff line change @@ -151,36 +151,18 @@ const fetchGasPrice = async (chainId: string) => {
151151 const data = await result . json ( ) ;
152152 console . log ( 'fetchGasPrice:' , data ) ;
153153 return data ?. data ;
154-
155- // const result = {
156- // data: {
157- // fast: {
158- // estimated_seconds: 0,
159- // front_tx_count: 0,
160- // level: 'fast',
161- // price: 11006500,
162- // priority_price: 1200000,
163- // },
164- // normal: {
165- // estimated_seconds: 0,
166- // front_tx_count: 0,
167- // level: 'normal',
168- // price: 1200800,
169- // priority_price: 1100000,
170- // },
171- // slow: {
172- // estimated_seconds: 0,
173- // front_tx_count: 0,
174- // level: 'slow',
175- // price: 1000600,
176- // priority_price: 1000000,
177- // },
178- // },
179- // success: true,
180- // };
181- return result . data ;
182154} ;
183155
156+ export async function getTransactionGas ( tx : any , chainId : string ) {
157+ const chainData = PresetsUtil . getChainData ( parseChainId ( chainId ) ) ;
158+ const provider = new ethers . providers . JsonRpcProvider ( chainData . rpcUrl ) ;
159+ const feeData = await provider . getFeeData ( ) ;
160+ return {
161+ maxFeePerGas : feeData . maxFeePerGas ,
162+ maxPriorityFeePerGas : feeData . maxPriorityFeePerGas ,
163+ } ;
164+ }
165+
184166export async function calculateGasLimit ( tx : any , chainId : string ) {
185167 const chainData = PresetsUtil . getChainData ( parseChainId ( chainId ) ) ;
186168 const provider = new ethers . providers . JsonRpcProvider ( chainData . rpcUrl ) ;
You can’t perform that action at this time.
0 commit comments