Skip to content

Fix provider type errors in NetworkController and its downstream packages #1823

@MajorLift

Description

@MajorLift

Explanation

Tasks

Provider type alignment

  • ProxyWithAccessibleTarget<SafeEventEmitterProvider> (@metamask/network-controller) vs. Provider (@metamask/eth-query)
 error TS2345: Argument of type 'ProxyWithAccessibleTarget<SafeEventEmitterProvider>' is not assignable to parameter of type 'Provider<JsonRpcParams, Json>'.
  Types of property 'sendAsync' are incompatible.
    Type '(req: JsonRpcRequest<JsonRpcParams>, callback: (error: unknown, providerRes?: any) => void) => void' is not assignable to type '<Params, Result>(payload: SendAsyncPayload<Params>, callback: ProviderSendAsyncCallback<Result>) => void'.
      Types of parameters 'req' and 'payload' are incompatible.
        Type 'SendAsyncPayload<Params>' is not assignable to type 'JsonRpcRequest<JsonRpcParams>'.
  • SafeEventEmitterProvider
  • ProviderProxy
  • FakeProvider

References

Metadata

Metadata

Labels

bugSomething isn't workingteam-wallet-frameworkDeprecated: Please use `team-core-platform` instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions