0.5.0 • Published 6 days ago

@daohaus/connect v0.5.0

Weekly downloads
-
License
-
Repository
github
Last release
6 days ago

@daohaus/connect

DAOhaus Connect provides a drop-in component for handling wallet connection. It includes additional functionality such as notifying users of unsupported networks, switching networks, and displaying ens data. It also includes a top-of-page navigation component and a layout component to enable rapid application development. It is opinionated and composed with the following libraries:

View on NPM

Usage

Installation

yarn add @daohaus/connect

Note: This will also install @daohaus/connect-context

Requirements

You will need to provide a Wallet Connect V2 api key as an env variable at NX_WALLET_CONNECT_ID. You can get those from Wallet Connect

NX_WALLET_CONNECT_ID=<some wc api key>

Examples

How to add to your application

import { DHConnectProvider } from `@daohaus/connect`;

ReactDOM.render(
  <StrictMode>
    <BrowserRouter>
      <DHConnectProvider
        daoId={"some dao id if scoping to a single dao"}
        daoChain={"some dao chain id if scoping to single chain"}>
        <App />
      </DHConnectProvider>
    </BrowserRouter>
  </StrictMode>,
document.getElementById('root')

How to add the DAOHaus layout and nav

import { HausLayout } from '@daohaus/daohaus-connect-feature'

<HausLayout
  pathname={location.pathname}
  navLinks={[{ label: 'Home', href: '/'` }]}
  footer={<Footer />}
>
  <YourApp /> // any other components that are needed
</HausLayout>

How to make a connect button

const { connectWallet } = useConnect();

<Button onClick={connectWallet} sm type="button">
  Connect
</Button>;

How to get connected wallet data

const { isConnected, address } = useConnect();

...

if (!isConnected) {
    return <ConnectWalletButton isSm={isSm} />;
  }

  return <p>{address}</p>;
};

Building

Run nx run connect:build to build the library.

0.5.0

6 days ago

0.4.5

7 days ago

0.4.4

1 month ago

0.4.3

2 months ago

0.4.2

3 months ago

0.4.1

4 months ago

0.4.0

4 months ago

0.3.3

5 months ago

0.3.0

7 months ago

0.3.2

6 months ago

0.3.1

7 months ago

0.1.32

10 months ago

0.2.0-alpha.0

10 months ago

0.2.0-alpha.4

9 months ago

0.2.0-alpha.3

9 months ago

0.2.0-alpha.6

9 months ago

0.2.0-alpha.5

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.2.3

8 months ago

0.2.2

8 months ago

0.1.31

11 months ago

0.1.30

11 months ago

0.1.27

12 months ago

0.1.28

12 months ago

0.1.29

11 months ago

0.1.25

12 months ago

0.1.26

12 months ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.23

1 year ago

0.1.24

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.4

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago