Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent estimate if frontend provider is browser wallet #250

Open
darwintree opened this issue Jan 19, 2024 · 0 comments
Open

Prevent estimate if frontend provider is browser wallet #250

darwintree opened this issue Jan 19, 2024 · 0 comments

Comments

@darwintree
Copy link
Contributor

darwintree commented Jan 19, 2024

The following code might fail from the sdk auto-estimation

const hash = await xxxContract.doXXX(param1).sendTransaction({from: addr})

For example, if there is not enough balance for addr, an error will happen and developer needs to handle the error themselves.

However, this situation can be prevented if developr manually encode the transaction parameters and call the cfx_sendTransaction method rather than using the sdk provided method. In that case the browser wallet could handle the error and tell the user the problem is insufficient balance.

It is suggested to improve the implementation to reduce the work dapp developers need to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant