import request from '../request';
import {getHeaders} from './index'
// 合约交易

// 持有列表
export const ContractUserList = () => {
    return request.get('/admin-api/api/contract/assets', {
        headers: getHeaders(),
    });
}

// 持有仓位
export const ContractHoldingPosition = (data: any) => {
    return request.get('/admin-api/api/contract/position', {
        params: data,
        headers: getHeaders(),
    });
}

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

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

// 平仓
export const ContractClosePosition = (data: any) => {
    return request.post('/admin-api/api/contract/close', data, {
        headers: getHeaders(),
    });
}

// 合约辅助
export const ContractAssist = () => {
    return request.get('/admin-api/api/helper/contracts', {
        headers: getHeaders(),
    });
}

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

// 批量操作(发起交易)
export const ContractBatchOperation = (data: any) => {
    return request.post('/admin-api/api/contract/operation', data, {
        headers: getHeaders(),
    })
}

// 撤销委托
export const onContractRevoke = (data: any) => {
    return request.post('/admin-api/api/contract/cancel', data, {
        headers: getHeaders(),
    })
}
