1import { Just, Nothing } from 'folktale/maybe';
2import React, { useEffect } from 'react';
4import View from 'components/View';
5import { usePassphraseInput } from 'components/Inputs';
6import { ForwardButton } from 'components/Buttons';
8import { EthereumWallet } from 'lib/wallet';
9import { useWallet } from 'store/wallet';
10import { Input } from 'indigo-react';
12export default function PrivateKey({ loginCompleted }) {
13 const { wallet, setWallet } = useWallet();
15 const privateKeyInput = usePassphraseInput({
20 const privateKey = privateKeyInput.data;
23 if (/^[0-9A-Fa-f]{64}$/g.test(privateKey) === true) {
24 const sec = Buffer.from(privateKey, 'hex');
25 const newWallet = new EthereumWallet(sec);
26 setWallet(Just(newWallet));
30 }, [privateKey, setWallet]);
34 Please enter your raw Ethereum private key here.
35 <Input {...privateKeyInput} />
38 disabled={Nothing.hasInstance(wallet)}
39 onClick={loginCompleted}>
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list