Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
0xk0stas committed Oct 4, 2023
1 parent 19125c0 commit 0aa54a8
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/pages/CreateWallet/CreateWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ const CreateWallet = () => {
const generateWalletInfo = () => {
const mnemonic = Mnemonic.generate();
const words = mnemonic.getWords();
console.log("⚠️ ~ file: CreateWallet.tsx:63 ~ generateWalletInfo ~ words::::", words)
const mnemonicString = mnemonic.toString();
const mnemonicKey = mnemonic.deriveKey();
const mnemonicPublicKey = mnemonicKey.generatePublicKey();
const address = mnemonicPublicKey.toAddress().bech32();
const addressShard = getShardOfAddress(address);
const addressShard = getShardOfAddress(mnemonicPublicKey);
const password = "password";
const addressIndex = 0;
const secretKey = mnemonic.deriveKey(addressIndex);
Expand Down Expand Up @@ -155,6 +154,26 @@ const CreateWallet = () => {
))}
</Grid>
</Text>
{jsonFileContent == "" &&
<HStack>
<Text>
Click to re-generate the information:
</Text>
<Button
w={'fit'}
_hover={{
opacity: 1,
boxShadow: 'lg'
}}
onClick={handleGenerateWalletInfo}
>
Generate
</Button>
</HStack>
}
<Text>
or
</Text>
{jsonFileContent == "" && <HStack>
<Text>
Click to obtain the JSON file of the new wallet:
Expand Down

0 comments on commit 0aa54a8

Please sign in to comment.