Onchain Reads
viewHat
Get a hat's properties.
Arguments:
hatId
- The hat ID.
Response:
details
- hat's details field.maxSupply
- maximum amount of wearers.supply
- current amount of wearers.eligibility
- hat's eligibility address.toggle
- hat's toggle address.imageUri
- hat's image URI.numChildren
- number of child hats.mutable
-true
if the hat is mutable,false
otherwise.active
-true
if the hat is active,false
otherwise.
isWearerOfHat
Check if an address is a wearer of a specific hat. An address is considered a wearer of a hat if the following conditions are met:
The address owns the hat's token ID (hat ID).
The hat is active (controlled by the hat's toggle).
The wearer is eligible for the hat (controlled by the hat's eligibility).
Arguments:
wearer
- wearer's address.hatId
- hat's ID.
Response:
true
if the given address is a wearer of the hat, false
otherwise.
isAdminOfHat
Check if an address is an admin of a specific hat. An address is an admin of a hat if it wears one of the hat's predecessor hats.
Arguments:
user
- address to check whether an admin.hatId
- hat's ID.
Response:
true
if the given address is an admin of the hat, false
otherwise.
isActive
Check if a hat is active.
Arguments:
hatId
- hat's ID.
Response:
true
if the given hat is active, false
otherwise.
isInGoodStanding
Check if a wearer is in good standing for a given hat.
Arguments:
wearer
- address to check whether in good standing.hatId
- hat's ID.
Response:
true
if the given wearer is in good standing, false
otherwise.
isEligible
Check if an address is eligible for a specific hat.
Arguments:
wearer
- address to check whether is eligible.hatId
- hat's ID.
Response:
true
if the given address is eligible for the hat, false
otherwise.
predictHatId
Predict the ID of a yet to be created hat.
Arguments:
admin
- parent hat of the would be created one.
Response:
Hat ID of the would be created hat.
getTreesCount
Get the number of existing trees.
Response:
Current number of trees.
getLinkageRequest
Get the linkage request of a tree.
Arguments:
topHatDomain
- the tree domain. The tree domain is the first four bytes of the tophat ID.
Response:
If request exists, returns the requested new admin hat ID. If not, returns zero.
getLinkedTreeAdmin
Get the admin of a linked tree (the hat which the tophat is linked to).
Arguments:
topHatDomain
- the tree domain. The tree domain is the first four bytes of the tophat ID.
Response:
If tree is linked, returns the admin hat ID of the linked tree. If not, returns zero.
getHatLevel
Get a hat's level. If the tree is linked, level is calculated in the global tree (comprised of all linked trees).
Arguments:
hatId
- hat's ID.
Response:
The hat's level in the global tree.
getLocalHatLevel
Get a hat's level in its local tree (without considering linked trees).
Arguments:
hatId
- hat's ID.
Response:
The hat's local level.
getTopHatDomain
Get a hat's tree domain.
Arguments:
hatId
- hat's ID.
Response:
The tree domain of the hat. The tree domain is the first four bytes of the tophat ID.
getTippyTopHatDomain
Get the tree domain of the global's tree tophat (tippy top hat), which the provided tree is included in.
Arguments:
topHatDomain
- The tree domain. The tree domain is the first four bytes of its tophat ID.
Response:
The tree domain of the tippy top hat.
getAdmin
Get the direct admin of a hat.
Arguments:
hatId
- hat's ID.
Response:
The admin's hat ID. If the provided hat is an unlinked tophat, then this top hat ID is returned, as it is the admin of itself. Otherwise, the hat's parent hat ID is returned.
getChildrenHats
Get the children hats of a hat.
Arguments:
hatId
- hat's ID.
Response:
The hat's children IDs.
Last updated