Display hdpaths for newly created accounts

This commit is contained in:
IshaVenikar
2024-02-20 13:35:01 +05:30
parent 1bde70b7d6
commit dbaf43f98c
4 changed files with 18 additions and 12 deletions
+10 -2
View File
@@ -27,8 +27,10 @@ const Accounts: React.FC<AccountsProps> = ({
setIsAccountCreating(true);
const newAccount = await addAccount(network);
setIsAccountCreating(false);
newAccount && updateAccounts(newAccount);
updateIndex(selectedAccounts[selectedAccounts.length - 1].id + 1);
if (newAccount) {
updateAccounts(newAccount);
updateIndex(newAccount.id);
}
};
const selectedAccounts: Account[] = (() => {
@@ -82,6 +84,12 @@ const Accounts: React.FC<AccountsProps> = ({
<Text style={styles.highlight}>Public Key: </Text>
{selectedAccounts[currentIndex]?.pubKey}
</Text>
<Text variant="bodyLarge">
<Text style={{ fontWeight: '700' }}>HD Path: </Text>
{selectedAccounts &&
selectedAccounts[currentIndex] &&
selectedAccounts[currentIndex].hdPath}
</Text>
</View>
<View style={styles.signLink}>
-1
View File
@@ -30,7 +30,6 @@ const HomeScreen = () => {
const createWalletHandler = async () => {
setIsWalletCreating(true);
await new Promise(resolve => setTimeout(resolve, 2000));
const { mnemonic, ethAccounts, cosmosAccounts } = await createWallet();
ethAccounts &&
cosmosAccounts &&