Mint Badge
Mint a new badge to a recipient
Endpoint: /game/badge/mint
Method: POST
{
slugs: string[]; // Array of badge slugs
plyrIds: string[]; // Array of recipient PLYR[ID]
}
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