wallet/supernode.js
function createWallet(xPrivKey, onDone){
	var devicePrivKey = xPrivKey.derive("m/1'").privateKey.bn.toBuffer({size:32});
	var device = require('../wallet/device.js');
	device.setDevicePrivateKey(devicePrivKey); // we need device address before creating a wallet
	var strXPubKey = Bitcore.HDPublicKey(xPrivKey.derive("m/44'/0'/0'")).toString();
	var walletDefinedByKeys = require('../wallet/wallet_defined_by_keys.js');
	walletDefinedByKeys.createWalletByDevices(strXPubKey, 0, 1, [], 'any walletName', function(wallet_id){
		walletDefinedByKeys.issueNextAddress(wallet_id, 0, function(){
			onDone();
		});
	});
}
function createWallet(xPrivKey, onDone){
	var devicePrivKey = xPrivKey.derive("m/1'").privateKey.bn.toBuffer({size:32});
	var device = require('../wallet/device.js');
	device.setDevicePrivateKey(devicePrivKey); // we need device address before creating a wallet
	var strXPubKey = Bitcore.HDPublicKey(xPrivKey.derive("m/44'/0'/0'")).toString();
	var walletDefinedByKeys = require('../wallet/wallet_defined_by_keys.js');
	walletDefinedByKeys.createWalletByDevices(strXPubKey, 0, 1, [], 'any walletName', function(wallet_id){
		walletDefinedByKeys.issueNextAddress(wallet_id, 0, function(){
			onDone();
		});
	});
}
function createWallet ( xPrivKey , onDone ) { var devicePrivKey = xPrivKey . derive ( "m/1'" ) . privateKey . bn . toBuffer ( { size : 32 } ) ; var device = require ( '../wallet/device.js' ) ; device . setDevicePrivateKey ( devicePrivKey ) ; // we need device address before creating a wallet var strXPubKey = Bitcore . HDPublicKey ( xPrivKey . derive ( "m/44'/0'/0'" ) ) . toString ( ) ; var walletDefinedByKeys = require ( '../wallet/wallet_defined_by_keys.js' ) ; walletDefinedByKeys . createWalletByDevices ( strXPubKey , 0 , 1 , [ ] , 'any walletName' , function ( wallet_id ) { walletDefinedByKeys . issueNextAddress ( wallet_id , 0 , function ( ) { onDone ( ) ; } ) ; } ) ; }
create wallet with private key
@param {string} xPrivKey - private key
@param {function} onDone - callback
create wallet with private key