Skip to content

Upgrade @metamask/network-controller from v19 to v20 #391

@mcmire

Description

@mcmire

@metamask/network-controller 20.0.0 removed providerConfig from state, which means that we now need to use selectedNetworkClientId to access the chain ID for the currently selected network. Currently there is one instance of this in the constructor. Once we make that change, we no longer need to take provider, because we can get this from the network client object.

This is a prerequisite for upgrading to BaseController v2.

Acceptance Criteria

  • Constructor no longer takes onNetworkStateChange, but subscribes to NetworkController:stateChange instead, feeding selectedNetworkClientId to NetworkController:getNetworkClientById and accessing the chain ID through the network client.
  • Constructor no longer takes provider, but uses NetworkController:getNetworkClientById to access the provider from the current network client.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions