Connecting Wallet
Connect to RISE Wallet using Wagmi
Connecting Wallet
Connecting to RISE Wallet is as simple as using any standard Wagmi connector. The Porto connector handles passkey authentication automatically, creating a seamless login experience.
"use client";import { Button } from "@/components/ui/button";import { useAccount, useConnect, useDisconnect } from "wagmi";export function WalletConnect() { const { address, isConnected } = useAccount(); const { connect, connectors } = useConnect(); const { disconnect } = useDisconnect(); // 1. Get the Rise Wallet connector const rwConnector = connectors.find( (c) => c.id === "com.risechain.wallet" ); if (isConnected) { return ( <div className="flex gap-4 items-center"> <span>{address}</span> <Button onClick={() => disconnect()}> Disconnect </Button> </div> ); } return ( <Button onClick={() => connect({ connector: rwConnector })} > Connect via Passkey </Button> );}How it Works
- Find the Rise Wallet Connector: Locate the Rise Wallet connector from the available connectors using its ID
com.risechain.wallet. - Trigger Connection: Call the
connectfunction with the Rise Wallet connector. - Passkey Authentication: The user is prompted to authenticate using their device's passkey (FaceID, TouchID, etc.).
- Account Ready: Once authenticated, the account is connected and ready to transact.
The Rise Wallet connector integrates seamlessly with Wagmi's standard hooks like useAccount, useConnect, and useDisconnect, requiring no specialized APIs.