Skip to content

refactor: update preferred account type reading#4557

Merged
tomiir merged 6 commits intomainfrom
enes/apkt-3108-default-account-type-is-not-working
Jun 24, 2025
Merged

refactor: update preferred account type reading#4557
tomiir merged 6 commits intomainfrom
enes/apkt-3108-default-account-type-is-not-working

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

@enesozturk enesozturk commented Jun 24, 2025

Description

There couple of problems:

  • We are reading AccountController.state.preferredAccountType value in Wagmi adapter's AuthConnector which is getting undefined value even though we use defaultAccountTypes property.
  • Also we are setting user's defaultAccountTypes object to account state of each namespace which is unnecessary. Refactors that state to each namespace on ChainController to have their own singe preferredAccountType values.

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

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 24, 2025

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

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

@linear
Copy link
Copy Markdown

linear bot commented Jun 24, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jun 24, 2025

⚠️ No Changeset found

Latest commit: f50c25e

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 24, 2025

Warnings
⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 92): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 92): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 243): 0xeeeeeeeeeeeeeeeeee...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 243): 0xeeeeeeeeeeeeeeeeee...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 92): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/controllers/tests/controllers/ChainController.test.ts (line 253): So111111111111111111...

⚠️

🔑 Potential UUID detected in packages/adapters/ethers/src/tests/client.test.ts (line 916): ba0ba0cd-17c6-4806-a...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 74): 5eykt4UsFv8P8NJdTREp...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 110): AKhoybLLJS1deDJDyjEL...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 125): 48ckoQL1HhH5aqU1ifKq...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 110): AKhoybLLJS1deDJDyjEL...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 110): AKhoybLLJS1deDJDyjEL...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 110): AKhoybLLJS1deDJDyjEL...

⚠️

🔑 Potential High‑entropy string detected in packages/adapters/solana/src/tests/AuthProvider.test.ts (line 125): 48ckoQL1HhH5aqU1ifKq...

⚠️

🔑 Potential High‑entropy string detected in packages/scaffold-ui/test/views/w3m-wallet-receive-view.test.ts (line 42): 0x123456789abcdef123...

⚠️

🔑 Potential UUID detected in packages/adapters/wagmi/src/tests/client.test.ts (line 403): 07ba87ed-43aa-4adf-4...

Generated by 🚫 dangerJS against f50c25e

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 24, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.74% 30522 / 39260
🔵 Statements 77.74% 30522 / 39260
🔵 Functions 68.56% 2519 / 3674
🔵 Branches 84.39% 6320 / 7489
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/ethers/src/client.ts 62.17% 70.68% 65.71% 62.17% 50-51, 54-55, 62-64, 86-87, 101-104, 146-147, 178-179, 193-216, 229-265, 271-272, 279-296, 368-390, 393-398, 410-411, 421-442, 447-448, 470, 497-498, 507-508, 538-548, 551-597, 604-605, 627, 656-657, 668-669, 700-701, 705, 732-737, 746-764, 770-771, 775-780, 789-790, 801-802, 808-820
packages/adapters/ethers5/src/client.ts 52.93% 69.14% 57.14% 52.93% 47-133, 149-150, 181-182, 196-219, 232-268, 274-275, 282-299, 371-393, 396-401, 413-414, 424-445, 450-451, 473, 500-501, 510-511, 541-587, 590-600, 607-608, 630, 659-660, 672-673, 706-707, 711, 730-744, 752-770, 776-777, 781-786, 795-796, 807-808, 814-826
packages/adapters/solana/src/providers/AuthProvider.ts 72.51% 76.47% 69.23% 72.51% 49-54, 68-69, 83-84, 130-138, 153-154, 167-173, 176-187
packages/adapters/wagmi/src/connectors/AuthConnector.ts 6.62% 100% 25% 6.62% 53-54, 57-78, 81-126, 129-263
packages/appkit/src/adapters/ChainAdapterBlueprint.ts 77.28% 91.66% 78.12% 77.28% 222-223, 227-228, 251-255, 261-264, 490-517, 545-550, 577-578, 591-619, 628-629, 528
packages/appkit/src/client/appkit-base-client.ts 74.35% 89.55% 75.46% 74.35% 179, 190-193, 206-232, 264-265, 267-268, 273-274, 352-353, 389-395, 456-457, 486-492, 495-496, 514-515, 564-565, 571-575, 608-612, 625-639, 664-670, 674-686, 689-691, 694-696, 699-701, 704-706, 709-715, 718-720, 723-729, 745-757, 763-796, 799-809, 861-862, 868, 879-895, 915, 919-926, 988-989, 1000, 1006-1008, 1021-1030, 1065-1066, 1079, 1102-1107, 1150, 1171-1172, 1182, 1184-1200, 1205, 1258-1269, 1311-1319, 1364, 1370-1374, 1407-1410, 1445-1464, 1487-1498, 1527-1528, 1534-1560, 1768-1769, 1801-1802, 1805-1806, 1819-1822, 1825-1826, 1846-1847, 1850-1851, 1863-1873, 1890-1896, 1900-1901, 1915, 1923, 1926, 1930, 1935-1954, 1957-1966, 1973-1974, 1988-1989, 1992-1993, 2000-2001, 2040-2041, 2124-2125, 2128-2129, 2132-2135, 2138-2139, 2142-2143, 2146-2147, 2150-2151, 2154-2158, 2167-2176, 2185-223, 1028, 1494, 1937-1958
packages/appkit/src/client/appkit.ts 48.7% 79.31% 82.6% 48.7% 68-102, 105-119, 122-129, 132-148, 151-158, 163-170, 179-180, 187-188, 216-239, 247-259, 261, 263-282, 284-298, 323-329, 332, 363-364, 369-370, 385-465, 502-506, 528-529, 552-554, 562-563, 602-603
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/exports/react.ts 92.73% 92.1% 77.77% 92.73% 68-76, 83-85, 108
packages/controllers/exports/vue.ts 94.5% 93.54% 60% 94.5% 132-133, 205, 210, 215, 229, 292-295, 331-334, 358, 363, 377
packages/controllers/src/controllers/AccountController.ts 91.35% 95.08% 72.34% 91.35% 59-60, 67-71, 154, 166, 216-219, 79, 184, 198-218
packages/controllers/src/controllers/ChainController.ts 79.46% 87.11% 74.72% 79.46% 186-197, 201-219, 223-233, 237-259, 281-282, 303-304, 345-346, 395-402, 406-419, 442-443, 459-460, 463-464, 473-474, 479-480, 496-497, 515-516, 557-560, 568-569, 607-613, 626-627, 661-662, 714, 740-741, 769-770, 780-781, 102, 204, 738
packages/controllers/src/controllers/ConnectionController.ts 80.56% 80.85% 52.87% 80.56% 158, 211-215, 218-222, 247-251, 260-279, 286, 294, 298, 302, 306, 310, 314, 318, 322, 353-354, 357-358, 393, 397, 430-432, 443-444, 477-478, 488-489, 491-492, 500-501, 503-504, 510-522, 366
packages/controllers/src/controllers/ConnectorController.ts 85.71% 97.36% 73.77% 85.71% 62-64, 129-131, 142, 199-200, 215-216, 226-234, 296-316, 333-338, 407, 411-412
packages/controllers/src/controllers/SendController.ts 59.49% 72.72% 58.82% 59.49% 72, 116-118, 120, 132-133, 136-137, 157-172, 215-230, 235-266, 272-273, 285, 287-301, 305-322, 148-262
packages/controllers/src/controllers/SwapController.ts 51.3% 73.41% 63.79% 51.3% 55-58, 185, 196-197, 227-232, 265-267, 276-277, 285-299, 328, 337-338, 346-349, 382, 389, 394-411, 420-422, 436-437, 448-449, 461, 468-469, 473-481, 485, 487, 489, 491, 536-545, 572-610, 614-661, 665-714, 719-766, 770-850, 869-870, 764-846
packages/controllers/src/controllers/TransactionsController.ts 81.3% 88.46% 80% 81.3% 49, 54-55, 64, 92-109, 124, 103
packages/controllers/src/utils/ChainControllerUtil.ts 100% 100% 66.66% 100%
packages/controllers/src/utils/ConnectorControllerUtil.ts 18.81% 88.88% 33.33% 18.81% 73-74, 94-107, 110-278, 281-311, 314-354, 357-363
packages/controllers/src/utils/SIWXUtil.ts 72.16% 66% 47.36% 72.16% 38-39, 45-46, 52-65, 74-75, 78-79, 82-83, 86-87, 99-100, 120-142, 160, 162-163, 165-166, 181-196, 308-319, 227
packages/scaffold-ui/src/partials/w3m-account-default-widget/index.ts 82.74% 85% 65% 82.74% 74-75, 84, 156, 162-163, 184, 207-208, 246, 268, 292, 296-297, 300-301, 304-305, 320, 324-336, 350-352, 370-372, 375-376, 333
packages/scaffold-ui/src/partials/w3m-account-tokens-widget/index.ts 89.18% 100% 77.77% 89.18% 38, 41, 48-49, 61, 75, 89, 104
packages/scaffold-ui/src/partials/w3m-account-wallet-features-widget/index.ts 70.99% 77.04% 68.18% 70.99% 73-80, 84, 95-97, 140, 155, 159-160, 174, 177, 195, 215, 234, 254, 276-277, 279-280, 282-283, 290-294, 310, 312, 322, 326-327, 330-331, 334-356, 377-378, 385-398, 352-395
packages/scaffold-ui/src/partials/w3m-activity-list/index.ts 66.2% 78.37% 77.77% 66.2% 60-66, 69, 72-75, 91-92, 105-106, 133-134, 156, 168-179, 182-197, 209, 249, 281, 293-300, 303-304, 311-325, 335-336, 323
packages/scaffold-ui/src/partials/w3m-onramp-providers-footer/index.ts 93.75% 100% 100% 93.75% 47, 55
packages/scaffold-ui/src/views/w3m-account-settings-view/index.ts 13.86% 100% 0% 13.86% 59-79, 82-83, 87-157, 161-187, 190-211, 214-219, 222-230, 233-268, 271-272, 275-301, 304-307, 310-330, 333-335
packages/scaffold-ui/src/views/w3m-choose-account-name-view/index.ts 20% 100% 0% 20% 25-28, 32-50, 54-79, 82-96, 99-111, 109
packages/scaffold-ui/src/views/w3m-onramp-providers-view/index.ts 91.66% 66.66% 87.5% 91.66% 36, 66, 87, 114-115, 118-119, 129
packages/scaffold-ui/src/views/w3m-register-account-name-view/index.ts 25.15% 100% 0% 25.15% 51-66, 70-71, 74-77, 81-101, 105-118, 136-141, 144-145, 148-155, 158-178, 181-193, 196-203, 206-247, 250-253
packages/scaffold-ui/src/views/w3m-swap-view/index.ts 78.14% 75% 96% 78.14% 108-112, 122-124, 127-129, 132-143, 166, 172-174, 187, 196-197, 200-201, 217, 230, 251, 272-273, 297, 340-349, 367-383, 427-428, 445-446
packages/scaffold-ui/src/views/w3m-wallet-compatible-networks-view/index.ts 20.83% 100% 0% 20.83% 27-28, 31-32, 36-47, 51-87
packages/scaffold-ui/src/views/w3m-wallet-receive-view/index.ts 83.67% 80.76% 85.71% 83.67% 44-49, 53-55, 67-68, 110, 127-128, 134, 145
packages/scaffold-ui/src/views/w3m-wallet-send-preview-view/index.ts 78.7% 91.3% 85.71% 78.7% 137, 148, 156-159, 166-186, 184
packages/siwe/scaffold/views/w3m-connecting-siwe-view/index.ts 7.52% 100% 0% 7.52% 23-27, 31-79, 83-134, 137-158, 94-156
Generated in workflow #12914 for commit f50c25e by the Vitest Coverage Report Action

@tomiir tomiir deleted the enes/apkt-3108-default-account-type-is-not-working branch June 24, 2025 13:59
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.

2 participants