import { ChannelOrderReq, ChannelOrderRsp } from "./interface";
import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
import { getLoginData } from '@/services/bus/login'

/**
 * 期货交易委托请求
 * @param param
 */
export const channelOrderReq = (param: ChannelOrderReq): Promise<ChannelOrderRsp> => {
    return protoMiddleware<ChannelOrderReq>(param, 'ChannelOrderReq', 'ChannelOrderRsp', {
        AccountID: param.AccountID,
        AccountID2: getLoginData().ClientID,
        MarketID: param.MarketID,
        GoodsID: param.MarketID,
    })
}