-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat/chain controller #2459
feat/chain controller #2459
Conversation
…ible for token list item
@@ -84,7 +84,8 @@ export class W3mUnsupportedChainView extends LitElement { | |||
} | |||
|
|||
private networksTemplate() { | |||
const { approvedCaipNetworkIds, requestedCaipNetworks } = NetworkController.state | |||
const requestedCaipNetworks = NetworkController.getRequestedCaipNetworks() | |||
const approvedCaipNetworkIds = NetworkController.state.approvedCaipNetworkIds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we use state here same as approvedCaipNetworkIds
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you see the getRequestedCaipNetworks()
function body, we have multi-chain related conditions. Unlike the approvedCaipNetworkIds
value, we need to get this value dynamically. Explained here: #2459 (comment)
Breaking Changes
With the multi-chain, we need to refactor current controllers and implement a new controller to manage multiple adapters in a single place. With multi-chain, users will be able to customize and use different adapters at a time. Since that feature will make breaking changes to our client packages and how we are initializing & using scaffold in clients. We need to make this transition as smooth as possible so new architecture should require minimum code change on the UI components and controllers
This PR introduces
ChainController
and necessary actions, new types, new values to our connector and network objects.ChainController
is responsible of storing account & network states and clients.Changes