Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

FANtium/torus-wagmi-connector

 
 

Repository files navigation

Ledger

Torus Wagmi Connector

Wagmi Connector for Torus Wallet

About

@toruslabs/torus-wagmi-connector is a connector for the popular wagmi library built on top of the @toruslabs/torus-embed .

It can be used to initialize a wagmi client that will seemlessly manage the interaction of your DApp with Torus Wallet.

How to use

Here is an example of a wagmi client using both the TorusConnector and the default InjectedConnector respectively.

import { TorusConnector } from "@toruslabs/torus-wagmi-connector";
import { chain, configureChains, createClient } from "wagmi";
import { InjectedConnector } from "wagmi/connectors/injected";
import { publicProvider } from "wagmi/providers/public";

const { chains, provider } = configureChains(
  [chain.mainnet, chain.polygon],
  [publicProvider()],
);

const wagmiClient = createClient({
  autoConnect: true,
  connectors: [
    new TorusConnector({
      chains: chains,
      options: {
        chainId: "0x1",
        host: "mainnet",
      },
    }),
    new InjectedConnector({ chains }),
  ],
  provider,
});

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%