Skip to content

Commit

Permalink
additional nep2 method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ejhfast committed Aug 31, 2017
1 parent 7c192e9 commit 2ec1b81
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/nep2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ const scrypt_options = {
size: 64
};

// encrypts a given wif given passphrase,
// retuns account object
export const encryptWifAccount = (wif, passphrase) => {
return encrypt_wif(wif, passphrase).then((encWif) => {
const loadAccount = getAccountsFromWIFKey(wif);
return {
wif: wif,
address: loadAccount[0].address,
encryptedWif: encWif,
passphrase: passphrase
};
});
};

// generate new encrypted wif given passphrase
// (returns a promise)
export const generateEncryptedWif = (passphrase) => {
Expand Down

0 comments on commit 2ec1b81

Please sign in to comment.