@multiversx/sdk-core
Advanced tools
Comparing version 12.2.1 to 12.3.0
@@ -11,2 +11,3 @@ /// <reference types="node" /> | ||
gasLimitIssue: IGasLimit; | ||
gasLimitToggleBurnRoleGlobally: IGasLimit; | ||
gasLimitESDTLocalMint: IGasLimit; | ||
@@ -41,7 +42,13 @@ gasLimitESDTLocalBurn: IGasLimit; | ||
canPause: boolean; | ||
canMint: boolean; | ||
canBurn: boolean; | ||
canChangeOwner: boolean; | ||
canUpgrade: boolean; | ||
canAddSpecialRoles: boolean; | ||
/** | ||
* @deprecated (not used anymore) | ||
*/ | ||
canMint?: boolean; | ||
/** | ||
* @deprecated (not used anymore) | ||
*/ | ||
canBurn?: boolean; | ||
} | ||
@@ -65,2 +72,14 @@ interface IIssueSemiFungibleArgs extends IBaseArgs { | ||
} | ||
interface IRegisterAndSetAllRoles extends IBaseArgs { | ||
issuer: IAddress; | ||
tokenName: string; | ||
tokenTicker: string; | ||
tokenType: RegisterAndSetAllRolesTokenType; | ||
numDecimals: number; | ||
} | ||
declare type RegisterAndSetAllRolesTokenType = "NFT" | "SFT" | "META" | "FNG"; | ||
interface IToggleBurnRoleGloballyArgs extends IBaseArgs { | ||
manager: IAddress; | ||
tokenIdentifier: string; | ||
} | ||
interface IFungibleSetSpecialRoleArgs extends IBaseArgs { | ||
@@ -151,5 +170,9 @@ manager: IAddress; | ||
issueFungible(args: IIssueFungibleArgs): Transaction; | ||
private notifyAboutUnsettingBurnRoleGlobally; | ||
issueSemiFungible(args: IIssueSemiFungibleArgs): Transaction; | ||
issueNonFungible(args: IIssueNonFungibleArgs): Transaction; | ||
registerMetaESDT(args: IRegisterMetaESDT): Transaction; | ||
registerAndSetAllRoles(args: IRegisterAndSetAllRoles): Transaction; | ||
setBurnRoleGlobally(args: IToggleBurnRoleGloballyArgs): Transaction; | ||
unsetBurnRoleGlobally(args: IToggleBurnRoleGloballyArgs): Transaction; | ||
setSpecialRoleOnFungible(args: IFungibleSetSpecialRoleArgs): Transaction; | ||
@@ -156,0 +179,0 @@ setSpecialRoleOnSemiFungible(args: ISemiFungibleSetSpecialRoleArgs): Transaction; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
const logger_1 = require("../logger"); | ||
const networkParams_1 = require("../networkParams"); | ||
@@ -16,2 +17,3 @@ const transaction_1 = require("../transaction"); | ||
issueFungible(args) { | ||
this.notifyAboutUnsettingBurnRoleGlobally(); | ||
const parts = [ | ||
@@ -26,4 +28,2 @@ "issue", | ||
...(args.canPause ? [codec_1.utf8ToHex("canPause"), this.trueAsHex] : []), | ||
...(args.canMint ? [codec_1.utf8ToHex("canMint"), this.trueAsHex] : []), | ||
...(args.canBurn ? [codec_1.utf8ToHex("canBurn"), this.trueAsHex] : []), | ||
...(args.canChangeOwner ? [codec_1.utf8ToHex("canChangeOwner"), this.trueAsHex] : []), | ||
@@ -44,3 +44,12 @@ ...(args.canUpgrade ? [codec_1.utf8ToHex("canUpgrade"), this.trueAsHex] : []), | ||
} | ||
notifyAboutUnsettingBurnRoleGlobally() { | ||
logger_1.Logger.info(` | ||
========== | ||
IMPORTANT! | ||
========== | ||
You are about to issue (register) a new token. This will set the role "ESDTRoleBurnForAll" (globally). | ||
Once the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).`); | ||
} | ||
issueSemiFungible(args) { | ||
this.notifyAboutUnsettingBurnRoleGlobally(); | ||
const parts = [ | ||
@@ -70,2 +79,3 @@ "issueSemiFungible", | ||
issueNonFungible(args) { | ||
this.notifyAboutUnsettingBurnRoleGlobally(); | ||
const parts = [ | ||
@@ -95,2 +105,3 @@ "issueNonFungible", | ||
registerMetaESDT(args) { | ||
this.notifyAboutUnsettingBurnRoleGlobally(); | ||
const parts = [ | ||
@@ -120,2 +131,52 @@ "registerMetaESDT", | ||
} | ||
registerAndSetAllRoles(args) { | ||
this.notifyAboutUnsettingBurnRoleGlobally(); | ||
const parts = [ | ||
"registerAndSetAllRoles", | ||
codec_1.utf8ToHex(args.tokenName), | ||
codec_1.utf8ToHex(args.tokenTicker), | ||
codec_1.utf8ToHex(args.tokenType), | ||
codec_1.bigIntToHex(args.numDecimals) | ||
]; | ||
return this.createTransaction({ | ||
sender: args.issuer, | ||
receiver: this.config.esdtContractAddress, | ||
nonce: args.transactionNonce, | ||
value: this.config.issueCost, | ||
gasPrice: args.gasPrice, | ||
gasLimitHint: args.gasLimit, | ||
executionGasLimit: this.config.gasLimitIssue, | ||
dataParts: parts | ||
}); | ||
} | ||
setBurnRoleGlobally(args) { | ||
const parts = [ | ||
"setBurnRoleGlobally", | ||
codec_1.utf8ToHex(args.tokenIdentifier) | ||
]; | ||
return this.createTransaction({ | ||
sender: args.manager, | ||
receiver: this.config.esdtContractAddress, | ||
nonce: args.transactionNonce, | ||
gasPrice: args.gasPrice, | ||
gasLimitHint: args.gasLimit, | ||
executionGasLimit: this.config.gasLimitToggleBurnRoleGlobally, | ||
dataParts: parts | ||
}); | ||
} | ||
unsetBurnRoleGlobally(args) { | ||
const parts = [ | ||
"unsetBurnRoleGlobally", | ||
codec_1.utf8ToHex(args.tokenIdentifier) | ||
]; | ||
return this.createTransaction({ | ||
sender: args.manager, | ||
receiver: this.config.esdtContractAddress, | ||
nonce: args.transactionNonce, | ||
gasPrice: args.gasPrice, | ||
gasLimitHint: args.gasLimit, | ||
executionGasLimit: this.config.gasLimitToggleBurnRoleGlobally, | ||
dataParts: parts | ||
}); | ||
} | ||
setSpecialRoleOnFungible(args) { | ||
@@ -122,0 +183,0 @@ const parts = [ |
@@ -9,2 +9,3 @@ import BigNumber from "bignumber.js"; | ||
gasLimitIssue: IGasLimit; | ||
gasLimitToggleBurnRoleGlobally: IGasLimit; | ||
gasLimitESDTLocalMint: IGasLimit; | ||
@@ -11,0 +12,0 @@ gasLimitESDTLocalBurn: IGasLimit; |
@@ -11,2 +11,3 @@ "use strict"; | ||
this.gasLimitIssue = 60000000; | ||
this.gasLimitToggleBurnRoleGlobally = 60000000; | ||
this.gasLimitESDTLocalMint = 300000; | ||
@@ -13,0 +14,0 @@ this.gasLimitESDTLocalBurn = 300000; |
@@ -29,2 +29,8 @@ /// <reference types="node" /> | ||
} | ||
export interface IRegisterAndSetAllRolesOutcome { | ||
tokenIdentifier: string; | ||
roles: string[]; | ||
} | ||
export interface IToggleBurnRoleGloballyOutcome { | ||
} | ||
export interface ISetSpecialRoleOutcome { | ||
@@ -86,2 +92,5 @@ userAddress: string; | ||
parseRegisterMetaESDT(transaction: ITransactionOnNetwork): IESDTIssueOutcome; | ||
parseRegisterAndSetAllRoles(transaction: ITransactionOnNetwork): IRegisterAndSetAllRolesOutcome; | ||
parseSetBurnRoleGlobally(transaction: ITransactionOnNetwork): IToggleBurnRoleGloballyOutcome; | ||
parseUnsetBurnRoleGlobally(transaction: ITransactionOnNetwork): IToggleBurnRoleGloballyOutcome; | ||
parseSetSpecialRole(transaction: ITransactionOnNetwork): ISetSpecialRoleOutcome; | ||
@@ -88,0 +97,0 @@ parseNFTCreate(transaction: ITransactionOnNetwork): INFTCreateOutcome; |
@@ -32,2 +32,18 @@ "use strict"; | ||
} | ||
parseRegisterAndSetAllRoles(transaction) { | ||
this.ensureNoError(transaction); | ||
const eventRegister = this.findSingleEventByIdentifier(transaction, "registerAndSetAllRoles"); | ||
const tokenIdentifier = this.extractTokenIdentifier(eventRegister); | ||
const eventSetRole = this.findSingleEventByIdentifier(transaction, "ESDTSetRole"); | ||
const roles = eventSetRole.topics.slice(3).map(topic => topic.valueOf().toString()); | ||
return { tokenIdentifier, roles }; | ||
} | ||
parseSetBurnRoleGlobally(transaction) { | ||
this.ensureNoError(transaction); | ||
return {}; | ||
} | ||
parseUnsetBurnRoleGlobally(transaction) { | ||
this.ensureNoError(transaction); | ||
return {}; | ||
} | ||
parseSetSpecialRole(transaction) { | ||
@@ -34,0 +50,0 @@ this.ensureNoError(transaction); |
{ | ||
"name": "@multiversx/sdk-core", | ||
"version": "12.2.1", | ||
"version": "12.3.0", | ||
"description": "MultiversX SDK for JavaScript and TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
706160
12024