rabbyWallet
A wallet configurator for Rabby Wallet which allows integrating the wallet with React.
It returns a WalletConfig
object which can be used to connect the wallet to app via ConnectWallet
component or useConnect
hook.
Example
Usage with ConnectWallet
To allow users to connect to this wallet using the ConnectWallet
component, you can add it to ThirdwebProvider
's supportedWallets prop.
<ThirdwebProvider supportedWallets={[rabbyWallet()]}>
<App />
</ThirdwebProvider>;
Usage with useConnect
you can use the useConnect
hook to programmatically connect to the wallet without using the ConnectWallet
component.
The wallet also needs to be added in ThirdwebProvider
's supportedWallets if you want the wallet to auto-connect on next page load.
const rabbyWalletConfig = rabbyWallet();
function App() {
const connect = useConnect();
async function handleConnect() {
const wallet = await connect(rabbyWalletConfig, options);
console.log("connected to", wallet);
}
return <button onClick={handleConnect}> Connect </button>;
}