Repository navigation
Conversation
Add a Wallet Management tab to the profile settings page so users can review the Web3 wallets linked to their account. The new tab renders the ConnectedWallets panel, fed by the useWalletManagement hook and walletService (Component -> Hook -> Service), and keeps the shared wallet context (useWalletStore) in sync when a wallet is selected or unlinked. Also restore the wallet session, transaction-status and multi-sig methods on walletService that a previous balance-only refactor had dropped, which left useWallet, useTxTracker and useMultiSigApprovals calling missing methods and broke the wallet service transaction tests. Closes SwiftChainn#874 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@Deemexlyon Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Please resolve conflict. Thanks for contributing to Swiftchainn |
Contributor
Author
|
@johdanike Please approve workflow |
Contributor
|
Thanks for contributing to Swiftchainn man. Nice work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #874
Summary
Adds a Wallet Management tab to the profile settings page (
app/(dashboard)/settings/profile/page.tsx) alongside the existing Profile Information and Security tabs. The tab lists the Web3 wallets linked to the authenticated account and lets the user set an active wallet or unlink one, with all data coming from the backend API.While wiring this up I found that
services/walletService.tshad been replaced wholesale by a balance-only refactor (commit57c6ca4), which silently droppedconnect,disconnect,getBalance,getTransactionStatus,getPendingMultiSigOperationsandsignMultiSigOperation.useWallet,useTxTrackeranduseMultiSigApprovalsstill call these methods, so 19 tests inservices/__tests__/walletService.transaction.test.tswere failing. This PR restores those methods (keeping the newer balance caching intact) so the wallet context this feature syncs with actually works.Changes
types/wallet.types.tsConnectedWalletandConnectedWalletsResponsetypesservices/walletService.tsgetConnectedWallets()anddisconnectWallet()hooks/useWalletManagement.tsdisconnectWallet,setActiveWallet, and wallet-context synccomponents/wallet/ConnectedWallets.tsxapp/(dashboard)/settings/profile/page.tsxConnectedWalletsArchitecture
Strict layered flow, no component talks to a service or the network directly:
Data source
All wallet data is retrieved from the backend API through
walletService— there are no inline mock objects in the component or hook. The panel renders loading, error (with retry) and empty states so it behaves correctly against a real backend.Wallet-context sync
useWalletManagementreadsuseWalletStoreand:activeWallet;setActiveWallet;Testing
Two suites unrelated to this change (
hooks/__tests__/useWallet.test.ts,components/wallet/__tests__/BalanceWarning.test.tsx) fail identically on the base branch and are not touched here.Acceptance criteria
ConnectedWalletscomponent renders within the tab panelmin-h-[420px]reserved on the panel prevents layout shift when switching tabsCloses #874with a work summary in the PR bodyNotes for reviewers
GET /api/wallet/wallets->{ success, message?, data: ConnectedWallet[] }andDELETE /api/wallet/wallets/:id->{ success, message }.