openclaw-glance-plugin 0.1.2 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-glance-plugin",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "OpenClaw plugin client for ticker-monitor openclaw-bridge",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -141,6 +141,10 @@ export class OpenClawBridgeClient extends EventEmitter {
141
141
  return this._request('ping', {});
142
142
  }
143
143
 
144
+ async queryTickerData(payload) {
145
+ return this._request('ticker.query', payload || {});
146
+ }
147
+
144
148
  async waitUntilConnected(timeoutMs = this.waitConnectTimeoutMs) {
145
149
  if (this.connected && this.ws && this.ws.readyState === WebSocket.OPEN) {
146
150
  return true;
@@ -94,6 +94,10 @@ export class OpenClawPluginAdapter {
94
94
  channelConfigs.call = demand.callConfig;
95
95
  if (!channels.includes('call')) channels.push('call');
96
96
  }
97
+ if (demand.smsConfig) {
98
+ channelConfigs.sms = demand.smsConfig;
99
+ if (!channels.includes('sms')) channels.push('sms');
100
+ }
97
101
  if (!channels.includes('openclaw')) channels.unshift('openclaw');
98
102
  if (!channelConfigs.openclaw) channelConfigs.openclaw = {};
99
103
 
@@ -112,6 +116,25 @@ export class OpenClawPluginAdapter {
112
116
  return this.client.createWatch(payload);
113
117
  }
114
118
 
119
+ /**
120
+ * 查询标的实时行情(透传到 bridge 的 ticker.query)。
121
+ */
122
+ async queryTickerData(query) {
123
+ const stockCode = query?.stockCode || query?.productCode || query?.stock_code || '';
124
+ const productType = query?.productType || query?.product_type || '';
125
+ let market = query?.market;
126
+
127
+ if (market == null && String(productType).toLowerCase() === 'crypto') {
128
+ market = '';
129
+ }
130
+
131
+ return this.client.queryTickerData({
132
+ stock_code: stockCode,
133
+ market: market == null ? '' : String(market),
134
+ product_type: productType
135
+ });
136
+ }
137
+
115
138
  async pause(strategyId) {
116
139
  return this.client.pauseWatch(strategyId);
117
140
  }