diff --git a/openapi/catalyst.yaml b/openapi/catalyst.yaml index b5abf07..0c0744a 100644 --- a/openapi/catalyst.yaml +++ b/openapi/catalyst.yaml @@ -100,6 +100,14 @@ paths: $ref: 'paths/lambdas/lambdas@collections@contents@{urn}@image.yaml' /lambdas/collections/standard/erc721/{chainId}/{contract}/{option}/{emission}: $ref: 'paths/lambdas/lambdas@collections@standard@erc721@{chainId}@{contract}@{option}@{emission}.yaml' + /lambdas/nfts/wearables/{address}: + $ref: 'paths/lambdas/lambdas@nfts@wearables@{address}.yaml' + /lambdas/nfts/emotes/{address}: + $ref: 'paths/lambdas/lambdas@nfts@emotes@{address}.yaml' + /lambdas/nfts/names/{address}: + $ref: 'paths/lambdas/lambdas@nfts@names@{address}.yaml' + /lambdas/nfts/lands/{address}: + $ref: 'paths/lambdas/lambdas@nfts@lands@{address}.yaml' /lambdas/collections/wearables: $ref: 'paths/lambdas/lambdas@collections@wearables.yaml' /lambdas/collections/wearables-by-owner/{address}: diff --git a/openapi/components/examples/lambdas/200-emotes-paginated.json b/openapi/components/examples/lambdas/200-emotes-paginated.json new file mode 100644 index 0000000..28af2d4 --- /dev/null +++ b/openapi/components/examples/lambdas/200-emotes-paginated.json @@ -0,0 +1,25 @@ +{ + "value": { + "emotes": [ + { + "urn": "urn:decentraland:matic:collections-v2:0xa5b27856547a7d7c238b0e6c2de7a73556b915ba:0", + "amount": 1 + }, + { + "urn": "urn:decentraland:matic:collections-v2:0x7f26599ad1e9ad0ce6d47c5043d70d3bcd3d259a:0", + "amount": 1 + }, + { + "urn": "urn:decentraland:matic:collections-v2:0xeed6bdbdec460e258688e15816e8a9f760c3651a:0", + "amount": 1 + }, + { + "urn": "urn:decentraland:matic:collections-v2:0xa6c722476bdd17bf2adb65e96388345d83259f3b:0", + "amount": 1 + } + ], + "totalAmount": 973, + "pageNum": "3", + "pageSize": "4" + } +} \ No newline at end of file diff --git a/openapi/components/examples/lambdas/200-lands-paginated.json b/openapi/components/examples/lambdas/200-lands-paginated.json new file mode 100644 index 0000000..eaafef7 --- /dev/null +++ b/openapi/components/examples/lambdas/200-lands-paginated.json @@ -0,0 +1,28 @@ +{ + "value": { + "lands": [ + { + "name": "No rules red light", + "contractAddress": "0x959e104e1a4db6317fa58f8295f586e1a978c297", + "tokenId": "2178", + "category": "estate", + "description": "No rules red light", + "price": "13850000000000000000000", + "image": "https://api.decentraland.org/v1/estates/2178/map.png" + }, + { + "name": null, + "contractAddress": "0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d", + "tokenId": "115792089237316195423570985008687907830471066081937686987411485309984659472358", + "category": "parcel", + "x": "-68", + "y": "-26", + "price": null, + "image": "https://api.decentraland.org/v1/parcels/-68/-26/map.png" + } + ], + "totalAmount": 692, + "pageNum": "1", + "pageSize": "2" + } +} \ No newline at end of file diff --git a/openapi/components/examples/lambdas/200-names-paginated.json b/openapi/components/examples/lambdas/200-names-paginated.json new file mode 100644 index 0000000..b7ad668 --- /dev/null +++ b/openapi/components/examples/lambdas/200-names-paginated.json @@ -0,0 +1,33 @@ +{ + "value": { + "names": [ + { + "name": "Gojo", + "contractAddress": "0x2a187453064356c898cae034eaed119e1663acb8", + "tokenId": "115307283102801270656452808194409685445355100338904720773052040552422075323100", + "price": "25000000000000000000000" + }, + { + "name": "Ugh", + "contractAddress": "0x2a187453064356c898cae034eaed119e1663acb8", + "tokenId": "109851145768931514038649521124955142005672037705020471158837454870244371101640", + "price": "20000000000000000000000" + }, + { + "name": "Pain", + "contractAddress": "0x2a187453064356c898cae034eaed119e1663acb8", + "tokenId": "37860252415586502442474289153833538639704044038329376660459632788847982021683", + "price": "35000000000000000000000" + }, + { + "name": "Hawks", + "contractAddress": "0x2a187453064356c898cae034eaed119e1663acb8", + "tokenId": "61045570331711729163571591712822027676157304898474053802260900686360273563216", + "price": "30000000000000000000000" + } + ], + "totalAmount": 812, + "pageNum": "2", + "pageSize": "4" + } +} \ No newline at end of file diff --git a/openapi/components/examples/lambdas/200-wearables-paginated.json b/openapi/components/examples/lambdas/200-wearables-paginated.json new file mode 100644 index 0000000..6a5af1a --- /dev/null +++ b/openapi/components/examples/lambdas/200-wearables-paginated.json @@ -0,0 +1,93 @@ +{ + "value": { + "wearables": [ + { + "urn": "urn:decentraland:matic:collections-v2:0x6d83706836e820e79252edd48da419d2d03592d4:0", + "individualData": [ + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-6407", + "tokenId": "6407", + "transferredAt": "1662738697", + "price": "10000000000000000000000000" + }, + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-5452", + "tokenId": "5452", + "transferredAt": "1662738325", + "price": "10000000000000000000000000" + }, + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-4497", + "tokenId": "4497", + "transferredAt": "1662737945", + "price": "10000000000000000000000000" + }, + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-3542", + "tokenId": "3542", + "transferredAt": "1662737595", + "price": "10000000000000000000000000" + }, + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-2587", + "tokenId": "2587", + "transferredAt": "1662737239", + "price": "10000000000000000000000000" + }, + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-1632", + "tokenId": "1632", + "transferredAt": "1662736881", + "price": "10000000000000000000000000" + }, + { + "id": "0x6d83706836e820e79252edd48da419d2d03592d4-677", + "tokenId": "677", + "transferredAt": "1662736515", + "price": "10000000000000000000000000" + } + ], + "amount": 7 + }, + { + "urn": "urn:decentraland:matic:collections-v2:0x475abb52a7e925209b1334e52bfb62e1da9ebf62:1", + "individualData": [ + { + "id": "0x475abb52a7e925209b1334e52bfb62e1da9ebf62-105312291668557186697918027683670432318895095400549111254310977681", + "tokenId": "105312291668557186697918027683670432318895095400549111254310977681", + "transferredAt": "1662040489", + "price": "1000000000000000000" + } + ], + "amount": 1 + }, + { + "urn": "urn:decentraland:matic:collections-v2:0x710dce41dceace2f0e06c0cffee25fe65ad6f64c:0", + "individualData": [ + { + "id": "0x710dce41dceace2f0e06c0cffee25fe65ad6f64c-339", + "tokenId": "339", + "transferredAt": "1662040423", + "price": "500000000000000000" + } + ], + "amount": 1 + }, + { + "urn": "urn:decentraland:matic:collections-v2:0x293d1ae40b28c39d7b013d4a1fe3c5a8c016bf19:1", + "individualData": [ + { + "id": "0x293d1ae40b28c39d7b013d4a1fe3c5a8c016bf19-105312291668557186697918027683670432318895095400549111254310977722", + "tokenId": "105312291668557186697918027683670432318895095400549111254310977722", + "transferredAt": "1662040329", + "price": "100000000000000000" + } + ], + "amount": 1 + } + ], + "totalAmount": 23, + "pageNum": "2", + "pageSize": "4" + } +} \ No newline at end of file diff --git a/openapi/components/schemas/lambdas/200-emotes-paginated.yaml b/openapi/components/schemas/lambdas/200-emotes-paginated.yaml new file mode 100644 index 0000000..afdcf0b --- /dev/null +++ b/openapi/components/schemas/lambdas/200-emotes-paginated.yaml @@ -0,0 +1,17 @@ +type: object +properties: + emotes: + type: array + items: + type: object + properties: + urn: + type: string + amount: + type: number + totalAmount: + type: number + pageNum: + type: string + pageSize: + type: string \ No newline at end of file diff --git a/openapi/components/schemas/lambdas/200-lands-paginated.yaml b/openapi/components/schemas/lambdas/200-lands-paginated.yaml new file mode 100644 index 0000000..817a121 --- /dev/null +++ b/openapi/components/schemas/lambdas/200-lands-paginated.yaml @@ -0,0 +1,31 @@ +type: object +properties: + lands: + type: array + items: + type: object + properties: + name: + type: string + contractAddress: + type: string + tokenId: + type: string + price: + type: string + category: + type: string + x: + type: string + y: + type: string + image: + type: string + description: + type: string + totalAmount: + type: number + pageNum: + type: string + pageSize: + type: string \ No newline at end of file diff --git a/openapi/components/schemas/lambdas/200-names-paginated.yaml b/openapi/components/schemas/lambdas/200-names-paginated.yaml new file mode 100644 index 0000000..9b416f5 --- /dev/null +++ b/openapi/components/schemas/lambdas/200-names-paginated.yaml @@ -0,0 +1,21 @@ +type: object +properties: + names: + type: array + items: + type: object + properties: + name: + type: string + contractAddress: + type: string + tokenId: + type: string + price: + type: string + totalAmount: + type: number + pageNum: + type: string + pageSize: + type: string \ No newline at end of file diff --git a/openapi/components/schemas/lambdas/200-wearables-paginated.yaml b/openapi/components/schemas/lambdas/200-wearables-paginated.yaml new file mode 100644 index 0000000..32179cd --- /dev/null +++ b/openapi/components/schemas/lambdas/200-wearables-paginated.yaml @@ -0,0 +1,30 @@ +type: object +properties: + wearables: + type: array + items: + type: object + properties: + urn: + type: string + amount: + type: number + individualData: + type: array + items: + type: object + properties: + id: + type: string + tokenId: + type: string + transferredAt: + type: string + price: + type: string + totalAmount: + type: number + pageNum: + type: string + pageSize: + type: string \ No newline at end of file diff --git a/openapi/paths/lambdas/lambdas@collections@wearables-by-owner@{address}.yaml b/openapi/paths/lambdas/lambdas@collections@wearables-by-owner@{address}.yaml index b6b9a99..57e951e 100644 --- a/openapi/paths/lambdas/lambdas@collections@wearables-by-owner@{address}.yaml +++ b/openapi/paths/lambdas/lambdas@collections@wearables-by-owner@{address}.yaml @@ -1,5 +1,6 @@ get: operationId: getWearablesByOwner + deprecated: true summary: Get list of wearables by owner tags: - Lambdas diff --git a/openapi/paths/lambdas/lambdas@nfts@emotes@{address}.yaml b/openapi/paths/lambdas/lambdas@nfts@emotes@{address}.yaml new file mode 100644 index 0000000..15b9fa4 --- /dev/null +++ b/openapi/paths/lambdas/lambdas@nfts@emotes@{address}.yaml @@ -0,0 +1,56 @@ +get: + operationId: getPaginatedEmotes + summary: Get list of emotes for an address + tags: + - Lambdas + description: Get a list of emotes owned by the given address + parameters: + - in: query + name: collectionId + schema: + type: string + example: 'urn:decentraland:matic:collections-thirdparty:ntr1-meta:ntr1-meta-1ef79e7b' + description: >- + Third Party collection Id to filter emotes, if this param is not sent then the 3rd parties emotes are not shown. If it is sent, only the 3rd parties emotes are shown. + - in: query + name: includeDefinitions + schema: + type: boolean + example: true + description: >- + If present, response will be extended with the definition data. + - in: path + name: address + required: true + schema: + type: string + example: '0xf4f7512c68f358856514cd4e449fc6c5ac04bb15' + description: >- + Ethereum address from which you want to get the list of emotes + - in: query + name: pageNum + schema: + type: string + example: "1" + description: >- + The number of the requested page. It needs `pageSize` to be present to enable a paginated response. + - in: query + name: pageSize + schema: + type: string + example: "10" + description: >- + The size of the requested page. It needs `pageNum` to be present to enable a paginated response. + + responses: + '200': + description: List of emotes owned by the given address + content: + application/json; charset=utf-8: + schema: + $ref: ../../components/schemas/lambdas/200-emotes-paginated.yaml + examples: + default: + $ref: ../../components/examples/lambdas/200-emotes-paginated.json + '500': + description: 'Failed to fetch emotes for the address' diff --git a/openapi/paths/lambdas/lambdas@nfts@lands@{address}.yaml b/openapi/paths/lambdas/lambdas@nfts@lands@{address}.yaml new file mode 100644 index 0000000..ca790b9 --- /dev/null +++ b/openapi/paths/lambdas/lambdas@nfts@lands@{address}.yaml @@ -0,0 +1,42 @@ +get: + operationId: getPaginatedLands + summary: Get list of lands for an address + tags: + - Lambdas + description: Get a list of lands owned by the given address + parameters: + - in: path + name: address + required: true + schema: + type: string + example: '0xddf1eec586d8f8f0eb8c5a3bf51fb99379a55684' + description: >- + Ethereum address from which you want to get the list of lands + - in: query + name: pageNum + schema: + type: string + example: "1" + description: >- + The number of the requested page. It needs `pageSize` to be present to enable a paginated response. + - in: query + name: pageSize + schema: + type: string + example: "10" + description: >- + The size of the requested page. It needs `pageNum` to be present to enable a paginated response. + + responses: + '200': + description: List of lands owned by the given address + content: + application/json; charset=utf-8: + schema: + $ref: ../../components/schemas/lambdas/200-lands-paginated.yaml + examples: + default: + $ref: ../../components/examples/lambdas/200-lands-paginated.json + '500': + description: 'Failed to fetch lands for the address' diff --git a/openapi/paths/lambdas/lambdas@nfts@names@{address}.yaml b/openapi/paths/lambdas/lambdas@nfts@names@{address}.yaml new file mode 100644 index 0000000..857789b --- /dev/null +++ b/openapi/paths/lambdas/lambdas@nfts@names@{address}.yaml @@ -0,0 +1,42 @@ +get: + operationId: getPaginatedNames + summary: Get list of names for an address + tags: + - Lambdas + description: Get a list of names owned by the given address + parameters: + - in: path + name: address + required: true + schema: + type: string + example: '0xddf1eec586d8f8f0eb8c5a3bf51fb99379a55684' + description: >- + Ethereum address from which you want to get the list of names + - in: query + name: pageNum + schema: + type: string + example: "1" + description: >- + The number of the requested page. It needs `pageSize` to be present to enable a paginated response. + - in: query + name: pageSize + schema: + type: string + example: "10" + description: >- + The size of the requested page. It needs `pageNum` to be present to enable a paginated response. + + responses: + '200': + description: List of names owned by the given address + content: + application/json; charset=utf-8: + schema: + $ref: ../../components/schemas/lambdas/200-names-paginated.yaml + examples: + default: + $ref: ../../components/examples/lambdas/200-names-paginated.json + '500': + description: 'Failed to fetch names for the address' diff --git a/openapi/paths/lambdas/lambdas@nfts@wearables@{address}.yaml b/openapi/paths/lambdas/lambdas@nfts@wearables@{address}.yaml new file mode 100644 index 0000000..a1aaea0 --- /dev/null +++ b/openapi/paths/lambdas/lambdas@nfts@wearables@{address}.yaml @@ -0,0 +1,70 @@ +get: + operationId: getPaginatedWearables + summary: Get list of wearables for an address + tags: + - Lambdas + description: Get a list of wearables owned by the given address + parameters: + - in: path + name: address + required: true + schema: + type: string + example: '0xa87d168717538e86d71ac48baccaeb84162de602' + description: >- + Ethereum address from which you want to get the list of wearables + - in: query + name: collectionId + schema: + type: string + example: 'urn:decentraland:matic:collections-thirdparty:ntr1-meta:ntr1-meta-1ef79e7b' + description: >- + Third Party collection Id to filter wearables, if this param is not sent then the 3rd parties wearables are not shown. If it is sent, only the 3rd parties wearables are shown. + - in: query + name: includeDefinitions + schema: + type: boolean + example: true + description: >- + If present, response will be extended with the definition data. + - in: query + name: includeThirdParty + schema: + type: boolean + example: true + description: >- + If present, response will include the third-party wearables owned by the address. They will appear before other wearables if the response is paginated. + - in: query + name: pageNum + schema: + type: string + example: "1" + description: >- + The number of the requested page. It needs `pageSize` to be present to enable a paginated response. + - in: query + name: pageSize + schema: + type: string + example: "10" + description: >- + The size of the requested page. It needs `pageNum` to be present to enable a paginated response. + - in: query + name: orderBy + schema: + type: string + example: rarity + description: >- + Determines the field to be sort by. By default it will be by `transferredAt`. Possible values: `transferredAt` and `rarity`. + + responses: + '200': + description: List of wearables owned by the given address + content: + application/json; charset=utf-8: + schema: + $ref: ../../components/schemas/lambdas/200-wearables-paginated.yaml + examples: + default: + $ref: ../../components/examples/lambdas/200-wearables-paginated.json + '500': + description: 'Failed to fetch wearables for the address' diff --git a/package-lock.json b/package-lock.json index 73c6611..b62a9c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5367,6 +5367,16 @@ "node": ">=6" } }, + "node_modules/redoc-cli/node_modules/@types/chokidar": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@types/chokidar/-/chokidar-2.1.3.tgz", + "integrity": "sha512-6qK3xoLLAhQVTucQGHTySwOVA1crHRXnJeLwqK6KIFkkKa2aoMFXh+WEi8PotxDtvN6MQJLyYN9ag9P6NLV81w==", + "deprecated": "This is a stub types definition. chokidar provides its own type definitions, so you do not need this installed.", + "extraneous": true, + "dependencies": { + "chokidar": "*" + } + }, "node_modules/redoc-cli/node_modules/@types/eslint": { "version": "8.4.6", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.6.tgz", @@ -5396,12 +5406,31 @@ "dev": true, "peer": true }, + "node_modules/redoc-cli/node_modules/@types/handlebars": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.1.0.tgz", + "integrity": "sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA==", + "deprecated": "This is a stub types definition. handlebars provides its own type definitions, so you do not need this installed.", + "extraneous": true, + "dependencies": { + "handlebars": "*" + } + }, "node_modules/redoc-cli/node_modules/@types/json-schema": { "version": "7.0.9", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, + "node_modules/redoc-cli/node_modules/@types/mkdirp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.1.tgz", + "integrity": "sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q==", + "extraneous": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/redoc-cli/node_modules/@types/node": { "version": "15.12.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz", @@ -14487,6 +14516,14 @@ "defer-to-connect": "^1.0.1" } }, + "@types/chokidar": { + "version": "https://registry.npmjs.org/@types/chokidar/-/chokidar-2.1.3.tgz", + "integrity": "sha512-6qK3xoLLAhQVTucQGHTySwOVA1crHRXnJeLwqK6KIFkkKa2aoMFXh+WEi8PotxDtvN6MQJLyYN9ag9P6NLV81w==", + "extraneous": true, + "requires": { + "chokidar": "*" + } + }, "@types/eslint": { "version": "8.4.6", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.6.tgz", @@ -14516,12 +14553,28 @@ "dev": true, "peer": true }, + "@types/handlebars": { + "version": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.1.0.tgz", + "integrity": "sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA==", + "extraneous": true, + "requires": { + "handlebars": "*" + } + }, "@types/json-schema": { "version": "7.0.9", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, + "@types/mkdirp": { + "version": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.1.tgz", + "integrity": "sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q==", + "extraneous": true, + "requires": { + "@types/node": "*" + } + }, "@types/node": { "version": "15.12.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz",