Skip to main content

MobileWalletProvider

Wrap your app’s root component with MobileWalletProvider from @wallet-ui/react-native-web3js. This provider manages the wallet connection state and exposes the useMobileWallet hook to all child components.
App.tsx
import { MobileWalletProvider } from '@wallet-ui/react-native-web3js';
import { clusterApiUrl } from '@solana/web3.js';

const chain = 'solana:devnet';
const endpoint = clusterApiUrl('devnet');
const identity = {
  name: 'My Solana App',
  uri: 'https://mysolanaapp.com',
  icon: 'favicon.png',
};

export default function App() {
  return (
    <MobileWalletProvider chain={chain} endpoint={endpoint} identity={identity}>
      {/* Your app content */}
    </MobileWalletProvider>
  );
}

Props

PropTypeDescription
chainstringThe Solana cluster to connect to (e.g. 'solana:devnet', 'solana:mainnet-beta').
endpointstringThe RPC endpoint URL for the cluster.
identityobjectYour app’s identity shown to the user during wallet authorization.

Identity object

FieldTypeDescription
namestringYour app’s display name.
uristringYour app’s website URL.
iconstringPath to your app icon, relative to uri.

useMobileWallet hook

Inside any component wrapped by MobileWalletProvider, use the useMobileWallet hook to access wallet functionality:
import { useMobileWallet } from '@wallet-ui/react-native-web3js';

function MyComponent() {
  const {
    account,           // The connected wallet account (null if disconnected)
    connect,           // Connect to a wallet
    disconnect,        // Disconnect from the wallet
    signMessage,       // Sign an arbitrary message
    signIn,            // Sign in with Solana (SIWS)
    signAndSendTransaction, // Sign and send a transaction
    connection,        // The Solana RPC connection instance
  } = useMobileWallet();

  return (
    // Your component UI
  );
}

Next steps

Quickstart

See usage examples for all useMobileWallet hook methods.
Last modified on February 13, 2026