@dshtrading/connector-binance 0.6.0 → 0.6.2
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/lib/dataplane.d.ts +2 -2
- package/lib/dataplane.js +5 -3
- package/package.json +5 -5
package/lib/dataplane.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { Config } from "./index.js";
|
|
|
2
2
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
3
|
//#region src/dataplane.d.ts
|
|
4
4
|
declare const inject: string[];
|
|
5
|
-
declare function apply(ctx: Context, config
|
|
5
|
+
declare function apply(ctx: Context, config?: Config): void;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { apply, inject };
|
|
7
|
+
export { Config, apply, inject };
|
package/lib/dataplane.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { BinanceMarketDataService, ROUTER_PROVIDER, TRADING_CRYPTO_MARKET_DATA_KEY, routeAllows } from "./index.js";
|
|
1
|
+
import { BinanceMarketDataService, Config, ROUTER_PROVIDER, TRADING_CRYPTO_MARKET_DATA_KEY, routeAllows } from "./index.js";
|
|
2
2
|
//#region src/dataplane.ts
|
|
3
3
|
const inject = [];
|
|
4
|
+
/** schema 的运行时可调用形态(校验即补默认值);手工构造 ctx 不传 config 时按 schema 默认值处理。 */
|
|
5
|
+
const withDefaults = (value) => Config(value);
|
|
4
6
|
/** 解析注册表服务;老部署(base/router 未升级)返回 undefined → 调用方回退旧的直接 provide 路径。 */
|
|
5
7
|
function resolveMarketDataRegistry(ctx) {
|
|
6
8
|
const candidate = ctx.get?.("tradingMarketDataRegistry", false);
|
|
7
9
|
return candidate !== void 0 ? candidate : void 0;
|
|
8
10
|
}
|
|
9
|
-
function apply(ctx, config) {
|
|
11
|
+
function apply(ctx, config = withDefaults(void 0)) {
|
|
10
12
|
if (!config.enabled) return;
|
|
11
13
|
const registry = resolveMarketDataRegistry(ctx);
|
|
12
14
|
if (registry === void 0) {
|
|
@@ -19,4 +21,4 @@ function apply(ctx, config) {
|
|
|
19
21
|
ctx.effect(() => registry.register("crypto", ROUTER_PROVIDER, service));
|
|
20
22
|
}
|
|
21
23
|
//#endregion
|
|
22
|
-
export { apply, inject };
|
|
24
|
+
export { Config, apply, inject };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dshtrading/connector-binance",
|
|
3
3
|
"description": "Binance market connector plugin for dsh-trading: public market data over REST+WS implementing the @dshtrading/api contracts",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@dshtrading/authority": "^0.6.
|
|
25
|
-
"@dshtrading/indicators": "^0.6.
|
|
26
|
-
"@dshtrading/api": "^0.6.
|
|
24
|
+
"@dshtrading/authority": "^0.6.2",
|
|
25
|
+
"@dshtrading/indicators": "^0.6.2",
|
|
26
|
+
"@dshtrading/api": "^0.6.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@deepseek-ai/cordis": ">=4.0.0",
|
|
30
|
-
"@deepseek-ai/dsh-tools": ">=0.2.
|
|
30
|
+
"@deepseek-ai/dsh-tools": ">=0.2.1-rc.2",
|
|
31
31
|
"@deepseek-ai/schemastery": ">=3.18.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|