Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 0064-token-data-standard.md
  • Loading branch information
Gusarich authored Sep 23, 2023
commit 2a460eb926e12132955c1334ef34fda7e54f6bf9
25 changes: 14 additions & 11 deletions text/0064-token-data-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,30 @@ snake#00 data:(SnakeData ~n) = ContentData;
chunks#01 data:ChunkedData = ContentData;
onchain#00 data:(HashMapE 256 ^ContentData) = FullContent;
offchain#01 uri:Text = FullContent;
tonstorage#02 bagid:uint256 = FullContent;
```

Note, that while TL-B scheme does not constrain bit size of each chunk it is expected that all chunks contain ceil number of bytes.

## NFT metadata attributes
1. `uri` - Optional. Used by "Semi-chain content layout". ASCII string. A URI pointing to JSON document with metadata.
2. `name` - Optional. UTF8 string. Identifies the asset.
3. `description` - Optional. UTF8 string. Describes the asset.
4. `image` - Optional. ASCII string. A URI pointing to a resource with mime type image.
5. `image_data` - Optional. Either binary representation of the image for onchain layout or base64 for offchain layout.
2. `bagid` - Optional. Used by "Semi-chain content layout". Integer. A Bag ID pointing to JSON document with metadata.
3. `name` - Optional. UTF8 string. Identifies the asset.
4. `description` - Optional. UTF8 string. Describes the asset.
5. `image` - Optional. ASCII string. A URI pointing to a resource with mime type image.
6. `image_data` - Optional. Either binary representation of the image for onchain layout or base64 for offchain layout.

## Jetton metadata attributes
1. `uri` - Optional. Used by "Semi-chain content layout". ASCII string. A URI pointing to JSON document with metadata.
2. `name` - Optional. UTF8 string. The name of the token - e.g. "Example Coin".
3. `description` - Optional. UTF8 string. Describes the token - e.g. "This is an example jetton for the TON network".
4. `image` - Optional. ASCII string. A URI pointing to a jetton icon with mime type image.
5. `image_data` - Optional. Either binary representation of the image for onchain layout or base64 for offchain layout.
6. `symbol` - Optional. UTF8 string. The symbol of the token - e.g. "XMPL". Used in the form "You received 99 XMPL".
7. `decimals` - Optional. If not specified, 9 is used by default. UTF8 encoded string with number from 0 to 255. The number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation, while 0 means that tokens are indivisible: user representation of token number should correspond to token amount in wallet-contract storage.
2. `bagid` - Optional. Used by "Semi-chain content layout". Integer. A Bag ID pointing to JSON document with metadata.
3. `name` - Optional. UTF8 string. The name of the token - e.g. "Example Coin".
4. `description` - Optional. UTF8 string. Describes the token - e.g. "This is an example jetton for the TON network".
5. `image` - Optional. ASCII string. A URI pointing to a jetton icon with mime type image.
6. `image_data` - Optional. Either binary representation of the image for onchain layout or base64 for offchain layout.
7. `symbol` - Optional. UTF8 string. The symbol of the token - e.g. "XMPL". Used in the form "You received 99 XMPL".
8. `decimals` - Optional. If not specified, 9 is used by default. UTF8 encoded string with number from 0 to 255. The number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation, while 0 means that tokens are indivisible: user representation of token number should correspond to token amount in wallet-contract storage.
In case you specify decimals, it is highly recommended that you specify this parameter on-chain and that the smart contract code ensures that this parameter is immutable.
8. `amount_style` - Optional. Needed by external applications to understand which format for displaying the number of jettons.
9. `amount_style` - Optional. Needed by external applications to understand which format for displaying the number of jettons.
- "n" - number of jettons (default value). If the user has 100 tokens with decimals 0, then display that user has 100 tokens
- "n-of-total" - the number of jettons out of the total number of issued jettons. For example, totalSupply Jetton = 1000. A user has 100 jettons in the jetton wallet. For example must be displayed in the user's wallet as 100 of 1000 or in any other textual or graphical way to demonstrate the particular from the general.
- "%" - percentage of jettons from the total number of issued jettons. For example, totalSupply Jetton = 1000. A user has 100 jettons in the jetton wallet. For example it should be displayed in the user's wallet as 10%.
Expand Down