| 1234567891011121314151617181920212223242526272829303132333435 |
- import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
- import APP from "@/services";
- import {Callback} from "@/utils/websocket";
- import {ErmcpContractOperateApplyReq} from "@/services/proto/contract/interface";
- /**
- * 合同
- * @param param
- */
- export const operationContractReq = (param: ErmcpContractOperateApplyReq): Promise<any> => {
- return new Promise((resolve, reject) => {
- const params = {
- protobufName: 'ContractOperateApplyReq',
- funCodeName: 'ContractOperateApplyReq',
- reqParams: param,
- msgHeadParams: {
- AccountID: param.accountid,
- MarketID: 18,
- GoodsID: 0,
- }
- };
- const package50 = buildProtoReq50(params);
- APP.sendTradingServer(package50, undefined, {
- onSuccess: (res) => {
- const { isSuccess, result } = parseProtoRsp50(res, 'ContractOperateApplyRsp');
- if (isSuccess) {
- resolve(result);
- } else {
- reject(result);
- }
- },
- onFail: (err) => reject(err.message),
- } as Callback);
- });
- }
|