import request from '../utils/request'

//创建订单及订单详情
export function addOrders(data) {
  return request({
    url: `/lease/order/info/addOrders`,
    method: 'post',
    data
  })
}


//取消订单
export function cancelOrder(data) {
  return request({
    url: `/lease/order/info/cancelOrder`,
    method: 'post',
    data
  })
}


//根据订单id查询订单信息
export function getOrdersByIds(data) {
  return request({
    url: `/lease/order/info/getOrdersByIds`,
    method: 'post',
    data
  })
}


//查询订单列表（买家侧）
export function getOrdersByStatus(data) {
  return request({
    url: `/lease/order/info/getOrdersByStatus`,
    method: 'post',
    data
  })
}

//查询订单列表（卖家侧）
export function getOrdersByStatusForSeller(data) {
  return request({
    url: `/lease/order/info/getOrdersByStatusForSeller`,
    method: 'post',
    data
  })
}


//结算前链和币种查询
export function getChainAndListForSeller(data) {
  return request({
    url: `/lease/shop/getChainAndListForSeller`,
    method: 'post',
    data
  })
}

//获取实时币价
export function getCoinPrice(data) {
  return request({
    url: `/lease/order/info/getCoinPrice`,
    method: 'post',
    data
  })
}


//获取支持的算法币种
export function getMachineSupportCoinAndAlgorithm(data) {
  return request({
    url: `/lease/v2/order/info/getMachineSupportCoinAndAlgorithm`,
    method: 'post',
    data
  })
}

//获取支持的矿池 和模型
export function getMachineSupportPool(data) {
  return request({
    url: `/lease/v2/order/info/getMachineSupportPool`,
    method: 'post',
    data
  })
}


//创建订单
export function addOrdersV2(data) {
  return request({
    url: `/lease/v2/order/info/addOrdersV2`,
    method: 'post',
    data
  })
}




//已购矿机配置
export function getPurchasedItems(data) {
  return request({
    url: `/lease/v2/order/info/getPurchasedItems`,
    method: 'post',
    data
  })
}

//已购商品详情
export function getPurchasedInfoV2(data) {
  return request({
    url: `/lease/v2/order/info/getPurchasedInfo`,
    method: 'post',
    data
  })
}






