WalletProvider
Description
The WalletProvider
context provider provides the essential data and functions for Razor Kit and
it is the entrypoint for customized configurations. So you need to wrap all the Razor Kit
hooks and components under a <WalletProvider />
component before you start to use them.
Examples
Basic Usage
import React from 'react'
import ReactDOM from 'react-dom/client';
import { WalletProvider } from '@razorlabs/razorkit';
const App: React.FC = () => {
return (
<div>
Hello World!
</div>
)
}
ReactDOM.createRoot(document.getElementById('root')!).render(
<WalletProvider>
<App />
</WalletProvider>
);
Customize your wallet list on modal
Check Customize Wallet List for details.
Configure supported networks
Check Configure supported networks for details.
API
Props
Prop | Type | Default | Description |
---|---|---|---|
defaultWallets | IDefaultWallet | [...AllPresetWallets] | Configure wallet list for dapp, by default we load all the preset wallets |
chains | Chain[] | DefaultChains | Configure supported networks for dapp |
autoConnect | boolean | true | Auto connect to the last connected wallet when launched |