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

Replace Ethers with @metamask/eth-query #59

Draft
wants to merge 1 commit into
base: narrow-provider-type
Choose a base branch
from

Commits on Nov 22, 2023

  1. Replace Ethers with @metamask/eth-query

    It seems that a recent change to switch from `ethjs-query` to Ethers has
    caused a regression: when the network is switched, `this.web3` still
    points to the previous network. This happens because Web3Provider saves
    a copy of the `sendAsync` method on the given provider, so even if
    `nonce-tracker` is given a provider proxy, `this.web3` still has a
    reference to the `sendAsync` method from the previous provider object.
    
    This is a common problem with Ethers. Although Ethers has some nice
    features, we don't need to pull it in here, and we can use
    `@metamask/eth-query` (which provides TypeScript support, unlike
    `@metamask/ethjs-query`) instead. We do lose one feature of Ethers,
    which is that it automatically converts response data for requests to
    the appropriate types, but we can make use of `@metamask/utils` to help
    with this.
    mcmire committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    2a98649 View commit details
    Browse the repository at this point in the history