useClientCapability
Reads the client from the nearest ClientProvider and asserts at mount that the
requested capability is installed, narrowing the return type via the generic. Throws a
SolanaError with code SOLANA_ERROR__REACT__MISSING_CAPABILITY when the
capability is absent — including the calling hookName and a providerHint so users can fix
the mistake without cross-referencing docs.
Use this from the implementation of plugin-specific hooks. Apps that need ad-hoc access without a runtime check can reach for useClient directly and supply their own type narrowing.
Type Parameters
| Type Parameter | Description |
|---|---|
TClient extends object | The narrowed client shape returned once the capability assertion passes. Always pass this generic — the hook can't infer it from a string. |
Parameters
| Parameter | Type |
|---|---|
__namedParameters | UseClientCapabilityConfig |
Returns
Client<TClient>