@tradejs/connectors 2.0.5 → 2.0.7
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/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1164,7 +1164,7 @@ var ByBitConnectorCreator = async (config) => {
|
|
|
1164
1164
|
getOpenPositionPnl: async () => {
|
|
1165
1165
|
const client = await getPrivateClient();
|
|
1166
1166
|
if (!client) {
|
|
1167
|
-
|
|
1167
|
+
throw new Error("Bybit private client is unavailable");
|
|
1168
1168
|
}
|
|
1169
1169
|
const positionRes = await client.getPositionInfo({
|
|
1170
1170
|
category: BYBIT_CATEGORY2,
|
|
@@ -1176,7 +1176,9 @@ var ByBitConnectorCreator = async (config) => {
|
|
|
1176
1176
|
"positions pnl retCode: %s, %s",
|
|
1177
1177
|
positionRes.retCode
|
|
1178
1178
|
);
|
|
1179
|
-
|
|
1179
|
+
throw new Error(
|
|
1180
|
+
`Bybit positions request failed: ${positionRes.retCode} ${positionRes.retMsg ?? ""}`.trim()
|
|
1181
|
+
);
|
|
1180
1182
|
}
|
|
1181
1183
|
return (positionRes.result?.list ?? []).map((item) => {
|
|
1182
1184
|
const qty = Number(item.size ?? Number.NaN);
|
package/dist/index.mjs
CHANGED
|
@@ -1121,7 +1121,7 @@ var ByBitConnectorCreator = async (config) => {
|
|
|
1121
1121
|
getOpenPositionPnl: async () => {
|
|
1122
1122
|
const client = await getPrivateClient();
|
|
1123
1123
|
if (!client) {
|
|
1124
|
-
|
|
1124
|
+
throw new Error("Bybit private client is unavailable");
|
|
1125
1125
|
}
|
|
1126
1126
|
const positionRes = await client.getPositionInfo({
|
|
1127
1127
|
category: BYBIT_CATEGORY2,
|
|
@@ -1133,7 +1133,9 @@ var ByBitConnectorCreator = async (config) => {
|
|
|
1133
1133
|
"positions pnl retCode: %s, %s",
|
|
1134
1134
|
positionRes.retCode
|
|
1135
1135
|
);
|
|
1136
|
-
|
|
1136
|
+
throw new Error(
|
|
1137
|
+
`Bybit positions request failed: ${positionRes.retCode} ${positionRes.retMsg ?? ""}`.trim()
|
|
1138
|
+
);
|
|
1137
1139
|
}
|
|
1138
1140
|
return (positionRes.result?.list ?? []).map((item) => {
|
|
1139
1141
|
const qty = Number(item.size ?? Number.NaN);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradejs/connectors",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "MIT-licensed exchange connectors and market data providers for the TradeJS framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tradejs",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tradejs/core": "^2.0.
|
|
37
|
-
"@tradejs/infra": "^2.0.
|
|
38
|
-
"@tradejs/node": "^2.0.
|
|
39
|
-
"@tradejs/types": "^2.0.
|
|
36
|
+
"@tradejs/core": "^2.0.7",
|
|
37
|
+
"@tradejs/infra": "^2.0.7",
|
|
38
|
+
"@tradejs/node": "^2.0.7",
|
|
39
|
+
"@tradejs/types": "^2.0.7",
|
|
40
40
|
"bybit-api": "^4.7.1",
|
|
41
41
|
"chalk": "4.1.2",
|
|
42
42
|
"lodash": "^4.18.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsup": "^8.5.1",
|
|
46
|
-
"typescript": "^5.
|
|
46
|
+
"typescript": "^5.9"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsup",
|