| | |
| | | long timeSec = System.currentTimeMillis() / 1000; |
| | | JSONObject msg = buildAuthRequest("subscribe", buildUid(), timeSec); |
| | | ws.send(msg.toJSONString()); |
| | | log.info("[{}] subscribed, contract:{}", channelName, contract); |
| | | log.info("[{}] 订阅成功, 合约:{}", channelName, contract); |
| | | } |
| | | |
| | | /** |
| | |
| | | auth.put("SIGN", hs512Sign("unsubscribe", timeSec)); |
| | | msg.put("auth", auth); |
| | | ws.send(msg.toJSONString()); |
| | | log.info("[{}] unsubscribed, contract:{}", channelName, contract); |
| | | log.info("[{}] 取消订阅成功, 合约:{}", channelName, contract); |
| | | } |
| | | |
| | | protected GateGridTradeService getGridTradeService() { return gridTradeService; } |
| | |
| | | } |
| | | return hex.toString(); |
| | | } catch (Exception e) { |
| | | log.error("[{}] sign fail", channelName, e); |
| | | log.error("[{}] 签名计算失败", channelName, e); |
| | | return ""; |
| | | } |
| | | } |