Fetching Wearers

getWearer

Get a Wearer by its address.

const wearer = await hatsSubgraphClient.getWearer({
    chainId,
    wearerAddress,
    props,
});

Arguments:

{
    chainId: number;
    wearerAddress:`0x${string}`;
    props: WearerPropsConfig;
}
  • chainId - ID of the chain to fetch from.

  • wearerAddress - Wearer's address.

  • props - Wearer's properties to fetch, including the ones of nested objects. Check the WearerPropsConfig type for the available properties and query filters.

Response:

Wearer

A Wearer object, containing the chosen properties.

Example:

getWearersOfHatPaginated

Paginate over the Wearers of a Hat.

Arguments:

  • chainId - ID of the chain to fetch from.

  • hatId - ID of the hat of which wearers to fetch.

  • props - Wearer's properties to fetch, including the ones of nested objects. Check the WearerPropsConfig type for the available properties and query filters.

  • page - Number of page to fetch.

  • perPage - Number of Wearers to fetch in each page.

Response:

An array of Wearer objects, containing the chosen properties.

Example:

Last updated