WIP: remove ConnectionControllerClient and move behavior account behavior to ConnectionController
Description
Overview
This PR implements a significant architectural refactoring that moves account-related logic from AppKitBaseClient to ConnectionController and completely removes the connectionControllerClient abstraction layer. This change aligns with the AppKit stability improvements initiative and moves us closer to atomic state management.
🎯 Motivation
As outlined in the AppKit Refactor POC Findings & Recommendations, the current architecture has several issues: Circular Dependencies: Controllers have circular deps through client abstractions Tangled State: Multiple cross-controller dependencies make atomic updates impossible Blurry Boundaries: State responsibilities are unclear between controllers Proxy Pattern Anti-pattern: connectionControllerClient acts as unnecessary middleware
🔄 Changes Made
✅ Removed connectionControllerClient Completely
- Eliminated the client abstraction layer that was creating circular dependencies
- Direct controller-to-controller communication replaces client-mediated calls
- Simplified the call chain:
views → controllers → adapters(instead of views → controllers → client → adapters)
🏗️ Moved Account Logic to ConnectionController
The following methods were moved from AppKitBaseClient to ConnectionController:
Connection Management Methods:
- connectExternal() - External wallet connection logic
- reconnectExternal() - Reconnection handling
- disconnect() - Disconnection flows
- switchConnection() - Multi-wallet connection switching
Account Operations:
- syncAccount() - Account synchronization
- syncIdentity() - Identity/ENS resolution
- updateBalance() - Balance updates
Provider execution
- signMessage() - Message signing functionality
- sendTransaction() - Transaction sending
- estimateGas() - Gas estimation
- writeContract() - Smart contract interactions
- (new) request() - Generic RPC request. Removed specific namespace requests
Utility Methods:
- parseUnits() / formatUnits() - Unit conversion utilities
- getEnsAddress() / getEnsAvatar() - ENS resolution
- checkInstalled() - Wallet installation checks
Updated Adapter Integration
Adapters now call ConnectionController methods directly instead of through client
- Removed adapter dependency on connectionControllerClient
- Simplified adapter initialization and connection flows
Type of change
- [ ] Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Associated Issues
Closes APKT-3837
Checklist
- [ ] Code in this PR is covered by automated tests (Unit tests, E2E tests)
- [ ] My changes generate no new warnings
- [ ] I have reviewed my own code
- [ ] I have filled out all required sections
- [ ] I have tested my changes on the preview link
- [ ] Approver of this PR confirms that the changes are tested on the preview link
[!NOTE] Consolidates account and provider operations into ConnectionController, removes ConnectionControllerClient, and updates adapters, UI, tests, and examples to the new API.
- Core/AppKit:
- Migrate connection/account flows and provider ops (
connectExternal,reconnectExternal,disconnect,switchConnection,syncAccount,syncIdentity,updateBalance,signMessage,sendTransaction,estimateGas,writeContract,request) intoConnectionController.- Remove
ConnectionControllerClient; simplify call chain and updateAppKitBaseClient,appkit-core, and universal adapter client.- Adjust controller exports, types, and utils (balance/ENS/units) to route through
ConnectionController.- Adapters:
- Update
wagmi,ethers/ethers5,solana,bitcoin,polkadot,tonclients to callConnectionControllerdirectly; refresh tests and mocks.- UI/Scaffold:
- Update modal/views/widgets to consume new controller APIs (connect, networks, send/swap/receive flows).
- Controllers:
- Refactor
ChainController,SendController,SwapController,BlockchainApiControllerto align with new responsibilities and API surface.- Tests:
- Broad test updates across
appkit,controllers,adapters, andscaffold-ui; add/adjust cases for connection, balance, send/estimate, ENS, smart sessions.- Examples/Packages:
- Align example apps and package configs to new API surface; minor package.json updates across apps/examples/packages.
Written by Cursor Bugbot for commit f872b740b5a31938915e5526f7c9ff3d94ec44f3. This will update automatically on new commits. Configure here.
⚠️ No Changeset found
Latest commit: f872b740b5a31938915e5526f7c9ff3d94ec44f3
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| appkit-basic-html | Preview | Comment | Nov 14, 2025 4:14pm | |
| appkit-demo | Preview | Comment | Nov 14, 2025 4:14pm | |
| appkit-gallery | Preview | Comment | Nov 14, 2025 4:14pm | |
| appkit-headless-sample-app | Preview | Comment | Nov 14, 2025 4:14pm | |
| appkit-laboratory | Preview | Nov 14, 2025 4:14pm |
10 Skipped Deployments
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| appkit-basic-example | Nov 14, 2025 4:14pm | |||
| appkit-basic-sign-client-example | Nov 14, 2025 4:14pm | |||
| appkit-basic-up-example | Nov 14, 2025 4:14pm | |||
| appkit-ethers5-bera | Nov 14, 2025 4:14pm | |||
| appkit-nansen-demo | Nov 14, 2025 4:14pm | |||
| appkit-vue-solana | Nov 14, 2025 4:14pm | |||
| appkit-wagmi-cdn-example | Nov 14, 2025 4:14pm | |||
| ethereum-provider-wagmi-example | Nov 14, 2025 4:14pm | |||
| next-wagmi-solana-bitcoin-example | Nov 14, 2025 4:14pm | |||
| vue-wagmi-example | Nov 14, 2025 4:14pm |
| Warnings | |
|---|---|
| :warning: |
🔑 Potential UUID detected in packages/controllers/src/controllers/BlockchainApiController.ts (line 47): |
| :warning: |
🔑 Potential UUID detected in packages/controllers/src/controllers/BlockchainApiController.ts (line 47): |
| :warning: |
🔑 Potential UUID detected in packages/adapters/ethers/src/tests/client.test.ts (line 980): |
| :warning: |
🔑 Potential UUID detected in packages/adapters/wagmi/src/tests/client.test.ts (line 430): |
Generated by :no_entry_sign: dangerJS against f872b740b5a31938915e5526f7c9ff3d94ec44f3
📦 Bundle Size Check
✅ All bundles are within size limits
📊 View detailed bundle sizes
> @reown/[email protected] size /home/runner/work/appkit/appkit
> size-limit
@reown/appkit - Main Entry
Size limit: 80 kB
Size: 79.64 kB with all dependencies, minified and gzipped
Loading time: 1.6 s on slow 3G
Running time: 304 ms on Snapdragon 410
Total time: 1.9 s
@reown/appkit/react
Size limit: 230 kB
Size: 228.72 kB with all dependencies, minified and gzipped
Loading time: 4.5 s on slow 3G
Running time: 494 ms on Snapdragon 410
Total time: 5 s
@reown/appkit/vue
Size limit: 80 kB
Size: 79.64 kB with all dependencies, minified and gzipped
Loading time: 1.6 s on slow 3G
Running time: 208 ms on Snapdragon 410
Total time: 1.8 s
@reown/appkit-scaffold-ui
Size limit: 220 kB
Size: 209.63 kB with all dependencies, minified and gzipped
Loading time: 4.1 s on slow 3G
Running time: 383 ms on Snapdragon 410
Total time: 4.5 s
@reown/appkit-ui
Size limit: 500 kB
Size: 13.15 kB with all dependencies, minified and gzipped
Loading time: 257 ms on slow 3G
Running time: 39 ms on Snapdragon 410
Total time: 295 ms
Coverage Report
| Status | Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔵 | Lines | 79.56% | 37952 / 47697 |
| 🔵 | Statements | 79.56% | 37952 / 47697 |
| 🔵 | Functions | 77.98% | 4087 / 5241 |
| 🔵 | Branches | 86.45% | 9234 / 10681 |
File Coverage
Early found bugs up to this commit:
- Disconnect from default wallet button is disconnecting single namespace
- WC connections are being disconnected but ak state is not updating or non current namespace
Visual Regression Test Results ❌ Failed
⚠️ 1 visual change(s) detected
Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=431 Storybook Preview: https://6493191bf4b10fed8ca7353f-jxaehscdas.chromatic.com/
👉 Please review the visual changes in Chromatic and accept or reject them.
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
| Diff | Package | Supply Chain Security |
Vulnerability | Quality | Maintenance | License |
|---|---|---|---|---|---|---|
| @wagmi/vue@0.2.11 ⏵ 0.3.3 | ||||||
| @babel/runtime@7.28.3 ⏵ 7.28.4 | ||||||
| @reown/appkit-controllers@1.8.8 | ||||||
| @reown/appkit@1.8.8 | ||||||
| @reown/appkit-scaffold-ui@1.8.8 | ||||||
| @reown/appkit-testing@1.8.8 | ||||||
| @reown/appkit-ui@1.8.8 |