diff --git a/docs/src/content/docs/cookbook/jettons.mdx b/docs/src/content/docs/cookbook/jettons.mdx index 5fa47287a..9ca6204ce 100644 --- a/docs/src/content/docs/cookbook/jettons.mdx +++ b/docs/src/content/docs/cookbook/jettons.mdx @@ -369,7 +369,7 @@ fun composeJettonMetadata( description: String, // text description of the Jetton symbol: String, // "stock ticker" symbol without the $ prefix, like USDT or SCALE image: String, // link to the image - // There could be other attributes, see: + // There could be other data, see: // https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#jetton-metadata-attributes ): Cell { let dict: map = emptyMap(); @@ -379,9 +379,8 @@ fun composeJettonMetadata( dict.set(sha256("image"), image.asMetadataCell()); return beginCell() - .storeUint(0, 8) - .storeBit(true) - .storeRef(dict.asCell()!!) + .storeUint(0, 8) // a null byte prefix + .storeMaybeRef(dict.asCell()!!) // 1 as a single bit, then a reference .endCell(); } @@ -402,6 +401,12 @@ inline extends fun asMetadataCell(self: String): Cell { } ``` +:::note[Useful links:] + + [Token Data Standard in TEPs](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#jetton-metadata-attributes) + +::: + :::tip[Hey there!] Didn't find your favorite example of Jetton usage? Have cool implementations in mind? [Contributions are welcome!](https://github.com/tact-lang/tact/issues) diff --git a/docs/src/content/docs/cookbook/nfts.mdx b/docs/src/content/docs/cookbook/nfts.mdx index ece7dc463..770d5dee3 100644 --- a/docs/src/content/docs/cookbook/nfts.mdx +++ b/docs/src/content/docs/cookbook/nfts.mdx @@ -333,7 +333,7 @@ fun composeCollectionMetadata( name: String, // full name description: String, // text description of the NFT image: String, // link to the image - // There could be other attributes, see: + // There could be other data, see: // https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes ): Cell { let dict: map = emptyMap(); @@ -342,9 +342,8 @@ fun composeCollectionMetadata( dict.set(sha256("image"), image.asMetadataCell()); return beginCell() - .storeUint(0, 8) - .storeBit(true) - .storeRef(dict.asCell()!!) + .storeUint(0, 8) // a null byte prefix + .storeMaybeRef(dict.asCell()!!) // 1 as a single bit, then a reference .endCell(); } @@ -364,6 +363,13 @@ inline extends fun asMetadataCell(self: String): Cell { } ``` +:::note[Useful links:] + + [Token Data Standard in TEPs](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes)\ + [Off-chain NFT metadata by GetGems](https://github.com/getgems-io/nft-contracts/blob/main/docs/metadata.md) + +::: + ### NFT Item {#onchain-metadata-nft-item} ```tact @@ -372,7 +378,7 @@ fun composeItemMetadata( name: String, // full name description: String, // text description of the NFT image: String, // link to the image - // There could be other attributes, see: + // There could be other data, see: // https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes ): Cell { let dict: map = emptyMap(); @@ -381,9 +387,8 @@ fun composeItemMetadata( dict.set(sha256("image"), image.asMetadataCell()); return beginCell() - .storeUint(0, 8) - .storeBit(true) - .storeRef(dict.asCell()!!) + .storeUint(0, 8) // a null byte prefix + .storeMaybeRef(dict.asCell()!!) // 1 as a single bit, then a reference .endCell(); } @@ -403,6 +408,13 @@ inline extends fun asMetadataCell(self: String): Cell { } ``` +:::note[Useful links:] + + [Token Data Standard in TEPs](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#nft-metadata-attributes)\ + [Off-chain NFT metadata by GetGems](https://github.com/getgems-io/nft-contracts/blob/main/docs/metadata.md) + +::: + :::tip[Hey there!] Didn't find your favorite example of a NFT communication? Have cool implementations in mind? [Contributions are welcome!](https://github.com/tact-lang/tact/issues)