diff --git a/package-lock.json b/package-lock.json index 03d687d90..5d1a2e812 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,14 +16,14 @@ "@golevelup/nestjs-rabbitmq": "^2.2.0", "@multiversx/sdk-core": "^12.2.1", "@multiversx/sdk-data-api-client": "^0.4.4", - "@multiversx/sdk-nestjs-auth": "^1.2.7", - "@multiversx/sdk-nestjs-cache": "^1.2.7", - "@multiversx/sdk-nestjs-common": "^1.2.7", - "@multiversx/sdk-nestjs-elastic": "^1.2.7", - "@multiversx/sdk-nestjs-http": "^1.2.7", - "@multiversx/sdk-nestjs-monitoring": "^1.2.7", - "@multiversx/sdk-nestjs-rabbitmq": "^1.2.7", - "@multiversx/sdk-nestjs-redis": "^1.2.7", + "@multiversx/sdk-nestjs-auth": "^1.2.8", + "@multiversx/sdk-nestjs-cache": "^1.2.8", + "@multiversx/sdk-nestjs-common": "^1.2.8", + "@multiversx/sdk-nestjs-elastic": "^1.2.8", + "@multiversx/sdk-nestjs-http": "^1.2.8", + "@multiversx/sdk-nestjs-monitoring": "^1.2.8", + "@multiversx/sdk-nestjs-rabbitmq": "^1.2.8", + "@multiversx/sdk-nestjs-redis": "^1.2.8", "@multiversx/sdk-wallet": "^4.0.0", "@nestjs/apollo": "^10.1.3", "@nestjs/common": "^9.1.4", @@ -3522,9 +3522,9 @@ } }, "node_modules/@multiversx/sdk-nestjs-auth": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-auth/-/sdk-nestjs-auth-1.2.7.tgz", - "integrity": "sha512-JoVCNncj1jjnR/oWKgmt94jZvCrvtF3efuFbFfDYaQd4GTJ/GrOI6XPK/BqxKu6w6QcD+y8n9SXwrdXwFZIw+g==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-auth/-/sdk-nestjs-auth-1.2.8.tgz", + "integrity": "sha512-33dfaWItUml2IA3zNsM9Bhjgkdze88MztTSA/AbcIbBvT/0Fz/G2dNfQO908ehSPgy8pVePFLES2F+mF8tjD5Q==", "dependencies": { "@multiversx/sdk-core": "*", "@multiversx/sdk-native-auth-server": "^1.0.6", @@ -3595,9 +3595,9 @@ } }, "node_modules/@multiversx/sdk-nestjs-cache": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-cache/-/sdk-nestjs-cache-1.2.7.tgz", - "integrity": "sha512-aZjmVFoiRCDalpXII2D/TVgyfFd1sXQ8EymPGYipOJ14BtUffGLBKpmmqSvvKUVRNEJxL/5BZoY595b9LQqG0Q==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-cache/-/sdk-nestjs-cache-1.2.8.tgz", + "integrity": "sha512-LguOupevbIu+f63MUsjKznjeLeUsVpkG2IVebLjFtjjyDRA8sAiCmUHFxo6g3nwmO+ofWdTt0V1aAJbuJ6envQ==", "dependencies": { "lru-cache": "^8.0.4", "moment": "^2.29.4", @@ -3614,9 +3614,9 @@ } }, "node_modules/@multiversx/sdk-nestjs-common": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-common/-/sdk-nestjs-common-1.2.7.tgz", - "integrity": "sha512-hpU0YAq5HXpxCUYtgpdyiRMeUmDSMtdcK6qLOKOw9B/mT4eJ+n6DVbgRE1X/oABCOM0ofBYF6BeqysM5hJEeOw==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-common/-/sdk-nestjs-common-1.2.8.tgz", + "integrity": "sha512-8iu9izEJ0yun+W2UtuZhkE2g2AOeOE/+jC/sxOefDe3BF2v7zKXesP1OCBNXMonm5w+zglMpo21tAI+mwTuE2Q==", "dependencies": { "@multiversx/sdk-core": "^11.4.1", "@multiversx/sdk-native-auth-client": "^1.0.0", @@ -3665,18 +3665,18 @@ } }, "node_modules/@multiversx/sdk-nestjs-elastic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-elastic/-/sdk-nestjs-elastic-1.2.7.tgz", - "integrity": "sha512-mgIK8eiFqmogegaRoAdhpvr1hCJFy4P2OUP6L3XcROye1YcpwlCLNF7bjZhvry8wL1CuBozfurSDzai5KYx8nw==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-elastic/-/sdk-nestjs-elastic-1.2.8.tgz", + "integrity": "sha512-yBy5vZubXJv+d35fksOuMqlA5NSS2KqwbuCohKsgBo9mBD4KpXWo1sHwEJAn7XP3Cxr6/kO8g/sFIeeZCuOCow==", "peerDependencies": { "@multiversx/sdk-nestjs-http": "*", "@nestjs/common": "^9.x" } }, "node_modules/@multiversx/sdk-nestjs-http": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-http/-/sdk-nestjs-http-1.2.7.tgz", - "integrity": "sha512-xmQhJ7kvVqVW2MJ0sBvrS+YFF97tazH1M43HQw33JKcjjaB7UxA2u0LlLfmwvSjFjttmbFBFRP/sfoamCdjsqg==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-http/-/sdk-nestjs-http-1.2.8.tgz", + "integrity": "sha512-pVOj7Sz8qW+u0XAIIDRdsdmnO0gP8W/p1IJbzasst2pWN++KXY03ZCjjTjjQR3xU+tvYUHN6Oc5dh5PJ7r1KrA==", "dependencies": { "@multiversx/sdk-wallet": "3.0.0", "agentkeepalive": "^4.3.0", @@ -3730,9 +3730,9 @@ } }, "node_modules/@multiversx/sdk-nestjs-monitoring": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-monitoring/-/sdk-nestjs-monitoring-1.2.7.tgz", - "integrity": "sha512-FzElAGVcHEalXhwiIKo1zzVVFDYV7cVjguJr0kMNGK7pZtsdx1idx26KxEc4942OLnVRkxh2JYDMvjkwbErtXA==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-monitoring/-/sdk-nestjs-monitoring-1.2.8.tgz", + "integrity": "sha512-XFD6zT0e6Sk8P7Y1k36Huf/GblcnNeaEhxOI37qyI1JmAXyfS8Z4Sw+LTY/Z8o0AIv7337gfkFkEDCm/P4qj4w==", "dependencies": { "prom-client": "^14.0.1", "winston": "^3.7.2", @@ -3743,9 +3743,9 @@ } }, "node_modules/@multiversx/sdk-nestjs-rabbitmq": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-rabbitmq/-/sdk-nestjs-rabbitmq-1.2.7.tgz", - "integrity": "sha512-pu/rPwMShOQrNwaf38nFTnvBlPD7VZi6pzkEBOuxSwvCR9AKYQsTOumLEEU3RzjFugVAz94C+Vfi0M5WleOZLw==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-rabbitmq/-/sdk-nestjs-rabbitmq-1.2.8.tgz", + "integrity": "sha512-hT3jLaB0OyfYvd6CTyEe6joXG1NbcN3aYIO2ZUhb5h+BfgVaEyjqo/q6v5mnea/TnY1fIYDcM9TvvqYtRhLOHg==", "dependencies": { "@golevelup/nestjs-rabbitmq": "^3.0.0", "uuid": "^8.3.2" @@ -3823,9 +3823,9 @@ ] }, "node_modules/@multiversx/sdk-nestjs-redis": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-redis/-/sdk-nestjs-redis-1.2.7.tgz", - "integrity": "sha512-NreDnU9a2GEyWatIV91l0j1jCUPWoge2+4++dXgxOcMb0NyBJnlNUEr4KIabCv96s7hVow9Z4KzkdKMSewaFzQ==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-redis/-/sdk-nestjs-redis-1.2.8.tgz", + "integrity": "sha512-jU3yaccIlpCyI8bKoKpPV/WaAgPykb9CWBlAqz/FUjmd6W4vYGCsQkZU7J0W9cq4aWp7koxQzwhZLCGYFzdiWA==", "dependencies": { "ioredis": "^5.2.3" }, diff --git a/package.json b/package.json index 83a8918d2..0d138cd67 100644 --- a/package.json +++ b/package.json @@ -83,14 +83,14 @@ "@elrondnetwork/transaction-processor": "^0.1.26", "@golevelup/nestjs-rabbitmq": "^2.2.0", "@multiversx/sdk-data-api-client": "^0.4.4", - "@multiversx/sdk-nestjs-auth": "^1.2.7", - "@multiversx/sdk-nestjs-cache": "^1.2.7", - "@multiversx/sdk-nestjs-common": "^1.2.7", - "@multiversx/sdk-nestjs-elastic": "^1.2.7", - "@multiversx/sdk-nestjs-http": "^1.2.7", - "@multiversx/sdk-nestjs-monitoring": "^1.2.7", - "@multiversx/sdk-nestjs-rabbitmq": "^1.2.7", - "@multiversx/sdk-nestjs-redis": "^1.2.7", + "@multiversx/sdk-nestjs-auth": "^1.2.8", + "@multiversx/sdk-nestjs-cache": "^1.2.8", + "@multiversx/sdk-nestjs-common": "^1.2.8", + "@multiversx/sdk-nestjs-elastic": "^1.2.8", + "@multiversx/sdk-nestjs-http": "^1.2.8", + "@multiversx/sdk-nestjs-monitoring": "^1.2.8", + "@multiversx/sdk-nestjs-rabbitmq": "^1.2.8", + "@multiversx/sdk-nestjs-redis": "^1.2.8", "@multiversx/sdk-wallet": "^4.0.0", "@nestjs/apollo": "^10.1.3", "@nestjs/common": "^9.1.4", diff --git a/src/endpoints/accounts/account.controller.ts b/src/endpoints/accounts/account.controller.ts index 56fc11cee..be21fa035 100644 --- a/src/endpoints/accounts/account.controller.ts +++ b/src/endpoints/accounts/account.controller.ts @@ -33,7 +33,7 @@ import { ProviderStake } from '../stake/entities/provider.stake'; import { TokenDetailedWithBalance } from '../tokens/entities/token.detailed.with.balance'; import { NftCollectionAccount } from '../collections/entities/nft.collection.account'; import { TokenWithRoles } from '../tokens/entities/token.with.roles'; -import { ParseAddressPipe, ParseTokenPipe, OriginLogger, ParseArrayPipe, ParseBlockHashPipe, ParseCollectionPipe, ParseNftPipe, ParseBoolPipe, ParseEnumArrayPipe, ParseEnumPipe, ParseIntPipe, ParseTokenOrNftPipe, ParseTransactionHashPipe, ParseAddressArrayPipe, ApplyComplexity } from '@multiversx/sdk-nestjs-common'; +import { ParseAddressPipe, ParseTokenPipe, OriginLogger, ParseArrayPipe, ParseBlockHashPipe, ParseCollectionPipe, ParseNftPipe, ParseBoolPipe, ParseEnumArrayPipe, ParseEnumPipe, ParseIntPipe, ParseTokenOrNftPipe, ParseTransactionHashPipe, ParseAddressArrayPipe, ApplyComplexity, ParseNftArrayPipe } from '@multiversx/sdk-nestjs-common'; import { QueryPagination } from 'src/common/entities/query.pagination'; import { TransactionQueryOptions } from '../transactions/entities/transactions.query.options'; import { TokenWithRolesFilter } from '../tokens/entities/token.with.roles.filter'; @@ -496,7 +496,7 @@ export class AccountController { @Query('from', new DefaultValuePipe(0), ParseIntPipe) from: number, @Query('size', new DefaultValuePipe(25), ParseIntPipe) size: number, @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('type') type?: NftType, @Query('collection') collection?: string, @Query('collections', ParseArrayPipe) collections?: string[], @@ -540,7 +540,7 @@ export class AccountController { @ApiOkResponse({ type: Number }) async getNftCount( @Param('address', ParseAddressPipe) address: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('search') search?: string, @Query('type') type?: NftType, @Query('collection') collection?: string, @@ -560,7 +560,7 @@ export class AccountController { async getNftCountAlternative( @Param('address', ParseAddressPipe) address: string, @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('type') type?: NftType, @Query('collection') collection?: string, @Query('collections', ParseArrayPipe) collections?: string[], diff --git a/src/endpoints/collections/collection.controller.ts b/src/endpoints/collections/collection.controller.ts index c9a8fff6b..532e96a91 100644 --- a/src/endpoints/collections/collection.controller.ts +++ b/src/endpoints/collections/collection.controller.ts @@ -7,7 +7,7 @@ import { Nft } from "../nfts/entities/nft"; import { NftService } from "../nfts/nft.service"; import { NftFilter } from "../nfts/entities/nft.filter"; import { NftQueryOptions } from "../nfts/entities/nft.query.options"; -import { ParseAddressPipe, ParseArrayPipe, ParseCollectionPipe, ParseBoolPipe, ParseEnumArrayPipe, ParseIntPipe, ApplyComplexity, ParseAddressArrayPipe, ParseBlockHashPipe, ParseEnumPipe, ParseRecordPipe } from '@multiversx/sdk-nestjs-common'; +import { ParseAddressPipe, ParseArrayPipe, ParseCollectionPipe, ParseBoolPipe, ParseEnumArrayPipe, ParseIntPipe, ApplyComplexity, ParseAddressArrayPipe, ParseBlockHashPipe, ParseEnumPipe, ParseRecordPipe, ParseNftArrayPipe, ParseCollectionArrayPipe } from '@multiversx/sdk-nestjs-common'; import { QueryPagination } from "src/common/entities/query.pagination"; import { CollectionFilter } from "./entities/collection.filter"; import { CollectionAccount } from "./entities/collection.account"; @@ -58,7 +58,7 @@ export class CollectionController { @Query('from', new DefaultValuePipe(0), ParseIntPipe) from: number, @Query('size', new DefaultValuePipe(25), ParseIntPipe) size: number, @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseCollectionArrayPipe) identifiers?: string[], @Query('type', new ParseEnumArrayPipe(NftType)) type?: NftType[], @Query('creator', ParseAddressPipe) creator?: string, @Query('before', new ParseIntPipe) before?: number, @@ -225,7 +225,7 @@ export class CollectionController { @Query('from', new DefaultValuePipe(0), ParseIntPipe) from: number, @Query('size', new DefaultValuePipe(25), ParseIntPipe) size: number, @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('name') name?: string, @Query('tags', ParseArrayPipe) tags?: string[], @Query('creator', ParseAddressPipe) creator?: string, @@ -273,7 +273,7 @@ export class CollectionController { async getNftCount( @Param('collection', ParseCollectionPipe) collection: string, @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('name') name?: string, @Query('tags', ParseArrayPipe) tags?: string[], @Query('creator', ParseAddressPipe) creator?: string, diff --git a/src/endpoints/nfts/nft.controller.ts b/src/endpoints/nfts/nft.controller.ts index 1502f493d..4109e9b57 100644 --- a/src/endpoints/nfts/nft.controller.ts +++ b/src/endpoints/nfts/nft.controller.ts @@ -9,7 +9,7 @@ import { NftType } from "./entities/nft.type"; import { NftService } from "./nft.service"; import { QueryPagination } from 'src/common/entities/query.pagination'; import { NftQueryOptions } from './entities/nft.query.options'; -import { ParseAddressPipe, ParseBoolPipe, ParseArrayPipe, ParseIntPipe, ParseNftPipe, ParseCollectionPipe, ApplyComplexity, ParseAddressArrayPipe, ParseBlockHashPipe, ParseEnumPipe, ParseRecordPipe } from '@multiversx/sdk-nestjs-common'; +import { ParseAddressPipe, ParseBoolPipe, ParseArrayPipe, ParseIntPipe, ParseNftPipe, ParseCollectionPipe, ApplyComplexity, ParseAddressArrayPipe, ParseBlockHashPipe, ParseEnumPipe, ParseRecordPipe, ParseNftArrayPipe, ParseCollectionArrayPipe } from '@multiversx/sdk-nestjs-common'; import { TransactionDetailed } from '../transactions/entities/transaction.detailed'; import { TransactionStatus } from '../transactions/entities/transaction.status'; import { SortOrder } from 'src/common/entities/sort.order'; @@ -37,6 +37,7 @@ export class NftController { @ApiQuery({ name: 'identifiers', description: 'Search by token identifiers, comma-separated', required: false }) @ApiQuery({ name: 'type', description: 'Filter by type (NonFungibleESDT/SemiFungibleESDT/MetaESDT)', required: false }) @ApiQuery({ name: 'collection', description: 'Get all tokens by token collection', required: false }) + @ApiQuery({ name: 'collections', description: 'Get all tokens by token collections, comma-separated', required: false }) @ApiQuery({ name: 'name', description: 'Get all nfts by name', required: false }) @ApiQuery({ name: 'tags', description: 'Filter by one or more comma-separated tags', required: false }) @ApiQuery({ name: 'creator', description: 'Return all NFTs associated with a given creator', required: false }) @@ -54,9 +55,10 @@ export class NftController { @Query('from', new DefaultValuePipe(0), ParseIntPipe) from: number, @Query('size', new DefaultValuePipe(25), ParseIntPipe) size: number, @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('type') type?: NftType, @Query('collection', ParseCollectionPipe) collection?: string, + @Query('collections', ParseCollectionArrayPipe) collections?: string[], @Query('name') name?: string, @Query('tags', ParseArrayPipe) tags?: string[], @Query('creator', ParseAddressPipe) creator?: string, @@ -75,7 +77,7 @@ export class NftController { return await this.nftService.getNfts( new QueryPagination({ from, size }), - new NftFilter({ search, identifiers, type, collection, name, tags, creator, hasUris, isWhitelistedStorage, isNsfw, traits, before, after }), + new NftFilter({ search, identifiers, type, collection, collections, name, tags, creator, hasUris, isWhitelistedStorage, isNsfw, traits, before, after }), options ); } @@ -87,6 +89,7 @@ export class NftController { @ApiQuery({ name: 'identifiers', description: 'Search by token identifiers, comma-separated', required: false }) @ApiQuery({ name: 'type', description: 'Filter by type (NonFungibleESDT/SemiFungibleESDT/MetaESDT)', required: false }) @ApiQuery({ name: 'collection', description: 'Get all tokens by token collection', required: false }) + @ApiQuery({ name: 'collections', description: 'Get all tokens by token collections, comma-separated', required: false }) @ApiQuery({ name: 'name', description: 'Get all nfts by name', required: false }) @ApiQuery({ name: 'tags', description: 'Filter by one or more comma-separated tags', required: false }) @ApiQuery({ name: 'creator', description: 'Return all NFTs associated with a given creator', required: false }) @@ -98,9 +101,10 @@ export class NftController { @ApiQuery({ name: 'after', description: 'Return all NFTs after given timestamp', required: false, type: Number }) async getNftCount( @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('type') type?: NftType, @Query('collection', ParseCollectionPipe) collection?: string, + @Query('collections', ParseCollectionArrayPipe) collections?: string[], @Query('name') name?: string, @Query('tags', ParseArrayPipe) tags?: string[], @Query('creator', ParseAddressPipe) creator?: string, @@ -111,16 +115,17 @@ export class NftController { @Query('before', new ParseIntPipe) before?: number, @Query('after', new ParseIntPipe) after?: number, ): Promise { - return await this.nftService.getNftCount(new NftFilter({ search, identifiers, type, collection, name, tags, creator, isWhitelistedStorage, hasUris, isNsfw, traits, before, after })); + return await this.nftService.getNftCount(new NftFilter({ search, identifiers, type, collection, collections, name, tags, creator, isWhitelistedStorage, hasUris, isNsfw, traits, before, after })); } @Get("/nfts/c") @ApiExcludeEndpoint() async getNftCountAlternative( @Query('search') search?: string, - @Query('identifiers', ParseArrayPipe) identifiers?: string[], + @Query('identifiers', ParseNftArrayPipe) identifiers?: string[], @Query('type') type?: NftType, @Query('collection', ParseCollectionPipe) collection?: string, + @Query('collections', ParseCollectionArrayPipe) collections?: string[], @Query('name') name?: string, @Query('tags', ParseArrayPipe) tags?: string[], @Query('creator', ParseAddressPipe) creator?: string, @@ -131,7 +136,7 @@ export class NftController { @Query('before', new ParseIntPipe) before?: number, @Query('after', new ParseIntPipe) after?: number, ): Promise { - return await this.nftService.getNftCount(new NftFilter({ search, identifiers, type, collection, name, tags, creator, isWhitelistedStorage, hasUris, isNsfw, traits, before, after })); + return await this.nftService.getNftCount(new NftFilter({ search, identifiers, type, collection, collections, name, tags, creator, isWhitelistedStorage, hasUris, isNsfw, traits, before, after })); } @Get('/nfts/:identifier')