import request from '../request';
import {getHeaders} from './index';

// 获取用户列表
export const SpotUserList = () => {
    return request.get('/admin-api/api/spot/assets', {
        headers: getHeaders(),
    });
}

// 现货辅助列表
export const SpotAssist = () => {
    return request.get('/admin-api/api/helper/spots', {
        headers: getHeaders(),
    });
}

// 持有资产(仓位)
export const SpotAssets = (data: any) => {
    return request.get('/admin-api/api/spot/assets', {
        params: data,
        headers: getHeaders(),
    });
}

// 获取交易策略
export const SpotStrategy = () => {
    return request.get('/admin-api/api/spot/strategy', {
        headers: getHeaders(),
    });
}

// 批量操作，开始交易
export const SpotBatchOperation = (data: any) => {
    return request.post('/admin-api/api/spot/operation', data, {
        headers: getHeaders(),
    });
}

// 获取当前委托
export const SpotCurrentEntrustment = (data: any) => {
    return request.get('/admin-api/api/spot/entrust', {
        params: data,
        headers: getHeaders(),
    });
}

// 撤销
export const SpotCancel = (data: any) => {
    return request.post('/admin-api/api/spot/cancel', data, {
        headers: getHeaders(),
    });
}

// 历史成交
export const SpotHistoryTransaction = (data: any) => {
    return request.get('/admin-api/api/spot/history', {
        params: data,
        headers: getHeaders(),
    });
}
