BuidlGuidl / burnerwallet

https://burner.buidlguidl.com
MIT License
0 stars 1 forks source link

User friendly message when you try to sign a tx from a connected dapp (via WC) and you don't have enough ETH #49

Open Pabl0cks opened 1 month ago

Pabl0cks commented 1 month ago

Took me a while to realize that the reason of the errors while signing transactions was that I ran out of Sepolia ETH :)

Right now we are showing something like:

Example 1:

Missing or invalid parameters.
Double check you have provided the correct parameters.

URL: https://eth-sepolia.g.alchemy.com/v2/oKxs-03sij-U_N0iOlrSsZFr29-IqbuF
Request body: {"method":"eth_estimateGas","params":[{"from":"0x1dC580f680120c2A913C972d45AE7C5307669611","data":"0x7d789dee","maxFeePerGas":"0x1abe9f9055","maxPriorityFeePerGas":"0x3b9aca00","nonce":"0x40","to":"0xB663315d5CC527948070801aE3CeAAf9C85E9934","value":"0x71afd498d0000"}]}

Estimate Gas Arguments:
from: 0x1dC580f680120c2A913C972d45AE7C5307669611
to: 0xB663315d5CC527948070801aE3CeAAf9C85E9934
value: 0.002 SEP
data: 0x7d789dee
maxFeePerGas: 114.867277909 gwei
maxPriorityFeePerGas: 1 gwei
nonce: 64

Request Arguments:
from: 0x1dC580f680120c2A913C972d45AE7C5307669611
to: 0xB663315d5CC527948070801aE3CeAAf9C85E9934
value: 0.002 ETH

Example 2:

Missing or invalid parameters.
Double check you have provided the correct parameters.

URL: https://eth-sepolia.g.alchemy.com/v2/oKxs-03sij-U_N0iOlrSsZFr29-IqbuF
Request body: {"method":"eth_estimateGas","params":[{"from":"0x1dC580f680120c2A913C972d45AE7C5307669611","data":"0xbc8641b1","maxFeePerGas":"0x14e5f6b04d","maxPriorityFeePerGas":"0x3b9aca00","nonce":"0x41","to":"0xce679E53BF113058d44278F9CF8D772A72DF5eb9"}]}

Estimate Gas Arguments:
from: 0x1dC580f680120c2A913C972d45AE7C5307669611
to: 0xce679E53BF113058d44278F9CF8D772A72DF5eb9
data: 0xbc8641b1
maxFeePerGas: 89.757495373 gwei
maxPriorityFeePerGas: 1 gwei
nonce: 65

Request Arguments:
from: 0x1dC580f680120c2A913C972d45AE7C5307669611
to: 0xce679E53BF113058d44278F9CF8D772A72DF5eb9
data: 0xbc8641b1
bhavyagor12 commented 1 month ago

@Pabl0cks hey can i pick this one?

Pabl0cks commented 1 month ago

@Pabl0cks hey can i pick this one?

Sure @bhavyagor12! You can tackle it 🙌 WalletConnect feature is not merged yet, @damianmarti is working on #46 (I think will be merged soonish).

If you feel stuck or have any technical question, let us know!

bhavyagor12 commented 1 month ago

@Pabl0cks what I m trying to implement here is that I will Extract the details of the error from a regex expression And I will have a mapper that maps this detail to a user friendly msg like: "estimating gas costs failed" : " Not enough funds to cover the Gas"

The right side would be the user side msg and this would get displayed as a Notification

Pabl0cks commented 3 weeks ago

@Pabl0cks what I m trying to implement here is that I will Extract the details of the error from a regex expression And I will have a mapper that maps this detail to a user friendly msg like: "estimating gas costs failed" : " Not enough funds to cover the Gas"

The right side would be the user side msg and this would get displayed as a Notification

This sounds good! Right now we are showing this:

image

So I was thinking in either showing:

Burner Metamask
image image

Which one you guys prefer @bhavyagor12 @carletex ?