Last active
March 24, 2023 08:45
-
-
Save miguelmota/29da2d51a8304defbfc4ef398bcc9558 to your computer and use it in GitHub Desktop.
Ethers.js Ledger Signer example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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