-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
0ad117b
commit 74fb858
Showing
31 changed files
with
1,119 additions
and
629 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const MNEMONIC_ENTROPY = 256; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"HOME": "/", | ||
"WELCOME": "/onboard/welcome", | ||
"CREATE": "/onboard/create", | ||
"RESTORE": "/onboard/restore", | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
import { Flex, Box } from '@blockstack/ui'; | ||
import { ChainID } from '@blockstack/stacks-transactions'; | ||
import { deriveRootKeychainFromMnemonic, deriveStxAddressChain } from '@blockstack/keychain'; | ||
|
||
import { selectMnemonic } from '../../store/keys'; | ||
import { BIP32Interface } from '@blockstack/keychain/node_modules/bip32'; | ||
|
||
// | ||
// Placeholder component | ||
export const Home: React.FC = () => { | ||
const mnemonic = useSelector(selectMnemonic); | ||
const [keychain, setKeychain] = useState<{ rootNode: BIP32Interface } | null>(null); | ||
useEffect(() => { | ||
const deriveMasterKeychain = async () => { | ||
if (!mnemonic) return; | ||
const resp = await deriveRootKeychainFromMnemonic(mnemonic, ''); | ||
setKeychain(resp); | ||
}; | ||
void deriveMasterKeychain(); | ||
}, [mnemonic]); | ||
|
||
const { privateKey } = keychain?.rootNode | ||
? deriveStxAddressChain(ChainID.Testnet)(keychain.rootNode) | ||
: { privateKey: '' }; | ||
|
||
if (!mnemonic) return <>'How you get to homepage without a mnemonic?'</>; | ||
|
||
console.log(keychain); | ||
|
||
return ( | ||
<Flex pt="120px" flexDirection="column" mx="loose"> | ||
<Box>Mnemonic: {mnemonic}</Box> | ||
<Box mt="loose">MnemonicEncryptedHex: {(keychain as any)?.encryptedMnemonicHex}</Box> | ||
<Box mt="loose">Private key: {privateKey}</Box> | ||
</Flex> | ||
); | ||
}; |
This file contains 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
This file contains 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
This file contains 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
12 changes: 1 addition & 11 deletions
12
app/pages/onboarding/04-generating-secret/generating-secret.tsx
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.