Skip to content

CP-10109 Wallets management #2841

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

Closed
wants to merge 14 commits into from
Closed

CP-10109 Wallets management #2841

wants to merge 14 commits into from

Conversation

neven-s
Copy link
Collaborator

@neven-s neven-s commented May 29, 2025

Description

Ticket: CP-10109

This PR introduces functionality to import existing wallets (via seed and private keys) and provides UI for managing multiple wallets and their associated accounts.

Key changes:

Wallet Import:

Implemented the flow for importing wallets using a seed phrase.
Added an ImportPrivateKey screen and the corresponding logic to import accounts via their private keys.

Multi-Wallet and Account Management UI:

Introduced an addOrConnectWallet screen, providing a central point for users to either create a new wallet or import an existing one.
Updated the "Manage Accounts" screen to display a list of available wallets and their respective accounts.

State Management & Core Logic:

Created a thunk for setActiveAccount to ensure that when an account is made active, its parent wallet context is also correctly set.
Ensured that the real walletId is used when creating subsequent accounts within a wallet.
Removed the isActive property from the Wallet interface, as active status is managed via dedicated Redux state.

Refactoring & Fixes:

Corrected ThunkDispatch typing.

Screenshots/Videos

Import seed flow

Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 45 03
Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 45 06
Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 45 12

Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 45 30
Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 45 43

Import PK flow

Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 45 52

Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 46 03

Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 46 12
Simulator Screenshot - iPhone 16 Pro - 2025-05-29 at 18 46 18

Testing

Import Seed Wallet:

  • Navigate to the Manage Accounts screen.
  • Choose the option to import a wallet using a seed phrase.
  • Enter a valid seed and complete the import process.
  • Verify the wallet and its accounts are imported correctly and displayed on the "Manage Accounts" screen.
  • Check balances and try to set an imported account as active.

Import Private Key:

  • Navigate to the Manage Accounts screen.
  • Choose the option to import a private key.
  • Enter a valid private key.
  • Verify the new account is added to the selected/active wallet and appears in the "Manage Accounts" screen.
  • Check its balance and functionality.

Multi-Wallet/Account Navigation:

  • On the "Manage Accounts" screen, verify that all wallets and their respective accounts are listed.
  • Test switching the active account between different accounts, potentially across different wallets. Confirm that the application state (balances, transaction history context, etc.) updates correctly.
  • Test creating a new account within an existing wallet and ensure it uses the correct walletId.

Error Handling:

  • Test importing with an invalid seed.
  • Test importing an invalid private key.
  • Verify appropriate error messages are shown.

Known issues

  • in addAccount = createAsyncThunk selectAccounts should select only accounts from wallet account being added to
  • when importing private key no balance is showed
  • after importing seed/key navigation should go back to list of wallets

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have added/updated necessary unit tests
  • I have updated the documentation

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.

1 participant