From 8456dc5481a35e80ecd7f2a106698c255a2cf359 Mon Sep 17 00:00:00 2001 From: Bucur David Date: Tue, 14 Nov 2023 13:26:18 +0200 Subject: [PATCH 1/5] fix: remove window usage for converting to base64 -Refs: #74 --- src/datanft.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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=${ From c8c7a9c1b4a2e045dd9e0a7456c954e23e795af8 Mon Sep 17 00:00:00 2001 From: Bucur David Date: Tue, 14 Nov 2023 13:30:29 +0200 Subject: [PATCH 2/5] fix: gas limit update --- src/minter.ts | 2 +- src/nft-minter.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..54a009a 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 }); From 53032edfa499ba9cfb5ab2cb9637f2855833b1ad Mon Sep 17 00:00:00 2001 From: Bucur David Date: Wed, 15 Nov 2023 18:23:09 +0200 Subject: [PATCH 3/5] feat: taxToken information on requirements --- src/interfaces.ts | 1 + src/nft-minter.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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/nft-minter.ts b/src/nft-minter.ts index 54a009a..949d549 100644 --- a/src/nft-minter.ts +++ b/src/nft-minter.ts @@ -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 { From e5d913545c4e4156a90cf8e01628547999a4844e Mon Sep 17 00:00:00 2001 From: Bucur David Date: Wed, 15 Nov 2023 21:23:18 +0200 Subject: [PATCH 4/5] fix: updated abi file --- src/abis/data-nft-lease.abi.json | 135 ++++++++++++++++++++++--------- 1 file changed, 95 insertions(+), 40 deletions(-) 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" } ] }, From ef85fe41455b4e98528c471d28d8d95ec0c7ac61 Mon Sep 17 00:00:00 2001 From: Mark Paul Date: Thu, 16 Nov 2023 21:21:32 +1100 Subject: [PATCH 5/5] v bump to 2.3.0 --- 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 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",