Improve detection of supported hw wallets.
This commit is contained in:
parent
0c69dfb061
commit
8d63fa3507
6 changed files with 30 additions and 27 deletions
|
|
@ -5,20 +5,21 @@ angular.module('copayApp.services')
|
|||
|
||||
var root = {};
|
||||
|
||||
if (!platformInfo.isIntelTEE) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var IntelWallet = require('intelWalletCon');
|
||||
var TEE_APP_ID = '63279de1b6cb4dcf8c206716bd318092f8c206716bd31809263279de1b6cb4dc';
|
||||
|
||||
root.description = {
|
||||
supports: platformInfo.supportsIntelTEE,
|
||||
id: 'intelTEE',
|
||||
name: 'Intel TEE',
|
||||
longName: 'Intel TEE Hardware Wallet',
|
||||
derivationStrategy: 'BIP44'
|
||||
};
|
||||
|
||||
if (!root.description.isAvailable) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var IntelWallet = require('intelWalletCon');
|
||||
var TEE_APP_ID = '63279de1b6cb4dcf8c206716bd318092f8c206716bd31809263279de1b6cb4dc';
|
||||
|
||||
root.walletEnclave = new IntelWallet.Wallet();
|
||||
var walletEnclaveStatus = root.walletEnclave.initializeEnclave();
|
||||
if (walletEnclaveStatus != 0) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services')
|
||||
.factory('ledger', function($log, bwcService, gettext, hwWallet) {
|
||||
.factory('ledger', function($log, bwcService, gettext, hwWallet, platformInfo) {
|
||||
var root = {};
|
||||
var LEDGER_CHROME_ID = "kkdpmhnladdopljabkgpacgpliggeeaf";
|
||||
|
||||
root.description = {
|
||||
supports: platformInfo.supportsLedger,
|
||||
id: 'ledger',
|
||||
name: 'Ledger',
|
||||
longName: 'Ledger Hardware Wallet'
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@ angular.module('copayApp.services').factory('platformInfo', function($window) {
|
|||
ret.isMobile = ret.isAndroid || ret.isIOS || ret.isWP;
|
||||
ret.isChromeApp = $window.chrome && chrome.runtime && chrome.runtime.id && !ret.isNW;
|
||||
ret.isDevel = !ret.isMobile && !ret.isChromeApp && !ret.isNW;
|
||||
ret.isIntelTEE = true;
|
||||
|
||||
ret.supportsLedger = ret.isChromeApp;
|
||||
ret.supportsTrezor = ret.isChromeApp || ret.isDevel;
|
||||
ret.supportsIntelTEE = false;
|
||||
|
||||
return ret;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services')
|
||||
.factory('trezor', function($log, $timeout, lodash, bitcore, hwWallet) {
|
||||
.factory('trezor', function($log, $timeout, lodash, bitcore, hwWallet, platformInfo) {
|
||||
var root = {};
|
||||
|
||||
var SETTLE_TIME = 3000;
|
||||
root.callbacks = {};
|
||||
|
||||
root.description = {
|
||||
supported: platformInfo.supportsTrezor,
|
||||
id: 'trezor',
|
||||
name: 'Trezor',
|
||||
longName: 'Trezor Hardware Wallet',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue