From 334ed3ee5774188eca7255d8cae8681731e7ed4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20D=C3=ADaz?= Date: Thu, 18 Apr 2024 11:19:11 -0300 Subject: [PATCH] feat: Add matic amoy support (#3078) * feat: Add matic amoy to the protocol matcher * chore: Update packages * fix: Styles * fix: emote size condition * chore: Upgrade @dcl/schemas * feat: Update decentraland-transactions package * fix: package-lock * fix: package version * chore: Upgrade .nvmrc to node 20 lts --- .nvmrc | 2 +- package-lock.json | 30 +++++++++++++++--------------- package.json | 6 +++--- src/lib/urn.ts | 5 ++++- src/modules/collection/sagas.ts | 2 +- src/modules/item/sagas.ts | 2 +- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.nvmrc b/.nvmrc index bb52a169c..790e1105f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.18.2 +v20.10.0 diff --git a/package-lock.json b/package-lock.json index 2fd2404fb..f315c642d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@dcl/crypto": "^3.4.5", "@dcl/hashing": "^3.0.4", "@dcl/mini-rpc": "^1.0.7", - "@dcl/schemas": "^11.4.0", + "@dcl/schemas": "^11.5.0", "@dcl/sdk": "7.4.17", "@dcl/single-sign-on-client": "^0.1.0", "@dcl/ui-env": "^1.5.0", @@ -44,10 +44,10 @@ "decentraland-builder-scripts": "^0.24.0", "decentraland-connect": "^6.3.1", "decentraland-crypto-fetch": "^2.0.1", - "decentraland-dapps": "^19.5.1", + "decentraland-dapps": "^19.5.3", "decentraland-ecs": "6.12.4-7784644013.commit-f770b3e", "decentraland-experiments": "^1.0.2", - "decentraland-transactions": "^2.0.3", + "decentraland-transactions": "^2.6.1", "decentraland-ui": "^5.17.1", "ethers": "^5.6.8", "file-saver": "^2.0.1", @@ -2547,9 +2547,9 @@ } }, "node_modules/@dcl/schemas": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/@dcl/schemas/-/schemas-11.4.0.tgz", - "integrity": "sha512-pCMENllY9vcl4HS1ta/TpVqjWUov/oa9xab+Ki1iMur48nE5+xXfa7+laCPhWLOKSZEkC59i5S6zQGTSWFPYew==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/@dcl/schemas/-/schemas-11.5.0.tgz", + "integrity": "sha512-FkDAsZm6Ydu5PEROup2dLjOcqNwOiUISGhVYQAg6bWIp3kDnAjxguutOXIfxuZrVZELEcIi6+ntbvvfR28FAwg==", "dependencies": { "ajv": "^8.11.0", "ajv-errors": "^3.0.0", @@ -11199,14 +11199,14 @@ } }, "node_modules/decentraland-dapps": { - "version": "19.5.1", - "resolved": "https://registry.npmjs.org/decentraland-dapps/-/decentraland-dapps-19.5.1.tgz", - "integrity": "sha512-bdqDlKc7gjcvsFxh0uv2QWkABLzM5z0b60tzm7CY74gu1z4NJh0D8+ajTXWj/hAOydF2N2PCbOg3FK4CUe9eUA==", + "version": "19.5.3", + "resolved": "https://registry.npmjs.org/decentraland-dapps/-/decentraland-dapps-19.5.3.tgz", + "integrity": "sha512-FPje1IKjWb1pY3FXMX6DjlWoF2sazEpUmKP1jefrlTq8CF/oIj2qaw/CjCYo1MpJZoirKBOYmfRR0fIDRpdEUA==", "dependencies": { "@0xsequence/multicall": "^0.25.1", "@0xsequence/relayer": "^0.25.1", "@dcl/crypto": "^3.3.1", - "@dcl/schemas": "^11.4.0", + "@dcl/schemas": "^11.4.1-20240412130706.commit-0f2e689", "@dcl/single-sign-on-client": "^0.1.0", "@dcl/ui-env": "^1.5.0", "@transak/transak-sdk": "^1.0.31", @@ -11219,8 +11219,8 @@ "dcl-catalyst-client": "^21.1.0", "decentraland-connect": "^6.3.1", "decentraland-crypto-fetch": "^2.0.1", - "decentraland-transactions": "^2.3.2", - "decentraland-ui": "^5.17.0", + "decentraland-transactions": "^2.6.0", + "decentraland-ui": "^5.17.1", "ethers": "^5.6.8", "events": "^3.3.0", "flat": "^5.0.2", @@ -11459,9 +11459,9 @@ } }, "node_modules/decentraland-transactions": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/decentraland-transactions/-/decentraland-transactions-2.3.2.tgz", - "integrity": "sha512-VsYCQaJLO1tGcB94wW9yZcHCoAyznpV7gzK4bRQzSs9+oMC+MUhppNKpO8KZMHtYU/vvb88kDh9PDBbjb7RiAw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/decentraland-transactions/-/decentraland-transactions-2.6.1.tgz", + "integrity": "sha512-sOZICcRM1qv17AclrHfQ7hbFfMKG6Lu0AKkVKn5O7pEGJeK38y5aFb0cef4Y20CGLpkMD3S+xQM+hBX5+ntJDA==", "dependencies": { "@0xsquid/sdk": "^2.8.9", "@0xsquid/squid-types": "^0.1.51", diff --git a/package.json b/package.json index 366f0eaac..fe9976199 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "@dcl/crypto": "^3.4.5", "@dcl/hashing": "^3.0.4", "@dcl/mini-rpc": "^1.0.7", - "@dcl/schemas": "^11.4.0", + "@dcl/schemas": "^11.5.0", "@dcl/sdk": "7.4.17", "@dcl/single-sign-on-client": "^0.1.0", "@dcl/ui-env": "^1.5.0", @@ -38,10 +38,10 @@ "decentraland-builder-scripts": "^0.24.0", "decentraland-connect": "^6.3.1", "decentraland-crypto-fetch": "^2.0.1", - "decentraland-dapps": "^19.5.1", + "decentraland-dapps": "^19.5.3", "decentraland-ecs": "6.12.4-7784644013.commit-f770b3e", "decentraland-experiments": "^1.0.2", - "decentraland-transactions": "^2.0.3", + "decentraland-transactions": "^2.6.1", "decentraland-ui": "^5.17.1", "ethers": "^5.6.8", "file-saver": "^2.0.1", diff --git a/src/lib/urn.ts b/src/lib/urn.ts index 44b6953e8..38d680760 100644 --- a/src/lib/urn.ts +++ b/src/lib/urn.ts @@ -7,8 +7,10 @@ import { getChainIdByNetwork } from 'decentraland-dapps/dist/lib/eth' * (? * mainnet| * goerli| + * sepolia| * matic| * mumbai| + * amoy| * off-chain * ): * )? @@ -32,7 +34,7 @@ import { getChainIdByNetwork } from 'decentraland-dapps/dist/lib/eth' * ) */ const baseMatcher = 'urn:decentraland' -const protocolMatcher = '(?mainnet|goerli|sepolia|matic|mumbai|off-chain)' +const protocolMatcher = '(?mainnet|goerli|sepolia|matic|mumbai|amoy|off-chain)' const typeMatcher = '(?base-avatars|collections-v2|collections-thirdparty|entity)' const baseAvatarsSuffixMatcher = '((?<=base-avatars:)BaseMale|BaseFemale)' @@ -47,6 +49,7 @@ export enum URNProtocol { SEPOLIA = 'sepolia', MATIC = 'matic', MUMBAI = 'mumbai', + AMOY = 'amoy', OFF_CHAIN = 'off-chain' } export enum URNType { diff --git a/src/modules/collection/sagas.ts b/src/modules/collection/sagas.ts index b3497ff34..5e82678cc 100644 --- a/src/modules/collection/sagas.ts +++ b/src/modules/collection/sagas.ts @@ -465,7 +465,7 @@ export function* collectionSaga(legacyBuilderClient: BuilderAPI, client: Builder partnerId = '01HRRQQ70YK4SP88GHM9A61P6B' commodity = 'TT' scAddress = '0xe539E0AED3C1971560517D58277f8dd9aC296281' - network = 'mumbai' + network = 'mumbai' // TODO: Update to amoy when wert support it origin = 'https://sandbox.wert.io' break case 'prod': diff --git a/src/modules/item/sagas.ts b/src/modules/item/sagas.ts index fd1e32946..1ea9e657a 100644 --- a/src/modules/item/sagas.ts +++ b/src/modules/item/sagas.ts @@ -436,7 +436,7 @@ export function* itemSaga(legacyBuilder: LegacyBuilderAPI, builder: BuilderClien throw new ItemSkinTooBigError() } - if (!isSkin && finalModelSize > MAX_WEARABLE_FILE_SIZE) { + if (!isSkin && !isEmote && finalModelSize > MAX_WEARABLE_FILE_SIZE) { throw new ItemWearableTooBigError() } }