| | |
| | | // 合约接口 |
| | | import request from "@/request"; |
| | | import { httpJson,httpMultipart } from "@/request/http"; |
| | | import { httpJson, httpMultipart } from "@/request/http"; |
| | | |
| | | // 止盈止损 |
| | | export const _getzyzs = (params) => { |
| | | return request({ |
| | | url: "/api/contractApplyOrder!stopProfitAndLoss.action", |
| | | method: "GET", |
| | | params: { |
| | | order_no: params.order_no, |
| | | stop_price_profit: params.stop_price_profit, |
| | | stop_price_loss: params.stop_price_loss, |
| | | }, |
| | | // isLoading: true |
| | | }); |
| | | return request({ |
| | | url: "/api/contractApplyOrder!stopProfitAndLoss.action", |
| | | method: "GET", |
| | | params: { |
| | | order_no: params.order_no, |
| | | stop_price_profit: params.stop_price_profit, |
| | | stop_price_loss: params.stop_price_loss, |
| | | }, |
| | | // isLoading: true |
| | | }); |
| | | }; |
| | | // 获取可用余额 |
| | | // 获取可用余额 |
| | | export const _getBalance = () => { |
| | | return request({ |
| | | url: "/api/wallet!getUsdt.action", |
| | |
| | | /** ============================= 永续合约委托 =======================*/ |
| | | |
| | | // 开仓初始化参数 |
| | | export const _initOpen = (symbol) => { |
| | | export const _initOpen = (symbol) => { |
| | | return request({ |
| | | url: '/api/contractApplyOrder!openview.action', |
| | | method: 'GET', |
| | |
| | | } |
| | | |
| | | // 平仓初始化参数 |
| | | export const _initClose = (symbol) => { |
| | | export const _initClose = (symbol) => { |
| | | return request({ |
| | | url: '/api/contractApplyOrder!closeview.action', |
| | | method: 'GET', |
| | |
| | | params: { |
| | | symbol: params.symbol, |
| | | session_token: params.session_token, |
| | | stop_price_profit:stop_price_profit, |
| | | stop_price_loss:stop_price_profit, |
| | | stop_price_profit: stop_price_profit, |
| | | stop_price_loss: stop_price_profit, |
| | | direction: params.direction || 'buy', // buy, sell |
| | | amount: params.amount, // 数量 |
| | | price_type: params.price_type || 'opponent', // limit - 限价,opponent - 市价 |
| | |
| | | /** 当前委托 */ |
| | | |
| | | // 当前委托列表 |
| | | export const _orderListCur = (symbol, type = 'orders', page_no = 1) => { |
| | | export const _orderListCur = (symbol, type = 'orders', page_no = 1) => { |
| | | return request({ |
| | | url: '/api/contractApplyOrder!list.action', |
| | | method: 'GET', |
| | | params: { |
| | | symbol, |
| | | // symbol, |
| | | type, |
| | | page_no |
| | | } |
| | |
| | | url: '/api/contractOrder!list.action', |
| | | method: 'GET', |
| | | params: { |
| | | symbol, |
| | | // symbol, |
| | | type, |
| | | page_no |
| | | } |