index.ts 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import {
  2. DeliveryOrderReq,
  3. HdWRDealOrderReq,
  4. HdWROrderReq, HolderCloseReq, PaymentArrearsReq, TradeHoldTransferApplyAuditReqType, TradeHoldTransferApplyReq, WarehouseRepurchaseReq, WrBargainApplyReq, WRListingCancelOrderReq, WROutApplyCancelReq,
  5. WROutApplyReq, WROutCancelReq, WROutConfirmReq, WRTradeFinanceBuyCancelReq
  6. } from "@/services/proto/warehousetrade/interface";
  7. import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
  8. import { HeadEnum } from "@/services/socket/protobuf/protoHeader";
  9. /**
  10. * 持仓单挂牌请求
  11. * @param param
  12. */
  13. export const hdWROrder = (param: HdWROrderReq): Promise<any> => {
  14. return protoMiddleware<HdWROrderReq>(param, 'HdWROrderReq', 'HdWROrderRsp', HeadEnum.tradeMode17)
  15. }
  16. /**
  17. * 持仓单摘牌请求
  18. *
  19. * @param param
  20. * @constructor
  21. */
  22. export const HdWRDealOrder = (param: HdWRDealOrderReq): Promise<any> => {
  23. return protoMiddleware<HdWRDealOrderReq>(param, 'HdWRDealOrderReq', 'HdWRDealOrderRsp', HeadEnum.tradeMode17)
  24. }
  25. /**
  26. * 议价摘牌请求
  27. *
  28. * @param param
  29. * @constructor
  30. */
  31. export const wrBargainApply = (param: WrBargainApplyReq): Promise<any> => {
  32. return protoMiddleware<WrBargainApplyReq>(param, 'WrBargainApplyReq', 'WrBargainApplyRsp', HeadEnum.tradeMode17)
  33. }
  34. /**
  35. * 出入库请求
  36. * @param param
  37. */
  38. export const wROutApply = (param: WROutApplyReq): Promise<any> => {
  39. return protoMiddleware<WROutApplyReq>(param, 'WROutApplyReq', 'WROutApplyRsp', HeadEnum.tradeMode17)
  40. }
  41. /**
  42. * 挂牌撤单请求
  43. * @param param
  44. */
  45. export const wRListingCancelOrder = (param: WRListingCancelOrderReq): Promise<any> => {
  46. return protoMiddleware<WRListingCancelOrderReq>(param, 'WRListingCancelOrderReq', 'WRListingCancelOrderRsp', HeadEnum.tradeMode17)
  47. }
  48. // 融资相关
  49. /**
  50. * 仓单回购请求
  51. * @param param
  52. */
  53. export const WarehouseRepurchase = (param: WarehouseRepurchaseReq): Promise<any> => {
  54. return protoMiddleware<WarehouseRepurchaseReq>(param, 'WarehouseRepurchaseReq', 'WarehouseRepurchaseRsp', HeadEnum.MarketID45201)
  55. }
  56. /**
  57. * 支付欠款请求
  58. * @param param
  59. */
  60. export const PaymentArrears = (param: PaymentArrearsReq): Promise<any> => {
  61. return protoMiddleware<PaymentArrearsReq>(param, 'PaymentArrearsReq', 'PaymentArrearsRsp', HeadEnum.MarketID45201)
  62. }
  63. /**
  64. * 挂牌撤单请求
  65. * @param param
  66. */
  67. export const WRTradeFinanceBuyCancel = (param: WRTradeFinanceBuyCancelReq): Promise<any> => {
  68. return protoMiddleware<WRTradeFinanceBuyCancelReq>(param, 'WRTradeFinanceBuyCancelReq', 'WRTradeFinanceBuyCancelRsp', HeadEnum.tradeMode17)
  69. }
  70. /**
  71. * 仓单出入库注销请求
  72. * @deprecated 该接口废弃
  73. * @param param
  74. */
  75. export const WROutApplyCancel = (param: WROutApplyCancelReq): Promise<any> => {
  76. return protoMiddleware<WROutApplyCancelReq>(param, 'WROutApplyCancelReq', 'WROutApplyCancelRsp', HeadEnum.tradeMode17)
  77. }
  78. /**
  79. * 仓单出库确认请求
  80. * @param param
  81. * @constructor
  82. */
  83. export const WROutConfirm = (param: WROutConfirmReq): Promise<any> => {
  84. return protoMiddleware<WROutConfirmReq>(param, 'WROutConfirmReq', 'WROutConfirmRsp', HeadEnum.tradeMode17)
  85. }
  86. /**
  87. * 仓单出库撤回请求
  88. * @param param
  89. * @constructor
  90. */
  91. export const WROutCancel = (param: WROutCancelReq): Promise<any> => {
  92. return protoMiddleware<WROutCancelReq>(param, 'WROutCancelReq', 'WROutCancelRsp', HeadEnum.tradeMode17)
  93. }
  94. /**
  95. * 交割申报请求 0 6 1 (交收)
  96. * @param param
  97. * @constructor
  98. */
  99. export const DeliveryOrder = (param: DeliveryOrderReq): Promise<any> => {
  100. return protoMiddleware<DeliveryOrderReq>(param, 'DeliveryOrderReq', 'DeliveryOrderRsp', HeadEnum.tradeMode17)
  101. }
  102. /**
  103. * 单协议平仓
  104. * @param param
  105. * @constructor
  106. */
  107. export const tradeHoldTransferApply = (param: TradeHoldTransferApplyReq): Promise<any> => {
  108. return protoMiddleware<TradeHoldTransferApplyReq>(param, 'TradeHoldTransferApplyReq', 'TradeHoldTransferApplyRsp', HeadEnum.tradeMode17)
  109. }
  110. /**
  111. * 单协议平仓
  112. * @param param
  113. * @constructor
  114. */
  115. export const tradeHoldTransferApplyAuditReq = (param: TradeHoldTransferApplyAuditReqType): Promise<any> => {
  116. return protoMiddleware<TradeHoldTransferApplyAuditReqType>(param, 'TradeHoldTransferApplyAuditReq', 'TradeHoldTransferApplyAuditRsp', HeadEnum.tradeMode17)
  117. }
  118. /**
  119. * 按单平仓
  120. * @param param
  121. * @constructor
  122. */
  123. export const holderClose = (param: HolderCloseReq): Promise<any> => {
  124. return protoMiddleware(param, 'HolderCloseReq', 'HolderCloseRsp', HeadEnum.tradeMode46)
  125. }
  126. // /**
  127. // * 议价申请拒绝请求
  128. // * @param param
  129. // * @constructor
  130. // */
  131. // export const WrBargainNoAgree = (param: WrBargainNoAgreeReq): Promise<any> =>{
  132. // return protoMiddleware<WrBargainNoAgreeReq>(param, 'WrBargainNoAgreeReq', 'WrBargainNoAgreeRsp', HeadEnum.tradeMode17)
  133. // }