feat: implement non-btc wallet selection on BABY staking#1536
Conversation
1b78390 to
0fd3765
Compare
There was a problem hiding this comment.
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.
| const requiredChains = ( | ||
| location.pathname.startsWith("/baby") ? ["BBN"] : ["BTC", "BBN"] | ||
| ) as ("BTC" | "BBN")[]; |
There was a problem hiding this comment.
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.
| }; | ||
|
|
||
| const location = useLocation(); | ||
| const isBabyRoute = location.pathname.startsWith("/baby"); |
There was a problem hiding this comment.
The hardcoded route prefix '/baby' is duplicated from WalletConnectionProvider.tsx. This should be extracted as a shared constant to maintain consistency and avoid duplication.
…ple-staking into jb-no-btc-wallet-menu
…jb-no-btc-wallet-menu
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