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

feat/chain controller #2459

Merged
merged 91 commits into from
Jun 28, 2024
Merged

feat/chain controller #2459

merged 91 commits into from
Jun 28, 2024

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Jun 24, 2024

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

  • feat: add chain controller

enesozturk and others added 30 commits May 29, 2024 16:05
@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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)

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.

3 participants