Ledger
The LedgerConnector
supports connecting with a Ledger device using the Ledger Connect Kit.
import { LedgerConnector } from 'wagmi/connectors/ledger'
Usage
import { mainnet } from 'wagmi/chains'
import { LedgerConnector } from 'wagmi/connectors/ledger'
const connector = new LedgerConnector({
chains: [mainnet],
})
Note: The above example is using chains from wagmi/chains
entrypoint.
Configuration
chains (optional)
Chains supported by app. Defaults to defaultChains
.
import { mainnet } from 'wagmi/chains'
import { LedgerConnector } from 'wagmi/connectors/ledger'
const connector = new LedgerConnector({
chains: [mainnet],
})
options
chainId
The Chain ID of the connecting chain.
import { LedgerConnector } from 'wagmi/connectors/ledger'
const connector = new LedgerConnector({
options: {
chainId: 1,
},
})
enableDebugLogs
Toggle debug logging for Ledger Connect Kit.
import { LedgerConnector } from 'wagmi/connectors/ledger'
const connector = new LedgerConnector({
options: {
enableDebugLogs: true,
},
})
rpc
A Chain ID (key) / RPC URL (value) map.
import { LedgerConnector } from 'wagmi/connectors/ledger'
const connector = new LedgerConnector({
options: {
rpc: {
1: 'https://eth-mainnet.alchemyapi.io/v2/yourAlchemyId',
},
},
})