useIdentity
Reads client.identity and re-renders whenever it changes, returning undefined while no
identity is available.
The identity is the TransactionSigner representing the wallet whose on-chain assets the application is acting upon.
When the client advertises ClientWithSubscribeToIdentity,
this hook subscribes via client.subscribeToIdentity so the returned value always reflects the
latest identity. For a client whose identity is fixed for its lifetime, the hook falls back to a
no-op subscription and simply reads the value once.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | ClientWithIdentity & Partial<ClientWithSubscribeToIdentity> | A client with an identity plugin installed. If it also advertises subscribeToIdentity, the hook tracks changes reactively. |
Returns
TransactionSigner | undefined
The current client.identity signer, or undefined if no identity is currently
available.