Skip to content

Prevent estimate if frontend provider is browser wallet #250

Open
@darwintree

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions