usePermissions
Hook for retrieving active permissions for an account.
Internally uses wallet_getPermissions
.
import { Hooks } from 'porto/wagmi'
function Example() {
const result = Hooks.usePermissions()
}
Parameters
address
Address | undefined
Address of the account to get permissions for. If not provided, will use the connected account.
import { Hooks } from 'porto/wagmi'
function Example() {
const result = Hooks.usePermissions({
address: '0x...'
})
}
config
Config | undefined
Configuration to pass to the query.
Return Type
UseQueryResult<PermissionInfo[]>
Returns a TanStack Query
result object with the following properties:
data
PermissionInfo[] | undefined
Array of permission information objects.
error
Error | null
Error encountered during query execution, if any.
isError
boolean
True if the query encountered an error.
isIdle
boolean
True if the query has not started yet.
isLoading
boolean
True if the query is in a loading state.
isPending
boolean
True if the query is in a pending state.
isSuccess
boolean
True if the query was successful and data is available.
status
'error' | 'idle' | 'loading' | 'success'
Current status of the query.