wallet/supernode.js
function signWithLocalPrivateKey(wallet_id, account, is_change, address_index, text_to_sign, handleSig){
	var path = "m/44'/0'/" + account + "'/"+is_change+"/"+address_index;
	var privateKey = xPrivKey.derive(path).privateKey;
	var privKeyBuf = privateKey.bn.toBuffer({size:32}); // https://github.com/bitpay/bitcore-lib/issues/47
	handleSig(ecdsaSig.sign(text_to_sign, privKeyBuf));
}
function signWithLocalPrivateKey(wallet_id, account, is_change, address_index, text_to_sign, handleSig){
	var path = "m/44'/0'/" + account + "'/"+is_change+"/"+address_index;
	var privateKey = xPrivKey.derive(path).privateKey;
	var privKeyBuf = privateKey.bn.toBuffer({size:32}); // https://github.com/bitpay/bitcore-lib/issues/47
	handleSig(ecdsaSig.sign(text_to_sign, privKeyBuf));
}
function signWithLocalPrivateKey ( wallet_id , account , is_change , address_index , text_to_sign , handleSig ) { var path = "m/44'/0'/" + account + "'/" + is_change + "/" + address_index ; var privateKey = xPrivKey . derive ( path ) . privateKey ; var privKeyBuf = privateKey . bn . toBuffer ( { size : 32 } ) ; // https://github.com/bitpay/bitcore-lib/issues/47 handleSig ( ecdsaSig . sign ( text_to_sign , privKeyBuf ) ) ; }
sign with local privateKey
@param {string} wallet_id - wallet id
@param {number} account - account index
@param {number} is_change - is_change is 0 not is_change is 1
@param {number} address_index - address index
@param {string} text_to_sign - text
@param {function} handleSig - callback
sign with local privateKey