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 NameTypeDescription

handle

Cell

The handle of the target Nabi Profile

Returns

TypeDescription

Int?

Optional containing profile ID or null

It should...

  1. 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

TypeDescription

Bool

Whether Nabi Protocol is in close beta

It should...

  1. Return true if a Nabi Protocol is in close beta, false otherwise.

getDispatcherAddress()

get fun getDispatcherAddress(): Address?

Returns

TypeDescription

Address?

Optional containing dispatcher address or null

It should...

  1. Return Optional containing the Nabi Hub Dispatcher contract address if dispatcher is set, null otherwise.

Nabi Profile

getProfile()

get fun getProfile(): Profile

Returns

TypeDescription

Profile

Object containing profile data

Profile Object FieldTypeDescription

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...

  1. Return a Profile object.

getPublicationAddressByIndex()

get fun getPublicationAddressByIndex(pubId: Int): Address

Parameter NameTypeDescription

pubId

Int

The index of the target publication within the Nabi Profile

Returns

TypeDescription

Address

The contract address of the target publication

It should...

  1. 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

TypeDescription

Int

The index of the next Nabi Badge Collection

It should...

  1. Return the index of the next Nabi Badge Collection to be created.

getNabiBadgeCollectionAddressByIndex()

get fun getNabiBadgeCollectionAddressByIndex(collectionId: Int): Address

Parameter NameTypeDescription

collectionId

Int

The index of the target Nabi Badge Collection within the Nabi Profile

Returns

TypeDescription

Address

The contract address of the target Nabi Badge Collection

It should...

  1. 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

TypeDescription

Bool

Whether the Collect NFT collection contract has been initialized

It should...

  1. Return true if the Collect NFT collection contract has been initialized false otherwise.

getPublicationData()

get fun getPublicationData(): PublicationData

Returns

TypeDescription

PublicationData

Object containing publication data

PublicationData Object FieldTypeDescription

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...

  1. Return a PublicationData object.

Last updated