1// import * as bip32 from 'bip32';
2import * as bip39 from 'bip39';
3import { bip32 } from 'bitcoinjs-lib';
4import { Just, Nothing } from 'folktale/maybe';
5import * as secp256k1 from 'secp256k1';
6import * as kg from 'urbit-key-generation';
7import { publicToAddress } from './utils/address';
9export function EthereumWallet(privateKey) {
10 this.privateKey = privateKey;
11 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
12 this.address = publicToAddress(this.publicKey);
15export const urbitWalletFromTicket = async (
20 return await kg.generateWallet({
23 passphrase: passphrase,
27export const walletFromMnemonic = (
31 skipMnemonicCheck?: boolean
34 skipMnemonicCheck || bip39.validateMnemonic(mnemonic)
35 ? Just(bip39.mnemonicToSeedSync(mnemonic, passphrase))
38 const toWallet = (sd, path) => {
40 const hd = bip32.fromSeed(sd);
41 wal = hd.derivePath(path);
42 wal.address = publicToAddress(wal.publicKey);
43 wal.passphrase = passphrase || '';
48 const wallet = seed.chain(sd => toWallet(sd, hdpath));
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