Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gh-pages to receive chainId, update Ledger library to 6.5.0 #95

Merged
merged 9 commits into from
Aug 30, 2021
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)
Gudahtt marked this conversation as resolved.
Show resolved Hide resolved
if (isKnownERC20Token) await this.app.provideERC20TokenInformation(isKnownERC20Token)
}
const res = await this.app.signTransaction(hdPath, tx)
this.sendMessageToExtension({
action: replyAction,
Expand Down
Loading