Skip to main content

Calculate Tournament Score Response

Schema for the response from POST /api/v2/tournament/:id/calculateScore.

Description

This schema defines the response payload returned when calculating tournament scores based on raw game points and NFT holdings. The response includes the calculated multiplier and final score.

Class Validator Schema

import { IsNumber } from "class-validator";

export class CalculateTournamentScoreResponsePayload {
@IsNumber()
multiplier: number;

@IsNumber()
score: number;
}

JSON Schema

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Calculate Tournament Score Response",
"type": "object",
"properties": {
"multiplier": {
"type": "number",
"description": "Applied multiplier based on NFT holdings"
},
"score": {
"type": "number",
"description": "Final calculated score (rawGamePoint × multiplier)"
}
},
"required": ["multiplier", "score"]
}

TypeScript Type

interface CalculateTournamentScoreResponsePayload {
multiplier: number;
score: number;
}

Example Response

{
"multiplier": 2.5,
"score": 3750
}

Field Descriptions

FieldTypeRequiredDescription
multipliernumberYesApplied multiplier based on NFT holdings
scorenumberYesFinal calculated score (rawGamePoint × multiplier)

Usage Example

const response = await fetch("https://api.intraverse.io/api/v2/tournament/tournament-123/calculateScore", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
rawGamePoint: 1500,
drops: [
{
dropId: "drop-123",
counts: [5, 2, 1], // 5 common, 2 rare, 1 legendary
},
],
}),
});

const result = await response.json();

console.log(`Applied multiplier: ${result.multiplier}`);
console.log(`Final score: ${result.score}`);
// Example: 1500 × 2.5 = 3750

Error Responses

{
"message": "Tournament not found",
"status": 404
}

Next Steps