Skip to content

Commit

Permalink
* docs(nft): add NFT Collection message flows and images
Browse files Browse the repository at this point in the history
*
* feat(NFTCollection.mdx): add NFT Collection message flows section
* fix(NFTCollection.mdx): fix typo in NFT Collection overview section
* feat(NFTCollection.mdx): add NFT Collection images for parent-child pattern and message flows
  • Loading branch information
alan890104 committed Oct 19, 2023
1 parent f521953 commit 6a60c7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/nft/NFTCollection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,23 @@ sidebar_position: 1

This NFT Collection smart contract provides a framework for NFT collections that comply with the [TEP-0062 standard](https://github.com/ton-blockchain/TEPs/blob/master/text/0062-nft-standard.md).

NFT in TON follows parent-child pattern. That is, each NFT item is a child contract of the NFT collection contract.
![NFT Collection](./images/nft_parent_child.png)

## Overview

In the TEP-0062 standard, each NFT collection is associated with an NFT Collection smart contract, which stores basic information about the collection, including the next item index, collection content, and owner address.

## Message Flows

![NFT Collection Message Flows](./images/nft_message_flow.png)

Specifically, the `Transfer` flow is as follows:

1. When NFT Item received a `Transfer` message, it will set the current owner to the `newOwner` in payload of `Transfer` message.
2. Then, an OwnershipAssigned event will send to NewOwner as a notification.
3. Last, if there are remaining funds, the NFT Item will send `Excesses` message to previous owner, attaching with the remaining funds.

### CollectionData Structure

```typescript
Expand Down
Binary file added docs/nft/images/nft_message_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/nft/images/nft_parent_child.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6a60c7b

Please sign in to comment.