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