!7 lib 1400586 // BitGet Java SDK import com.bitget.openapi.ws.*; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.bitget.openapi.dto.request.ws.SubscribeReq; import org.junit.Before; import org.junit.Test; public static final String PUSH_URL = "wss://ws.bitget.com/mix/v1/stream"; public static final String API_KEY = ""; public static final String SECRET_KEY = ""; public static final String PASS_PHRASE = ""; p { BitgetWsClient client = BitgetWsHandle.builder() .pushUrl(PUSH_URL) .apiKey(API_KEY) .secretKey(SECRET_KEY) .passPhrase(PASS_PHRASE) .isLogin(true) //???????????????????????channel???? .listener(response -> { JSONObject json = JSONObject.parseObject(response); System.out.println("def:" + json); //?????????,?:???? }).errorListener(response -> { JSONObject json = JSONObject.parseObject(response); System.out.println("error:" + json); }).build(); List list = new ArrayList() {{ add(SubscribeReq.builder().instType("mc").channel("ticker").instId("BTCUSD").build()); add(SubscribeReq.builder().instType("SP").channel("candle1W").instId("BTCUSDT").build()); }}; client.subscribe(list); List list2 = new ArrayList() {{ add(SubscribeReq.builder().instType("UMCBL").channel("account").instId("default").build()); }}; client.subscribe(list2, response -> { JSONObject json = JSONObject.parseObject(response); System.out.println("appoint:" + json); }); }