Categories
Wallet Hooks
Hooks for managing wallet connections and SOL balances:useWalletContext- Access the currently connected wallet contextuseSyncWalletToStore- Sync wallet state to the application storeuseSolBalance- Track and update SOL balance
Drift Client Hooks
Hooks for interacting with the Drift client:useDriftClientIsReady- Check if the Drift client is readyuseCommonDriftActions- Access Drift client actions
Priority Fee Hooks
Hooks for managing transaction priority fees:usePriorityFeeSubscriber- Subscribe to priority fee updatesusePriorityFeeUserSettings- Manage user priority fee preferencesusePriorityFeesPollingRate- Get the current polling rate for priority fees
Oracle Price Hooks
Hooks for tracking oracle price data:useSyncOraclePriceStore- Sync oracle prices to the store
Installation
These hooks are part of the@drift/react package:
Basic Usage
Most hooks work in conjunction with the Drift Common store:Source Code
All hooks are located in thehooks/ directory of the source code:
source/react/src/hooks/