Skip to main content

Hooks

useWallet()

The primary hook for accessing wallet state and methods.

Returns

boolean
Whether a wallet is currently connected
PublicKey | null
The connected wallet’s public key, or null if not connected
() => void
Function to disconnect the current wallet
boolean
Whether a wallet connection is currently in progress
Wallet | null
The currently connected wallet adapter instance

Example Usage

useConnection()

Hook for accessing the Solana connection instance.

Returns

Connection
The Solana connection instance for making RPC calls

useWalletModal()

Hook for controlling the wallet selection modal.

Returns

boolean
Whether the wallet modal is currently visible
(visible: boolean) => void
Function to show or hide the wallet modal

Example Usage

Components

MoongateConnectButton

The main connect button component (recommended for most use cases).

Props

ReactNode
default:"Connect Wallet"
Custom button text or content
string
Additional CSS classes to apply
CSSProperties
Inline styles to apply

Example Usage

WalletConnectButton

Individual wallet connect button for specific wallets.

Props

string
required
Name of the specific wallet to connect to
ReactNode
Custom button content

Example Usage

πŸ“± Mobile Considerations

The Adapter is fully responsive and mobile-optimized:
  • Touch-friendly wallet selection
  • Mobile wallet deep linking
  • Responsive modal sizing
  • iOS/Android wallet app integration

πŸ†˜ Need Help?