Hook to access the user's primary Solana address. Returns the first Solana address associated with the user's account. If the user has no Solana accounts, this will return null.
function SolanaWalletInfo() { const { solanaAddress } = useSolanaAddress(); if (!solanaAddress) { return <p>No Solana wallet connected</p>; } return ( <div> <h3>Your Solana Wallet</h3> <p>Address: {solanaAddress}</p> </div> );} Copy
function SolanaWalletInfo() { const { solanaAddress } = useSolanaAddress(); if (!solanaAddress) { return <p>No Solana wallet connected</p>; } return ( <div> <h3>Your Solana Wallet</h3> <p>Address: {solanaAddress}</p> </div> );}
Hook to access the user's primary Solana address. Returns the first Solana address associated with the user's account. If the user has no Solana accounts, this will return null.