Skip to content

ExtensionsProvider

A React context provider that discovers available wallet exensions and allows connection to them and their accounts.

source

Usage

Wrap your app with ExtensionsProvider and provide the required props.

import {
    ExtensionsProvider,
  } from '@w3ux/react-connect-kit';
 
const AppWithProviders = () => {
  // Dapp identifier
  const dappName = "My Dapp Name";
 
  // SS58 prefix of the current network
  const ss58 = 0;
 
  return (
    <ExtensionsProvider
      dappName={dappName}
      ss58={ss58}
    >
      <App />
    </ExtensionsProvider>
  );
);

The hooks useExtensions and useExtensionAccounts can now be used to access the extensions and their accounts.

Props

dappName

string

ss58

number

The SS58 prefix of the current network.