Usage
Parameters
| Parameter | Type | Required | Description |
|---|
params.walletAddress | string | Yes | Wallet address to query |
params.sessionPublicKey | string | Yes | Session public key to query |
options.enabled | boolean | No | Enable/disable the query (default: true) |
Pass null as params to disable the query.
Return Value
| Property | Type | Description |
|---|
data | SessionDataResponse | Session status from contract |
isLoading | boolean | Whether query is in progress |
isError | boolean | Whether an error occurred |
error | Error | null | Error details if any |
isSuccess | boolean | Whether query succeeded |
refetch | function | Manually refetch session data |
SessionDataResponse Structure
Example Implementation
Conditional Rendering Based on Session
Auto-Refresh Session Status
This is a read-only query that doesn’t require gas or signatures. It directly calls the smart contract’s view function.
If the session doesn’t exist on-chain, isActive will be false with remainingCalls: 0. This is normal for sessions that were never registered or have been revoked.