| | |
| | | */ |
| | | @Slf4j |
| | | public class LoginWs { |
| | | public static void websocketLogin(WebSocketClient webSocketClient) { |
| | | public static void websocketLogin(WebSocketClient webSocketClient, ExchangeInfoEnum account) { |
| | | |
| | | log.info("开始执行LoginWs......"); |
| | | // log.info("开始执行LoginWs......"); |
| | | try { |
| | | |
| | | JSONArray argsArray = new JSONArray(); |
| | | JSONObject loginArgs = new JSONObject(); |
| | | // 获取登录凭证信息(需要从配置或Redis中获取) |
| | | String apiKey = ExchangeInfoEnum.OKX_UAT.getApiKey(); |
| | | String passphrase = ExchangeInfoEnum.OKX_UAT.getPassphrase(); |
| | | String apiKey = account.getApiKey(); |
| | | String passphrase = account.getPassphrase(); |
| | | String timestamp = String.valueOf(System.currentTimeMillis() /1000); |
| | | String sign = SignUtils.signWebsocket(timestamp, ExchangeInfoEnum.OKX_UAT.getSecretKey()); |
| | | String sign = SignUtils.signWebsocket(timestamp, account.getSecretKey()); |
| | | |
| | | loginArgs.put("apiKey", apiKey); |
| | | loginArgs.put("passphrase", passphrase); |