1import React, { useEffect } from 'react';
2import { Just, Nothing } from 'folktale/maybe';
3import { Grid, Input } from 'indigo-react';
5import { useWallet } from 'store/wallet';
7import { useHexInput } from 'lib/useInputs';
8import { EthereumWallet, WALLET_TYPES, stripHexPrefix } from 'lib/wallet';
9import useLoginView from 'lib/useLoginView';
11export default function PrivateKey({ className }) {
12 useLoginView(WALLET_TYPES.PRIVATE_KEY);
14 const { setWallet } = useWallet();
16 const [privateKeyInput, { pass, data: privateKey }] = useHexInput({
25 const sec = Buffer.from(stripHexPrefix(privateKey), 'hex');
26 const newWallet = new EthereumWallet(sec);
27 setWallet(Just(newWallet));
31 }, [pass, privateKey, setWallet]);
34 <Grid className={className}>
35 <Grid.Item full as={Input} {...privateKeyInput} />
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