@rebase-agency/react-polkadot-connect
v0.1.3
Published
Polkadot API provider and hooks with account for React dApp
Downloads
9
Readme
@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()