@@ -4,14 +4,12 @@ import { bip32 } from 'bitcoinjs-lib';
4import { Just, Nothing } from 'folktale/maybe';
4import { Just, Nothing } from 'folktale/maybe';
5import * as secp256k1 from 'secp256k1';
5import * as secp256k1 from 'secp256k1';
6import * as kg from 'urbit-key-generation';
6import * as kg from 'urbit-key-generation';
7−import { publicToAddress } from 'ethereumjs-util';
7+import { publicToAddress } from './utils/address';
8−import { toHex } from 'web3-utils';
9−import { bufferedPublicKeyToAddress } from './utils/crypto';
11export function EthereumWallet(privateKey) {
9export function EthereumWallet(privateKey) {
12 this.privateKey = privateKey;
10 this.privateKey = privateKey;
13 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
11 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
14− this.address = bufferedPublicKeyToAddress(this.publicKey);
12+ this.address = publicToAddress(this.publicKey);
17export const urbitWalletFromTicket = async (ticket, point, passphrase) => {
15export const urbitWalletFromTicket = async (ticket, point, passphrase) => {
@@ -37,7 +35,7 @@ export const walletFromMnemonic = (
38 const hd = bip32.fromSeed(sd);
36 const hd = bip32.fromSeed(sd);
39 wal = hd.derivePath(path);
37 wal = hd.derivePath(path);
40− wal.address = bufferedPublicKeyToAddress(wal.publicKey);
38+ wal.address = publicToAddress(wal.publicKey);
41 wal.passphrase = passphrase || '';
39 wal.passphrase = passphrase || '';
42 wal = Just(wal);
40 wal = Just(wal);
43 return wal;
41 return wal;