Misc

searchTreesHatsWearers

Search for a Hat, Tree or Wearer by ID.

const res = await hatsSubgraphClient.searchTreesHatsWearers({
    chainId,
    search,
    treeProps,
    hatProps,
    wearerProps,
});

Arguments:

{
    chainId: number;
    search: string;
    treeProps: TreePropsConfig;
    hatProps: HatPropsConfig;
    wearerProps: WearerPropsConfig;
}
  • chainId - ID of the chain to fetch from.

  • search - ID to search for (Hat ID or pretty ID, Tree ID or Wearer address).

  • treeProps - Tree's properties to fetch, including the ones of nested objects. Check the TreePropsConfig type for the available properties and query filters.

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

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

Response:

{ trees: Tree[]; hats: Hat[]; wearers: Wearer[] }

An object containing the search result.

Example:

// search for a given hat, tree or wearer.
// include only the object's ID in the reuslt 
const res = await client.searchTreesHatsWearers({
  chainId: 10,
  search: "0x0000000100020001000100000000000000000000000000000000000000000000",
  treeProps: {},
  hatProps: {},
  wearerProps: {},
});

Last updated