allow importing HW seeds

This commit is contained in:
Matias Alejo Garcia 2017-06-12 16:22:50 -03:00
commit da15bc939b
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
5 changed files with 52 additions and 9 deletions

View file

@ -208,9 +208,9 @@ angular.module('copayApp.services')
};
var shouldSkipValidation = function(walletId) {
return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWP;
}
// Used when reading wallets from the profile
return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWP;
}
// Used when reading wallets from the profile
root.bindWallet = function(credentials, cb) {
if (!credentials.walletId || !credentials.m)
return cb('bindWallet should receive credentials JSON');
@ -618,6 +618,8 @@ angular.module('copayApp.services')
walletClient.importFromMnemonic(words, {
network: opts.networkName,
passphrase: opts.passphrase,
entropySourcePath: opts.entropySourcePath,
derivationStrategy: opts.derivationStrategy || 'BIP44',
account: opts.account || 0,
}, function(err) {
if (err) {

View file

@ -18,7 +18,9 @@ angular.module('copayApp.services')
};
root.getEntropySource = function(isMultisig, account, callback) {
console.log('[trezor.js.20:isMultisig:]',root.description.id, isMultisig, account); //TODO
root.getXPubKey(hwWallet.getEntropyPath(root.description.id, isMultisig, account), function(data) {
console.log('[trezor.js.21:data:]',data); //TODO
if (!data.success)
return callback(hwWallet._err(data));
@ -30,6 +32,7 @@ angular.module('copayApp.services')
root.getXPubKey = function(path, callback) {
$log.debug('TREZOR deriving xPub path:', path);
try {
console.log('[trezor.js.35:path:]',path); //TODO
TrezorConnect.getXPubKey(path, callback);
} catch (e) {
callback('Error connecting Trezor');