obtainNetworkName to wallet
This commit is contained in:
parent
abf74695b6
commit
cbc46f5345
5 changed files with 98 additions and 97 deletions
|
|
@ -200,6 +200,20 @@ Wallet.delete = function(walletId, storage, cb) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* @desc obtain network name from serialized wallet
|
||||
* @param {Object} wallet object
|
||||
* @return {string} network name
|
||||
*/
|
||||
Wallet.obtainNetworkName = function(obj) {
|
||||
return obj.networkName ||
|
||||
(obj.opts ? obj.opts.networkName : null) ||
|
||||
(obj.publicKeyRing ? obj.publicKeyRing.networkName : null) ||
|
||||
obj.privateKey.networkName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @desc Set the copayer id for the owner of this wallet
|
||||
* @param {string} pubkey - the pubkey to set to the {@link Wallet#seededCopayerId} property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue