Types
Hat Types
Hat
interface Hat {
id: `0x${string}`; // Hat ID
prettyId?: string; // pretty ID format
status?: boolean; // 'true' if active, 'false' otherwise
createdAt?: string | null; // timestamp of hat creation, null if not created yet
details?: string; // Hat's details field
maxSupply?: string; // max amount of wearers
eligibility?: `0x${string}`; // eligibility address
toggle?: `0x${string}`; // toggle address
mutable?: boolean; // 'true' if mutable, 'false' otherwise
imageUri?: string; // Hat's image URI
levelAtLocalTree?: number; // Hat's level at its local tree (not including linked trees)
currentSupply?: string; // current amount of hat wearers
tree?: Tree; // Tree which contains the Hat
wearers?: Wearer[]; // Hat's Wearers
badStandings?: Wearer[]; // Hat's Wearers in bad standing
admin?: Hat; // Hat's admin Hat
subHats?: Hat[]; // Hat's children Hats
linkRequestFromTree?: Tree[]; // Link requests from Trees
linkedTrees?: Tree[]; // Trees linked to the Hat
claimableBy?: ClaimsHatter[]; // Claims Hatters that the Hat is made claimable by
claimableForBy?: ClaimsHatter[]; // Claims Hatters that the Hat is made claimable for by
events?: HatsEvent[]; // Hat's events
}HatPropsConfig
Query configuration for a Hat's properties.
The Hat's ID property is required and thus is not included in the config. The rest of the properties are optional.
To choose Scalar properties (non-object), include their key with a value of
true.To choose an Object property, include its key with a value compatible with the object's config type:
For single-object properties (e.g.
tree), the config type includes the object's available properties without filters.For multi-object properties (e.g.
wearers), the config type includes both the object's available properties and optional filters (currently supports only the 'first' filter).
HatsConfig
Query configuration for a multi Hats property, i.e. a property that returns multiple Hats.
Wearer Types
Wearer
WearerPropsConfig
Query configuration for a Wearer's properties.
The Wearer's ID property is required and thus is not included in the config. The rest of the properties are optional.
To choose Scalar properties (non-object), include their key with a value of
true.To choose an Object property, include its key with a value compatible with the object's config type:
For single-object properties (e.g. the
treeproperty of a Hat), the config type includes the object's available properties.For multi-object properties (e.g.
currentHats), the config type includes both the object's available properties and optional filters (currently supports only the 'first' filter).
WearersConfig
Query configuration for a multi Wearers property, i.e. a property that returns multiple Wearers.
Tree Types
Tree
TreePropsConfig
Query configuration for a Tree's properties.
The Tree's ID property is required and thus is not included in the config. The rest of the properties are optional.
To choose Scalar properties (non-object), include their key with a value of
true.To choose an Object property, include its key with a value compatible with the object's config type:
For single-object properties (e.g.
childOfTree), the config type includes the object's available properties.For multi-object properties (e.g.
hats), the config type includes both the object's available properties and optional filters (currently supports only the 'first' filter).
TreesConfig
Query configuration for a multi Trees property, i.e. a property that returns multiple Trees.
Event Types
HatsEventBase
Base type, which contains the common properties of Hats Events, and which is then extended by each specific event.
HatsEventPropsConfig
Query configuration for the basic properties of a Hats Event.
The HatsEvent's ID property is required and thus is not included in the config. The rest of the properties are optional.
To choose Scalar properties (non-object), include their key with a value of true. To choose an Object property, include its key with a value compatible with the object's config.
Following are the various Hats Events, emitted from Hats-Protocol in response to various actions.
Fetched events will include the event's base properties, as well as the additional properties that are included in each specific event, according to its type.
HatCreatedEvent
HatMintedEvent
HatBurnedEvent
HatMutabilityChangedEvent
HatStatusChangedEvent
HatDetailsChangedEvent
HatEligibilityChangedEvent
HatToggleChangedEvent
HatMaxSupplyChangedEvent
HatImageURIChangedEvent
TopHatLinkRequestedEvent
TopHatLinkedEvent
WearerStandingChangedEvent
HatsEvent
Claims Hatter Types
ClaimsHatter
ClaimsHatterPropsConfig
Query configuration for a ClaimsHatter's properties.
The ClaimsHatter's ID property is required and thus is not included in the config. The rest of the properties are optional.
ClaimsHattersConfig
Query configuration for a multi ClaimsHatters property, e.g. a property that returns multiple Claims Hatters.
More
EndpointsConfig
Subgraph endpoints configuration, optionally provided at the client's creation.
Last updated