Skip to content

Commit

Permalink
feature: signatureNonce and solSignature added for CNftSolMinter
Browse files Browse the repository at this point in the history
  • Loading branch information
newbreedofgeek committed Oct 10, 2024
1 parent 75323ef commit 066e848
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
13 changes: 10 additions & 3 deletions src/cnft-sol-minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -57,6 +59,8 @@ export class CNftSolMinter extends MinterSol {
extraAssets?: string[];
imgGenBg?: string;
imgGenSet?: string;
signatureNonce?: string;
solSignature?: string;
}
): Promise<{
imageUrl: string;
Expand All @@ -74,7 +78,9 @@ export class CNftSolMinter extends MinterSol {
nftStorageToken,
extraAssets,
imgGenBg,
imgGenSet
imgGenSet,
signatureNonce,
solSignature
} = options ?? {};

const tokenNameValidator = new StringValidator()
Expand Down Expand Up @@ -213,8 +219,8 @@ export class CNftSolMinter extends MinterSol {
metadataOnIpfsUrl,
tokenName,
mintForSolAddr: creatorAddress,
solSignature: 'solSignature',
signatureNonce: 'signatureNonce'
solSignature: solSignature || '',
signatureNonce: signatureNonce || ''
});

const requestOptions = {
Expand All @@ -230,6 +236,7 @@ export class CNftSolMinter extends MinterSol {
this.solCNftMinterServiceUrl,
requestOptions
);

dataMintCall = await resMintCall.text();
mintMeta = dataMintCall;
} catch (e: any) {
Expand Down

0 comments on commit 066e848

Please sign in to comment.