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

more robust eth_signTypedData support #21

Conversation

dorothy-zbornak
Copy link
Contributor

@dorothy-zbornak dorothy-zbornak commented Jan 26, 2021

Depending on how you instantiate your providers (using provider engine or just a standardized provider), you can get inconsistent behavior when trying to perform an eth_signTypedData RPC call using MetaMask (+ probably other wallets). This attempts to make the behavior more consistent and more likely to succeed in different scenarios.

  • Add support for new/multiple/explicit versions eth_signTypedData_vX to MetaMaskSubprovider.
  • Remove Web3Wrapper.signedTypeDataV4Async()
  • Automatically backoff to decreasing versions of eth_signTypedData_vX in Web3Wrapper.signedTypeDataAsync().

This will break the protocol-utils package until it is updated to use Web3Wrapper.signedTypeDataAsync() (previously used Web3Wrapper.signedTypeDataAsync()).

Description

Testing instructions

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

…vider` and use the method name passed in

`@0x/web3-wrapper`: Remove `Web3Wrapper.signTypedDataV4Async()` and add backoff support for multiple versions of `eth_signTypedData` to `Web3Wrapper.signTypedDataAsync()`
Copy link
Contributor

@moodlezoup moodlezoup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay for robustness

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

Successfully merging this pull request may close these issues.

4 participants