useDriftClientIsReady
Checks whether the Drift client is subscribed and ready to use for executing transactions and reading data.Signature
Returns
boolean - true if the Drift client is subscribed and ready, false otherwise.
Example
Implementation
This hook calls thecheckIsDriftClientReady() method from the Drift Common store, which verifies that:
- The Drift client exists
- The client is subscribed to on-chain data
- The client is ready to process requests
Source
source/react/src/hooks/useDriftClientIsReady.tsx:6
useCommonDriftActions
Provides access to the common Drift actions object, which contains methods for managing connections, wallet interactions, and account subscriptions.Signature
Returns
An object containing the following action methods:handleWalletConnect
authority- The wallet’s public keyadapter- The wallet adapter instancesubscribeToDriftUsers- Whether to subscribe to Drift user accounts (default:true)
handleWalletDisconnect
updateConnection
newRpc- The new RPC endpoint to connect tonewDriftEnv- Optional new Drift environment ('mainnet-beta'|'devnet')subscribeToAccounts- Whether to subscribe to accounts after updating (default:true)additionalDriftClientConfig- Additional Drift client configuration options
fetchAndSubscribeToUsersAndSubaccounts
driftClient- The Drift client instanceauthority- The authority public key to fetch accounts for
emulateAccount
authority- The public key of the account to emulate
Example
Example: Account Emulation
Source
source/react/src/hooks/useCommonDriftActions.tsx:7
Action implementations: source/react/src/actions/driftActions.ts:28