Skip to content

Commit

Permalink
Update gh-pages to receive chainId, update Ledger library to 6.5.0 (M…
Browse files Browse the repository at this point in the history
…etaMask#95)

* Update gh-pages to receive chainId, update Ledger library to 6.4.1

* Add safety so that old and new lookup work properly

* Address feedback: check for chainId

* Pin to specific version to avoid semver issues

* v6.5.0 bycontractaddress removal

* Removed unused import

* Specificy npm v7.6.1 in engines property of package.json

* Update lockfile

* Remove unused parameter from signTransaction in ledger-bridge

Co-authored-by: Dan Miller <[email protected]>
Co-authored-by: Mark Stacey <[email protected]>
  • Loading branch information
3 people authored and Akaryatrh committed Dec 12, 2024
1 parent 943db40 commit 397f186
Show file tree
Hide file tree
Showing 4 changed files with 44,530 additions and 6,007 deletions.
38,846 changes: 33,027 additions & 5,819 deletions bundle.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions ledger-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ require('buffer')

import TransportU2F from '@ledgerhq/hw-transport-u2f'
import LedgerEth from '@ledgerhq/hw-app-eth'
import { byContractAddress } from '@ledgerhq/hw-app-eth/erc20'
import WebSocketTransport from '@ledgerhq/hw-transport-http/lib/WebSocketTransport'

// URL which triggers Ledger Live app to open and handle communication
Expand All @@ -30,7 +29,7 @@ export default class LedgerBridge {
this.unlock(replyAction, params.hdPath)
break
case 'ledger-sign-transaction':
this.signTransaction(replyAction, params.hdPath, params.tx, params.to)
this.signTransaction(replyAction, params.hdPath, params.tx)
break
case 'ledger-sign-personal-message':
this.signPersonalMessage(replyAction, params.hdPath, params.message)
Expand Down Expand Up @@ -140,13 +139,9 @@ export default class LedgerBridge {
}
}

async signTransaction (replyAction, hdPath, tx, to) {
async signTransaction (replyAction, hdPath, tx) {
try {
await this.makeApp()
if (to) {
const isKnownERC20Token = byContractAddress(to)
if (isKnownERC20Token) await this.app.provideERC20TokenInformation(isKnownERC20Token)
}
const res = await this.app.signTransaction(hdPath, tx)
this.sendMessageToExtension({
action: replyAction,
Expand Down
Loading

0 comments on commit 397f186

Please sign in to comment.