open-index/open-npm huggingface dataset:
npm package: @hotpotdao/react-hooks
Description: ## des
Latest version: 0.0.2

# react-hooks

## des

- 钱包: 激活、取消
- 账户: 链接、断开

## usage

## example

```tsx
import { useEvm } from '@hotpotdao/react-hooks';

const Homepage = () => {
  const { isActive, activate, accounts, connect, chainId, wallet } = useEvm();
  const connectWallet = async () => {
    if (!isActive) await activate('metamask'); // 需要激活或者链接的钱包
    if (connect) await connect();
    console.log(wallet); // wallet is provider
  };
  return (
    <>
      <main>
        <h2>{chainId}</h2>
        <h3>{accounts}</h3>
        <button onClick={connectWallet}>链接钱包</button>
      </main>
    </>
  );
};

export default Homepage;
```