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

refactor: exposed switch network method and hooks #3164

Merged
merged 30 commits into from
Nov 1, 2024

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Oct 30, 2024

Description

So far we are not properly providing programmatic way to switch network outside of the modal. This PR includes changes to update useAppKitNetwork hooks to have them switchNetwork and addNetwork functions.

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-1375
For GH issues: closes #...

Showcase (Optional)

Screen.Recording.2024-10-30.at.11.58.50.mov

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 Oct 30, 2024

🦋 Changeset detected

Latest commit: 7801b98

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

This PR includes changesets to release 20 packages
Name Type
@reown/appkit-utils Patch
@apps/laboratory Patch
@reown/appkit Patch
@reown/appkit-core Patch
@apps/demo Patch
@apps/gallery Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-polkadot Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-cdn 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

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 Oct 30, 2024

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

Name Status Preview Comments Updated (UTC)
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:01pm
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:01pm
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:01pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:01pm

Copy link
Contributor

github-actions bot commented Oct 30, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 342.25% 4470 / 18665
🔵 Statements 342.25% 4470 / 18665
🔵 Functions 376.35999999999996% 371 / 1086
🔵 Branches 465.36000000000007% 679 / 1385
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/appkit/exports/react.ts 0% 0% 0% 0% 1, 21, 25-36, 38-39, 47-48, 50-52, 54-60
packages/appkit/exports/vue.ts 0% 0% 0% 0% 1, 21, 25-32, 34-35, 41-42, 44-46, 48-54
packages/appkit/src/client.ts 76.56% 76.53% 85.36% 76.56% 93-94, 113-114, 117-118, 133-136, 139-142, 145-146, 175-182, 184-186, 189-196, 291, 299, 337-340, 346, 348-350, 352-353, 356, 451, 453-455, 458-459, 461-463, 478, 480-481, 488-489, 499-500, 515-516, 519-520, 523-524, 527-528, 537-539, 545-552, 569-572, 607, 616-628
packages/appkit-utils/src/ErrorUtil.ts 0% 0% 0% 0% 1-30, 32-34
packages/core/exports/react.ts 80.76% 100% 66.66% 80.76% 36-38, 40-41
packages/core/exports/vue.ts 0% 0% 0% 0% 1, 10, 14-17, 19-21, 23-25, 27-32, 34-38, 40-42, 44-46, 48-51, 53-59, 61-64, 66-67
packages/core/src/controllers/ChainController.ts 67.71% 59.67% 69.69% 67.71% 77-80, 83-87, 90-94, 96-97, 99-107, 113-114, 141, 143-153, 157-165, 188-189, 231-241, 246-247, 267-268, 272-274, 276-277, 280, 282-284, 286, 288-295, 298-301, 312-314, 316-317, 320-321, 326-327, 330-331, 346-348, 350-351, 354-355, 360-361, 364-365, 381-382, 387-388, 400-401, 434, 436-439, 441-442, 445-446, 449-450, 489-490, 509-512, 535-536
Generated in workflow #7126 for commit 7801b98 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.

3 participants