diff --git a/package-lock.json b/package-lock.json index 1ec569b..ac854ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@itheum/sdk-mx-data-nft", - "version": "2.2.0", + "version": "2.3.0", "license": "GPL-3.0-only", "dependencies": { "@multiversx/sdk-core": "12.11.0", diff --git a/package.json b/package.json index d42af6b..43b4867 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "2.2.0", + "version": "2.3.0", "description": "SDK for Itheum's Data NFT Technology on MultiversX Blockchain", "main": "out/index.js", "types": "out/index.d.js", diff --git a/src/abis/data-nft-lease.abi.json b/src/abis/data-nft-lease.abi.json index 72d5db2..ae983b9 100644 --- a/src/abis/data-nft-lease.abi.json +++ b/src/abis/data-nft-lease.abi.json @@ -2,10 +2,10 @@ "buildInfo": { "rustc": { "version": "1.71.0-nightly", - "commitHash": "7f94b314cead7059a71a265a8b64905ef2511796", - "commitDate": "2023-04-23", + "commitHash": "a2b1646c597329d0a25efa3889b66650f65de1de", + "commitDate": "2023-05-25", "channel": "Nightly", - "short": "rustc 1.71.0-nightly (7f94b314c 2023-04-23)" + "short": "rustc 1.71.0-nightly (a2b1646c5 2023-05-25)" }, "contractCrate": { "name": "data-nft-lease", @@ -13,15 +13,15 @@ }, "framework": { "name": "multiversx-sc", - "version": "0.43.2" + "version": "0.43.5" } }, "name": "DataNftMint", "constructor": { "inputs": [ { - "name": "administrator", - "type": "optional
", + "name": "setup_values", + "type": "optional>", "multi_arg": true } ], @@ -196,7 +196,7 @@ "outputs": [] }, { - "name": "setAntiSpamTax", + "name": "setMintTaxFee", "mutability": "mutable", "inputs": [ { @@ -294,26 +294,6 @@ ], "outputs": [] }, - { - "name": "setTax", - "onlyOwner": true, - "mutability": "mutable", - "inputs": [ - { - "name": "itheum_address", - "type": "Address" - }, - { - "name": "tax", - "type": "BigUint" - } - ], - "outputs": [ - { - "type": "BigUint" - } - ] - }, { "name": "setClaimsAddress", "mutability": "mutable", @@ -375,6 +355,16 @@ } ] }, + { + "name": "getTaxTokens", + "mutability": "readonly", + "inputs": [], + "outputs": [ + { + "type": "EgldOrEsdtTokenIdentifier" + } + ] + }, { "name": "getTaxIsRequired", "mutability": "readonly", @@ -561,17 +551,7 @@ ] }, { - "name": "getItheumTax", - "mutability": "readonly", - "inputs": [], - "outputs": [ - { - "type": "BigUint" - } - ] - }, - { - "name": "getItheumTaxAddress", + "name": "getRoyaltiesAddress", "mutability": "readonly", "inputs": [], "outputs": [ @@ -581,7 +561,7 @@ ] }, { - "name": "getClaimsAddress", + "name": "getFactoryAddress", "mutability": "readonly", "inputs": [], "outputs": [ @@ -697,6 +677,67 @@ } ], "outputs": [] + }, + { + "name": "check_claims", + "mutability": "mutable", + "inputs": [ + { + "name": "address_to_check", + "type": "Address" + } + ], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "get_claims", + "mutability": "mutable", + "inputs": [], + "outputs": [] + }, + { + "name": "factory_treasury_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "factory_tax", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "BigUint" + } + ] + }, + { + "name": "factory_claims_contract_address", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "Address" + } + ] + }, + { + "name": "factory_claims_token_identifier", + "mutability": "mutable", + "inputs": [], + "outputs": [ + { + "type": "TokenIdentifier" + } + ] } ], "events": [ @@ -816,7 +857,7 @@ ] }, { - "identifier": "antiSpamTaxSet", + "identifier": "mintTaxFee", "inputs": [ { "name": "token", @@ -860,6 +901,16 @@ } ] }, + { + "identifier": "setFactoryAddress", + "inputs": [ + { + "name": "factory_address", + "type": "Address", + "indexed": true + } + ] + }, { "identifier": "pauseCollection", "inputs": [ @@ -1039,6 +1090,10 @@ { "name": "administrator_address", "type": "Address" + }, + { + "name": "tax_token", + "type": "EgldOrEsdtTokenIdentifier" } ] }, diff --git a/src/datanft.ts b/src/datanft.ts index c5d2771..85f46de 100644 --- a/src/datanft.ts +++ b/src/datanft.ts @@ -451,7 +451,9 @@ export class DataNft { mvxNativeAuthOriginsToBase64 = mvxNativeAuthOriginsToBase64 .trim() .replaceAll(' ', ''); // remove all spaces - mvxNativeAuthOriginsToBase64 = window.btoa(mvxNativeAuthOriginsToBase64); // convert to base64 + mvxNativeAuthOriginsToBase64 = Buffer.from( + mvxNativeAuthOriginsToBase64 + ).toString('base64'); // construct the api url let url = `${this.dataMarshal}/access?NFTId=${ diff --git a/src/interfaces.ts b/src/interfaces.ts index 0d20b4b..6b8bb2c 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -105,4 +105,5 @@ export interface ContractConfiguration { rolesAreSet: boolean; claimsAddress: string; administratorAddress: string; + taxToken: string; } diff --git a/src/minter.ts b/src/minter.ts index 49cecc0..b2efbfc 100644 --- a/src/minter.ts +++ b/src/minter.ts @@ -254,7 +254,7 @@ export abstract class Minter { .setFunction(new ContractFunction('setLocalRoles')) .build(), receiver: this.contract.getAddress(), - gasLimit: 90000000, + gasLimit: 100000000, sender: senderAddress, chainID: this.chainID }); diff --git a/src/nft-minter.ts b/src/nft-minter.ts index ad8d1e3..949d549 100644 --- a/src/nft-minter.ts +++ b/src/nft-minter.ts @@ -90,7 +90,7 @@ export class NftMinter extends Minter { value: 50000000000000000, data: data, receiver: this.contract.getAddress(), - gasLimit: 50000000, + gasLimit: 100000000, sender: senderAddress, chainID: this.chainID }); @@ -453,7 +453,8 @@ export class NftMinter extends Minter { isContractPaused: returnValue?.is_paused as boolean, rolesAreSet: returnValue?.roles_are_set as boolean, claimsAddress: returnValue?.claims_address.toString(), - administratorAddress: returnValue?.administrator_address.toString() + administratorAddress: returnValue?.administrator_address.toString(), + taxToken: returnValue?.tax_token.toString() }; return contractConfiguration; } else {