mirror of https://github.com/BTCPrivate/copay.git
BWC 4.0 WIP
This commit is contained in:
parent
cc7bc88ee6
commit
5864afd8c0
|
@ -42,7 +42,7 @@
|
||||||
"url": "https://github.com/bitpay/copay/issues"
|
"url": "https://github.com/bitpay/copay/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bitcore-wallet-client": "2.11.0",
|
"bitcore-wallet-client": "4.0.0",
|
||||||
"coveralls": "^2.11.9",
|
"coveralls": "^2.11.9",
|
||||||
"express": "^4.11.2",
|
"express": "^4.11.2",
|
||||||
"fs": "0.0.2",
|
"fs": "0.0.2",
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
"url": "https://github.com/bitpay/copay/issues"
|
"url": "https://github.com/bitpay/copay/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bitcore-wallet-client": "2.11.0",
|
"bitcore-wallet-client": "4.0.0",
|
||||||
"coveralls": "^2.11.9",
|
"coveralls": "^2.11.9",
|
||||||
"express": "^4.11.2",
|
"express": "^4.11.2",
|
||||||
"fs": "0.0.2",
|
"fs": "0.0.2",
|
||||||
|
|
|
@ -20,18 +20,12 @@
|
||||||
<i class="icon ion-ios-arrow-right"></i>
|
<i class="icon ion-ios-arrow-right"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span translate>Devices</span>
|
<span translate>Wallet Type</span>
|
||||||
<span class="item-note">
|
<span class="item-note">
|
||||||
1
|
wallet.m-of-wallet.n
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item" ng-show="wallet.isPrivKeyExternal()">
|
||||||
<span translate>Required number of signatures</span>
|
|
||||||
<span class="item-note">
|
|
||||||
1
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="item" ng-show="index.isPrivKeyExternal">
|
|
||||||
<span translate>Hardware wallet</span>
|
<span translate>Hardware wallet</span>
|
||||||
<span class="item-note">
|
<span class="item-note">
|
||||||
{{wallet.externalSource}}
|
{{wallet.externalSource}}
|
||||||
|
@ -56,15 +50,20 @@
|
||||||
<div class="item item-divider">
|
<div class="item item-divider">
|
||||||
Security
|
Security
|
||||||
</div>
|
</div>
|
||||||
<div class="item item-icon-right" href ui-sref="wallet.backup" ng-hide="index.isPrivKeyExternal">
|
<div class="item item-icon-right" href ui-sref="wallet.backup" ng-hide="wallet.isPrivKeyExternal()">
|
||||||
<span translate>Backup</span>
|
<span translate>Backup</span>
|
||||||
<i class="icon ion-ios-arrow-right"></i>
|
<i class="icon ion-ios-arrow-right"></i>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="!index.noFocusedWallet && index.canSign">
|
<div ng-show="wallet.canSign()">
|
||||||
<ion-toggle ng-model="encryptEnabled" toggle-class="toggle-balanced" ng-change="encryptChange()">
|
<ion-toggleng-model="encryptEnabled" toggle-class="toggle-balanced" ng-change="encryptChange()">
|
||||||
<span class="toggle-label" translate>Request Spending Password</span>
|
<span class="toggle-label" translate>Request Spending Password</span>
|
||||||
</ion-toggle>
|
</ion-toggle>
|
||||||
</div>
|
</div>
|
||||||
|
<div ng-show="wallet.canSign() && touchIdAvailable">
|
||||||
|
<ion-toggle ng-model="touchIdEnabled" toggle-class="toggle-balanced" ng-change="touchIdChange()">
|
||||||
|
<span class="toggle-label" translate>Request Fingerprint</span>
|
||||||
|
</ion-toggle>
|
||||||
|
</div>
|
||||||
<div class="item item-icon-right" href ui-sref="wallet.deleteWords" ng-show ="!deleted">
|
<div class="item item-icon-right" href ui-sref="wallet.deleteWords" ng-show ="!deleted">
|
||||||
<span translate>Delete recovery phrase</span>
|
<span translate>Delete recovery phrase</span>
|
||||||
<i class="icon ion-ios-arrow-right"></i>
|
<i class="icon ion-ios-arrow-right"></i>
|
||||||
|
|
|
@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
|
function($rootScope, $scope, $timeout, $log, $state, $stateParams, $ionicPopup, uxLanguage, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
|
||||||
|
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
|
var xPriv6;
|
||||||
$scope.walletName = wallet.credentials.walletName;
|
$scope.walletName = wallet.credentials.walletName;
|
||||||
$scope.n = wallet.n;
|
$scope.n = wallet.n;
|
||||||
|
|
||||||
|
@ -15,36 +16,17 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var handleEncryptedWallet = function(client, cb) {
|
|
||||||
if (!walletService.isEncrypted(client)) {
|
|
||||||
return cb();
|
|
||||||
}
|
|
||||||
|
|
||||||
$rootScope.$emit('Local/NeedsPassword', false, function(err, password) {
|
|
||||||
if (err) return cb(err);
|
|
||||||
return cb(walletService.unlock(client, password));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
$scope.deleted = isDeletedSeed();
|
$scope.deleted = isDeletedSeed();
|
||||||
if ($scope.deleted) return;
|
if ($scope.deleted) return;
|
||||||
|
|
||||||
fingerprintService.check(wallet, function(err) {
|
walletService.getKey(wallet, function(err, mnemonics, xpriv) {
|
||||||
if (err) {
|
if (err) {
|
||||||
$state.go('preferences');
|
$state.go('preferences');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$scope.credentialsEncrypted = false;
|
||||||
handleEncryptedWallet(wallet, function(err) {
|
$scope.initFlow(mnemonics, xpriv);
|
||||||
if (err) {
|
|
||||||
$log.warn('Error decrypting credentials:', $scope.error);
|
|
||||||
$state.go('preferences');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$scope.credentialsEncrypted = false;
|
|
||||||
$scope.initFlow();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -61,7 +43,8 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
|
|
||||||
$scope.initFlow = function() {
|
$scope.initFlow = function() {
|
||||||
var words = wallet.getMnemonic();
|
var words = wallet.getMnemonic();
|
||||||
$scope.xPrivKey = wallet.credentials.xPrivKey;
|
xPriv6 = wallet.credentials.xPrivKey.substr(wallet.credentials.xPrivKey.length - 6);
|
||||||
|
|
||||||
$scope.mnemonicWords = words.split(/[\u3000\s]+/);
|
$scope.mnemonicWords = words.split(/[\u3000\s]+/);
|
||||||
$scope.shuffledMnemonicWords = shuffledWords($scope.mnemonicWords);
|
$scope.shuffledMnemonicWords = shuffledWords($scope.mnemonicWords);
|
||||||
$scope.mnemonicHasPassphrase = wallet.mnemonicHasPassphrase();
|
$scope.mnemonicHasPassphrase = wallet.mnemonicHasPassphrase();
|
||||||
|
@ -72,6 +55,7 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
$scope.selectComplete = false;
|
$scope.selectComplete = false;
|
||||||
$scope.backupError = false;
|
$scope.backupError = false;
|
||||||
|
|
||||||
|
words = lodash.repeat('x', 300);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 10);
|
}, 10);
|
||||||
|
@ -139,10 +123,12 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
account: wallet.credentials.account
|
account: wallet.credentials.account
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
walletClient.credentials.xPrivKey = lodash.repeat('x', 64);
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (walletClient.credentials.xPrivKey != $scope.xPrivKey) {
|
if (walletClient.credentials.xPrivKey.substr(walletClient.credentials.xPrivKey-6) != xPriv6) {
|
||||||
|
walletClient.credentials.xPrivKey = lodash.repeat('x', 64);
|
||||||
return cb('Private key mismatch');
|
return cb('Private key mismatch');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,6 +141,7 @@ angular.module('copayApp.controllers').controller('backupController',
|
||||||
var finalStep = function() {
|
var finalStep = function() {
|
||||||
ongoingProcess.set('validatingWords', true);
|
ongoingProcess.set('validatingWords', true);
|
||||||
confirm(function(err) {
|
confirm(function(err) {
|
||||||
|
xPriv6 = lodash.repeat('x', 6);
|
||||||
ongoingProcess.set('validatingWords', false);
|
ongoingProcess.set('validatingWords', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
backupError(err);
|
backupError(err);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesController',
|
angular.module('copayApp.controllers').controller('preferencesController',
|
||||||
function($scope, $rootScope, $timeout, $log, $stateParams, configService, profileService, fingerprintService, walletService) {
|
function($scope, $rootScope, $timeout, $log, $stateParams, configService, profileService, fingerprintService, walletService, $state) {
|
||||||
|
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
var walletId = wallet.credentials.walletId;
|
var walletId = wallet.credentials.walletId;
|
||||||
|
@ -10,22 +10,20 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
$scope.externalSource = null;
|
$scope.externalSource = null;
|
||||||
|
|
||||||
if (wallet) {
|
if (!wallet)
|
||||||
var config = configService.getSync();
|
return $state.go('tabs.home');
|
||||||
config.aliasFor = config.aliasFor || {};
|
|
||||||
$scope.alias = config.aliasFor[walletId] || wallet.credentials.walletName;
|
|
||||||
$scope.color = config.colorFor[walletId] || '#4A90E2';
|
|
||||||
|
|
||||||
$scope.encryptEnabled = walletService.isEncrypted(wallet);
|
var config = configService.getSync();
|
||||||
if (wallet.isPrivKeyExternal)
|
config.aliasFor = config.aliasFor || {};
|
||||||
$scope.externalSource = wallet.getPrivKeyExternalSourceName() == 'ledger' ? 'Ledger' : 'Trezor';
|
$scope.alias = config.aliasFor[walletId] || wallet.credentials.walletName;
|
||||||
|
$scope.color = config.colorFor[walletId] || '#4A90E2';
|
||||||
|
|
||||||
// TODO externalAccount
|
$scope.encryptEnabled = walletService.isEncrypted(wallet);
|
||||||
//this.externalIndex = wallet.getExternalIndex();
|
if (wallet.isPrivKeyExternal)
|
||||||
}
|
$scope.externalSource = wallet.getPrivKeyExternalSourceName() == 'ledger' ? 'Ledger' : 'Trezor';
|
||||||
|
|
||||||
$scope.touchidAvailable = fingerprintService.isAvailable();
|
$scope.touchIdAvailable = fingerprintService.isAvailable();
|
||||||
$scope.touchidEnabled = config.touchIdFor ? config.touchIdFor[walletId] : null;
|
$scope.touchIdEnabled = config.touchIdFor ? config.touchIdFor[walletId] : null;
|
||||||
|
|
||||||
$scope.deleted = false;
|
$scope.deleted = false;
|
||||||
if (wallet.credentials && !wallet.credentials.mnemonicEncrypted && !wallet.credentials.mnemonic) {
|
if (wallet.credentials && !wallet.credentials.mnemonicEncrypted && !wallet.credentials.mnemonic) {
|
||||||
|
@ -101,29 +99,15 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.touchidChange = function() {
|
$scope.touchIdChange = function() {
|
||||||
|
var newStatus = $scope.touchIdEnabled;
|
||||||
var opts = {
|
walletService.setTouchId(wallet, newStatus, function(err) {
|
||||||
touchIdFor: {}
|
|
||||||
};
|
|
||||||
opts.touchIdFor[walletId] = $scope.touchidEnabled;
|
|
||||||
|
|
||||||
fingerprintService.check(wallet, function(err) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.debug(err);
|
$log.warn(err);
|
||||||
$timeout(function() {
|
$scope.touchIdEnabled = !newStatus;
|
||||||
$scope.touchidError = true;
|
|
||||||
$scope.touchidEnabled = true;
|
|
||||||
}, 100);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
configService.set(opts, function(err) {
|
$log.debug('Touch Id status changed: ' + newStatus);
|
||||||
if (err) {
|
|
||||||
$log.debug(err);
|
|
||||||
$scope.touchidError = true;
|
|
||||||
$scope.touchidEnabled = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -547,27 +547,6 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
return isEncrypted;
|
return isEncrypted;
|
||||||
};
|
};
|
||||||
|
|
||||||
root.lock = function(wallet) {
|
|
||||||
try {
|
|
||||||
wallet.lock();
|
|
||||||
} catch (e) {
|
|
||||||
$log.warn('Encrypting wallet:', e);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
root.unlock = function(wallet, password) {
|
|
||||||
if (lodash.isEmpty(wallet))
|
|
||||||
return 'MISSING_PARAMETER';
|
|
||||||
if (lodash.isEmpty(password))
|
|
||||||
return 'NO_PASSWORD_GIVEN';
|
|
||||||
try {
|
|
||||||
wallet.unlock(password);
|
|
||||||
} catch (e) {
|
|
||||||
$log.warn('Decrypting wallet:', e);
|
|
||||||
return 'PASSWORD_INCORRECT';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
root.createTx = function(wallet, txp, cb) {
|
root.createTx = function(wallet, txp, cb) {
|
||||||
if (lodash.isEmpty(txp) || lodash.isEmpty(wallet))
|
if (lodash.isEmpty(txp) || lodash.isEmpty(wallet))
|
||||||
return cb('MISSING_PARAMETER');
|
return cb('MISSING_PARAMETER');
|
||||||
|
@ -619,8 +598,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.signTx = function(wallet, txp, cb) {
|
root.signTx = function(wallet, txp, password, cb) {
|
||||||
if (lodash.isEmpty(txp) || lodash.isEmpty(wallet))
|
if (lodash.isEmpty(txp) || lodash.isEmpty(wallet) || lodash.isEmpty(cb))
|
||||||
return cb('MISSING_PARAMETER');
|
return cb('MISSING_PARAMETER');
|
||||||
|
|
||||||
if (wallet.isPrivKeyExternal()) {
|
if (wallet.isPrivKeyExternal()) {
|
||||||
|
@ -637,8 +616,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
wallet.signTxProposal(txp, function(err, signedTxp) {
|
wallet.signTxProposal(txp, password, function(err, signedTxp) {
|
||||||
$log.debug('Transaction signed');
|
$log.debug('Transaction signed err:' + err);
|
||||||
return cb(err, signedTxp);
|
return cb(err, signedTxp);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -896,7 +875,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
|
|
||||||
askPassword(wallet.name, function(password) {
|
askPassword(wallet.name, function(password) {
|
||||||
if (!password) return cb('no password');
|
if (!password) return cb('no password');
|
||||||
return cb(root.unlock(wallet, password));
|
|
||||||
|
return cb(null, password);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -932,6 +912,19 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
root.prepare = function(wallet, cb) {
|
||||||
|
fingerprintService.check(wallet, function(err) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
|
||||||
|
root.handleEncryptedWallet(wallet, function(err, password) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
|
||||||
|
return cb(null, password);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
root.publishAndSign = function(wallet, txp, cb) {
|
root.publishAndSign = function(wallet, txp, cb) {
|
||||||
|
|
||||||
var publishFn = root.publishTx;
|
var publishFn = root.publishTx;
|
||||||
|
@ -943,56 +936,50 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
fingerprintService.check(wallet, function(err) {
|
root.prepare(wallet, function(err, password) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
root.handleEncryptedWallet(wallet, function(err) {
|
ongoingProcess.set('sendingTx', true);
|
||||||
|
publishFn(wallet, txp, function(err, publishedTxp) {
|
||||||
|
ongoingProcess.set('sendingTx', false);
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
ongoingProcess.set('sendingTx', true);
|
ongoingProcess.set('signingTx', true);
|
||||||
publishFn(wallet, txp, function(err, publishedTxp) {
|
root.signTx(wallet, publishedTxp, password, function(err, signedTxp) {
|
||||||
ongoingProcess.set('sendingTx', false);
|
ongoingProcess.set('signingTx', false);
|
||||||
if (err) return cb(err);
|
root.invalidateCache(wallet);
|
||||||
|
|
||||||
ongoingProcess.set('signingTx', true);
|
|
||||||
root.signTx(wallet, publishedTxp, function(err, signedTxp) {
|
|
||||||
root.lock(wallet);
|
|
||||||
|
|
||||||
ongoingProcess.set('signingTx', false);
|
|
||||||
root.invalidateCache(wallet);
|
|
||||||
|
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
// TODO?
|
// TODO?
|
||||||
var msg = err.message ?
|
var msg = err.message ?
|
||||||
err.message :
|
err.message :
|
||||||
gettext('The payment was created but could not be completed. Please try again from home screen');
|
gettext('The payment was created but could not be completed. Please try again from home screen');
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signedTxp.status == 'accepted') {
|
if (signedTxp.status == 'accepted') {
|
||||||
ongoingProcess.set('broadcastingTx', true);
|
ongoingProcess.set('broadcastingTx', true);
|
||||||
root.broadcastTx(wallet, signedTxp, function(err, broadcastedTxp) {
|
root.broadcastTx(wallet, signedTxp, function(err, broadcastedTxp) {
|
||||||
ongoingProcess.set('broadcastingTx', false);
|
ongoingProcess.set('broadcastingTx', false);
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
var type = txStatus.notify(broadcastedTxp);
|
var type = txStatus.notify(broadcastedTxp);
|
||||||
root.openStatusModal(type, broadcastedTxp, function() {
|
root.openStatusModal(type, broadcastedTxp, function() {
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
return cb(null, broadcastedTxp)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
var type = txStatus.notify(signedTxp);
|
|
||||||
root.openStatusModal(type, signedTxp, function() {
|
|
||||||
root.invalidateCache(wallet);
|
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
});
|
});
|
||||||
return cb(null, signedTxp);
|
|
||||||
}
|
return cb(null, broadcastedTxp)
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
var type = txStatus.notify(signedTxp);
|
||||||
|
root.openStatusModal(type, signedTxp, function() {
|
||||||
|
root.invalidateCache(wallet);
|
||||||
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
|
});
|
||||||
|
return cb(null, signedTxp);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1004,7 +991,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
notifications = lodash.filter(notifications, function(x) {
|
notifications = lodash.filter(notifications, function(x) {
|
||||||
return x.type != 'NewBlock' && x.type != 'BalanceUpdated' && x.type !='NewOutgoingTxByThirdParty';
|
return x.type != 'NewBlock' && x.type != 'BalanceUpdated' && x.type != 'NewOutgoingTxByThirdParty';
|
||||||
});
|
});
|
||||||
|
|
||||||
var idToName = {};
|
var idToName = {};
|
||||||
|
@ -1110,7 +1097,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// messsages...
|
// messages...
|
||||||
|
|
||||||
var u = bwcService.getUtils();
|
var u = bwcService.getUtils();
|
||||||
lodash.each(finale, function(x) {
|
lodash.each(finale, function(x) {
|
||||||
|
@ -1124,6 +1111,31 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
root.setTouchId = function(wallet, enabled, cb) {
|
||||||
|
fingerprintService.check(wallet, function(err) {
|
||||||
|
if (err) return cb(err); {
|
||||||
|
$log.debug(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
configService.set(opts, cb);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
root.getKey = function(wallet, cb) {
|
||||||
|
root.prepare(wallet, function(err, password) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
var keys;
|
||||||
|
|
||||||
|
try {
|
||||||
|
keys = wallet.getKeys(password);
|
||||||
|
} catch (e) {
|
||||||
|
return cb(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cb(null, keys);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue