udxcms 1.0.48 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/connect.d.ts +1 -0
- package/dist/utils/connect.js +5 -3
- package/package.json +1 -1
package/dist/utils/connect.d.ts
CHANGED
package/dist/utils/connect.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author:
|
|
5
5
|
* @Date: 2021-04-07 14:59:35
|
|
6
6
|
* @LastEditors: lewis lewis@everylink.ai
|
|
7
|
-
* @LastEditTime: 2025-
|
|
7
|
+
* @LastEditTime: 2025-12-20 10:44:11
|
|
8
8
|
*/
|
|
9
9
|
import SockJs from 'sockjs-client';
|
|
10
10
|
import Stomp from 'webstomp-client';
|
|
@@ -49,6 +49,7 @@ export class ConnectSocketTool {
|
|
|
49
49
|
const socket = new SockJs(webSocketUrl);
|
|
50
50
|
return Stomp.over(socket, options);
|
|
51
51
|
};
|
|
52
|
+
this.connectWsType = type;
|
|
52
53
|
if (connectTemp.chainId && connectTemp.chainId != chainId || type) {
|
|
53
54
|
this.chainId = chainId || getTradeDefaultChainId();
|
|
54
55
|
this.close();
|
|
@@ -80,8 +81,9 @@ export class ConnectSocketTool {
|
|
|
80
81
|
connectTemp.conncetedStr = 'connecting';
|
|
81
82
|
let apiType = connectType === "market_ws" ? "ws" : "api";
|
|
82
83
|
let base_url = site_config && getMarketApi(this.chainId, connectType, apiType) || '';
|
|
83
|
-
if (((_b = (_a = store === null || store === void 0 ? void 0 : store.state) === null || _a === void 0 ? void 0 : _a.trade) === null || _b === void 0 ? void 0 : _b.tradeMode) == 'perpetual') {
|
|
84
|
+
if (((_b = (_a = store === null || store === void 0 ? void 0 : store.state) === null || _a === void 0 ? void 0 : _a.trade) === null || _b === void 0 ? void 0 : _b.tradeMode) == 'perpetual' || this.connectWsType == 'perpetual') {
|
|
84
85
|
base_url = getMarketApi(this.chainId, 'perpetual', apiType);
|
|
86
|
+
console.log('perpetual base_url:', base_url);
|
|
85
87
|
// 永续暂时不支持聚合
|
|
86
88
|
if (!base_url) {
|
|
87
89
|
base_url = getMarketApi((_c = store === null || store === void 0 ? void 0 : store.state) === null || _c === void 0 ? void 0 : _c.chainId, 'perpetual', apiType);
|
|
@@ -106,7 +108,7 @@ export class ConnectSocketTool {
|
|
|
106
108
|
// }
|
|
107
109
|
// }
|
|
108
110
|
// ws_url = "https://ws.powx.io/market-ws/";
|
|
109
|
-
console.log("
|
|
111
|
+
console.log("cms_ws_url:", ws_url);
|
|
110
112
|
var options = { debug: false, protocols: Stomp.VERSIONS.supportedProtocols(), heartbeat: { outgoing: 20000, incoming: 10000 } };
|
|
111
113
|
let stompClient = this.getStompClient(ws_url, options);
|
|
112
114
|
console.log("stompClient:", stompClient);
|