Skip to content

feat: multi wallet controllers and storage#3955

Merged
0xmkh merged 17 commits intomainfrom
enes/apkt-1820-connect-multiple-wallets
May 8, 2025
Merged

feat: multi wallet controllers and storage#3955
0xmkh merged 17 commits intomainfrom
enes/apkt-1820-connect-multiple-wallets

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

@enesozturk enesozturk commented Mar 4, 2025

Description

Introduces early PoC for the Multi Wallet feature. In overall, this PR introduces changes on:

  • Controllers: Saves array of connections in ConnectionController, refactors ChainController to move switch network logics to call for certain logics while switching between accounts
  • AppKit/Core client: When established a connection, pushes a Connection object to the ConnectionController's connections array
  • UI: Subscribes to connections state and renders list of available accounts

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)
  • 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

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

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

@linear
Copy link
Copy Markdown

linear bot commented Mar 4, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 4, 2025

⚠️ No Changeset found

Latest commit: 7dd8730

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

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 1:09pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2025 1:09pm
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-basic-ep-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-basic-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-basic-up-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-ethers5-bera ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-nansen-demo ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-vue-solana ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview May 8, 2025 1:09pm
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm
vue-wagmi-example ⬜️ Ignored (Inspect) May 8, 2025 1:09pm

@enesozturk enesozturk changed the title feat: save and list multiple connections in wallets view and switch between them [WIP] feat: save and list multiple connections in wallets view and switch between them Mar 4, 2025
@enesozturk enesozturk changed the title [WIP] feat: save and list multiple connections in wallets view and switch between them [WIP] feat: multiple-wallets Mar 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2025

Warnings
⚠️ File packages/appkit/src/client/appkit-base-client.ts contains a KEY or SECRET
⚠️ File packages/common/src/utils/SafeLocalStorage.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ConnectionController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/utils/StorageUtil.ts contains a KEY or SECRET
⚠️ File packages/controllers/tests/utils/StorageUtil.test.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 7dd8730

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.01% 26435 / 34777
🔵 Statements 76.01% 26435 / 34777
🔵 Functions 67.56% 2237 / 3311
🔵 Branches 83.64% 5227 / 6249
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/adapters/ChainAdapterBlueprint.ts 90.98% 97.05% 76.47% 90.98% 142-143, 166-170, 176-179
packages/appkit/src/client/appkit-base-client.ts 75% 88.31% 77.15% 75% 163, 215-216, 218-219, 224-225, 303-304, 340-346, 380-381, 402-408, 411-412, 428-429, 462-466, 479-493, 518-524, 528-540, 543-545, 548-550, 553-555, 558-560, 563-569, 572-574, 577-583, 599-611, 617-650, 653-663, 715-716, 722, 733-747, 753, 757-764, 777-781, 822, 864-868, 874-875, 887, 910-915, 986, 990-991, 997, 1018-1019, 1029, 1031-1047, 1052, 1091-1092, 1105-1116, 1148-1155, 1201-1205, 1234-1237, 1241, 1257-1267, 1289-1300, 1329-1330, 1336-1362, 1525-1526, 1558-1559, 1562-1563, 1578-1581, 1584-1585, 1605-1606, 1609-1610, 1632-1633, 1647, 1655, 1658, 1662, 1667-1686, 1689-1698, 1713-1714, 1757-1760, 1763-1764, 1852-1853, 1856-1859, 1862-1863, 1866-1867, 1870-1871, 1874-1875, 1878-1882, 1891-1900, 1909-1920, 1296, 1669-1690
packages/common/src/utils/SafeLocalStorage.ts 96.36% 95.23% 100% 96.36% 60-61
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/src/controllers/ConnectionController.ts 85.64% 76.36% 50.79% 85.64% 127-131, 134-138, 172-173, 192, 200, 204, 212, 216, 220, 224, 228, 232, 259-260, 263-264, 299, 303, 314-315, 112-272
packages/controllers/src/utils/StorageUtil.ts 70.76% 73.04% 68.68% 70.76% 85-86, 104-107, 111-115, 123-124, 139-140, 149-152, 160-161, 170-173, 178-179, 186-189, 196-197, 204-207, 214-215, 222-225, 229-234, 241-242, 249-250, 261-264, 275-276, 287-288, 296-298, 300-301, 304-312, 315-319, 322-326, 334-335, 347-348, 351-367, 373-380, 392-393, 398-406, 423-424, 439-440, 449-450, 458, 460-461, 464-465, 479-480, 490-491, 505-506, 514, 517, 519-520, 523-524, 541-542, 552-553, 563-564, 573-574, 596-597, 609-612
Generated in workflow #11687 for commit 7dd8730 by the Vitest Coverage Report Action

@enesozturk enesozturk force-pushed the enes/apkt-1820-connect-multiple-wallets branch from d8059cc to 5253d72 Compare March 6, 2025 11:37
@enesozturk enesozturk changed the base branch from main to enes/apkt-2401-update-connected-connector-id-local-storage-value-calls March 6, 2025 12:39
Base automatically changed from enes/apkt-2401-update-connected-connector-id-local-storage-value-calls to main March 10, 2025 16:18
@0xmkh 0xmkh changed the title [WIP] feat: multiple-wallets feat: multi wallet controllers and storage May 7, 2025
Copy link
Copy Markdown
Collaborator

@tomiir tomiir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this relate to multi address on a single account?
What is a Connection (theoretically speaking).

Is there a diagram I could look at that would explain how a connection relates to an account, to a connector, etc?

@0xmkh 0xmkh added this pull request to the merge queue May 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 8, 2025
@0xmkh 0xmkh added this pull request to the merge queue May 8, 2025
Merged via the queue into main with commit b716922 May 8, 2025
38 checks passed
@0xmkh 0xmkh deleted the enes/apkt-1820-connect-multiple-wallets branch May 8, 2025 13:54
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.

4 participants