walletkey: minor.
This commit is contained in:
parent
2097450b42
commit
44b5a8725e
@ -248,22 +248,8 @@ WalletKey.fromRing = function fromRing(account, ring) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether an object is a WalletKey.
|
* Convert wallet key to a path.
|
||||||
* @param {Object} obj
|
* @returns {Path}
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
|
|
||||||
WalletKey.isWalletKey = function isWalletKey(obj) {
|
|
||||||
return obj
|
|
||||||
&& obj.path !== undefined
|
|
||||||
&& Buffer.isBuffer(obj.publicKey)
|
|
||||||
&& typeof obj.toSecret === 'function';
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test whether an object is a WalletKey.
|
|
||||||
* @param {Object} obj
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
WalletKey.prototype.toPath = function toPath() {
|
WalletKey.prototype.toPath = function toPath() {
|
||||||
@ -293,6 +279,19 @@ WalletKey.prototype.toPath = function toPath() {
|
|||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test whether an object is a WalletKey.
|
||||||
|
* @param {Object} obj
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
|
||||||
|
WalletKey.isWalletKey = function isWalletKey(obj) {
|
||||||
|
return obj
|
||||||
|
&& Buffer.isBuffer(obj.publicKey)
|
||||||
|
&& typeof obj.index === 'number'
|
||||||
|
&& typeof obj.toPath === 'function';
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expose
|
* Expose
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user