Skip to main content
This page demonstrates how to use each method from the useMobileWallet hook. Make sure you have completed the Installation and Setup steps first. Stay on the tab for the Solana library you installed.

Connect / Disconnect

Use connect to initiate a wallet connection and disconnect to end it. The account field holds the selected wallet account.

Sign Message

Use signMessages to request the wallet to sign an arbitrary byte payload. This is useful for off-chain signature verification.
signMessages takes bytes, not a string. Use TextEncoder to encode text — a base64 helper such as toUint8Array will decode your text as base64 and sign the wrong payload.

Sign In with Solana (SIWS)

Use signIn to connect to a wallet and verify ownership in a single step. This combines authorization and message signing into one user interaction. Read the account from the returned result — the hook’s account is not updated until the next render.
signIn works whether or not the user is already connected. Omit address to let the wallet pick the account and sign in as part of the same prompt.

Sign and Send Transaction

Request the wallet to sign a transaction and submit it to the Solana network. Both examples send a memo instruction — swap it for whichever instructions your app builds.
sendTransactions takes instructions and handles fetching the blockhash, compiling the transaction, signing, and sending.
signAndSendTransactions requires minContextSlot. Fetch the blockhash with getLatestBlockhashAndContext() so you have the slot to pass along, rather than getLatestBlockhash().

Next steps

Advanced: Invoke MWA Sessions Directly

Learn the low-level transact() API for direct MWA session control.

Sample Apps

Browse reference apps to jumpstart your development.
Last modified on September 3, 2026