Skip to content

fix: use getCaipNetworks method on Bitcoin adapter to find active caip network#4899

Merged
tomiir merged 4 commits intomainfrom
enes/apkt-3657-bob-bitcoin-adapter-defaults-to-bitcoin-mainnet-on
Aug 25, 2025
Merged

fix: use getCaipNetworks method on Bitcoin adapter to find active caip network#4899
tomiir merged 4 commits intomainfrom
enes/apkt-3657-bob-bitcoin-adapter-defaults-to-bitcoin-mainnet-on

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

Description

After connecting and switching network on Bitcoin, refreshing page switches AppKit back to Bitcoin Mainnet

Reproducing steps

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

Copilot AI review requested due to automatic review settings August 25, 2025 13:42
@linear
Copy link
Copy Markdown

linear bot commented Aug 25, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 25, 2025

⚠️ No Changeset found

Latest commit: 8f54d45

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 Aug 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Aug 25, 2025 2:42pm
appkit-demo Ready Ready Preview Comment Aug 25, 2025 2:42pm
appkit-gallery Ready Ready Preview Comment Aug 25, 2025 2:42pm
appkit-laboratory Ready Ready Preview Comment Aug 25, 2025 2:42pm
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Aug 25, 2025 2:42pm
appkit-basic-sign-client-example Ignored Ignored Aug 25, 2025 2:42pm
appkit-basic-up-example Ignored Ignored Aug 25, 2025 2:42pm
appkit-ethers5-bera Ignored Ignored Aug 25, 2025 2:42pm
appkit-nansen-demo Ignored Ignored Aug 25, 2025 2:42pm
appkit-vue-solana Ignored Ignored Aug 25, 2025 2:42pm
appkit-wagmi-cdn-example Ignored Ignored Aug 25, 2025 2:42pm
ethereum-provider-wagmi-example Ignored Ignored Aug 25, 2025 2:42pm
next-wagmi-solana-bitcoin-example Ignored Ignored Aug 25, 2025 2:42pm
vue-wagmi-example Ignored Ignored Aug 25, 2025 2:42pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where the Bitcoin adapter was not properly maintaining the selected network after page refresh. The fix ensures that when connecting to a specific chain, the adapter uses the available CAIP networks to find the active network instead of relying solely on the connector's chain list.

  • Updates chain selection logic to use getCaipNetworks() method instead of connector.chains
  • Ensures proper network persistence across page refreshes for Bitcoin connections

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 25, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.41% 34745 / 44310
🔵 Statements 78.41% 34745 / 44310
🔵 Functions 76.21% 3823 / 5016
🔵 Branches 86.72% 8195 / 9449
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/bitcoin/src/connectors/UnisatConnector/index.ts 97.51% 93.18% 100% 97.51% 52-53, 191, 214
Generated in workflow #14520 for commit 8f54d45 by the Vitest Coverage Report Action

@enesozturk enesozturk added this pull request to the merge queue Aug 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 25, 2025
@enesozturk enesozturk added this pull request to the merge queue Aug 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 25, 2025
@tomiir tomiir merged commit d33de80 into main Aug 25, 2025
41 checks passed
@tomiir tomiir deleted the enes/apkt-3657-bob-bitcoin-adapter-defaults-to-bitcoin-mainnet-on branch August 25, 2025 15:51
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