useMina
TheuseMina hook provides access to the Mina SDK instance and its initialization status.
Import
Signature
Parameters
This hook takes no parameters.Returns
MinaContextValue
Basic Usage
Fetching Data
Use the SDK instance to fetch chains, tokens, and quotes:Error Handling
Always handle the error state for a robust user experience:Executing Transactions
Use the SDK to execute bridge transactions:TypeScript Usage
The hook provides proper TypeScript types:Provider Requirement
Best Practices
Performance Tips:
- Check
isReadybefore making SDK calls to avoid null reference errors - Use the specialized hooks (
useQuote,useTokenBalance,useTransactionStatus) for common operations - they handle loading states and caching automatically - Memoize callbacks that use
minato prevent unnecessary re-renders - Only use
useMinadirectly when you need low-level SDK access
When to Use useMina vs Specialized Hooks
Next Steps
useQuote
Fetch bridge quotes with automatic debouncing
useTokenBalance
Track wallet token balances
