1.0.0 • Published 2 years ago

hashconnect-provider v1.0.0

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Hashconnect-Provider

This package provides a react context for connecting to HashConnect easily.

Install

npm install hashconnect-provider

Setup

wrap your app in HashConnectContextProvider

import { HashConnect } from "hashconnect/dist/hashconnect";
import HashConnectContextProvider from 'hashconnect-provider'

export default function App({ Component, pageProps }: AppProps) {
  return <>
    <HashConnectContextProvider hashConnect={new HashConnect(true)} network="testnet" singleAccount={true} metaData={{
            name: "dApp Example",
            description: "An example hedera dApp",
            icon: "https://www.hashpack.app/img/logo.svg",
            url: "http://localhost:3000"
        }}
    >
        <Component {...pageProps} />
      </HashConnectContextProvider>
  </>

}

Usage

    const { 
        hcData, // hashConnect data state
        hashConnect, // hashConnect instance
        topic, //  topic state
        setTopic,
        pairingString, 
        pairingData,
        availableExtension,
        state, // state of the connection
        connectToExtension,
        clearPairings,
        disconnect,
        sendTransaction,
        network,
        getProvider,
        getSigner,
        accountId // first accountId in the paringData
    } = useHashConnectContext();
1.0.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago