allow importing HW seeds
This commit is contained in:
parent
7eede29079
commit
da15bc939b
5 changed files with 52 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue