@qhecuba/hector-react-hooks
TypeScript icon, indicating that this package has built-in type declarations

0.0.24 • Public • Published

hector-react-hooks

Hector React hooks

This package also installs hector-metamask and hector packages.

Install

Npm:

npm install @qhecuba/hector-react-hooks

Yarn:

yarn add @qhecuba/hector-react-hooks

Usage

const [status, connect, getWallet] = useConnect(wallets.metamask());

Example

import React from "react";
import { useConnect, wallets } from "@qhecuba/hector-react-hooks";
import { useEffect } from "react";

function App() {
    const [status, connect, getWallet] = useConnect(wallets.metamask());

    useEffect(() => {
        connect();
        getWallet();
    }, []);

    return (
        <div className="App">
            <h1>{status.isConnected ? "Connected" : "Not connected"}</h1>
            <p>Wallet: {status.wallet}</p>
            <button onClick={connect}>Connect</button>
        </div>
    );
}

export default App;

Dependents (0)

Package Sidebar

Install

npm i @qhecuba/hector-react-hooks

Weekly Downloads

2

Version

0.0.24

License

ISC

Unpacked Size

7.49 kB

Total Files

10

Last publish

Collaborators

  • mahdiabedi1384