Skip to content

Commit

Permalink
fix issue when external apps request WC to estimate gas
Browse files Browse the repository at this point in the history
  • Loading branch information
santteegt committed Mar 27, 2024
1 parent 454a54f commit 1865e46
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libs/moloch-v3-fields/src/utils/walletConnectV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ const useWalletConnectV2 = (): useWalletConnectType => {
});
break;
}
case 'eth_estimateGas': {
// notice: we don't require to estimate gas for the individual contract call to build the proposal calldata
await web3wallet.respondSessionRequest({
topic,
response: {
id,
jsonrpc: '2.0',
result: '0x0', // notice: respond zero gas by default
},
});
break;
}
default: {
const errorMsg = 'Tx type not supported';
setError(errorMsg);
Expand Down

0 comments on commit 1865e46

Please sign in to comment.