Fetching Hats

getHat

Get a Hat by its ID.

const hat = await hatsSubgraphClient.getHat({
    chainId,
    hatId,
    props,
});

Arguments:

{
    chainId: number;
    hatId: bigint;
    props: HatPropsConfig;
}
  • chainId - ID of the chain to fetch from.

  • hatId - ID of the Hat to fetch.

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

Response:

Hat

A Hat object, containing the chosen properties.

Example:

getHatsByIds

Get Hats by their IDs.

Arguments:

  • chainId - ID of the chain to fetch from.

  • hatIds - IDs of the Hats to fetch.

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

Response:

An array of Hat objects, containing the chosen properties.

Example:

Last updated