import request from '@/utils/request';

/**
 * 获取NFT合约列表
 * @param {object} params
 * @returns {array} data
 *    name 游戏币名称
 *    type 游戏币类型
 *    usdt_price 游戏货币与usdt的比例
 *    eth_price 游戏货币与eth的比例
 */
export const getNFTContractList = () => {
  return request.request({
    url: '/erc721/get',
    method: 'get',
  });
};

/**
 * 创建NFT合约
 * @param {object} data
 *
 * @returns {array} data
 */
export const createNFTContract = (data) => {
  return request.request({
    url: '/erc721/create',
    method: 'post',
    data,
  });
};

/**
 * 查询token_Id是否存在
 * @param {object} params
 *
 * @returns {array} data
 */
export const checkTokenId = (params) => {
  return request.request({
    url: '/nft/check',
    method: 'get',
    params,
  });
};

/**
 * 获取NFT列表
 * @param {object} params
 *
 * @returns {array} data
 */
export const getNFTList = (params) => {
  return request.request({
    url: '/nft/get',
    method: 'get',
    params,
  });
};

/**
 * mintNFT
 * @param {object} data
 *
 * @returns {array} data
 */
export const mintNFT = (data) => {
  return request.request({
    url: '/nft/create',
    method: 'post',
    data,
  });
};

/**
 * 更新NFT信息
 * @param {object} data
 *
 * @returns {array} data
 */
export const updateNFTInfo = (data) => {
  return request.request({
    url: '/nft/update',
    method: 'post',
    data,
  });
};
