EthersJS is an Ethereum client connect library which can be used with MetaMask or TAILWIND.
Download TAILWIND extension
Download TAILWIND wallet adapter
yarn add @tailwindzone/connect
Use TAILWIND as an Ethereum Provider
import { connect } from "@tailwindzone/connect"; import { ethers } from "ethers"; const onSignClick = async () => { const tailwind = await connect(); // Use tailwind as ethers provider, just like window.ethereum // for MetaMask, you can also use `window.tailwind` directly. const provider = new ethers.BrowserProvider(tailwind); const signer = provider.getSigner(); const contract = new Contract( COUNTER_CONTRACT_ADDR, [ "function increment() public", "function decrement() public" ], signer ); const tx = await contract.increment(); await tx.wait(); }
Done!