Skip to main content
There are several ways to obtain the address of an NFT item: call the collection’s get_nft_address_by_index get-method on-chain, or calculate the address locally from the item index, item code, and collection address.

Standard Collections

Using Get-Method

Use get_nft_address_by_index_get_method() to call get_nft_address_by_index on the collection contract.

Calculating Locally

Use NFTCollectionStandard.calculate_nft_item_address() to derive the address without any network calls. The address is the hash of the item’s initial state, built from the index, the item contract code, and the collection address.
Obtain the NFT item contract code by following Get Contract Code and Data. nft_item_code accepts a Cell or a hex-encoded BoC string. For collections deployed with the default tonutils item code, NFTItemStandard.get_default_code() returns it directly.

TON DNS Domains

The item index of a TON DNS domain is string_hash(domain_name) — the SHA-256 hash of the domain name without the zone suffix (e.g. "temp" for temp.ton). See Use FunC Hash Functions.

Using Get-Method

Compute the domain index with string_hash() and pass it to the same get-method helper.

Calculating Locally

TONDNSCollection.calculate_nft_item_address() accepts either the domain name string (the index is derived automatically) or a precomputed numeric index.
Obtain the DNS item contract code by following Get Contract Code and Data.

Telegram Gifts and Anonymous Numbers

The item index of a Telemint token is string_hash(telemint_token_name) — the SHA-256 hash of the token name (e.g. the number "8888888" or a username). See Use FunC Hash Functions.

Using Get-Method

Calculating Locally

Telemint items store their initial data in a different layout than standard collections, so use the Telegram collection classes: TelegramGiftsCollection for gifts and anonymous numbers, TelegramUsernamesCollection for t.me usernames. Both share the same calculate_nft_item_address() implementation.
Obtain the Telemint item contract code by following Get Contract Code and Data.