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: allow getting account state by chain namespace #3818

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Feb 7, 2025

Description

Refactors account hook and subscribe methods for getting chain specific account state.

  • useAppKitState for React/Vue
  • subscribeAccount for plain JS

These hooks and methods are getting optional chainNamespace that users can get only a specific chain's account state for their cases.

Added example apps to test these in different environments:

  • html-wagmi-solana-bitcoin
  • next-wagmi-solana-bitcoin-app-router
  • nuxt-wagmi-solana-bitcoin

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-2167, APKT-2168
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

Copy link

linear bot commented Feb 7, 2025

Copy link

changeset-bot bot commented Feb 7, 2025

🦋 Changeset detected

Latest commit: babe120

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit Patch
@reown/appkit-core Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 7, 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 Feb 10, 2025 6:21pm
appkit-ethers5-bera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 6:21pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 6:21pm
9 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 6:21pm
appkit-basic-ep-example ⬜️ Ignored (Inspect) Feb 10, 2025 6:21pm
appkit-basic-example ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 6:21pm
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 6:21pm
appkit-basic-up-example ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 6:21pm
appkit-vue-solana ⬜️ Ignored (Inspect) Feb 10, 2025 6:21pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Feb 10, 2025 6:21pm
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2025 6:21pm
vue-wagmi-example ⬜️ Ignored (Inspect) Feb 10, 2025 6:21pm

@enesozturk enesozturk requested review from magiziz, tomiir and svenvoskamp and removed request for magiziz February 7, 2025 14:01
Copy link
Contributor

github-actions bot commented Feb 7, 2025

Warnings
⚠️ File examples/next-wagmi-solana-bitcoin-app-router/src/app/layout.tsx contains a KEY or SECRET
⚠️ File packages/appkit/src/client.ts contains a KEY or SECRET
⚠️ File packages/core/exports/vue.ts contains a KEY or SECRET
⚠️ File packages/core/src/controllers/AccountController.ts contains a KEY or SECRET
⚠️ File packages/core/src/controllers/ChainController.ts contains a KEY or SECRET
⚠️ File packages/core/src/controllers/ConnectorController.ts contains a KEY or SECRET
⚠️ File packages/core/src/utils/TypeUtil.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against babe120

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 69.18% 20111 / 29067
🔵 Statements 69.18% 20111 / 29067
🔵 Functions 60.9% 1776 / 2916
🔵 Branches 80.94% 3737 / 4617
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/exports/constants.ts 100% 100% 100% 100%
packages/appkit/src/client.ts 61.37% 84.61% 76.43% 61.37% 179-180, 212-213, 233-234, 237-238, 253-256, 259-262, 282-283, 286-287, 303-337, 340-349, 364-365, 615-616, 619-622, 625-626, 629-630, 633-634, 637-638, 645-649, 714-724, 733-758, 765-768, 795-796, 810-811, 820-821, 824-825, 830-831, 855-856, 883-889, 915-926, 929-965, 968-973, 989-993, 1006-1017, 1020-1039, 1042-1048, 1051-1061, 1064-1076, 1079-1081, 1084-1086, 1089-1091, 1094-1096, 1099-1106, 1111-1169, 1177-1189, 1200-1214, 1217-1224, 1227-1238, 1241-1247, 1252, 1256, 1271, 1284-1285, 1293-1296, 1299-1302, 1305-1311, 1321-1322, 1354-1370, 1382-1385, 1389, 1405-1415, 1424-1425, 1436-1454, 1460-1467, 1471-1486, 1504-1514, 1517-1597, 1600-1620, 1638, 1654-1655, 1661, 1663-1679, 1684, 1696, 1734-1741, 1743-1754, 1757-1765, 1803-1806, 1813-1819, 1826-1827, 1832-1833, 1873-1874, 1887-1888, 1893-1894, 1896-1897, 1902-1905, 1916-1917, 1956-1960, 1985-1986, 2010-2011, 2040-2041, 2045-2046, 2144-2145, 305-341
packages/core/exports/react.ts 70.21% 50% 66.66% 70.21% 30-38, 61-66
packages/core/exports/vue.ts 88.33% 78.57% 66.66% 88.33% 73-74, 81-86
packages/core/src/controllers/AccountController.ts 89.06% 93.54% 67.34% 89.06% 63-64, 71-75, 108, 158, 204-209, 224-227, 83, 192, 206-226
packages/core/src/controllers/ChainController.ts 84.74% 83.76% 79.74% 84.74% 193-202, 206-224, 246-247, 280-287, 292-293, 330-337, 371-372, 375-376, 385-386, 391-392, 408-409, 414-415, 427-428, 464-465, 508-514, 527-528, 571-572, 667, 671-680, 97, 177
packages/core/src/controllers/ConnectorController.ts 81.5% 97.36% 72.97% 81.5% 39-41, 49-51, 122-123, 138-139, 149-157, 211-231, 251-252
Generated in workflow #9488 for commit babe120 by the Vitest Coverage Report Action

Copy link

linear bot commented Feb 10, 2025

Copy link

linear bot commented Feb 10, 2025

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