From 066e848059ea65be2cb977b32df9af8e23d87a61 Mon Sep 17 00:00:00 2001 From: Mark Paul Date: Thu, 10 Oct 2024 20:56:47 +0100 Subject: [PATCH] feature: signatureNonce and solSignature added for CNftSolMinter --- package.json | 3 +-- src/cnft-sol-minter.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8d0cbbc..522de3d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "3.7.0-alpha.6", + "version": "3.7.0-alpha.7", "description": "SDK for Itheum's Data NFT Technology on MultiversX Blockchain", - "main": "out/index.js", "types": "out/index.d.js", "files": [ diff --git a/src/cnft-sol-minter.ts b/src/cnft-sol-minter.ts index 0a90a44..fd71e5c 100644 --- a/src/cnft-sol-minter.ts +++ b/src/cnft-sol-minter.ts @@ -40,6 +40,8 @@ export class CNftSolMinter extends MinterSol { * - extraAssets: [optional] extra URIs to attached to the NFT. Can be media files, documents, etc. These URIs are public * - imgGenBg: [optional] the custom series bg to influence the image generation service * - imgGenSet: [optional] the custom series layer set to influence the image generation service + * - signatureNonce: [optional] a recent nonce from the marshal network that will be signed to produce solSignature + * - solSignature: [optional] a solana signature of signatureNonce to prove creatorAddress ownership * */ async mint( @@ -57,6 +59,8 @@ export class CNftSolMinter extends MinterSol { extraAssets?: string[]; imgGenBg?: string; imgGenSet?: string; + signatureNonce?: string; + solSignature?: string; } ): Promise<{ imageUrl: string; @@ -74,7 +78,9 @@ export class CNftSolMinter extends MinterSol { nftStorageToken, extraAssets, imgGenBg, - imgGenSet + imgGenSet, + signatureNonce, + solSignature } = options ?? {}; const tokenNameValidator = new StringValidator() @@ -213,8 +219,8 @@ export class CNftSolMinter extends MinterSol { metadataOnIpfsUrl, tokenName, mintForSolAddr: creatorAddress, - solSignature: 'solSignature', - signatureNonce: 'signatureNonce' + solSignature: solSignature || '', + signatureNonce: signatureNonce || '' }); const requestOptions = { @@ -230,6 +236,7 @@ export class CNftSolMinter extends MinterSol { this.solCNftMinterServiceUrl, requestOptions ); + dataMintCall = await resMintCall.text(); mintMeta = dataMintCall; } catch (e: any) {