Skip to content

Commit 2fdf90e

Browse files
mmv08taylorjdawson
andauthored
1.32.0-0.2.1: [fix] Ledger Transport boolean expression assignment, log errors (#648)
* fix transport boolean expression * remove unused variable * Fix typescript problem, remove prettier plugin from config * fix compilation * remove store type arg * Version bump + revert yarn.lock change Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
1 parent cc4ddcb commit 2fdf90e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.prettierrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ module.exports = {
55
printWidth: 80,
66
tabWidth: 2,
77
arrowParens: 'avoid',
8-
svelteSortOrder: 'options-scripts-styles-markup',
9-
plugins: ['prettier-plugin-svelte']
8+
svelteSortOrder: 'options-scripts-styles-markup'
109
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.32.0-0.2.0",
3+
"version": "1.32.0-0.2.1",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",

src/modules/select/wallets/ledger.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ async function ledgerProvider(options: LedgerProviderOptions) {
8989
const { Transaction } = await import('@ethereumjs/tx')
9090
const { default: Common } = await import('@ethereumjs/common')
9191
const ethUtil = await import('ethereumjs-util')
92-
const buffer = await import('buffer')
9392
const { TypedDataUtils } = await import('eth-sig-util')
9493

9594
const domainHash = (message: any) => {
@@ -232,17 +231,19 @@ async function ledgerProvider(options: LedgerProviderOptions) {
232231
}
233232

234233
// Get the Transport class
235-
const Transport =
236-
LedgerTransport || (await supportsWebUSB())
234+
let Transport = LedgerTransport
235+
if (!Transport) {
236+
Transport = (await supportsWebUSB())
237237
? (await import('@ledgerhq/hw-transport-webusb')).default
238238
: (await import('@ledgerhq/hw-transport-u2f')).default
239-
239+
}
240240
transport = await Transport.create()
241241

242242
eth = new Eth(transport)
243243

244244
Transport.listen(observer)
245245
} catch (error) {
246+
console.error(error)
246247
throw new Error('Error connecting to Ledger wallet')
247248
}
248249
}
@@ -300,6 +301,7 @@ async function ledgerProvider(options: LedgerProviderOptions) {
300301

301302
return account
302303
} catch (error) {
304+
console.error({ error })
303305
throw new Error('There was a problem accessing your Ledger accounts.')
304306
}
305307
}

0 commit comments

Comments
 (0)