Skip to content

hlopes-ledger/ledger-wagmi-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

@ledgerhq/ledger-wagmi-connector is a connector for the popular wagmi library based on the Ledger Connect Kit, @ledgerhq/connect-kit.

It can be used to add a Ledger button to your DApp.

How to use

Here is an example of a wagmi client using the Ledger wagmi connector.

import { configureChains, defaultChains } from 'wagmi';
import { publicProvider } from 'wagmi/providers/public';
import { LedgerConnector } from '@ledgerhq/ledger-wagmi-connector';

// Configure chains for connectors to support
const { chains } = configureChains(defaultChains, [
  publicProvider()
]);

// Set up connectors
export const connectors = {
  ledger: new LedgerConnector({
    chains,
    options: {
      enableDebugLogs: false,
      // passed to WalletConnect
      chainId: 1,
      // specify if no rpc, passed to WalletConnect
      infuraId: 'YOUR_INFURA_ID',
      // specify chain:URL if no infuraId, passed to WalletConnect
      rpc: {
        1: 'https://cloudflare-eth.com/', // Mainnet
        137: 'https://polygon-rpc.com/',  // Polygon
      }
    }
  }),
};

Contributing

You need to have a recent Node.js and pnpm installed.

Install dependencies

pnpm install

Build

Build the Connector

pnpm build

Lint

Check code quality with

pnpm lint

Documentation

Have a look at the wagmi repo and the wagmi doc to learn more on connectors and wagmi.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published