diff --git a/package-lock.json b/package-lock.json index 2a1db5d..1e30a1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "2.5.0", + "version": "2.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@itheum/sdk-mx-data-nft", - "version": "2.5.0", + "version": "2.6.0", "license": "GPL-3.0-only", "dependencies": { "@multiversx/sdk-core": "12.17.0", @@ -19,7 +19,7 @@ "jest": "29.7.0", "ts-jest": "29.1.1", "tslint": "6.1.3", - "typedoc": "0.25.4", + "typedoc": "0.25.7", "typescript": "5.3.3" } }, @@ -5002,9 +5002,9 @@ } }, "node_modules/shiki": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.4.tgz", - "integrity": "sha512-IXCRip2IQzKwxArNNq1S+On4KPML3Yyn8Zzs/xRgcgOWIr8ntIK3IKzjFPfjy/7kt9ZMjc+FItfqHRBg8b6tNQ==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", + "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", "dev": true, "dependencies": { "ansi-sequence-parser": "^1.1.0", @@ -5535,15 +5535,15 @@ } }, "node_modules/typedoc": { - "version": "0.25.4", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz", - "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==", + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.7.tgz", + "integrity": "sha512-m6A6JjQRg39p2ZVRIN3NKXgrN8vzlHhOS+r9ymUYtcUP/TIQPvWSq7YgE5ZjASfv5Vd5BW5xrir6Gm2XNNcOow==", "dev": true, "dependencies": { "lunr": "^2.3.9", "marked": "^4.3.0", "minimatch": "^9.0.3", - "shiki": "^0.14.1" + "shiki": "^0.14.7" }, "bin": { "typedoc": "bin/typedoc" diff --git a/package.json b/package.json index 330929e..dd4d787 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "2.5.0", + "version": "2.6.0", "description": "SDK for Itheum's Data NFT Technology on MultiversX Blockchain", "main": "out/index.js", "types": "out/index.d.js", @@ -26,7 +26,7 @@ "jest": "29.7.0", "ts-jest": "29.1.1", "tslint": "6.1.3", - "typedoc": "0.25.4", + "typedoc": "0.25.7", "typescript": "5.3.3" }, "repository": { diff --git a/src/abis/data-nft-lease.abi.json b/src/abis/data-nft-lease.abi.json index ae983b9..4c4060b 100644 --- a/src/abis/data-nft-lease.abi.json +++ b/src/abis/data-nft-lease.abi.json @@ -468,14 +468,9 @@ ] }, { - "name": "getSftsFrozenForAddress", + "name": "getFrozenNonces", "mutability": "readonly", - "inputs": [ - { - "name": "address", - "type": "Address" - } - ], + "inputs": [], "outputs": [ { "type": "variadic", @@ -483,21 +478,6 @@ } ] }, - { - "name": "getFrozenCount", - "mutability": "readonly", - "inputs": [ - { - "name": "address", - "type": "Address" - } - ], - "outputs": [ - { - "type": "u32" - } - ] - }, { "name": "isWhiteListEnabled", "mutability": "readonly", @@ -792,13 +772,8 @@ ] }, { - "identifier": "frozenSftsPerAddress", + "identifier": "frozenNfts", "inputs": [ - { - "name": "address", - "type": "Address", - "indexed": true - }, { "name": "nonce", "type": "u64", @@ -807,13 +782,8 @@ ] }, { - "identifier": "unfrozenSftsPerAddress", + "identifier": "unfrozenNfts", "inputs": [ - { - "name": "address", - "type": "Address", - "indexed": true - }, { "name": "nonce", "type": "u64", @@ -1040,6 +1010,41 @@ "indexed": true } ] + }, + { + "identifier": "claimRoyalties", + "inputs": [ + { + "name": "claim_address", + "type": "Address", + "indexed": true + }, + { + "name": "token_identifier", + "type": "EgldOrEsdtTokenIdentifier", + "indexed": true + }, + { + "name": "nonce", + "type": "u64", + "indexed": true + }, + { + "name": "amount", + "type": "BigUint", + "indexed": true + }, + { + "name": "tax", + "type": "BigUint", + "indexed": true + }, + { + "name": "tax_address", + "type": "Address", + "indexed": true + } + ] } ], "hasCallback": true, diff --git a/src/minter.ts b/src/minter.ts index 4150596..00427b3 100644 --- a/src/minter.ts +++ b/src/minter.ts @@ -137,35 +137,6 @@ export abstract class Minter { } } - /** - * Retrieves a list of nonces that are frozen for address - * @param address The address to check - */ - async viewAddressFrozenNonces(address: IAddress): Promise { - const interaction = this.contract.methodsExplicit.getSftsFrozenForAddress([ - new AddressValue(address) - ]); - const query = interaction.buildQuery(); - const queryResponse = await this.networkProvider.queryContract(query); - const endpointDefinition = interaction.getEndpoint(); - const { firstValue, returnCode } = new ResultsParser().parseQueryResponse( - queryResponse, - endpointDefinition - ); - if (returnCode.isSuccess()) { - const returnValue = firstValue?.valueOf(); - const frozenNonces: number[] = returnValue.map((nonce: any) => - nonce.toNumber() - ); - return frozenNonces; - } else { - throw new ErrContractQuery( - 'viewAddressFrozenNonces', - returnCode.toString() - ); - } - } - /** * Creates a `burn` transaction * @param senderAddress the address of the user diff --git a/src/nft-minter.ts b/src/nft-minter.ts index a02f122..f2ab200 100644 --- a/src/nft-minter.ts +++ b/src/nft-minter.ts @@ -486,6 +486,29 @@ export class NftMinter extends Minter { } } + /** + * Retrieves a list of nonces that are frozen + */ + async viewFrozenNonces(): Promise { + const interaction = this.contract.methodsExplicit.getFrozenNonces(); + const query = interaction.buildQuery(); + const queryResponse = await this.networkProvider.queryContract(query); + const endpointDefinition = interaction.getEndpoint(); + const { firstValue, returnCode } = new ResultsParser().parseQueryResponse( + queryResponse, + endpointDefinition + ); + if (returnCode.isSuccess()) { + const returnValue = firstValue?.valueOf(); + const frozenNonces: number[] = returnValue.map((nonce: any) => + nonce.toNumber() + ); + return frozenNonces; + } else { + throw new ErrContractQuery('viewFrozenNonces', returnCode.toString()); + } + } + /** * Retrieves the address with update attributes roles for contract collection */ diff --git a/src/sft-minter.ts b/src/sft-minter.ts index 0711a7d..72cf283 100644 --- a/src/sft-minter.ts +++ b/src/sft-minter.ts @@ -93,6 +93,35 @@ export class SftMinter extends Minter { } } + /** + * Retrieves a list of nonces that are frozen for address + * @param address The address to check + */ + async viewAddressFrozenNonces(address: IAddress): Promise { + const interaction = this.contract.methodsExplicit.getSftsFrozenForAddress([ + new AddressValue(address) + ]); + const query = interaction.buildQuery(); + const queryResponse = await this.networkProvider.queryContract(query); + const endpointDefinition = interaction.getEndpoint(); + const { firstValue, returnCode } = new ResultsParser().parseQueryResponse( + queryResponse, + endpointDefinition + ); + if (returnCode.isSuccess()) { + const returnValue = firstValue?.valueOf(); + const frozenNonces: number[] = returnValue.map((nonce: any) => + nonce.toNumber() + ); + return frozenNonces; + } else { + throw new ErrContractQuery( + 'viewAddressFrozenNonces', + returnCode.toString() + ); + } + } + /** * Creates an initialize contract transaction for the contract * @param senderAddress The address of the sender, must be the admin of the contract