From 4ffc55e15036be3fef053d0a86b51ce6e3f73baa Mon Sep 17 00:00:00 2001 From: danielailie Date: Thu, 14 Dec 2023 14:54:59 +0200 Subject: [PATCH 1/7] Update env for proxy deployer --- .../proxy-deployer/proxy-deployer.abi.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/proxy-deployer/proxy-deployer.abi.service.ts b/src/modules/proxy-deployer/proxy-deployer.abi.service.ts index 3ea11f319..bd592a4bd 100644 --- a/src/modules/proxy-deployer/proxy-deployer.abi.service.ts +++ b/src/modules/proxy-deployer/proxy-deployer.abi.service.ts @@ -17,7 +17,7 @@ export class ProxyDeployerAbiService { } async deployMinterSc(request: DeployMinterRequest): Promise { - const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS); + const contract = await this.contract.getContract(process.env.PROXY_DEPLOYER_ADDRESS); return contract.methodsExplicit .contractDeploy([ @@ -37,7 +37,7 @@ export class ProxyDeployerAbiService { } async deployBulkSc(ownerAddress: string): Promise { - const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS); + const contract = await this.contract.getContract(process.env.PROXY_DEPLOYER_ADDRESS); return contract.methodsExplicit .contractDeploy([ @@ -52,7 +52,7 @@ export class ProxyDeployerAbiService { } async deployMarketplaceSc(ownerAddress: string, marketplaceFee: string, paymentTokens?: string[]): Promise { - const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS); + const contract = await this.contract.getContract(process.env.PROXY_DEPLOYER_ADDRESS); const args: any[] = [new AddressValue(Address.fromString(process.env.TEMPLATE_MARKETPLACE_ADDRESS))]; if (paymentTokens) { args.push( @@ -69,7 +69,7 @@ export class ProxyDeployerAbiService { } async pauseNftMinter(ownerAddress: string, request: UpgradeMinterRequest): Promise { - const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS); + const contract = await this.contract.getContract(process.env.PROXY_DEPLOYER_ADDRESS); return contract.methodsExplicit .pauseNftMinter([new AddressValue(new Address(request.minterAddress))]) @@ -81,7 +81,7 @@ export class ProxyDeployerAbiService { } async resumeNftMinter(ownerAddress: string, request: UpgradeMinterRequest): Promise { - const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS); + const contract = await this.contract.getContract(process.env.PROXY_DEPLOYER_ADDRESS); return contract.methodsExplicit .resumeNftMinter([new AddressValue(new Address(request.minterAddress))]) @@ -93,7 +93,7 @@ export class ProxyDeployerAbiService { } public async getMintersForAddress(address: string): Promise { - const contract = await this.contract.getContract(process.env.DEPLOYER_ADDRESS); + const contract = await this.contract.getContract(process.env.PROXY_DEPLOYER_ADDRESS); let getDataQuery = contract.methodsExplicit.getUserNftMinterContracts([new AddressValue(new Address(address))]); const response = await this.getFirstQueryResult(getDataQuery); From 37885e65d55d16b38fe14f321c73e0b758ba4a44 Mon Sep 17 00:00:00 2001 From: danielailie Date: Thu, 14 Dec 2023 15:28:12 +0200 Subject: [PATCH 2/7] add logs --- src/modules/rabbitmq/blockchain-events/minter-events.service.ts | 1 + src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/modules/rabbitmq/blockchain-events/minter-events.service.ts b/src/modules/rabbitmq/blockchain-events/minter-events.service.ts index 8c48c29d2..d738d6a5c 100644 --- a/src/modules/rabbitmq/blockchain-events/minter-events.service.ts +++ b/src/modules/rabbitmq/blockchain-events/minter-events.service.ts @@ -12,6 +12,7 @@ export class MinterEventsService { public async handleNftMinterEvents(mintEvents: any[], hash: string) { for (let event of mintEvents) { + console.log({Minevent: JSON.stringify(event)}) switch (event.identifier) { case MinterEventEnum.callBack: const brandEvent = new BrandCreatedEvent(event); diff --git a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts index a8fae1a72..289daa8b5 100644 --- a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts +++ b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts @@ -50,6 +50,7 @@ export class NftEventsConsumer { ); const minters = await this.mintersService.getMintersAddresses(); + console.log({minters}) await this.nftEventsService.handleNftMintEvents( nftAuctionEvents?.events?.filter( (e: { identifier: NftEventEnum }) => From fe28d858b108032b493fa2580442d27de643d606 Mon Sep 17 00:00:00 2001 From: danielailie Date: Thu, 14 Dec 2023 16:08:56 +0200 Subject: [PATCH 3/7] remove logs --- src/modules/rabbitmq/blockchain-events/minter-events.service.ts | 1 - src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/modules/rabbitmq/blockchain-events/minter-events.service.ts b/src/modules/rabbitmq/blockchain-events/minter-events.service.ts index d738d6a5c..8c48c29d2 100644 --- a/src/modules/rabbitmq/blockchain-events/minter-events.service.ts +++ b/src/modules/rabbitmq/blockchain-events/minter-events.service.ts @@ -12,7 +12,6 @@ export class MinterEventsService { public async handleNftMinterEvents(mintEvents: any[], hash: string) { for (let event of mintEvents) { - console.log({Minevent: JSON.stringify(event)}) switch (event.identifier) { case MinterEventEnum.callBack: const brandEvent = new BrandCreatedEvent(event); diff --git a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts index 289daa8b5..a8fae1a72 100644 --- a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts +++ b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts @@ -50,7 +50,6 @@ export class NftEventsConsumer { ); const minters = await this.mintersService.getMintersAddresses(); - console.log({minters}) await this.nftEventsService.handleNftMintEvents( nftAuctionEvents?.events?.filter( (e: { identifier: NftEventEnum }) => From 5bb83eef742415ce300e43ba9e3e790523343759 Mon Sep 17 00:00:00 2001 From: danielailie Date: Thu, 14 Dec 2023 21:07:40 +0200 Subject: [PATCH 4/7] Add logs --- src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts index a8fae1a72..d3b3c90f4 100644 --- a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts +++ b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts @@ -33,6 +33,7 @@ export class NftEventsConsumer { dlqExchange: process.env.RABBITMQ_DLQ_EXCHANGE, }) async consumeAuctionEvents(nftAuctionEvents: any) { + console.log(11111111, nftAuctionEvents) if (nftAuctionEvents?.events) { const internalMarketplaces = await this.marketplaceService.getInternalMarketplacesAddreses(); const externalMarketplaces = await this.marketplaceService.getExternalMarketplacesAddreses(); From 8f577ca47e66cc7c50f7f2abeadd797befbd779a Mon Sep 17 00:00:00 2001 From: danielailie Date: Fri, 15 Dec 2023 15:44:33 +0200 Subject: [PATCH 5/7] Update dependecies --- package-lock.json | 163 +++++++++--------- package.json | 14 +- src/crons/elastic.updater/nsfw-queries.ts | 6 +- src/modules/admins/flag-nft.service.ts | 4 +- .../analytics/elastic.indexer.service.ts | 26 +-- .../assets-history-elastic.service.ts | 10 +- .../marketplaces.elastic.queries.ts | 7 +- .../nft-rarity/nft-rarity.elastic.service.ts | 6 +- 8 files changed, 104 insertions(+), 132 deletions(-) diff --git a/package-lock.json b/package-lock.json index 327e26c37..f0f4b5ce1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,12 +16,12 @@ "@golevelup/nestjs-rabbitmq": "4.0.0", "@multiversx/sdk-core": "12.14.0", "@multiversx/sdk-native-auth-server": "1.0.7", - "@multiversx/sdk-nestjs-cache": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-common": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-elastic": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-http": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-monitoring": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-redis": "2.0.0-beta.2", + "@multiversx/sdk-nestjs-cache": "3.0.0", + "@multiversx/sdk-nestjs-common": "3.0.0", + "@multiversx/sdk-nestjs-elastic": "3.0.0", + "@multiversx/sdk-nestjs-http": "3.0.0", + "@multiversx/sdk-nestjs-monitoring": "3.0.0", + "@multiversx/sdk-nestjs-redis": "3.0.0", "@multiversx/sdk-network-providers": "^1.2.1", "@nestjs/apollo": "12.0.7", "@nestjs/common": "10.2.4", @@ -50,7 +50,7 @@ "dataloader": "2.0.0", "errorhandler": "1.5.1", "form-data": "4.0.0", - "graphql": "16.8.0", + "graphql": "16.8.1", "graphql-fields-list": "2.2.4", "graphql-query-complexity": "0.12.0", "graphql-relay": "0.10.0", @@ -3708,19 +3708,21 @@ } }, "node_modules/@multiversx/sdk-native-auth-client": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-native-auth-client/-/sdk-native-auth-client-1.0.5.tgz", - "integrity": "sha512-MA9KCNy2K0Irw+RMn01mxXB3Z+EcpMuUFBqr6ZhVQyxmXjujK+CHvlXH5TSADIm5Yw2SfGjFGdiqRu64lNVvuA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-native-auth-client/-/sdk-native-auth-client-1.0.6.tgz", + "integrity": "sha512-IGJZnanNYGv0CTA02qh402EJ5UbQ73J5tOjRenz2yQBNrqenJCfBJsEX5JJc5Quk/ppuZhl3GppQIBqsrGOidg==", "dependencies": { - "axios": "0.24.0" + "axios": "^1.6.2" } }, "node_modules/@multiversx/sdk-native-auth-client/node_modules/axios": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", - "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { - "follow-redirects": "^1.14.4" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/@multiversx/sdk-native-auth-server": { @@ -3751,9 +3753,9 @@ "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, "node_modules/@multiversx/sdk-nestjs-cache": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-cache/-/sdk-nestjs-cache-2.0.0-beta.2.tgz", - "integrity": "sha512-HpLV0ZqqH8Pz71ykcJ+QYKgKQPimXmR31wf+yU5peOhtIjPRLS4YKKgW4xVL0xzzCvp5Vc4wtJdDZ0nhysa8lw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-cache/-/sdk-nestjs-cache-3.0.0.tgz", + "integrity": "sha512-yxaF0sH8SOgMS760p6cHI4Am7jUbQDDIosHGNb4O1OxeALOWX0rp+xf/gFy7hVA6RlGXE+9X/ja9OvRLF2Hb8g==", "dependencies": { "lru-cache": "^8.0.4", "moment": "^2.29.4", @@ -3762,9 +3764,9 @@ "uuid": "^8.3.2" }, "peerDependencies": { - "@multiversx/sdk-nestjs-common": "^2.0.0-beta.2", - "@multiversx/sdk-nestjs-monitoring": "^2.0.0-beta.2", - "@multiversx/sdk-nestjs-redis": "^2.0.0-beta.2", + "@multiversx/sdk-nestjs-common": "^3.0.0", + "@multiversx/sdk-nestjs-monitoring": "^3.0.0", + "@multiversx/sdk-nestjs-redis": "^3.0.0", "@nestjs/common": "^10.x", "@nestjs/core": "^10.x" } @@ -3778,29 +3780,28 @@ } }, "node_modules/@multiversx/sdk-nestjs-common": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-common/-/sdk-nestjs-common-2.0.0-beta.2.tgz", - "integrity": "sha512-17A0LvcYxatHGhtEY6SANmZDk3bnd6O3aHU4bFyWEivESoiRJSbZvlKiJ03z+57vqmR5oDpK+GBJawwOP8yQTA==", - "dependencies": { - "@multiversx/sdk-core": "12.6.1", - "@multiversx/sdk-native-auth-client": "^1.0.0", - "@multiversx/sdk-native-auth-server": "^1.0.4", - "@multiversx/sdk-network-providers": "^1.3.0", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-common/-/sdk-nestjs-common-3.0.0.tgz", + "integrity": "sha512-H8VX2BEo96H8Mvz80UE9gtoM9ai1s+FZX1XdIMFcMVagzf4U/x1PWVJ7NSdDi+TWNS7w+NgW9AS/fLifWQaV5A==", + "dependencies": { + "@multiversx/sdk-core": "^12.15.0", + "@multiversx/sdk-network-providers": "^2.2.0", "nest-winston": "^1.6.2", "uuid": "^8.3.2", "winston": "^3.7.2" }, "peerDependencies": { - "@multiversx/sdk-nestjs-monitoring": "^2.0.0-beta.2", + "@multiversx/sdk-nestjs-monitoring": "^3.0.0", "@nestjs/common": "^10.x", + "@nestjs/config": "^3.x", "@nestjs/core": "^10.x", "@nestjs/swagger": "^7.x" } }, "node_modules/@multiversx/sdk-nestjs-common/node_modules/@multiversx/sdk-core": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-core/-/sdk-core-12.6.1.tgz", - "integrity": "sha512-T21TMC3euAi3C0WtB6WOzNYQW4XbKTrH0Q1K7gxcNpLDqnQbMwh0SuVAossQRL/s1Ca829Zjt3zmuGQUtWAU1A==", + "version": "12.16.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-core/-/sdk-core-12.16.0.tgz", + "integrity": "sha512-b2htlSeXVkZwrnEVAxoUgNe0oiiOheEjibEbxwNXqtWnsSI31fAtVXxXMersVgcliMJGjmtHkpFAItAucG3OSg==", "dependencies": { "@multiversx/sdk-transaction-decoder": "1.0.2", "bech32": "1.1.4", @@ -3812,6 +3813,28 @@ "protobufjs": "7.2.4" } }, + "node_modules/@multiversx/sdk-nestjs-common/node_modules/@multiversx/sdk-network-providers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-network-providers/-/sdk-network-providers-2.2.0.tgz", + "integrity": "sha512-2n/+7Ap6S9rJGTiX38GCZ2TmY9zQ1U7o1DwnWpHNRJRxArSN/xzLrbcSKy8InMyc+4A+VHf5pV0Pk8NdPV6++w==", + "dependencies": { + "axios": "1.6.1", + "bech32": "1.1.4", + "bignumber.js": "9.0.1", + "buffer": "6.0.3", + "json-bigint": "1.0.0" + } + }, + "node_modules/@multiversx/sdk-nestjs-common/node_modules/axios": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", + "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/@multiversx/sdk-nestjs-common/node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -3841,48 +3864,30 @@ } }, "node_modules/@multiversx/sdk-nestjs-elastic": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-elastic/-/sdk-nestjs-elastic-2.0.0-beta.2.tgz", - "integrity": "sha512-+a4ekHKqWd68RPzFMn8wJLlaBSLLJ9Aa1JhSB39DyQGQlIdjdQmJBRB24LmnpQ5gFDrgQcY7qLCo2AovFphG3Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-elastic/-/sdk-nestjs-elastic-3.0.0.tgz", + "integrity": "sha512-UUDNYmm34Da/8g0ZQhIcmsD6h7YGMV0oZcSqmYSjZkayi6izJ+0x8AekOFoaBvNrDzjuCWNA4iwa9GH5jM/s2g==", "peerDependencies": { - "@multiversx/sdk-nestjs-http": "^2.0.0-beta.2", + "@multiversx/sdk-nestjs-http": "^3.0.0", "@nestjs/common": "^10.x" } }, "node_modules/@multiversx/sdk-nestjs-http": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-http/-/sdk-nestjs-http-2.0.0-beta.2.tgz", - "integrity": "sha512-o73XtLnmQyohFgGEjj/uSMPyWn2rVt+8HI4x9+osYkiuvtASje7DrFfXuVVY3mLEXTnE+SdeucdXNig/aUnHAQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-http/-/sdk-nestjs-http-3.0.0.tgz", + "integrity": "sha512-h96BN23vbszLXuYSJ20IY6fY02XGUyLu0nxdnJlORLTzxGdUU6X5MeuQsYxnDLkCmnr53eRjVFWgtH4kC3PYoQ==", "dependencies": { - "@multiversx/sdk-wallet": "3.0.0", + "@multiversx/sdk-native-auth-client": "^1.0.6", "agentkeepalive": "^4.3.0", "axios": "^0.27.2" }, "peerDependencies": { - "@multiversx/sdk-nestjs-common": "^2.0.0-beta.2", - "@multiversx/sdk-nestjs-monitoring": "^2.0.0-beta.2", - "@multiversx/sdk-wallet": "<=3.0.0", + "@multiversx/sdk-nestjs-common": "^3.0.0", + "@multiversx/sdk-nestjs-monitoring": "^3.0.0", "@nestjs/common": "^10.x", "@nestjs/core": "^10.x" } }, - "node_modules/@multiversx/sdk-nestjs-http/node_modules/@multiversx/sdk-wallet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-wallet/-/sdk-wallet-3.0.0.tgz", - "integrity": "sha512-nDVBtva1mpfutXA8TfUnpdeFqhY9O+deNU3U/Z41yPBcju1trHDC9gcKPyQqcQ3qjG/6LwEXmIm7Dc5fIsvVjg==", - "dependencies": { - "@multiversx/sdk-bls-wasm": "0.3.5", - "bech32": "1.1.4", - "bip39": "3.0.2", - "blake2b": "2.1.3", - "ed25519-hd-key": "1.1.2", - "ed2curve": "0.3.0", - "keccak": "3.0.1", - "scryptsy": "2.1.0", - "tweetnacl": "1.0.3", - "uuid": "8.3.2" - } - }, "node_modules/@multiversx/sdk-nestjs-http/node_modules/agentkeepalive": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", @@ -3903,23 +3908,10 @@ "form-data": "^4.0.0" } }, - "node_modules/@multiversx/sdk-nestjs-http/node_modules/keccak": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/@multiversx/sdk-nestjs-monitoring": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-monitoring/-/sdk-nestjs-monitoring-2.0.0-beta.2.tgz", - "integrity": "sha512-T16l8U4eEUpE+XxHj0VkPhrprBvC6C+noxN15BhrKir7gnKl3Ut5A9bkvBaczJ0DvvXhMSQei0XaGbu8JL7ErA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-monitoring/-/sdk-nestjs-monitoring-3.0.0.tgz", + "integrity": "sha512-YbiMJFXVCoZy/u3ACKq+xugsGtFjxt7VX8koIKaa3snHURumIRsD9Y0rYyLlkr+h1djtm/gdJTGe91Z17MXZzw==", "dependencies": { "prom-client": "^14.0.1", "winston": "^3.7.2", @@ -3941,9 +3933,9 @@ } }, "node_modules/@multiversx/sdk-nestjs-redis": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-redis/-/sdk-nestjs-redis-2.0.0-beta.2.tgz", - "integrity": "sha512-YUBMkHvofTRgVy3Rz2pvfG4Rme41NcyWiQo1Z5CfkflI1yIbL9V2NCQT5RTq1hVKLB1h2MOteGf6OCK4vdBC3w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@multiversx/sdk-nestjs-redis/-/sdk-nestjs-redis-3.0.0.tgz", + "integrity": "sha512-Xu8kNO8F7Yx2SZQOH9E7ZG+Mkw8MV6v0mim+vMaJ4gsvXYpPPHtNQ/hJw3fffUB3OEdnCK6hy1EgtfCbUAqYmg==", "dependencies": { "ioredis": "^5.2.3" }, @@ -9418,9 +9410,9 @@ "dev": true }, "node_modules/graphql": { - "version": "16.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.0.tgz", - "integrity": "sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -13289,6 +13281,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", diff --git a/package.json b/package.json index 67f240eba..b4790182c 100644 --- a/package.json +++ b/package.json @@ -41,12 +41,12 @@ "@golevelup/nestjs-rabbitmq": "4.0.0", "@multiversx/sdk-core": "12.14.0", "@multiversx/sdk-native-auth-server": "1.0.7", - "@multiversx/sdk-nestjs-cache": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-common": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-elastic": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-http": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-monitoring": "2.0.0-beta.2", - "@multiversx/sdk-nestjs-redis": "2.0.0-beta.2", + "@multiversx/sdk-nestjs-cache": "3.0.0", + "@multiversx/sdk-nestjs-common": "3.0.0", + "@multiversx/sdk-nestjs-elastic": "3.0.0", + "@multiversx/sdk-nestjs-http": "3.0.0", + "@multiversx/sdk-nestjs-monitoring": "3.0.0", + "@multiversx/sdk-nestjs-redis": "3.0.0", "@multiversx/sdk-network-providers": "^1.2.1", "@nestjs/apollo": "12.0.7", "@nestjs/common": "10.2.4", @@ -75,7 +75,7 @@ "dataloader": "2.0.0", "errorhandler": "1.5.1", "form-data": "4.0.0", - "graphql": "16.8.0", + "graphql": "16.8.1", "graphql-fields-list": "2.2.4", "graphql-query-complexity": "0.12.0", "graphql-relay": "0.10.0", diff --git a/src/crons/elastic.updater/nsfw-queries.ts b/src/crons/elastic.updater/nsfw-queries.ts index 1c57f77a4..f3e2b8c2e 100644 --- a/src/crons/elastic.updater/nsfw-queries.ts +++ b/src/crons/elastic.updater/nsfw-queries.ts @@ -1,5 +1,5 @@ import { NftTypeEnum } from 'src/modules/assets/models'; -import { ElasticQuery, QueryType } from '@multiversx/sdk-nestjs-elastic'; +import { ElasticQuery, MatchQuery, QueryType } from '@multiversx/sdk-nestjs-elastic'; import { constants } from 'src/config'; import { ELASTIC_NFT_NSFW } from 'src/utils/constants'; @@ -7,12 +7,12 @@ export const getNsfwNotMarkedQuery = ElasticQuery.create() .withMustNotExistCondition(ELASTIC_NFT_NSFW) .withMustExistCondition('identifier') .withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type)) - .withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true })) + .withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true)])) .withPagination({ from: 0, size: constants.elasticMaxBatch }); export const getNsfwMarkedQuery = ElasticQuery.create() .withFields([ELASTIC_NFT_NSFW]) .withMustExistCondition('identifier') .withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type)) - .withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true })) + .withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true)])) .withPagination({ from: 0, size: constants.elasticMaxBatch }); diff --git a/src/modules/admins/flag-nft.service.ts b/src/modules/admins/flag-nft.service.ts index 4fe1584bc..78d60319b 100644 --- a/src/modules/admins/flag-nft.service.ts +++ b/src/modules/admins/flag-nft.service.ts @@ -1,4 +1,4 @@ -import { ElasticQuery, QueryOperator, QueryType } from '@multiversx/sdk-nestjs-elastic'; +import { ElasticQuery, MatchQuery, QueryOperator, QueryType } from '@multiversx/sdk-nestjs-elastic'; import { Locker } from '@multiversx/sdk-nestjs-common'; import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common'; import { MxElasticService, NftMedia } from 'src/common'; @@ -67,7 +67,7 @@ export class FlagNftService { .withMustExistCondition('identifier') .withMustCondition(QueryType.Match('token', collection, QueryOperator.AND)) .withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type)) - .withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true })) + .withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true)])) .withPagination({ from: 0, size: 10000 }); await this.elasticUpdater.getScrollableList(ELASTIC_TOKENS_INDEX, 'identifier', query, async (items) => { const nsfwItems = items.map((item) => ({ diff --git a/src/modules/analytics/elastic.indexer.service.ts b/src/modules/analytics/elastic.indexer.service.ts index a0873e3d0..3731d725b 100644 --- a/src/modules/analytics/elastic.indexer.service.ts +++ b/src/modules/analytics/elastic.indexer.service.ts @@ -1,4 +1,4 @@ -import { ElasticQuery, ElasticSortOrder, QueryType } from '@multiversx/sdk-nestjs-elastic'; +import { ElasticQuery, ElasticSortOrder, MatchQuery, QueryType } from '@multiversx/sdk-nestjs-elastic'; import { Injectable } from '@nestjs/common'; import { MxElasticService } from 'src/common'; @@ -19,22 +19,10 @@ export class ElasticAnalyticsService { const elasticQuery = ElasticQuery.create() .withPagination({ from: 0, size: 500 }) .withMustCondition( - QueryType.Should( - eventNames.map((eventName) => - QueryType.Nested('events', { - 'events.identifier': eventName, - }), - ), - ), + QueryType.Should(eventNames.map((eventName) => QueryType.Nested('events', [new MatchQuery('events.identifier', eventName)]))), ) .withMustCondition( - QueryType.Should( - addresses.map((address) => - QueryType.Nested('events', { - 'events.address': address, - }), - ), - ), + QueryType.Should(addresses.map((address) => QueryType.Nested('events', [new MatchQuery('events.address', address)]))), ) .withDateRangeFilter('timestamp', lte, gte) .withSort([{ name: 'timestamp', order: ElasticSortOrder.ascending }]); @@ -56,13 +44,7 @@ export class ElasticAnalyticsService { private async getTransactionsLogs(eventName: string, gte: number, lte: number): Promise { const elasticQuery = ElasticQuery.create() .withMustCondition( - QueryType.Should( - [eventName].map((eventName) => - QueryType.Nested('events', { - 'events.identifier': eventName, - }), - ), - ), + QueryType.Should([eventName].map((eventName) => QueryType.Nested('events', [new MatchQuery('events.identifier', eventName)]))), ) .withDateRangeFilter('timestamp', lte, gte) .withSort([{ name: 'timestamp', order: ElasticSortOrder.ascending }]); diff --git a/src/modules/asset-history/assets-history-elastic.service.ts b/src/modules/asset-history/assets-history-elastic.service.ts index 31182f892..e6df50ce3 100644 --- a/src/modules/asset-history/assets-history-elastic.service.ts +++ b/src/modules/asset-history/assets-history-elastic.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { MxElasticService } from 'src/common'; -import { ElasticQuery, ElasticSortOrder, QueryType, RangeLowerThan } from '@multiversx/sdk-nestjs-elastic'; +import { ElasticQuery, ElasticSortOrder, MatchQuery, QueryType, RangeLowerThan } from '@multiversx/sdk-nestjs-elastic'; import { constants } from 'src/config'; @Injectable() @@ -14,14 +14,10 @@ export class AssetsHistoryElasticService { const query = ElasticQuery.create() .withMustCondition( - QueryType.Nested('events', { - 'events.topics': encodedCollection, - }), + QueryType.Nested('events', [new MatchQuery('events.topics', encodedCollection )]) , ) .withMustCondition( - QueryType.Nested('events', { - 'events.topics': encodedNonce, - }), + QueryType.Nested('events', [new MatchQuery('events.topics', encodedCollection )]), ) .withRangeFilter('timestamp', new RangeLowerThan(beforeTimestamp)) .withSort([{ name: 'timestamp', order: ElasticSortOrder.descending }]) diff --git a/src/modules/marketplaces/marketplaces.elastic.queries.ts b/src/modules/marketplaces/marketplaces.elastic.queries.ts index 3b9b0bd6a..901f17f81 100644 --- a/src/modules/marketplaces/marketplaces.elastic.queries.ts +++ b/src/modules/marketplaces/marketplaces.elastic.queries.ts @@ -5,6 +5,7 @@ import { RangeGreaterThan, ElasticSortOrder, QueryConditionOptions, + MatchQuery, } from '@multiversx/sdk-nestjs-elastic'; import { constants } from 'src/config'; import { MarketplaceEventsIndexingRequest } from './models/MarketplaceEventsIndexingRequest'; @@ -34,11 +35,7 @@ export const getMarketplaceTransactionsElasticQuery = (input: MarketplaceEventsI export const getMarketplaceEventsElasticQuery = (input: MarketplaceEventsIndexingRequest): ElasticQuery => { return ElasticQuery.create() - .withMustCondition( - QueryType.Nested('events', { - 'events.address': input.marketplaceAddress, - }), - ) + .withMustCondition(QueryType.Nested('events', [new MatchQuery('events.address', input.marketplaceAddress)])) .withRangeFilter('timestamp', new RangeLowerThan(input.beforeTimestamp)) .withRangeFilter('timestamp', new RangeGreaterThan(input.afterTimestamp)) .withSort([{ name: 'timestamp', order: ElasticSortOrder.descending }]) diff --git a/src/modules/nft-rarity/nft-rarity.elastic.service.ts b/src/modules/nft-rarity/nft-rarity.elastic.service.ts index d4f6550a6..240bc5d7f 100644 --- a/src/modules/nft-rarity/nft-rarity.elastic.service.ts +++ b/src/modules/nft-rarity/nft-rarity.elastic.service.ts @@ -1,6 +1,6 @@ import { Injectable, Logger } from '@nestjs/common'; import { MxElasticService } from 'src/common'; -import { ElasticQuery, ElasticSortOrder, QueryOperator, QueryType } from '@multiversx/sdk-nestjs-elastic'; +import { ElasticQuery, ElasticSortOrder, MatchQuery, QueryOperator, QueryType } from '@multiversx/sdk-nestjs-elastic'; import { Locker } from '@multiversx/sdk-nestjs-common'; import { NftTypeEnum } from '../assets/models'; import { NftRarityData } from './models/nft-rarity-data.model'; @@ -171,7 +171,7 @@ export class NftRarityElasticService { const query = ElasticQuery.create() .withMustExistCondition('nonce') .withMustCondition(QueryType.Match('token', collectionTicker, QueryOperator.AND)) - .withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true })) + .withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true )])) // TODO(whiteListedStorage) // .withMustCondition( // QueryType.Nested('data', { 'data.whiteListedStorage': true }), @@ -406,7 +406,7 @@ export class NftRarityElasticService { return ElasticQuery.create() .withMustExistCondition('nonce') .withMustNotCondition(QueryType.Exists(ELASTIC_NFT_HASRARITY)) - .withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true })) + .withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true )])) .withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type)) .withFields(['token']) .withPagination({ From b64541308601c91c96251b58edc70c9e7d572838 Mon Sep 17 00:00:00 2001 From: danielailie Date: Fri, 15 Dec 2023 15:54:51 +0200 Subject: [PATCH 6/7] Fix tests --- .jest/setEnvVars.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.jest/setEnvVars.js b/.jest/setEnvVars.js index 9a9edd787..64c71c9c1 100644 --- a/.jest/setEnvVars.js +++ b/.jest/setEnvVars.js @@ -1,4 +1,5 @@ process.env.DEPLOYER_ADDRESS = 'erd1qqqqqqqqqqqqqpgqut6lamz9dn480ytj8cmcwvydcu3lj55epltq9t9kam'; +process.env.PROXY_DEPLOYER_ADDRESS = 'erd1qqqqqqqqqqqqqpgqut6lamz9dn480ytj8cmcwvydcu3lj55epltq9t9kam'; process.env.TEMPLATE_BULK_ADDRESS = 'erd1qqqqqqqqqqqqqpgqzs3y0vr4t4sqyet32t6jp9m85l3hlr93u00sdj9rxa'; process.env.TEMPLATE_MINTER_ADDRESS = 'erd1qqqqqqqqqqqqqpgqzs3y0vr4t4sqyet32t6jp9m85l3hlr93u00sdj9rxa'; process.env.TEMPLATE_MARKETPLACE_ADDRESS = 'erd1qqqqqqqqqqqqqpgq9ac9zvc4ugzrgqaqjqgjdhvxxtx7wu2eu00sxezym3'; From 380546e46b0485c9f8a411e5ddb8558dc88b2780 Mon Sep 17 00:00:00 2001 From: danielailie Date: Fri, 15 Dec 2023 15:56:46 +0200 Subject: [PATCH 7/7] remove console logs --- src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts index d3b3c90f4..a8fae1a72 100644 --- a/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts +++ b/src/modules/rabbitmq/blockchain-events/nft-events.consumer.ts @@ -33,7 +33,6 @@ export class NftEventsConsumer { dlqExchange: process.env.RABBITMQ_DLQ_EXCHANGE, }) async consumeAuctionEvents(nftAuctionEvents: any) { - console.log(11111111, nftAuctionEvents) if (nftAuctionEvents?.events) { const internalMarketplaces = await this.marketplaceService.getInternalMarketplacesAddreses(); const externalMarketplaces = await this.marketplaceService.getExternalMarketplacesAddreses();