Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

feat: implement non-btc wallet selection on BABY staking#1536

Merged
jonybur merged 5 commits into
mainfrom
jb-no-btc-wallet-menu
Sep 5, 2025
Merged

feat: implement non-btc wallet selection on BABY staking#1536
jonybur merged 5 commits into
mainfrom
jb-no-btc-wallet-menu

Conversation

@jonybur

@jonybur jonybur commented Sep 3, 2025

Copy link
Copy Markdown
Kapture.2025-09-03.at.17.30.00.mp4

babylonlabs-io/babylon-toolkit#78

Needs this PR to be merged first: babylonlabs-io/babylon-toolkit#136

Copilot AI review requested due to automatic review settings September 3, 2025 15:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 implements conditional wallet selection for BABY staking routes, allowing users to connect only with BBN wallets when accessing baby-specific routes while maintaining dual-wallet requirements for other routes.

  • Adds route-based logic to determine required wallet chains
  • Updates authentication guards to conditionally require BTC connectivity
  • Modifies wallet connection UI to adapt based on current route

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/ui/common/hooks/useAuthGuard.ts Removes BTC connector requirement from auth guard loading state
src/ui/common/context/wallet/WalletConnectionProvider.tsx Adds route-based logic to set required chains and fixes type annotations
src/ui/common/context/wallet/BTCWalletProvider.tsx Ensures loading state is cleared even when BTC connector is not configured
src/ui/common/components/Wallet/Connect.tsx Updates wallet connection UI to conditionally require BTC wallet based on route

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

Comment on lines +79 to +81
const requiredChains = (
location.pathname.startsWith("/baby") ? ["BBN"] : ["BTC", "BBN"]
) as ("BTC" | "BBN")[];

Copilot AI Sep 3, 2025

Copy link

Choose a reason for hiding this comment

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

The hardcoded route prefix '/baby' should be extracted as a constant to improve maintainability and avoid magic strings. Consider defining a constant like BABY_ROUTE_PREFIX = '/baby' at the module level.

Copilot uses AI. Check for mistakes.
};

const location = useLocation();
const isBabyRoute = location.pathname.startsWith("/baby");

Copilot AI Sep 3, 2025

Copy link

Choose a reason for hiding this comment

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

The hardcoded route prefix '/baby' is duplicated from WalletConnectionProvider.tsx. This should be extracted as a shared constant to maintain consistency and avoid duplication.

Copilot uses AI. Check for mistakes.
@jonybur jonybur merged commit 625c583 into main Sep 5, 2025
6 checks passed
@jonybur jonybur deleted the jb-no-btc-wallet-menu branch September 5, 2025 13:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants