0.0.14 • Published 2 years ago

haha-connect v0.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.0.14-beta

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years 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