From 843936a071cfe93c947aeb5661596ebffac45cc9 Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 3 Jun 2025 13:55:32 +0300 Subject: [PATCH 1/4] Add and remove missing roles on sfts --- src/tokenManagement/resources.ts | 10 ++++++++++ .../tokenManagementTransactionsFactory.ts | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/tokenManagement/resources.ts b/src/tokenManagement/resources.ts index 69b5d5c2..0e607da3 100644 --- a/src/tokenManagement/resources.ts +++ b/src/tokenManagement/resources.ts @@ -32,6 +32,11 @@ export type SemiFungibleSpecialRoleInput = { addRoleNFTBurn: boolean; addRoleNFTAddQuantity: boolean; addRoleESDTTransferRole: boolean; + addRoleNFTUpdate: boolean; + addRoleESDTModifyRoyalties: boolean; + addRoleESDTSetNewUri: boolean; + addRoleESDTModifyCreator: boolean; + addRoleNFTRecreate: boolean; }; export type SpecialRoleInput = { @@ -61,6 +66,11 @@ export type UnsetSemiFungibleSpecialRoleInput = { removeRoleNFTBurn: boolean; removeRoleNFTAddQuantity: boolean; removeRoleESDTTransferRole: boolean; + removeRoleNFTUpdate: boolean; + removeRoleESDTModifyRoyalties: boolean; + removeRoleESDTSetNewUri: boolean; + removeRoleESDTModifyCreator: boolean; + removeRoleNFTRecreate: boolean; }; export type UnsetSpecialRoleInput = { diff --git a/src/tokenManagement/tokenManagementTransactionsFactory.ts b/src/tokenManagement/tokenManagementTransactionsFactory.ts index 90ad40a2..1747de0a 100644 --- a/src/tokenManagement/tokenManagementTransactionsFactory.ts +++ b/src/tokenManagement/tokenManagementTransactionsFactory.ts @@ -314,6 +314,11 @@ export class TokenManagementTransactionsFactory { options.addRoleNFTBurn ? args.push(new StringValue("ESDTRoleNFTBurn")) : 0; options.addRoleNFTAddQuantity ? args.push(new StringValue("ESDTRoleNFTAddQuantity")) : 0; options.addRoleESDTTransferRole ? args.push(new StringValue("ESDTTransferRole")) : 0; + options.addRoleNFTUpdate ? args.push(new StringValue("ESDTRoleNFTUpdate")) : 0; + options.addRoleESDTModifyRoyalties ? args.push(new StringValue("ESDTRoleModifyRoyalties")) : 0; + options.addRoleESDTSetNewUri ? args.push(new StringValue("ESDTRoleSetNewURI")) : 0; + options.addRoleESDTModifyCreator ? args.push(new StringValue("ESDTRoleModifyCreator")) : 0; + options.addRoleNFTRecreate ? args.push(new StringValue("ESDTRoleNFTRecreate")) : 0; const dataParts = ["setSpecialRole", ...this.argSerializer.valuesToStrings(args)]; @@ -336,6 +341,12 @@ export class TokenManagementTransactionsFactory { options.removeRoleNFTBurn ? args.push(new StringValue("ESDTRoleNFTBurn")) : 0; options.removeRoleNFTAddQuantity ? args.push(new StringValue("ESDTRoleNFTAddQuantity")) : 0; options.removeRoleESDTTransferRole ? args.push(new StringValue("ESDTTransferRole")) : 0; + options.removeRoleESDTTransferRole ? args.push(new StringValue("ESDTTransferRole")) : 0; + options.removeRoleNFTUpdate ? args.push(new StringValue("ESDTRoleNFTUpdate")) : 0; + options.removeRoleESDTModifyRoyalties ? args.push(new StringValue("ESDTRoleModifyRoyalties")) : 0; + options.removeRoleESDTSetNewUri ? args.push(new StringValue("ESDTRoleSetNewURI")) : 0; + options.removeRoleESDTModifyCreator ? args.push(new StringValue("ESDTRoleModifyCreator")) : 0; + options.removeRoleNFTRecreate ? args.push(new StringValue("ESDTRoleNFTRecreate")) : 0; const dataParts = ["unSetSpecialRole", ...this.argSerializer.valuesToStrings(args)]; From 6b6e2936eb2a3e39e0f6c19435673a20e3187b62 Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 3 Jun 2025 13:56:15 +0300 Subject: [PATCH 2/4] Bump Version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c692de46..f43b82a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@multiversx/sdk-core", - "version": "14.1.1", + "version": "14.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@multiversx/sdk-core", - "version": "14.1.1", + "version": "14.1.2", "license": "MIT", "dependencies": { "@multiversx/sdk-transaction-decoder": "1.0.2", diff --git a/package.json b/package.json index ba81a678..d884719f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-core", - "version": "14.1.1", + "version": "14.1.2", "description": "MultiversX SDK for JavaScript and TypeScript", "author": "MultiversX", "homepage": "https://multiversx.com", From 27f66cd63ae84118a35a285b03658d16f94bb9f6 Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 3 Jun 2025 14:00:51 +0300 Subject: [PATCH 3/4] Make this roles optional --- src/tokenManagement/resources.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tokenManagement/resources.ts b/src/tokenManagement/resources.ts index 0e607da3..30443b99 100644 --- a/src/tokenManagement/resources.ts +++ b/src/tokenManagement/resources.ts @@ -32,11 +32,11 @@ export type SemiFungibleSpecialRoleInput = { addRoleNFTBurn: boolean; addRoleNFTAddQuantity: boolean; addRoleESDTTransferRole: boolean; - addRoleNFTUpdate: boolean; - addRoleESDTModifyRoyalties: boolean; - addRoleESDTSetNewUri: boolean; - addRoleESDTModifyCreator: boolean; - addRoleNFTRecreate: boolean; + addRoleNFTUpdate?: boolean; + addRoleESDTModifyRoyalties?: boolean; + addRoleESDTSetNewUri?: boolean; + addRoleESDTModifyCreator?: boolean; + addRoleNFTRecreate?: boolean; }; export type SpecialRoleInput = { @@ -66,11 +66,11 @@ export type UnsetSemiFungibleSpecialRoleInput = { removeRoleNFTBurn: boolean; removeRoleNFTAddQuantity: boolean; removeRoleESDTTransferRole: boolean; - removeRoleNFTUpdate: boolean; - removeRoleESDTModifyRoyalties: boolean; - removeRoleESDTSetNewUri: boolean; - removeRoleESDTModifyCreator: boolean; - removeRoleNFTRecreate: boolean; + removeRoleNFTUpdate?: boolean; + removeRoleESDTModifyRoyalties?: boolean; + removeRoleESDTSetNewUri?: boolean; + removeRoleESDTModifyCreator?: boolean; + removeRoleNFTRecreate?: boolean; }; export type UnsetSpecialRoleInput = { From adb2b0b736974a7a52afc95c21fe644c8f293544 Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 3 Jun 2025 14:06:07 +0300 Subject: [PATCH 4/4] Remove duplicated role --- src/tokenManagement/tokenManagementTransactionsFactory.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tokenManagement/tokenManagementTransactionsFactory.ts b/src/tokenManagement/tokenManagementTransactionsFactory.ts index 1747de0a..63884ee5 100644 --- a/src/tokenManagement/tokenManagementTransactionsFactory.ts +++ b/src/tokenManagement/tokenManagementTransactionsFactory.ts @@ -341,7 +341,6 @@ export class TokenManagementTransactionsFactory { options.removeRoleNFTBurn ? args.push(new StringValue("ESDTRoleNFTBurn")) : 0; options.removeRoleNFTAddQuantity ? args.push(new StringValue("ESDTRoleNFTAddQuantity")) : 0; options.removeRoleESDTTransferRole ? args.push(new StringValue("ESDTTransferRole")) : 0; - options.removeRoleESDTTransferRole ? args.push(new StringValue("ESDTTransferRole")) : 0; options.removeRoleNFTUpdate ? args.push(new StringValue("ESDTRoleNFTUpdate")) : 0; options.removeRoleESDTModifyRoyalties ? args.push(new StringValue("ESDTRoleModifyRoyalties")) : 0; options.removeRoleESDTSetNewUri ? args.push(new StringValue("ESDTRoleSetNewURI")) : 0;