# metamask-react-button

> A button for metamask

Latest version **0.1.4** (published 2022-03-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install metamask-react-button
pnpm add metamask-react-button
yarn add metamask-react-button
bun add metamask-react-button
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2022-03-08 |
| First published | 2022-02-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | roylee1997, trextech |

## Links

- npm: https://www.npmjs.com/package/metamask-react-button
- npm.io page: https://npm.io/package/metamask-react-button

## Dependencies (2)

- [ethers](https://npm.io/package/ethers.md) ^5.5.4
- [styled-components](https://npm.io/package/styled-components.md) ^5.3.3

## Recent versions

- 0.1.4 (latest) — 2022-03-08
- 0.1.2 — 2022-02-26
- 0.1.0 — 2022-02-26

## README

# Example

```typescript
import { withMetaMask } from "metamask-react-button";

const Button = (props: any) => {
    console.log(props);
    const { requestAccounts, requestSign } = props;

    const handleClick = async () => {
        const accounts = await requestAccounts();
        console.log(accounts);
        const signature = await requestSign("Demo");
        console.log(signature);
    };

    return <button onClick={handleClick}>Click Me</button>;
};

const MetaMaskConnectButton = withMetaMask(Button);

function App() {
    return (
        <div className="App">
            <MetaMaskConnectButton />
        </div>
    );
}

export default App;
```

## Props

||

---
_Source: https://npm.io/package/metamask-react-button · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
