Skip to content

Commit 9303eca

Browse files
committed
fix: get tx feed
1 parent 621f755 commit 9303eca

File tree

2 files changed

+11
-29
lines changed

2 files changed

+11
-29
lines changed

wallets/rn_cli_wallet/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

wallets/rn_cli_wallet/src/utils/EIP155WalletUtil.ts

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff 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+
184166
export async function calculateGasLimit(tx: any, chainId: string) {
185167
const chainData = PresetsUtil.getChainData(parseChainId(chainId));
186168
const provider = new ethers.providers.JsonRpcProvider(chainData.rpcUrl);

0 commit comments

Comments
 (0)