@prophouse/sdk-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.36 • Public • Published

@prophouse/sdk-react

Useful tools for interacting with the Prop House protocol from React applications

Installation

npm install @prophouse/sdk-react
# OR
yarn add @prophouse/sdk-react

Usage

Provider

The PropHouseProvider component is used to provide a PropHouse instance to the application.

Currently, wagmi is required by the PropHouseProvider.

import { PropHouseProvider } from '@prophouse/sdk-react'
import { WagmiConfig, createClient } from 'wagmi'
import { getDefaultProvider } from 'ethers'

const client = createClient({
  autoConnect: true,
  provider: getDefaultProvider(),
});

const App = () => {
  return (
    <WagmiConfig client={client}>
      <PropHouseProvider>
        <MyComponent />
      </PropHouseProvider>
    </WagmiConfig>
  )
}

Hooks

usePropHouse

The usePropHouse hook is used to access the PropHouse instance provided by the PropHouseProvider component.

import { usePropHouse } from '@prophouse/sdk-react'

const MyComponent = () => {
  const propHouse = usePropHouse()

  return (
    <div>
      <p>Prop House Contract: {propHouse.contract.address}</p>
    </div>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @prophouse/sdk-react

Homepage

prop.house

Weekly Downloads

7

Version

1.0.36

License

GPL-3.0

Unpacked Size

9.43 kB

Total Files

12

Last publish

Collaborators

  • sovinseneca
  • solimander