Skip to main content

useGetAccountResource

Use this hook to fetch a specific resource for an address.

Usage

const { data: accountResource, isLoading: accountResourceoading } = useGetAccountResource(address, "onchain_bio", "bio");

This example fetches a bio resource of the onchain_bio module for a predefined address.

Parameters

ParameterTypeDescription
moduleNamestringName of the module where the resource is defined.
resourceNamestringName of the Resource
address (optional)stringAddress of the account. Uses the connected account address if no address is given.
options (optional)objectAdditional options for the query (e.g., retry settings)

Return Value

  • T: An object where T is the type of the resource (defaults to any).