2018-01-11 01:44:13 -05:00
|
|
|
import { fromPrivateKey, fromEthSale } from 'ethereumjs-wallet';
|
2017-11-08 13:16:43 -05:00
|
|
|
import { fromEtherWallet } from 'ethereumjs-wallet/thirdparty';
|
|
|
|
import { signWrapper } from './helpers';
|
|
|
|
import { decryptPrivKey } from 'libs/decrypt';
|
2018-02-02 01:01:30 -05:00
|
|
|
import { fromV3 } from 'libs/web-workers';
|
2017-11-09 22:30:20 -05:00
|
|
|
import Web3Wallet from './web3';
|
2017-11-29 15:14:57 -08:00
|
|
|
import AddressOnlyWallet from './address';
|
2017-11-08 13:16:43 -05:00
|
|
|
|
2017-12-18 18:29:26 -05:00
|
|
|
const EncryptedPrivateKeyWallet = (encryptedPrivateKey: string, password: string) =>
|
|
|
|
signWrapper(fromPrivateKey(decryptPrivKey(encryptedPrivateKey, password)));
|
2017-11-08 13:16:43 -05:00
|
|
|
|
|
|
|
const PresaleWallet = (keystore: string, password: string) =>
|
|
|
|
signWrapper(fromEthSale(keystore, password));
|
|
|
|
|
|
|
|
const MewV1Wallet = (keystore: string, password: string) =>
|
|
|
|
signWrapper(fromEtherWallet(keystore, password));
|
|
|
|
|
|
|
|
const PrivKeyWallet = (privkey: Buffer) => signWrapper(fromPrivateKey(privkey));
|
|
|
|
|
2018-01-11 01:44:13 -05:00
|
|
|
const UtcWallet = (keystore: string, password: string) => fromV3(keystore, password, true);
|
2017-11-08 13:16:43 -05:00
|
|
|
|
|
|
|
export {
|
|
|
|
EncryptedPrivateKeyWallet,
|
|
|
|
PresaleWallet,
|
|
|
|
MewV1Wallet,
|
|
|
|
PrivKeyWallet,
|
2017-11-09 22:30:20 -05:00
|
|
|
UtcWallet,
|
2017-11-29 15:14:57 -08:00
|
|
|
Web3Wallet,
|
|
|
|
AddressOnlyWallet
|
2017-11-08 13:16:43 -05:00
|
|
|
};
|