WIP test
This commit is contained in:
parent
e109550d9b
commit
39e85396db
7 changed files with 123 additions and 42 deletions
|
|
@ -70,6 +70,25 @@ Profile.prototype.toObj = function() {
|
|||
return _.clone(_.pick(this, 'hash', 'email', 'extra', 'walletInfos'));
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* @desc Return a base64 encrypted version of the wallet
|
||||
* @return {string} base64 encoded string
|
||||
*/
|
||||
Profile.prototype.export = function() {
|
||||
var profObj = this.toObj();
|
||||
return this.storage.encrypt(profObj);
|
||||
};
|
||||
|
||||
/*
|
||||
* @desc Return a base64 encrypted version of the wallet
|
||||
* @return {string} base64 encoded string
|
||||
*/
|
||||
Profile.import = function(str, password, storage) {
|
||||
var obj = storage.decrypt(str,password)
|
||||
return new Profile(obj, storage);
|
||||
};
|
||||
|
||||
Profile.prototype.getWallet = function(walletId, cb) {
|
||||
return this.walletInfos[walletId];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue