import request from "@/utils/request";

// 登录接口
export function login(data) {
  return request({
    url: "/custom/login/",
    method: "post",
    data,
  });
}

// 获取币币
export function GetCoins() {
  return request({
    url: "/finance/trading_pair/get_display_coin/",
    method: "get",
  });
}

//获取K线
export function GetCandlestickChart(id) {
  return request({
    url: `/finance/trading_pair/${id?.symbol}/get_kline/`,
    method: "get",
    params: {
      interval: id.period,
      limit: 150,
      end_time: id.to || undefined,
    },
  });
}

//交易对
export function TradingPair(id) {
  return request({
    url: `/finance/trading_pair/`,
    method: "get",
    params: {
      pageSize: id.pageSize,
      pageNum: id.pageNum,
    },
  });
}

// 获取理财产品
export function GetWealthProducts(params) {
  return request({
    url: "/wealth/products/",
    method: "get",
    params,
  });
}

// 获取理财产品单条信息
export function GetWealthProductsDetails(params) {
  return request({
    url: "/wealth/products/",
    method: "get",
    params,
  });
}

// 理财下单
export function wealthSubmitOrder(data) {
  return request({
    url: "/wealth/products/submit_order/",
    method: "post",
    data,
  });
}

// 理财列表
export function GetWealthOrderList() {
  return request({
    url: "/wealth/order/get_order_list/",
    method: "get",
  });
}

// 获取余额
export function GetUsdtBalance() {
  return request({
    url: "/custom/custom/get_usdt_balance/",
    method: "get",
  });
}

// ICO
export function GetIcoIco() {
  return request({
    url: "/ico/ico/",
    method: "get",
  });
}

// ICO规则
export function GetIcoDesc() {
  return request({
    url: "/ico/ico/get_ico_desc/",
    method: "get",
  });
}
