From 7fcf5193acbf8f10ef088bc8c7977ffd1bf9bc82 Mon Sep 17 00:00:00 2001 From: blurpesec Date: Fri, 12 Jun 2020 09:38:12 -0700 Subject: [PATCH] enable u2f? --- .../deterministic/DeterministicWalletService.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/WalletService/deterministic/DeterministicWalletService.tsx b/src/services/WalletService/deterministic/DeterministicWalletService.tsx index 4c98bac6d08..d8f264f010e 100644 --- a/src/services/WalletService/deterministic/DeterministicWalletService.tsx +++ b/src/services/WalletService/deterministic/DeterministicWalletService.tsx @@ -8,6 +8,8 @@ import { BalanceMap } from '@services/Store/BalanceService'; import { bigify } from '@utils'; +import TransportWebUSB from '@ledgerhq/hw-transport-webusb'; +import { LedgerU2F } from '../wallets'; interface EventHandlers { walletId: DPathFormat; @@ -30,7 +32,8 @@ export const DeterministicWalletService = ({ }: // walletId EventHandlers): IDeterministicWalletService => { const init = async (_: WalletId, asset: ExtendedAsset) => { - const wallet = new LedgerUSB() as Wallet; // @todo - fix the walletId & type + const isWebUSBSupported = await TransportWebUSB.isSupported().catch(() => false); + const wallet = isWebUSBSupported ? new LedgerUSB() : new LedgerU2F(); // @todo - fix the walletId & type wallet .initialize() .then(() => {