const axios = require('axios').default;
const HOST = 'cardano-testnet.tangocrypto.com';
const APP_ID = '34492bb302cf4678a3a0ec93029c5bh67';
const API_KEY = '8888c8026e7i47b4b2527151e126e914';
axios.defaults.baseURL = `https://${HOST}/${APP_ID}/v1`;
axios.defaults.headers.common['x-api-key'] = API_KEY;
axios.defaults.headers.post['Content-Type'] = 'application/json';
"name": "Tango Collection",
"description": "Tango collection description",
"url": "https://www.tangocrypto.com",
"payout_address": "addr_test1qp9mj7vnenx4v99hw7ztfq03n7dmmujpgtlyfjhhel9w67nk72usllcew208n60ym94xcptfrgytuy5apwp565x28jgsg0ztq3",
"lock_time": "2023-02-24"
"asset_name": "<asset_name>",
"media_type": "<mime_type>",
"description": "<description>",
"right_eye": "<right_eye>",
"left_eye": "<left_eye>",
"collection": "Faces Collection",
"twitter": "https://twitter.com/tango_crypto",
"copyright": "Tangocrypto 2022"
"description": "Faces collection",
"md5checksum": "b58e62a83802b2bf0792a4e983dd2ff3cf9e0c1e"
"name": "Attribute color",
"name": "Attribute left eye",
"name": "Attribute right eye",
"name": "Attribute mouth",
"image": "iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAABCRB0AEiAAECDoAJEDQ...A0ACBB0AEiDoAJAAQQeABPQu/W2h2FEAAMuy8PeE90ZE/PmXzxU5FgCgCT0R8f8BA0CEYwSaYAIAAAAASUVORK5CYII="
"description": "Faces collection",
"md5checksum": "bee6ddb26d7d9b5f7dccba997ec575d272d6981f"
"name": "Attribute color",
"name": "Attribute left eye",
"name": "Attribute right eye",
"name": "Attribute mouth",
"image": "iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KA.....IQdABIQNABIAFBB4AEBB0AEhB0AEhA0AEgAUEHgAR2tP/0YX/PAgDYkg8/SviOiIjVC0/381wAgC5si4j/D9xXpnG0bKuAAAAAAElFTkSuQmCC"
async function getCollection() {
const response = await axios.get('/nft/collections');
console.log(response.data);
async function createCollection(collection) {
const response = await axios.post('/nft/collections', JSON.stringify(collection));
console.log(response.data);
async function createTokens(collectionId, tokens) {
const response = await axios.post(`/nft/collections/${collectionId}/tokens`, JSON.stringify(tokens));
console.log(response.data);
async function createSalePhase(collectionId, salePhase) {
console.log("Create collection");
const response = await axios.post(`/nft/collections/${collectionId}/phases`, JSON.stringify(salePhase));
let collectionId = await createCollection(collection);
let tokens = await createTokens(collectionId, tokensArr);
let phase = await createSalePhase(collectionId, salePhase);