Skip to main content

Hooks

useWallet()

The primary hook for accessing wallet state and methods.

Returns

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

Example Usage

useConnection()

Hook for accessing the Solana connection instance.

Returns

connection
Connection
The Solana connection instance for making RPC calls

useWalletModal()

Hook for controlling the wallet selection modal.

Returns

visible
boolean
Whether the wallet modal is currently visible
setVisible
(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

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

Example Usage

WalletConnectButton

Individual wallet connect button for specific wallets.

Props

walletName
string
required
Name of the specific wallet to connect to
children
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?