Skip to content

rebase-agency/react-polkadot-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@rebase-agency/react-polkadot-connect

Install

Install package:

npm i @rebase-agency/react-polkadot-connect

or

yarn add @rebase-agency/react-polkadot-connect

Usage

Set up provider:

import {PolkadotProvider} from "@rebase-agency/react-polkadot-connect";

const root = createRoot(document.getElementById("root")!);

root.render(
  <PolkadotProvider config={{
    rpcLink: "..."
    appName: "..."
  }}>
    <App />
  </PolkadotProvider>
);

Then you can use hook for connect, account etc.:

import {usePolkadot} from "@rebase-agency/react-polkadot-connect";

const { address, connect, addresses, selectAddress } = usePolkadot()