@tradejs/connectors 3.1.0 → 3.1.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/README.md CHANGED
@@ -43,3 +43,5 @@ export default defineConfig({
43
43
  ## For Custom Connectors
44
44
 
45
45
  Use `defineConnectorPlugin(...)` from `@tradejs/core/config` in your own package and add that package to `connectors` in `tradejs.config.ts`.
46
+
47
+ Keywords: ai, claude, codex.
package/dist/index.js CHANGED
@@ -75,6 +75,14 @@ var decorateConnectorKline = (runtime, options) => runtime?.createCachedKline(op
75
75
 
76
76
  // src/ByBit/client.ts
77
77
  var PRIVATE_RECV_WINDOW_MS = 1e4;
78
+ var getApiRegion = () => {
79
+ const apiRegion = process.env.TRADEJS_BYBIT_API_REGION?.trim();
80
+ return apiRegion ? apiRegion : void 0;
81
+ };
82
+ var getApiRegionOptions = () => {
83
+ const apiRegion = getApiRegion();
84
+ return apiRegion ? { apiRegion } : {};
85
+ };
78
86
  var getClient = async (config, access = "private", runtime) => {
79
87
  const logger = getConnectorLogger(runtime);
80
88
  const resolveTradingAccount = getConnectorAccountResolver(runtime);
@@ -87,6 +95,7 @@ var getClient = async (config, access = "private", runtime) => {
87
95
  const useTestnet = account?.environment === "testnet";
88
96
  if (access === "public") {
89
97
  return new import_bybit_api.RestClientV5({
98
+ ...getApiRegionOptions(),
90
99
  parseAPIRateLimits: true,
91
100
  testnet: useTestnet
92
101
  });
@@ -105,6 +114,7 @@ var getClient = async (config, access = "private", runtime) => {
105
114
  return null;
106
115
  }
107
116
  const client = new import_bybit_api.RestClientV5({
117
+ ...getApiRegionOptions(),
108
118
  key: account.apiKey,
109
119
  secret: account.apiSecret,
110
120
  parseAPIRateLimits: true,
package/dist/index.mjs CHANGED
@@ -25,6 +25,14 @@ var decorateConnectorKline = (runtime, options) => runtime?.createCachedKline(op
25
25
 
26
26
  // src/ByBit/client.ts
27
27
  var PRIVATE_RECV_WINDOW_MS = 1e4;
28
+ var getApiRegion = () => {
29
+ const apiRegion = process.env.TRADEJS_BYBIT_API_REGION?.trim();
30
+ return apiRegion ? apiRegion : void 0;
31
+ };
32
+ var getApiRegionOptions = () => {
33
+ const apiRegion = getApiRegion();
34
+ return apiRegion ? { apiRegion } : {};
35
+ };
28
36
  var getClient = async (config, access = "private", runtime) => {
29
37
  const logger = getConnectorLogger(runtime);
30
38
  const resolveTradingAccount = getConnectorAccountResolver(runtime);
@@ -37,6 +45,7 @@ var getClient = async (config, access = "private", runtime) => {
37
45
  const useTestnet = account?.environment === "testnet";
38
46
  if (access === "public") {
39
47
  return new RestClientV5({
48
+ ...getApiRegionOptions(),
40
49
  parseAPIRateLimits: true,
41
50
  testnet: useTestnet
42
51
  });
@@ -55,6 +64,7 @@ var getClient = async (config, access = "private", runtime) => {
55
64
  return null;
56
65
  }
57
66
  const client = new RestClientV5({
67
+ ...getApiRegionOptions(),
58
68
  key: account.apiKey,
59
69
  secret: account.apiSecret,
60
70
  parseAPIRateLimits: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradejs/connectors",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "MIT-licensed exchange connectors and market data providers for the TradeJS framework.",
5
5
  "keywords": [
6
6
  "tradejs",
@@ -9,7 +9,10 @@
9
9
  "connectors",
10
10
  "exchange",
11
11
  "market-data",
12
- "bybit"
12
+ "bybit",
13
+ "ai",
14
+ "claude",
15
+ "codex"
13
16
  ],
14
17
  "repository": {
15
18
  "type": "git",
@@ -33,8 +36,8 @@
33
36
  }
34
37
  },
35
38
  "dependencies": {
36
- "@tradejs/core": "^3.1.0",
37
- "@tradejs/types": "^3.1.0",
39
+ "@tradejs/core": "^3.1.2",
40
+ "@tradejs/types": "^3.1.2",
38
41
  "bybit-api": "^4.7.1",
39
42
  "chalk": "4.1.2",
40
43
  "lodash": "^4.18.1"