Mint Badge

Mint a new badge to a recipient

Mints a new badge to a specified recipient address with associated metadata.

Endpoint: /game/badge/mint Method: POST

{
    slugs: string[];           // Array of badge slugs
    plyrIds: string[];      // Array of recipient PLYR[ID]
}

The `slugs`, and `plyrIds` arrays must have the same length. Each index represents a mint operation.

Example Usage

// Setup request parameters
const timestamp = Date.now().toString();
const body = {
    slugs: ['slugA'], // Badge slugs
    plyrIds: ['fennec'], // Recipient PLYR[ID]
};

// Generate HMAC signature
const hmac = generateHmacSignature(timestamp, body, secretKey);

// Make the API request
const response = await axios.post(apiEndpoint + '/game/badge/mint', body, {
    headers: {
        apikey: apiKey,
        signature: hmac,
        timestamp: timestamp
    }
});

// Process the response
console.log('Mint Task ID:', response.data.taskId);
console.log('Transaction Hash:', response.data.hash);
console.log('Token ID:', response.data.data.tokenId);

Last updated