/dyor

React hooks library for Polkadot SDK chains, inspired by wagmi.

Primary LanguageTypeScript

DYOR Image

React hooks library for Polkadot SDK chains, inspired by wagmi.

In the current state the package is just for fun and exploration.

Build Size Version Downloads

Getting Started

Installation

npm install dyor

Setup

You can use this library with any react project. Wrap your React app in the DyorProvider and pass the chains you want to use as props.

import { DyorProvider } from 'dyor'
wss://polkadot-asset-hub-rpc.polkadot.io
function App() {
  return (
    <DyorProvider config={config}>
      {/** ... */}
    </DyorProvider>
  )
}

Usage

import { useChain } from 'dyor'

function ChainConstants() {
  const AssetHub = useChain('AssetHub')

  ...
}