Merge branch 'master' of https://github.com/bitpay/copay into v3.5.0
This commit is contained in:
commit
19824e8fde
73 changed files with 200 additions and 94 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('importController',
|
||||
function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog, appConfigService) {
|
||||
function($scope, $timeout, $log, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, profileService, configService, sjcl, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService, popupService, gettextCatalog, appConfigService, hwWallet) {
|
||||
|
||||
var reader = new FileReader();
|
||||
var defaults = configService.getDefaults();
|
||||
|
|
@ -17,6 +17,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.formData.account = 1;
|
||||
$scope.importErr = false;
|
||||
$scope.isCopay = appConfigService.name == 'copay';
|
||||
$scope.fromHardwareWallet = { value: false };
|
||||
|
||||
if ($stateParams.code)
|
||||
$scope.processWalletInfo($stateParams.code);
|
||||
|
|
@ -38,6 +39,21 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.formData.seedSource = $scope.seedOptions[0];
|
||||
}
|
||||
|
||||
|
||||
$scope.seedOptionsAll = [];
|
||||
|
||||
$scope.seedOptionsAll.push({
|
||||
id: walletService.externalSource.ledger.id,
|
||||
label: walletService.externalSource.ledger.longName,
|
||||
});
|
||||
|
||||
$scope.seedOptionsAll.push({
|
||||
id: walletService.externalSource.trezor.id,
|
||||
label: walletService.externalSource.trezor.longName,
|
||||
});
|
||||
$scope.formData.seedSourceAll = $scope.seedOptionsAll[0];
|
||||
|
||||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
|
|
@ -159,6 +175,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
|
||||
$timeout(function() {
|
||||
profileService.importMnemonic(words, opts, function(err, client) {
|
||||
|
||||
ongoingProcess.set('importingWallet', false);
|
||||
|
||||
if (err) {
|
||||
|
|
@ -177,7 +194,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
};
|
||||
|
||||
$scope.setDerivationPath = function() {
|
||||
$scope.formData.derivationPath = $scope.formData.testnetEnabled ? derivationPathHelper.defaultTestnet : derivationPathHelper.default;
|
||||
$scope.formData.testnetEnabled ? derivationPathHelper.defaultTestnet : derivationPathHelper.default;
|
||||
};
|
||||
|
||||
$scope.getFile = function() {
|
||||
|
|
@ -256,6 +273,17 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
}
|
||||
|
||||
opts.passphrase = $scope.formData.passphrase || null;
|
||||
|
||||
if ($scope.fromHardwareWallet.value) {
|
||||
$log.debug('Importing seed from hardware wallet');
|
||||
$log.warn('This wont work for Intel TEE wallets');
|
||||
|
||||
var id = $scope.formData.seedSourceAll.id;
|
||||
var isMultisig = opts.derivationStrategy =='BIP48';
|
||||
var account = opts.account;
|
||||
opts.entropySourcePath = 'm/' + hwWallet.getEntropyPath(id, isMultisig, account);
|
||||
}
|
||||
|
||||
_importMnemonic(words, opts);
|
||||
};
|
||||
|
||||
|
|
@ -269,6 +297,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
|
||||
lopts.externalSource = walletService.externalSource.trezor.id;
|
||||
lopts.bwsurl = $scope.formData.bwsurl;
|
||||
lopts.account = account;
|
||||
ongoingProcess.set('importingWallet', true);
|
||||
$log.debug('Import opts', lopts);
|
||||
|
||||
|
|
@ -325,6 +354,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
|
||||
lopts.externalSource = lopts.externalSource = walletService.externalSource.ledger.id;
|
||||
lopts.bwsurl = $scope.formData.bwsurl;
|
||||
lopts.account = account;
|
||||
ongoingProcess.set('importingWallet', true);
|
||||
$log.debug('Import opts', lopts);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ angular.module('copayApp.controllers').controller('lockSetupController', functio
|
|||
|
||||
function getSavedMethod() {
|
||||
var config = configService.getSync();
|
||||
if (config.lock) return config.lock.method;
|
||||
if (config.lock && config.lock.method) return config.lock.method;
|
||||
return 'none';
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -128,6 +128,16 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
updateWalletsList();
|
||||
};
|
||||
|
||||
$scope.searchInFocus = function() {
|
||||
$scope.searchFocus = true;
|
||||
};
|
||||
|
||||
$scope.searchBlurred = function() {
|
||||
if ($scope.formData.search == null) {
|
||||
$scope.searchFocus = false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.findContact = function(search) {
|
||||
|
||||
if (incomingData.redir(search)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue