Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active March 24, 2023 08:45
Show Gist options
  • Save miguelmota/29da2d51a8304defbfc4ef398bcc9558 to your computer and use it in GitHub Desktop.
Save miguelmota/29da2d51a8304defbfc4ef398bcc9558 to your computer and use it in GitHub Desktop.
Ethers.js Ledger Signer example
const { providers } = require('ethers')
const { LedgerSigner } = require('@ethersproject/hardware-wallets')
const provider = new providers.JsonRpcProvider('https://mainnet.infura.io')
const type = 'hid'
const path = `m/44'/60'/0'/0/0`
const signer = new LedgerSigner(provider, type, path)
const address = await signer.getAddress()
console.log(address)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment