From d06e316992a96fd03bbe8759816d93a1e70cdfde Mon Sep 17 00:00:00 2001 From: Mark Paul Date: Thu, 12 Dec 2024 21:31:47 +1100 Subject: [PATCH] feature: for sol mint of cNFT, use the attributes that drip mentioned so the indexers work better --- package.json | 2 +- src/cnft-sol-minter.ts | 2 +- src/common/mint-utils.ts | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 471d1d0..5fb40ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "3.8.0-alpha.18", + "version": "3.8.0-alpha.19", "description": "SDK for Itheum's Data NFT Technology on MultiversX Blockchain", "main": "out/index.js", "types": "out/index.d.js", diff --git a/src/cnft-sol-minter.ts b/src/cnft-sol-minter.ts index bba27bf..6561ee4 100644 --- a/src/cnft-sol-minter.ts +++ b/src/cnft-sol-minter.ts @@ -35,7 +35,7 @@ export class CNftSolMinter extends MinterSol { * @param datasetTitle the title of the dataset. Between 10 and 60 alphanumeric characters. * @param datasetDescription the description of the dataset. Between 10 and 400 alphanumeric characters. * @param options [optional] below parameters are optional or required based on use case - * - imageUrl: the URL of the image for the Data NFT + * - imageUrl: the URL of the image for the Data NFT (HAS to be PNG as the cNFT metadata hardcodes the filetype property as PNG) * - traitsUrl: the URL of the traits for the Data NFT * - nftStorageToken: the nft storage token to be used to upload the image and metadata to IPFS * - extraAssets: [optional] extra URIs to attached to the NFT. Can be media files, documents, etc. These URIs are public diff --git a/src/common/mint-utils.ts b/src/common/mint-utils.ts index ca7e054..4de0daf 100644 --- a/src/common/mint-utils.ts +++ b/src/common/mint-utils.ts @@ -230,7 +230,19 @@ export function createIpfsMetadataSolCNft( itheum_data_stream_url: dataNFTStreamUrl, itheum_data_preview_url: dataNFTStreamPreviewUrl, itheum_data_marshal_url: dataNFTDataMarshalUrl, - attributes: [] as object[] + attributes: [] as object[], + animation_url: '', + external_url: 'https://itheum.io/datanfts-solana', + properties: { + category: 'image', + files: [ + { + type: 'image/png', + uri: imageOnIpfsUrl + } + ] + }, + symbol: '' }; if (extraAssets && extraAssets.length > 0) {