MarketPlace DTO
Schema for marketplace information used in drop APIs.
Description
The MarketPlace DTO schema defines the structure of marketplace information for NFT drops, including marketplace name, URL, and icon for supported trading platforms.
Class Validator Schema
import { IsString } from "class-validator";
export class MarketPlaceDto {
@IsString()
name: string;
@IsString()
url: string;
@IsString()
icon: string;
}
TypeScript Type
interface MarketPlaceDto {
name: string;
url: string;
icon: string;
}
Example
{
"name": "OpenSea",
"url": "https://opensea.io/collection/my-nft-drop",
"icon": "https://opensea.io/favicon.ico"
}
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Marketplace name |
url | string | Yes | Marketplace URL |
icon | string | Yes | Marketplace icon URL |
Example Response
{
"id": "marketplace-1",
"name": "OpenSea",
"url": "https://opensea.io"
}
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier for the marketplace |
name | string | Yes | Human-readable marketplace name |
url | string | Yes | URL to the marketplace website |
Common Marketplaces
Typical marketplace names include:
- OpenSea: Largest NFT marketplace
- Magic Eden: Solana-focused marketplace
- Blur: Ethereum NFT marketplace
- LooksRare: Community-driven marketplace
- X2Y2: NFT marketplace with trading features
Usage Example
// Example marketplace configuration
const marketplaces = [
{
id: "marketplace-1",
name: "OpenSea",
url: "https://opensea.io",
},
{
id: "marketplace-2",
name: "Magic Eden",
url: "https://magiceden.io",
},
{
id: "marketplace-3",
name: "Blur",
url: "https://blur.io",
},
];
// Get marketplace by name
const getMarketplaceByName = (name) => {
return marketplaces.find((mp) => mp.name === name);
};
const opensea = getMarketplaceByName("OpenSea");
console.log("OpenSea URL:", opensea?.url);
Validation Rules
- id: Must be a unique string identifier
- name: Must be a non-empty string
- url: Must be a valid URL string
Related Schemas
- Drop DTO - Main drop structure that contains marketplace information
- Create Drop Request - Creating drops with marketplace support
- RarityDto - Rarity tier definitions
- API Schemas Overview