1import Transport from '@ledgerhq/hw-transport-u2f'
2import Eth from '@ledgerhq/hw-app-eth'
4const LEDGER_BASE_PATH = "44'/60'/0'/0/0"
6const ledgerSignTransaction = async txn => {
7 const transport = await Transport.create()
8 const eth = new Eth(transport)
10 const serializedTx = txn.serialize().toString('hex')
11 const sig = await eth.signTransaction(LEDGER_BASE_PATH, serializedTx)
13 txn.v = Buffer.from(sig.v, 'hex')
14 txn.r = Buffer.from(sig.r, 'hex')
15 txn.s = Buffer.from(sig.s, 'hex')
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list