From 401f54479b5c246edbf233b606a67a5915830c02 Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Fri, 12 Jun 2026 17:26:05 -0600 Subject: [PATCH] fix(evm): remove unauthenticated NFT metadata endpoint (SSRF) Remove `GET /api/v1/metadata/token` and all of its supporting code (controller route, TokenMetadata/TokenType models, and the moralis + blockbook getTokenMetadata implementations). The endpoint made unauthenticated server-side HTTP requests to URLs derived from attacker-controlled NFT metadata (on-chain `tokenURI()`, `image`, `animation_url`), following redirects with no host allowlist or private-IP filtering. This is a blind SSRF (FOX-168) whose only reflected signal is the fetched `Content-Type` (image/video). The endpoint is unused by the web app, so removing the feature eliminates the attack surface outright rather than mitigating it with an outbound-URL allowlist (which remains exposed to DNS-rebinding). Co-Authored-By: Claude Opus 4.8 (1M context) --- node/coinstacks/arbitrum/api/src/swagger.json | 142 ------------------ .../coinstacks/avalanche/api/src/swagger.json | 142 ------------------ node/coinstacks/base/api/src/swagger.json | 142 ------------------ .../bnbsmartchain/api/src/swagger.json | 142 ------------------ .../common/api/src/evm/blockbookService.ts | 105 +------------ .../common/api/src/evm/controller.ts | 33 +--- node/coinstacks/common/api/src/evm/models.ts | 32 ---- .../common/api/src/evm/moralisService.ts | 61 +------- node/coinstacks/ethereum/api/src/swagger.json | 142 ------------------ node/coinstacks/gnosis/api/src/swagger.json | 142 ------------------ node/coinstacks/optimism/api/src/swagger.json | 142 ------------------ node/coinstacks/polygon/api/src/swagger.json | 142 ------------------ 12 files changed, 5 insertions(+), 1362 deletions(-) diff --git a/node/coinstacks/arbitrum/api/src/swagger.json b/node/coinstacks/arbitrum/api/src/swagger.json index 7e4f466e0..df12adc30 100644 --- a/node/coinstacks/arbitrum/api/src/swagger.json +++ b/node/coinstacks/arbitrum/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "GasEstimate": { "description": "Contains info about estimated gas cost of a transaction", "properties": { @@ -1025,92 +969,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/avalanche/api/src/swagger.json b/node/coinstacks/avalanche/api/src/swagger.json index 1a0d74e29..6873f0f54 100644 --- a/node/coinstacks/avalanche/api/src/swagger.json +++ b/node/coinstacks/avalanche/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "GasEstimate": { "description": "Contains info about estimated gas cost of a transaction", "properties": { @@ -1013,92 +957,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/base/api/src/swagger.json b/node/coinstacks/base/api/src/swagger.json index f0078ea90..b65f03b36 100644 --- a/node/coinstacks/base/api/src/swagger.json +++ b/node/coinstacks/base/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "BaseGasEstimate": { "description": "Contains info about estimated gas cost of a transaction on both L1 and L2", "properties": { @@ -1021,92 +965,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/bnbsmartchain/api/src/swagger.json b/node/coinstacks/bnbsmartchain/api/src/swagger.json index dfb8fdaa6..d57e22dd1 100644 --- a/node/coinstacks/bnbsmartchain/api/src/swagger.json +++ b/node/coinstacks/bnbsmartchain/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "GasEstimate": { "description": "Contains info about estimated gas cost of a transaction", "properties": { @@ -1013,92 +957,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/common/api/src/evm/blockbookService.ts b/node/coinstacks/common/api/src/evm/blockbookService.ts index ba885cfa0..15ff73bff 100644 --- a/node/coinstacks/common/api/src/evm/blockbookService.ts +++ b/node/coinstacks/common/api/src/evm/blockbookService.ts @@ -1,8 +1,8 @@ import type { Blockbook, Tx as BlockbookTx } from '@shapeshiftoss/blockbook' import type { Logger } from '@shapeshiftoss/logger' -import axios, { AxiosError } from 'axios' +import axios from 'axios' import BigNumber from 'bignumber.js' -import { erc1155Abi, erc721Abi, getAddress, getContract, isHex, parseUnits, PublicClient, toHex } from 'viem' +import { getAddress, isHex, parseUnits, PublicClient, toHex } from 'viem' import type { BadRequestError, BaseAPI, EstimateGasBody, RPCRequest, RPCResponse, SendTxBody } from '..' import { ApiError } from '..' import { createAxiosRetry, exponentialDelay, handleError, rpcId, validatePageSize } from '../utils' @@ -15,8 +15,6 @@ import type { GasFees, InternalTx, GasEstimate, - TokenMetadata, - TokenType, } from './models' import type { DebugCallStack, @@ -780,105 +778,6 @@ export class BlockbookService implements Omit, API { } } - async getTokenMetadata(address: string, id: string, type: TokenType): Promise { - const substitue = (data: string, id: string, hexEncoded: boolean): string => { - if (!data.includes('{id}')) return data - if (!hexEncoded) return data.replace('{id}', id) - return data.replace('{id}', new BigNumber(id).toString(16).padStart(64, '0').toLowerCase()) - } - - const makeUrl = (url: string): string => { - if (url.startsWith('ipfs://')) { - return url.replace('ipfs://', 'https://gateway.shapeshift.com/ipfs/') - } - - if (url.startsWith('ipns://')) { - return url.replace('ipns://', 'https://gateway.shapeshift.com/ipns/') - } - - return url - } - - try { - const uri = (await (() => { - switch (type) { - case 'erc721': - return getContract({ address: getAddress(address), abi: erc721Abi, client: this.client }).read.tokenURI([ - BigInt(id), - ]) - case 'erc1155': - return getContract({ address: getAddress(address), abi: erc1155Abi, client: this.client }).read.uri([ - BigInt(id), - ]) - default: - throw new Error(`invalid token type: ${type}`) - } - })()) as string - - const metadata = await (async () => { - // handle base64 encoded metadata - if (uri.startsWith('data:application/json;base64')) { - const [, b64] = uri.split(',') - return JSON.parse(Buffer.from(b64, 'base64').toString()) - } - - try { - // attempt to get metadata using hex encoded id as per erc spec - const { data } = await axiosNoRetry.get(makeUrl(substitue(uri, id, true))) - return data - } catch (err) { - // don't retry on timeout, assume host is offline - if (err instanceof AxiosError && err.code === AxiosError.ECONNABORTED) return {} - - try { - // not everyone follows the spec, attempt to get metadata using id string - const { data } = await axiosNoRetry.get(makeUrl(substitue(uri, id, false))) - return data - } catch (err) { - // swallow error and return empty object if unable to fetch metadata - return {} - } - } - })() - - const mediaUrl = metadata?.image ? makeUrl(metadata.image) : '' - - const mediaType = await (async () => { - if (!mediaUrl) return - - try { - const { headers } = await axiosNoRetry.head(mediaUrl) - return headers['content-type']?.includes('video') ? 'video' : 'image' - } catch (err) { - return - } - })() - - return { - address, - id, - type, - name: metadata?.name ?? '', - description: metadata?.description ?? '', - media: { - url: mediaUrl, - type: mediaType, - }, - } - } catch (err) { - this.logger.error(err, 'failed to fetch token metadata') - - return { - address, - id, - type, - name: '', - description: '', - media: { url: '' }, - } - } - } - async doRpcRequest(req: RPCRequest | Array): Promise> { try { const config = this.rpcApiKey ? { headers: { 'api-key': this.rpcApiKey } } : undefined diff --git a/node/coinstacks/common/api/src/evm/controller.ts b/node/coinstacks/common/api/src/evm/controller.ts index f3bdd77c6..dbf657bbe 100644 --- a/node/coinstacks/common/api/src/evm/controller.ts +++ b/node/coinstacks/common/api/src/evm/controller.ts @@ -9,7 +9,7 @@ import { SendTxBody, ValidationError, } from '../' -import { API, Account, Tx, TxHistory, TokenMetadata, TokenType } from './models' +import { API, Account, Tx, TxHistory } from './models' import { BlockbookService } from './blockbookService' import { MoralisService } from './moralisService' import { Chain } from 'viem' @@ -192,35 +192,4 @@ export class EVM extends Controller implements BaseAPI, Omit): Promise> { return EVM.service.doRpcRequest(body) } - - /** - * Get token metadata - * - * @param {string} contract contract address - * @param {string} id token identifier - * @param {TokenType} type token type (erc721 or erc1155) - * - * @returns {Promise} token metadata - */ - @Example({ - address: '0x0000000000000000000000000000000000000000', - id: '123456789', - type: 'ERC721', - name: 'FoxyFox', - description: 'FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle', - media: { - url: 'https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru', - type: 'image', - }, - }) - @Response(422, 'Validation Error') - @Response(500, 'Internal Server Error') - @Get('/metadata/token') - async getTokenMetadata( - @Query() contract: string, - @Query() id: string, - @Query() type: TokenType - ): Promise { - return EVM.service.getTokenMetadata(contract, id, type) - } } diff --git a/node/coinstacks/common/api/src/evm/models.ts b/node/coinstacks/common/api/src/evm/models.ts index dd30dc430..2cde788f0 100644 --- a/node/coinstacks/common/api/src/evm/models.ts +++ b/node/coinstacks/common/api/src/evm/models.ts @@ -44,26 +44,6 @@ export interface Token { id?: string } -/** - * Supported token types for token metadata - */ -export type TokenType = 'erc721' | 'erc1155' - -/** - * Contains info about token metadata (ERC-721/ERC-1155) - */ -export interface TokenMetadata { - address: string - id: string - type: string - name: string - description: string - media: { - url: string - type?: 'image' | 'video' - } -} - /** * Contains info about a token including balance for an address */ @@ -156,16 +136,4 @@ export interface API { */ // @Get('/gas/fees') getGasFees(): Promise - - /** - * Get token metadata - * - * @param {string} contract contract address - * @param {string} id token identifier - * @param {TokenType} type token type (erc721 or erc1155) - * - * @returns {Promise} token metadata - */ - // @Get('/metadata/token') - getTokenMetadata(contract: string, id: string, type: string): Promise } diff --git a/node/coinstacks/common/api/src/evm/moralisService.ts b/node/coinstacks/common/api/src/evm/moralisService.ts index eede43f7b..fd1cabc22 100644 --- a/node/coinstacks/common/api/src/evm/moralisService.ts +++ b/node/coinstacks/common/api/src/evm/moralisService.ts @@ -10,8 +10,8 @@ import { getAddress, isHex, parseUnits, PublicClient, toHex } from 'viem' import type { BaseAPI, EstimateGasBody, RPCRequest, RPCResponse, SendTxBody } from '..' import { ApiError, BadRequestError } from '..' import { createAxiosRetry, exponentialDelay, handleError, rpcId, validatePageSize } from '../utils' -import type { Account, API, Tx, TxHistory, GasFees, InternalTx, GasEstimate, TokenMetadata } from './models' -import { Fees, TokenBalance, TokenTransfer, TokenType } from './models' +import type { Account, API, Tx, TxHistory, GasFees, InternalTx, GasEstimate } from './models' +import { Fees, TokenBalance, TokenTransfer } from './models' import type { BlockNativeResponse, ExplorerApiResponse, ExplorerInternalTxByAddress, TraceCall } from './types' import { formatAddress } from '.' @@ -755,63 +755,6 @@ export class MoralisService implements Omit, API, AddressSub return { cursor: pagination.cursor, hasMore: Boolean(pagination.cursor), txs } } - async getTokenMetadata(address: string, id: string, type: TokenType): Promise { - const makeUrl = (url: string): string => { - if (url.startsWith('ipfs://')) { - return url.replace('ipfs://', 'https://gateway.shapeshift.com/ipfs/') - } - - if (url.startsWith('ipns://')) { - return url.replace('ipns://', 'https://gateway.shapeshift.com/ipns/') - } - - return url - } - - try { - const data = await Moralis.EvmApi.nft.getNFTMetadata({ - address, - tokenId: id, - chain: this.chain, - format: 'decimal', - }) - - if (!data || !data.raw.normalized_metadata || data.result.contractType !== type.toUpperCase()) { - throw new Error(`Metadata for ${address} (${id}) not found`) - } - - const { contractType } = data.result - const { description, name, image, animation_url } = data.raw.normalized_metadata - - const mediaUrl = makeUrl(animation_url || image || '') - - const mediaType = await (async () => { - if (!mediaUrl) return - - try { - const { headers } = await axiosNoRetry.head(mediaUrl) - return headers['content-type']?.includes('video') ? 'video' : 'image' - } catch (err) { - return - } - })() - - return { - address, - id, - name: name ?? '', - description: description ?? '', - type: contractType, - media: { - url: mediaUrl, - type: mediaType, - }, - } - } catch (err) { - throw handleError(err) - } - } - async doRpcRequest(req: RPCRequest | Array): Promise> { try { const { data } = await axiosWithRetry.post(this.rpcUrl, req) diff --git a/node/coinstacks/ethereum/api/src/swagger.json b/node/coinstacks/ethereum/api/src/swagger.json index 808143691..e8e9df11c 100644 --- a/node/coinstacks/ethereum/api/src/swagger.json +++ b/node/coinstacks/ethereum/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "GasEstimate": { "description": "Contains info about estimated gas cost of a transaction", "properties": { @@ -1013,92 +957,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/gnosis/api/src/swagger.json b/node/coinstacks/gnosis/api/src/swagger.json index bf881afef..b701e0890 100644 --- a/node/coinstacks/gnosis/api/src/swagger.json +++ b/node/coinstacks/gnosis/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "GasEstimate": { "description": "Contains info about estimated gas cost of a transaction", "properties": { @@ -1013,92 +957,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/optimism/api/src/swagger.json b/node/coinstacks/optimism/api/src/swagger.json index a4b418575..d1278af0e 100644 --- a/node/coinstacks/optimism/api/src/swagger.json +++ b/node/coinstacks/optimism/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "OptimismGasEstimate": { "description": "Contains info about estimated gas cost of a transaction on both L1 and L2", "properties": { @@ -1021,92 +965,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas", diff --git a/node/coinstacks/polygon/api/src/swagger.json b/node/coinstacks/polygon/api/src/swagger.json index 1eff63153..4c0169ef0 100644 --- a/node/coinstacks/polygon/api/src/swagger.json +++ b/node/coinstacks/polygon/api/src/swagger.json @@ -407,62 +407,6 @@ "type": "object", "additionalProperties": false }, - "TokenMetadata": { - "description": "Contains info about token metadata (ERC-721/ERC-1155)", - "properties": { - "address": { - "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "media": { - "properties": { - "type": { - "type": "string", - "enum": [ - "image", - "video" - ] - }, - "url": { - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" - } - }, - "required": [ - "address", - "id", - "type", - "name", - "description", - "media" - ], - "type": "object", - "additionalProperties": false - }, - "TokenType": { - "type": "string", - "enum": [ - "erc721", - "erc1155" - ], - "description": "Supported token types for token metadata" - }, "GasEstimate": { "description": "Contains info about estimated gas cost of a transaction", "properties": { @@ -1013,92 +957,6 @@ } } }, - "/api/v1/metadata/token": { - "get": { - "operationId": "GetTokenMetadata", - "responses": { - "200": { - "description": "token metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TokenMetadata" - }, - "examples": { - "Example 1": { - "value": { - "address": "0x0000000000000000000000000000000000000000", - "id": "123456789", - "type": "ERC721", - "name": "FoxyFox", - "description": "FOXatars are a cyber-fox NFT project created by ShapeShift and Mercle", - "media": { - "url": "https://storage.mercle.xyz/ipfs/bafybeifihbavnaqwmisq72nwqpmxy3qkfqxj5nvjg7wimluhisp7wkzcru", - "type": "image" - } - } - } - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationError" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InternalServerError" - } - } - } - } - }, - "description": "Get token metadata", - "tags": [ - "v1" - ], - "security": [], - "parameters": [ - { - "description": "contract address", - "in": "query", - "name": "contract", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token identifier", - "in": "query", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "token type (erc721 or erc1155)", - "in": "query", - "name": "type", - "required": true, - "schema": { - "$ref": "#/components/schemas/TokenType" - } - } - ] - } - }, "/api/v1/gas/estimate": { "post": { "operationId": "EstimateGas",