Skip to main content

Create Drop Request

Schema for creating new drops in the Intraverse Backend API v2.

Description

The Create Drop Request schema defines the structure of requests for creating new NFT drops. This includes all the configuration, metadata, and smart contract details needed to set up a new drop.

Class Validator Schema

import { IsArray, IsBoolean, IsEnum, IsNumber, IsOptional, IsString, MinLength, ValidateNested } from "class-validator";
import { Type } from "class-transformer";
import { MintPhaseDto } from "./MintPhaseDto";
import { MarketPlaceDto } from "./MarketPlaceDto";
import { RarityDto } from "./RarityDto";
import { DropNetwork } from "../models/drop";

export class CreateDropRequestPayload {
@IsString()
organizationId: string;

@IsString()
@MinLength(3)
name: string;

@IsString()
description: string;

@IsString()
contractAddress: string;

@IsString()
chain: string;

@IsString()
@IsEnum(DropNetwork)
network: DropNetwork;

@IsNumber()
chainId: number;

@IsString()
logo: string;

@IsString()
collectionImage: string;

@IsString()
moreInfoUrl: string;

@IsNumber()
startDate: number;

@IsNumber()
endDate: number;

@IsString()
@IsOptional()
magicEdenGoldTokenName: string | null;

@IsBoolean()
whitelistEnabled: boolean;

@IsArray()
@ValidateNested({ each: true })
@Type(() => RarityDto)
cards: RarityDto[];

@IsArray()
@ValidateNested({ each: true })
@Type(() => MarketPlaceDto)
marketplaces: MarketPlaceDto[];

@IsArray()
@ValidateNested({ each: true })
@Type(() => MintPhaseDto)
phases: MintPhaseDto[];

@IsString()
signerPrivateKey: string;

@IsBoolean()
hasMultipleContracts: boolean;

@IsBoolean()
hasDailyCheckIn: boolean;

@IsBoolean()
isVIP: boolean;

@IsBoolean()
isActive: boolean;
}

TypeScript Type

interface CreateDropRequestPayload {
organizationId: string;
name: string;
description: string;
contractAddress: string;
chain: string;
network: DropNetwork;
chainId: number;
logo: string;
collectionImage: string;
moreInfoUrl: string;
startDate: number;
endDate: number;
magicEdenGoldTokenName?: string | null;
whitelistEnabled: boolean;
cards: RarityDto[];
marketplaces: MarketPlaceDto[];
phases: MintPhaseDto[];
signerPrivateKey: string;
hasMultipleContracts: boolean;
hasDailyCheckIn: boolean;
isVIP: boolean;
isActive: boolean;
}

Example Request

{
"organizationId": "org-123",
"name": "Bored Ape Yacht Club",
"description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs",
"contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e0a6a9c8d0c0b0a",
"chain": "ethereum",
"network": "mainnet",
"chainId": 1,
"logo": "https://example.com/logo.png",
"collectionImage": "https://example.com/collection.png",
"moreInfoUrl": "https://boredapeyachtclub.com",
"startDate": 1640995200000,
"endDate": 1641081600000,
"magicEdenGoldTokenName": null,
"whitelistEnabled": true,
"cards": [
{
"id": "rarity-1",
"name": "Common",
"probability": 0.7,
"maxSupply": 7000
}
],
"marketplaces": [
{
"id": "marketplace-1",
"name": "OpenSea",
"url": "https://opensea.io"
}
],
"phases": [
{
"id": "phase-1",
"name": "Whitelist",
"startDate": 1640995200000,
"endDate": 1641081600000
}
],
"signerPrivateKey": "0x1234567890abcdef...",
"hasMultipleContracts": false,
"hasDailyCheckIn": false,
"isVIP": false,
"isActive": true
}

Field Descriptions

FieldTypeRequiredDescription
organizationIdstringYesOrganization identifier
namestringYesDrop name (minimum 3 characters)
descriptionstringYesDetailed description of the drop
contractAddressstringYesSmart contract address
chainstringYesBlockchain chain name
networkDropNetworkYesNetwork type (mainnet, testnet, etc.)
chainIdnumberYesBlockchain chain ID
logostringYesURL to the drop logo image
collectionImagestringYesURL to the collection image
moreInfoUrlstringYesURL for additional information
startDatenumberYesDrop start timestamp in milliseconds
endDatenumberYesDrop end timestamp in milliseconds
magicEdenGoldTokenNamestringNoMagic Eden gold token name if applicable
whitelistEnabledbooleanYesWhether whitelist is enabled
cardsRarityDto[]YesArray of rarity tier definitions
marketplacesMarketPlaceDto[]YesSupported marketplace information
phasesMintPhaseDto[]YesMinting phase definitions
signerPrivateKeystringYesPrivate key for contract signing
hasMultipleContractsbooleanYesWhether the drop has multiple contracts
hasDailyCheckInbooleanYesWhether daily check-in is required
isVIPbooleanYesWhether this is a VIP-only drop
isActivebooleanYesWhether the drop is active

DropNetwork Enum

enum DropNetwork {
MAINNET = "mainnet",
TESTNET = "testnet",
DEVNET = "devnet",
}

Validation Rules

  • name: Minimum 3 characters
  • startDate: Must be a valid timestamp
  • endDate: Must be after startDate
  • cards: Must be a non-empty array
  • marketplaces: Must be a non-empty array
  • phases: Must be a non-empty array
  • signerPrivateKey: Must be a valid private key

API Endpoint

This schema is used by the following endpoint:

  • POST /v2/drop - Create new drop

Authentication

This endpoint requires dual authentication:

User Authentication

  • JWT Bearer Token: Authorization: Bearer <jwt_token>
  • Purpose: Identifies the authenticated user
  • Scope: User must have valid authentication

Game Authentication

  • Game Key Header: x-game-key: <client_key> or x-game-server-key: <server_key>
  • Purpose: Identifies the game/application making the request
  • Validation: Game key must be valid and active

Example Request Headers

headers: {
"Content-Type": "application/json",
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"x-game-key": "your-game-client-key"
}

Response Format

The endpoint returns a DropDto object:

interface DropDto {
// See DropDto schema for complete structure
}

Next Steps