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

chore: add authProvider field to useAppKitAccount and serialize correct provider in appkit.getProvider #3611

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Jan 10, 2025

Description

  • Adds authProvider field to embeddedWalletInfo
  • Serializes provider in appkit.getProvider

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)

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

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 1fd1b0b

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 Jan 10, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-demo 🛑 Canceled (Inspect) Jan 10, 2025 1:53pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 1:53pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-vue-solana ⬜️ Ignored (Inspect) Jan 10, 2025 1:53pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jan 10, 2025 1:53pm
vue-wagmi-example ⬜️ Ignored (Inspect) Jan 10, 2025 1:53pm

vi.mocked(AccountController).state = { provider: mockProvider } as any
expect(appKit.getProvider()).toBe(mockProvider)
const mockProvider = vi.fn()
vi.mocked(ProviderUtil.state).providers = { eip155: mockProvider } as any
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible to use vi.spyOn ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tried but it was not working. I think spyiong on state.get works for snapshotting, but not when you query the state directly like in this case

Copy link
Contributor

github-actions bot commented Jan 10, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 64.71% 18321 / 28309
🔵 Statements 64.71% 18321 / 28309
🔵 Functions 55.41% 1581 / 2853
🔵 Branches 78.38% 3020 / 3853
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client.ts 60.35% 83.9% 75.54% 60.35% 199-200, 229-230, 245-246, 249-250, 265-268, 271-274, 294-295, 298-299, 315-336, 339-348, 617-618, 621-624, 627-628, 631-632, 635-636, 639-640, 647-651, 714-717, 743-744, 758-759, 768-769, 772-773, 778-779, 796-797, 815-835, 861-888, 891-940, 943-948, 964-968, 981-992, 995-1014, 1017-1023, 1026-1036, 1039-1051, 1054-1056, 1059-1061, 1064-1066, 1069-1071, 1074-1081, 1086-1144, 1148-1167, 1175-1189, 1192-1199, 1202-1216, 1219-1225, 1230, 1234, 1260-1261, 1269, 1272-1275, 1278-1284, 1294-1295, 1324-1340, 1348-1351, 1355-1369, 1373-1383, 1392-1393, 1398, 1404-1422, 1428-1435, 1446-1454, 1459-1468, 1471-1481, 1484-1564, 1567-1587, 1606, 1613, 1630, 1643-1644, 1679, 1711-1722, 1724-1736, 1762-1778, 1781, 1793-1797, 1828-1832, 1837, 1839-1840, 1853-1854, 1859-1860, 1862-1863, 1868-1871, 1918-1922, 1947-1948, 1972-1973, 2002-2003, 2007-2008, 2097, 2099-2101, 329-832
packages/core/exports/react.ts 86.48% 100% 66.66% 86.48% 53-58
packages/core/src/controllers/AccountController.ts 71.65% 67.64% 55.1% 71.65% 60-61, 68-72, 80, 86-94, 105, 155, 171, 175-177, 181-183, 189, 201-206, 212, 221-224, 234, 236-237, 241-252, 254-258
Generated in workflow #8733 for commit 1fd1b0b by the Vitest Coverage Report Action

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