Skip to content

Update wallet generate #5704

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Update wallet generate #5704

wants to merge 10 commits into from

Conversation

SeniorZhai
Copy link
Member

No description provided.

@SeniorZhai SeniorZhai requested a review from Copilot August 6, 2025 03:58
Copy link
Contributor

@Copilot 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 updates wallet generation functionality by adding support for creating new multi-chain wallets with variable BIP44 derivation path indices. The changes primarily focus on adding a classic wallet creation feature with proper UI components and updating the BIP44 path generation to support indexed addresses.

  • Updates BIP44 derivation paths to accept variable indices instead of hardcoded values
  • Adds new UI flow for creating classic wallets with multi-chain support
  • Implements wallet renaming functionality for classic wallets

Reviewed Changes

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

Show a summary per file
File Description
Bip44Test.kt Updates test cases to use new indexed BIP44 path functions
strings.xml Adds new string resources for wallet creation UI
view_classic_wallet_bottom.xml Adds rename option to classic wallet bottom sheet
fragment_add_wallet_bottom_sheet.xml Adds create new wallet option to wallet selection UI
ic_wallet_create.xml New icon resource for wallet creation
ic_menu_create_wallet.xml New menu icon for wallet creation
FetchWalletViewModel.kt Implements classic wallet creation logic
ImportWalletDetailPage.kt Adds EVM address checksum conversion for watch addresses
CreateWalletNoticePage.kt New compose page for wallet creation notice
AssetDashboardScreen.kt Adds name parameter to wallet card display
WalletSecurityActivity.kt Adds CREATE_WALLET mode support
WalletFragment.kt Implements wallet renaming and title display logic
VerifyPinBeforeImportWalletFragment.kt Adds navigation for wallet creation flow
CreateWalletNoticeFragment.kt New fragment for wallet creation notice
AddWalletBottomSheetDialogFragment.kt Adds create wallet action to bottom sheet
Bip44.kt Refactors path generation to support variable indices
TipSign.kt Updates signature functions to use indexed paths
Web3Repository.kt Adds method to get maximum classic wallet index
RefreshWeb3Job.kt Updates default wallet name to use string resource

@@ -127,7 +128,7 @@ fun tipPrivToPrivateKey(
}
else -> {
val addressFromGo = Blockchain.generateEthereumAddress(priv.hexString())
val bip44KeyPair = generateBip44Key(masterKeyPair, Bip44Path.Ethereum)
val bip44KeyPair = generateBip44Key(masterKeyPair, Bip44Path.solana(index))
Copy link
Preview

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

This line uses Bip44Path.solana(index) for Ethereum address generation, but it should use Bip44Path.ethereum(index) to match the intended chain type.

Suggested change
val bip44KeyPair = generateBip44Key(masterKeyPair, Bip44Path.solana(index))
val bip44KeyPair = generateBip44Key(masterKeyPair, Bip44Path.ethereum(index))

Copilot uses AI. Check for mistakes.

}.maxOrNull() ?: 0
val name = "${MixinApplication.appContext.getString(R.string.Common_Wallet)} ${maxIndex + 1}"
val evmAddress = privateKeyToAddress(currentSpendKey, Constants.ChainId.ETHEREUM_CHAIN_ID, classicIndex)
val solAddress =privateKeyToAddress(currentSpendKey, Constants.ChainId.SOLANA_CHAIN_ID, classicIndex)
Copy link
Preview

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

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

Missing space after the equals sign. Should be val solAddress = privateKeyToAddress(...).

Suggested change
val solAddress =privateKeyToAddress(currentSpendKey, Constants.ChainId.SOLANA_CHAIN_ID, classicIndex)
val solAddress = privateKeyToAddress(currentSpendKey, Constants.ChainId.SOLANA_CHAIN_ID, classicIndex)

Copilot uses AI. Check for mistakes.

@SeniorZhai SeniorZhai force-pushed the feature/create_wallet branch from f094bbe to 6ccc0ca Compare August 7, 2025 01:29
@SeniorZhai SeniorZhai force-pushed the feature/create_wallet branch from 644727a to 9cdcfe7 Compare August 7, 2025 04:15
…create_wallet

# Conflicts:
#	app/src/main/java/one/mixin/android/ui/address/TransferDestinationInputFragment.kt
@SeniorZhai SeniorZhai force-pushed the feature/create_wallet branch from a766b3d to 4c5532b Compare August 8, 2025 04:18
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