0.0.14 • Published 5 months ago

haha-connect v0.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

haha-connect

NPM version npm-typescriptLicense]github-license-url

Installation:

npm i haha-connect

or

yarn add haha-connect

Usage:

'use client'

import { HahaModal, HahaButton, connect, disconnect, initialize } from 'haha-connect'
import { useMemo } from 'react'

export default function Home() {
  const hahaConnector = useMemo(() => {
    return initialize('walletconnect_project_id')
  }, [])

  const isActive = hahaConnector.hooks.useIsActive()

  return (
    <main className='flex min-h-screen flex-col items-center justify-between p-24'>
      <div>
        {isActive ? (
          <HahaButton
            onClick={() => {
              disconnect(hahaConnector)
            }}
            label='Disconnect'
            style={{ backgroundColor: '#000', color: '#fff' }}
          />
        ) : (
          <HahaButton
            onClick={(e) => {
              connect(hahaConnector, 1)
              e.preventDefault()
            }}
            label='Connect with HaHa'
            style={{ backgroundColor: '#000', color: '#fff' }}
          />
        )}

        <HahaModal hahaConnector={hahaConnector} />
      </div>
    </main>
  )
}

Limitation :

Currently supports ethereum mainnet (chain id: 1) and polygon (chain id: 137)

0.0.14

5 months ago

0.0.14-beta

5 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago