diff --git a/package-lock.json b/package-lock.json index 70f8bfd..1ec569b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "2.1.5", + "version": "2.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@itheum/sdk-mx-data-nft", - "version": "2.1.5", + "version": "2.2.0", "license": "GPL-3.0-only", "dependencies": { "@multiversx/sdk-core": "12.11.0", diff --git a/package.json b/package.json index 37205f4..d42af6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@itheum/sdk-mx-data-nft", - "version": "2.1.5", + "version": "2.2.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/config.ts b/src/config.ts index efe9e28..088299a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,26 +25,26 @@ const testnetNetworkConfig: Config = { }; export const itheumTokenIdentifier: { [key in EnvironmentsEnum]: string } = { - devnet: 'ITHEUM-a61317', + devnet: 'ITHEUM-fce905', mainnet: 'ITHEUM-df6f26', testnet: '' }; export const dataNftTokenIdentifier: { [key in EnvironmentsEnum]: string } = { - devnet: 'DATANFTFT4-3ba099', + devnet: 'DATANFTFT-e0b917', mainnet: 'DATANFTFT-e936d4', testnet: '' }; //[future] list of whitelisted tokens as Data NFTs export const marketPlaceContractAddress: { [key in EnvironmentsEnum]: string } = { - devnet: 'erd1qqqqqqqqqqqqqpgqrwtl03qdxjv2e52ta5ry4rg0z7l95neqfsxsp4y4xh', + devnet: 'erd1qqqqqqqqqqqqqpgqlhewm06p4c9qhq32p239hs45dvry948tfsxshx3e0l', mainnet: 'erd1qqqqqqqqqqqqqpgqay2r64l9nhhvmaqw4qanywfd0954w2m3c77qm7drxc', testnet: '' }; export const minterContractAddress: { [key in EnvironmentsEnum]: string } = { - devnet: 'erd1qqqqqqqqqqqqqpgqpd9qxrq5a03jrneafmlmckmlj5zgdj55fsxsqa7jsm', + devnet: 'erd1qqqqqqqqqqqqqpgq7thwlde9hvc5ty7lx2j3l9tvy3wgkwu7fsxsvz9rat', mainnet: 'erd1qqqqqqqqqqqqqpgqmuzgkurn657afd3r2aldqy2snsknwvrhc77q3lj8l6', testnet: '' }; diff --git a/src/datanft.ts b/src/datanft.ts index 1585879..c5d2771 100644 --- a/src/datanft.ts +++ b/src/datanft.ts @@ -203,16 +203,20 @@ export class DataNft { /** * Returns an array of `DataNft` objects owned by the address * @param address the address to query - * @param identifier the Data NFT-FT token identifier (default = `DATA-NFT-FT` token identifier based on the {@link EnvironmentsEnum}) + * @param collections the collection identifiers to query. If not provided, the default collection identifier based on the {@link EnvironmentsEnum} */ static async ownedByAddress( address: string, - identifier = dataNftTokenIdentifier[this.env as EnvironmentsEnum] + collections?: string[] ): Promise { this.ensureNetworkConfigSet(); + const identifiersMap = + collections?.join(',') || + dataNftTokenIdentifier[this.env as EnvironmentsEnum]; + const res = await fetch( - `${this.apiConfiguration}/accounts/${address}/nfts?size=10000&collections=${identifier}&withSupply=true` + `${this.apiConfiguration}/accounts/${address}/nfts?size=10000&collections=${identifiersMap}&withSupply=true` ); checkStatus(res); diff --git a/tests/datanft.test.ts b/tests/datanft.test.ts index dd53aff..f37f037 100644 --- a/tests/datanft.test.ts +++ b/tests/datanft.test.ts @@ -53,12 +53,6 @@ describe('Data NFT test', () => { const nonceToSign = await dataNft.getMessageToSign(); expect(typeof nonceToSign).toBe('string'); - const nft = await DataNft.createFromApi({ - nonce: 62, - tokenIdentifier: 'DATANFTFT3-d0978e' - }); - - expect(nft).toBeInstanceOf(DataNft); }, 10000); test('#getOwnedByAddress', async () => { diff --git a/tests/sftminter.test.ts b/tests/sftminter.test.ts index 11ad11a..8c1f311 100644 --- a/tests/sftminter.test.ts +++ b/tests/sftminter.test.ts @@ -6,7 +6,7 @@ describe('Data Nft Minter Test', () => { const dataNftMarket = new SftMinter('devnet'); expect(dataNftMarket.getContractAddress()).toBeInstanceOf(Address); expect(dataNftMarket.getContractAddress().bech32()).toStrictEqual( - 'erd1qqqqqqqqqqqqqpgqpd9qxrq5a03jrneafmlmckmlj5zgdj55fsxsqa7jsm' + 'erd1qqqqqqqqqqqqqpgq7thwlde9hvc5ty7lx2j3l9tvy3wgkwu7fsxsvz9rat' ); });