Create NFT
Create a new NFT contract
Creates a new NFT contract with the specified name, symbol, and optional image.
Endpoint: /game/nft/create
Method: POST
{
name: string; // The name of the NFT contract
symbol: string; // The symbol for the NFT contract
chainId?: string; // Optional chain ID
image?: string; // Optional URL to the collection image
}
{
taskId: string;
data: {
nft: string; // The contract address of the created NFT
}
status: string;
}
{
error: string;
details?: any;
}
Example Usage
// Setup request parameters
const timestamp = Date.now().toString();
const body = {
name: 'My Game Items',
symbol: 'GITM',
chainId: '43114', // Avalanche C-Chain
image: 'https://google.com' // Optional image URL
};
// Generate HMAC signature
const hmac = generateHmacSignature(timestamp, body, secretKey);
// Make the API request
const response = await axios.post(apiEndpoint + '/game/nft/create', body, {
headers: {
apikey: apiKey,
signature: hmac,
timestamp: timestamp
}
});
// Process the response
console.log('NFT Creation Task ID:', response.data.taskId);
console.log('Created NFT Contract Address:', response.data.data.nft);
Last updated