Skip to main content
There is a collection smart contract and a separate smart contract for every NFT item — each item is its own contract, see more why. Each NFT knows its collection, its index, and its item-specific part of the metadata. The initial owner is assigned by the collection.

NFT deployment

The collection deploys NFT items with the initial owner and the item-specific metadata.

How to verify an NFT belongs to a collection?

High level

You can do it with a single request:
TypeScript

Low level

First, read the NFT item index. If the collection, for that index, returns the same NFT item address, the item belongs to the collection.
TypeScript

How to get full metadata of an NFT

High level

Playground link for metadata

Low level

Metadata is split into two parts: one part is stored on the item, another on the collection. We need to merge them. To get metadata for an NFT of a particular index, first fetch the NFT item address from the collection, then read the item metadata, and then combine it with the collection metadata to get the final result.

NFT transfer

transfer parameters

The NFT updates its owner field and now belongs to the new owner.

Optional

To send a notification to the new owner from the NFT, set a positive forward_amount. If you want to receive the excess (all remaining TON), set response_destination accordingly.

NFT sale

Often, a sale contract is created. First, the sale contract becomes the owner; upon successful purchase, it transfers the NFT to the buyer. See more:

Best practices

  • Metadata referenced by each link should be permanent. If you need to change it, send a transaction that updates the reference.