Getter Functions
This page elaborates on the getter functions of the various contracts in our ecosystem. NFT standard functions have been omitted.
Nabi Hub
getProfileIdByHandle()
get fun getProfileIdByHandle(handle: Cell): Int?
Parameter Name | Type | Description |
---|---|---|
handle | Cell | The handle of the target Nabi Profile |
Returns
Type | Description |
---|---|
Int? | Optional containing profile ID or null |
It should...
Return Optional containing the profile ID of the Nabi Profile with the input handle if it exists, null otherwise.
isClosedBeta()
get fun isClosedBeta(): Bool
Returns
Type | Description |
---|---|
Bool | Whether Nabi Protocol is in close beta |
It should...
Return
true
if a Nabi Protocol is in close beta,false
otherwise.
getDispatcherAddress()
get fun getDispatcherAddress(): Address?
Returns
Type | Description |
---|---|
Address? | Optional containing dispatcher address or null |
It should...
Return Optional containing the Nabi Hub Dispatcher contract address if dispatcher is set, null otherwise.
Nabi Profile
getProfile()
get fun getProfile(): Profile
Returns
Type | Description |
---|---|
Profile | Object containing profile data |
Profile Object Field | Type | Description |
---|---|---|
pub_count | Int | The number of publications created by this profile |
handle | Cell | The handle of the profile |
image_uri | Cell | The URI of the profile image |
follow_nft_address | Address | The contract address of the Follow NFT collection (will be the profile contract address if not initialized) |
follow_nft_uri | Cell | The URI that contains the metadata of the Follow NFT collection |
It should...
Return a Profile object.
getPublicationAddressByIndex()
get fun getPublicationAddressByIndex(pubId: Int): Address
Parameter Name | Type | Description |
---|---|---|
pubId | Int | The index of the target publication within the Nabi Profile |
Returns
Type | Description |
---|---|
Address | The contract address of the target publication |
It should...
Return the contract address of the publication at index
pubId
.
Note:
If the publication contract has not been deployed, an address would still be returned. However, sending messages to an undeployed contract would lead to the transaction being reverted. It is advised to check the profile's publication count first.
getNextBadgeCollectionIndex()
get fun getNextBadgeCollectionIndex(): Int
Returns
Type | Description |
---|---|
Int | The index of the next Nabi Badge Collection |
It should...
Return the index of the next Nabi Badge Collection to be created.
getNabiBadgeCollectionAddressByIndex()
get fun getNabiBadgeCollectionAddressByIndex(collectionId: Int): Address
Parameter Name | Type | Description |
---|---|---|
collectionId | Int | The index of the target Nabi Badge Collection within the Nabi Profile |
Returns
Type | Description |
---|---|
Address | The contract address of the target Nabi Badge Collection |
It should...
Return the contract address of the Nabi Badge Collection at index
collectionId
.
Note:
If the Nabi Badge Collection contract has not been deployed, an address would still be returned. However, sending messages to an undeployed contract would lead to the transaction being reverted. It is advised to check the profile's next badge collection index first.
Publication
isCollectNftInitialized()
get fun isCollectNftInitialized(): Bool
Returns
Type | Description |
---|---|
Bool | Whether the Collect NFT collection contract has been initialized |
It should...
Return
true
if the Collect NFT collection contract has been initializedfalse
otherwise.
getPublicationData()
get fun getPublicationData(): PublicationData
Returns
Type | Description |
---|---|
PublicationData | Object containing publication data |
PublicationData Object Field | Type | Description |
---|---|---|
pub_address | Address | The contract address of the publication |
profile_contract_pointed | Address | The contract address of the profile that created the publication |
profile_pub_id | Int | The index of the publication within the profile |
pub_contract_pointed | Address | The contract address of the reference publication for mirrors and comments (Will equal pub_address if publication is a post) |
content_uri | Cell | The URI containing the publication metadata |
collect_nft_address | Address | The contract address of the Collect NFT collection (will equal pub_address if collection not initialized) |
It should...
Return a PublicationData object.
Last updated