@anrmk/str-package 0.1.3 → 0.1.5
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/{TChallengeProgress-B9ZKiMB2.d.ts → TChallengeProgress-CFlK7XnZ.d.ts} +8 -9
- package/dist/{TChallengeProgress-Dw7FSPNm.d.cts → TChallengeProgress-hdTUsqAj.d.cts} +8 -9
- package/dist/{chunk-PGGSZUQW.js → chunk-LMNE5WZX.js} +29 -28
- package/dist/chunk-LMNE5WZX.js.map +1 -0
- package/dist/{chunk-HFDG7DDQ.js → chunk-VW3D4BVO.js} +21 -4
- package/dist/chunk-VW3D4BVO.js.map +1 -0
- package/dist/index.cjs +46 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/providers/bybit/index.cjs +19 -2
- package/dist/providers/bybit/index.cjs.map +1 -1
- package/dist/providers/bybit/index.js +1 -1
- package/dist/types/challenge/index.d.cts +2 -2
- package/dist/types/challenge/index.d.ts +2 -2
- package/dist/utils/challengeHelper.cjs +27 -26
- package/dist/utils/challengeHelper.cjs.map +1 -1
- package/dist/utils/challengeHelper.d.cts +8 -8
- package/dist/utils/challengeHelper.d.ts +8 -8
- package/dist/utils/challengeHelper.js +1 -1
- package/package.json +6 -1
- package/dist/chunk-HFDG7DDQ.js.map +0 -1
- package/dist/chunk-PGGSZUQW.js.map +0 -1
|
@@ -63,17 +63,16 @@ type TChallengeWalletBalance = {
|
|
|
63
63
|
type TChallengeProgress = {
|
|
64
64
|
id: string | null;
|
|
65
65
|
challengeId: string;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
currentProfitTarget: number;
|
|
66
|
+
totalLoss: number;
|
|
67
|
+
tradingDays: number;
|
|
68
|
+
dailyDrawdown: number;
|
|
69
|
+
profitTarget: number;
|
|
71
70
|
dailyStartingEquity: number;
|
|
72
71
|
dailyStartingUpdatedAt: string;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
dailyMaxEquity: number;
|
|
73
|
+
dailyMinEquity: number;
|
|
74
|
+
dailyMaxUpdatedAt: string;
|
|
75
|
+
dailyMinUpdatedAt: string;
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
export type { TChallengeClosedPnl as T, TChallengeClosedPnlStatistics as a, TChallengeProgress as b, TChallengeWalletBalance as c };
|
|
@@ -63,17 +63,16 @@ type TChallengeWalletBalance = {
|
|
|
63
63
|
type TChallengeProgress = {
|
|
64
64
|
id: string | null;
|
|
65
65
|
challengeId: string;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
currentProfitTarget: number;
|
|
66
|
+
totalLoss: number;
|
|
67
|
+
tradingDays: number;
|
|
68
|
+
dailyDrawdown: number;
|
|
69
|
+
profitTarget: number;
|
|
71
70
|
dailyStartingEquity: number;
|
|
72
71
|
dailyStartingUpdatedAt: string;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
dailyMaxEquity: number;
|
|
73
|
+
dailyMinEquity: number;
|
|
74
|
+
dailyMaxUpdatedAt: string;
|
|
75
|
+
dailyMinUpdatedAt: string;
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
export type { TChallengeClosedPnl as T, TChallengeClosedPnlStatistics as a, TChallengeProgress as b, TChallengeWalletBalance as c };
|
|
@@ -18,20 +18,21 @@ var createDefaultWallet = (challengeId = "", capital = 0) => ({
|
|
|
18
18
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
19
19
|
});
|
|
20
20
|
var createDefaultProgress = (challengeId = "", currentEquity = 0) => ({
|
|
21
|
+
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
21
22
|
challengeId,
|
|
22
23
|
currentEquity,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
totalLoss: 0,
|
|
25
|
+
tradingDays: 0,
|
|
26
|
+
dailyDrawdown: 0,
|
|
27
|
+
profitTarget: 0,
|
|
27
28
|
dailyStartingEquity: 0,
|
|
28
29
|
dailyStartingUpdatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
dailyMaxEquity: 0,
|
|
31
|
+
dailyMinEquity: 0,
|
|
32
|
+
dailyMaxUpdatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
33
|
+
dailyMinUpdatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
33
34
|
});
|
|
34
|
-
var
|
|
35
|
+
var tradingDaysCountCalculation = async (closedPnlData, minPositionSize) => {
|
|
35
36
|
if (!closedPnlData || closedPnlData.length === 0) {
|
|
36
37
|
return 0;
|
|
37
38
|
}
|
|
@@ -65,34 +66,34 @@ var currentDailyEquity = (wallet, progress) => {
|
|
|
65
66
|
const { equity, unrealisedPnl } = wallet;
|
|
66
67
|
const {
|
|
67
68
|
dailyStartingEquity,
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
dailyMaxEquity,
|
|
70
|
+
dailyMinEquity,
|
|
70
71
|
dailyStartingUpdatedAt,
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
dailyMaxUpdatedAt,
|
|
73
|
+
dailyMinUpdatedAt
|
|
73
74
|
} = progress;
|
|
74
75
|
let isSameDay = isSameUtcDay(dailyStartingUpdatedAt, startDateStr);
|
|
75
76
|
const newDailyStartingUpdatedAt = isSameDay ? dailyStartingUpdatedAt : startDateStr;
|
|
76
77
|
const newDailyStartingEquity = isSameDay ? dailyStartingEquity : equity;
|
|
77
|
-
isSameDay = isSameUtcDay(
|
|
78
|
-
let newMaxUpdatedAt = isSameDay ?
|
|
79
|
-
const
|
|
80
|
-
isSameDay = isSameUtcDay(
|
|
81
|
-
const newMinUpdatedAt = isSameDay ?
|
|
82
|
-
const
|
|
83
|
-
const dailyEquityDrawdown = equity -
|
|
78
|
+
isSameDay = isSameUtcDay(dailyMaxUpdatedAt, today);
|
|
79
|
+
let newMaxUpdatedAt = isSameDay ? dailyMaxUpdatedAt : today;
|
|
80
|
+
const newdailyMaxEquity = Math.max(isSameDay ? dailyMaxEquity : equity, equity);
|
|
81
|
+
isSameDay = isSameUtcDay(dailyMinUpdatedAt, today);
|
|
82
|
+
const newMinUpdatedAt = isSameDay ? dailyMinUpdatedAt : today;
|
|
83
|
+
const newdailyMinEquity = Math.min(isSameDay ? dailyMinEquity : equity, equity);
|
|
84
|
+
const dailyEquityDrawdown = equity - newdailyMaxEquity;
|
|
84
85
|
return {
|
|
85
86
|
currentEquity: equity,
|
|
86
|
-
|
|
87
|
+
dailyDrawdown: dailyEquityDrawdown,
|
|
87
88
|
dailyStartingEquity: newDailyStartingEquity,
|
|
88
89
|
dailyStartingUpdatedAt: newDailyStartingUpdatedAt.slice(0, 10),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
dailyMaxEquity: newdailyMaxEquity,
|
|
91
|
+
dailyMaxUpdatedAt: newMaxUpdatedAt,
|
|
92
|
+
dailyMinEquity: newdailyMinEquity,
|
|
93
|
+
dailyMinUpdatedAt: newMinUpdatedAt
|
|
93
94
|
};
|
|
94
95
|
};
|
|
95
96
|
|
|
96
|
-
export { createDefaultProgress, createDefaultWallet, currentDailyEquity,
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
export { createDefaultProgress, createDefaultWallet, currentDailyEquity, tradingDaysCountCalculation };
|
|
98
|
+
//# sourceMappingURL=chunk-LMNE5WZX.js.map
|
|
99
|
+
//# sourceMappingURL=chunk-LMNE5WZX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/challengeHelper.ts"],"names":[],"mappings":";;;AAQO,IAAM,mBAAA,GAAsB,CACjC,WAAA,GAAsB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AmB;AAAA,GACrB;AACF","file":"chunk-LMNE5WZX.js","sourcesContent":["import {\n TChallengeClosedPnl,\n TChallengeProgress,\n TChallengeWalletBalance,\n} from \"../types/challenge\";\nimport { IBybitAccountType, IBybitCoinType } from \"../types/bybit/enums\";\nimport { isSameUtcDay } from \"./helper\";\n\nexport const createDefaultWallet = (\n challengeId: string = \"\",\n capital: number = 0,\n): TChallengeWalletBalance =>\n ({\n challengeId,\n accountType: IBybitAccountType.UNIFIED,\n totalEquity: 0,\n totalPerpUpl: 0,\n totalWalletBalance: 0,\n totalAvailableBalance: 0,\n capital,\n\n equity: 0,\n usdValue: 0,\n unrealisedPnl: 0,\n walletBalance: 0,\n availableToWithdraw: 0,\n coin: IBybitCoinType.USDT,\n updatedAt: new Date().toISOString(),\n }) as TChallengeWalletBalance;\n\nexport const createDefaultProgress = (\n challengeId: string = \"\",\n currentEquity: number = 0,\n): TChallengeProgress =>\n ({\n id: new Date().getTime().toString(),\n challengeId,\n currentEquity,\n totalLoss: 0,\n tradingDays: 0,\n dailyDrawdown: 0,\n profitTarget: 0,\n dailyStartingEquity: 0,\n dailyStartingUpdatedAt: new Date().toISOString(),\n dailyMaxEquity: 0,\n dailyMinEquity: 0,\n dailyMaxUpdatedAt: new Date().toISOString(),\n dailyMinUpdatedAt: new Date().toISOString(),\n }) as TChallengeProgress;\n\n // A trading day counts if you open and close at least one trade \n// that day with a position size ≥ 5% of the initial balance and a PnL of ±1% or more.\nexport const tradingDaysCountCalculation = async (\n closedPnlData: TChallengeClosedPnl[] | null,\n minPositionSize: number,\n): Promise<number> => {\n if (!closedPnlData || closedPnlData.length === 0) {\n return 0;\n }\n\n const closedPnlGrouped = closedPnlData.reduce(\n (acc, trade) => {\n const day = trade.updatedTime.split(\"T\")[0];\n if (!acc[day]) {\n acc[day] = [];\n }\n acc[day].push(trade);\n return acc;\n },\n {} as Record<string, TChallengeClosedPnl[]>,\n );\n\n return await Object.values(closedPnlGrouped).reduce((count, dayTrades) => {\n // Check if any trade closed today met the minimum size requirement\n const hasQualifyingTrade = dayTrades.some((trade) => {\n const entryValue = trade.cumEntryValue;\n const closedPnL = trade.closedPnl;\n\n // 1. Position size must be >= 5% of initial balance\n const passesSize = entryValue >= minPositionSize;\n\n // 2. PnL must be >= 1% of the position size itself\n const minRequiredPnL = entryValue * 0.01;\n const passesPnL = Math.abs(closedPnL) >= minRequiredPnL;\n\n return passesSize && passesPnL;\n });\n\n return hasQualifyingTrade ? count + 1 : count;\n }, 0);\n};\n\nexport const currentDailyEquity = (\n wallet: TChallengeWalletBalance,\n progress: TChallengeProgress\n) => {\n const today = new Date().toISOString();\n const startDate = new Date().setUTCHours(0, 0, 0, 0);\n const startDateStr = new Date(startDate).toISOString();\n\n const { equity, unrealisedPnl } = wallet;\n const { dailyStartingEquity, dailyMaxEquity, dailyMinEquity, \n dailyStartingUpdatedAt, dailyMaxUpdatedAt, dailyMinUpdatedAt } = progress;\n \n // Determine if the daily starting equity should be updated based on whether it's a new day\n let isSameDay = isSameUtcDay(dailyStartingUpdatedAt, startDateStr)\n const newDailyStartingUpdatedAt = isSameDay ? dailyStartingUpdatedAt : startDateStr;\n const newDailyStartingEquity = isSameDay ? dailyStartingEquity : equity;\n\n // Determine if the max and min daily equity should be updated based on whether it's a new day\n isSameDay = isSameUtcDay(dailyMaxUpdatedAt, today);\n let newMaxUpdatedAt = isSameDay ? dailyMaxUpdatedAt : today;\n const newdailyMaxEquity = Math.max(isSameDay ? dailyMaxEquity : equity , equity);\n \n // Determine if the min daily equity should be updated based on whether it's a new day\n isSameDay = isSameUtcDay(dailyMinUpdatedAt, today);\n const newMinUpdatedAt = isSameDay ? dailyMinUpdatedAt : today;\n const newdailyMinEquity = Math.min(isSameDay ? dailyMinEquity : equity, equity);\n\n //Trailing Drawdown: The difference between the day’s highest equity and the lowest equity reached afterward, both including unrealized P&L.\n const dailyEquityDrawdown = equity - newdailyMaxEquity;\n \n return {\n currentEquity: equity,\n dailyDrawdown: dailyEquityDrawdown,\n\n dailyStartingEquity: newDailyStartingEquity,\n dailyStartingUpdatedAt: newDailyStartingUpdatedAt.slice(0, 10),\n\n dailyMaxEquity: newdailyMaxEquity,\n dailyMaxUpdatedAt: newMaxUpdatedAt,\n\n dailyMinEquity: newdailyMinEquity,\n dailyMinUpdatedAt: newMinUpdatedAt,\n };\n};"]}
|
|
@@ -28,16 +28,20 @@ async function getApiKeyInfo(credentials) {
|
|
|
28
28
|
cache: "no-store"
|
|
29
29
|
});
|
|
30
30
|
} catch (error) {
|
|
31
|
+
console.error("ByBit API Key Info network error", error);
|
|
31
32
|
throw new Error("ByBit API Key Info network error", { cause: error });
|
|
32
33
|
}
|
|
33
34
|
if (!bybitRes.ok) {
|
|
35
|
+
console.error("ByBit API Key Info request failed", bybitRes);
|
|
34
36
|
throw new Error("ByBit API Key Info request failed");
|
|
35
37
|
}
|
|
36
38
|
const bybitJson = await bybitRes.json();
|
|
37
39
|
if (bybitJson.retCode !== 0) {
|
|
40
|
+
console.error("ByBit API Key Info API error", bybitJson);
|
|
38
41
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
39
42
|
}
|
|
40
43
|
if (!bybitJson) {
|
|
44
|
+
console.error("Invalid ByBit API Key Info response", bybitJson);
|
|
41
45
|
throw new Error("Invalid ByBit API Key Info response");
|
|
42
46
|
}
|
|
43
47
|
return bybitJson;
|
|
@@ -66,17 +70,21 @@ async function getAccountInfo(credentials) {
|
|
|
66
70
|
cache: "no-store"
|
|
67
71
|
});
|
|
68
72
|
} catch (error) {
|
|
73
|
+
console.error("ByBit Account API network error", error);
|
|
69
74
|
throw new Error("ByBit Account API network error", { cause: error });
|
|
70
75
|
}
|
|
71
76
|
if (!bybitRes.ok) {
|
|
77
|
+
console.error("ByBit Account API request failed", bybitRes);
|
|
72
78
|
throw new Error("ByBit Account API request failed");
|
|
73
79
|
}
|
|
74
80
|
const bybitJson = await bybitRes.json();
|
|
75
81
|
if (bybitJson.retCode !== 0) {
|
|
82
|
+
console.error("ByBit Account API error", bybitJson);
|
|
76
83
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
77
84
|
}
|
|
78
85
|
const raw = bybitJson.result?.list?.[0];
|
|
79
86
|
if (!raw) {
|
|
87
|
+
console.error("No account info returned", bybitJson);
|
|
80
88
|
throw new Error("No account info returned");
|
|
81
89
|
}
|
|
82
90
|
return bybitJson;
|
|
@@ -110,13 +118,16 @@ async function getWalletBalance(credentials) {
|
|
|
110
118
|
}
|
|
111
119
|
);
|
|
112
120
|
} catch (error) {
|
|
121
|
+
console.error("ByBit Wallet API network error", error);
|
|
113
122
|
throw new Error("ByBit Wallet API network error", { cause: error });
|
|
114
123
|
}
|
|
115
124
|
if (!bybitRes.ok) {
|
|
125
|
+
console.error("ByBit Wallet API request failed", bybitRes);
|
|
116
126
|
throw new Error("ByBit Wallet API request failed: " + bybitRes.statusText);
|
|
117
127
|
}
|
|
118
128
|
const bybitJson = await bybitRes.json();
|
|
119
129
|
if (bybitJson.retCode !== 0) {
|
|
130
|
+
console.error("ByBit Wallet API error", bybitJson);
|
|
120
131
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
121
132
|
}
|
|
122
133
|
return bybitJson;
|
|
@@ -158,13 +169,16 @@ async function getClosedPnl(credentials, startTime, cursor) {
|
|
|
158
169
|
}
|
|
159
170
|
);
|
|
160
171
|
} catch (error) {
|
|
172
|
+
console.error("ByBit Closed PNL API network error", error);
|
|
161
173
|
throw new Error("ByBit Closed PNL API network error", { cause: error });
|
|
162
174
|
}
|
|
163
175
|
if (!bybitRes.ok) {
|
|
176
|
+
console.error("ByBit Closed PNL API request failed", bybitRes);
|
|
164
177
|
throw new Error("ByBit Closed PNL API request failed");
|
|
165
178
|
}
|
|
166
179
|
const bybitJson = await bybitRes.json();
|
|
167
180
|
if (bybitJson.retCode !== 0) {
|
|
181
|
+
console.error("ByBit Closed PNL API error", bybitJson);
|
|
168
182
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
169
183
|
}
|
|
170
184
|
return bybitJson;
|
|
@@ -210,13 +224,16 @@ async function getPositionInfo(credentials, category, symbol, settleCoin, cursor
|
|
|
210
224
|
}
|
|
211
225
|
);
|
|
212
226
|
} catch (error) {
|
|
213
|
-
|
|
227
|
+
console.error("ByBit Position Info API network error", { cause: error });
|
|
228
|
+
throw new Error("ByBit Position Info API network error", { cause: error });
|
|
214
229
|
}
|
|
215
230
|
if (!bybitRes.ok) {
|
|
216
|
-
|
|
231
|
+
console.error("ByBit Position Info API request failed", bybitRes);
|
|
232
|
+
throw new Error("ByBit Position Info API request failed");
|
|
217
233
|
}
|
|
218
234
|
const bybitJson = await bybitRes.json();
|
|
219
235
|
if (bybitJson.retCode !== 0) {
|
|
236
|
+
console.error("ByBit Position Info API error", bybitJson);
|
|
220
237
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
221
238
|
}
|
|
222
239
|
return bybitJson;
|
|
@@ -260,5 +277,5 @@ async function applyDemoMoney(credentials, payload) {
|
|
|
260
277
|
}
|
|
261
278
|
|
|
262
279
|
export { applyDemoMoney, getAccountInfo, getApiKeyInfo, getClosedPnl, getPositionInfo, getWalletBalance };
|
|
263
|
-
//# sourceMappingURL=chunk-
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
280
|
+
//# sourceMappingURL=chunk-VW3D4BVO.js.map
|
|
281
|
+
//# sourceMappingURL=chunk-VW3D4BVO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/providers/bybit/constants.ts","../src/providers/bybit/get-api-key-info.ts","../src/providers/bybit/get-account-info.ts","../src/providers/bybit/get-wallet-balance.ts","../src/providers/bybit/get-closed-pnl.ts","../src/providers/bybit/get-position-info.ts","../src/providers/bybit/apply-demo-money.ts"],"names":[],"mappings":";;;AAAO,IAAM,eAAA,GAAkB;AAAA,EAC3B,OAAA,EAAS,OAAA,CAAQ,GAAA,CAAI,cAAA,IAAkB,4BAAA;AAAA,EACvC,cAAA,EAAgB,MAAA,CAAO,OA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,EAAQ,MAAA;AAAA,QACR,OAAA,EAAS;AAAA,UACP,cAAA,EAAgB,kBAAA;AAAA,UAChB,gBAAA,EAAkB,MAAA;AAAA,UAClB,aAAA,EAAe,SAAA;AAAA,UACf,kBAAA,EAAoB,GAAA;AAAA,UACpB,kBAAA,EAAoB,SAAA;AAAA,UACpB,sBAAsB,eAAA,CAAgB;AAAA,SACxC;AAAA,QACA,IAAA,EAAM,WAAA;AAAA,QACN,MAAA,EAAQ,WAAA,CAAY,OAAA,CAAQ,eAAA,CAAgB,cAAc,CAAA;AAAA,QAC1D,KAAA,EAAO;AAAA;AACT,KACF;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,qCAAA,EAAuC,EAAE,KAAA,EAAO,OAAO,CAAA;AAAA,EACzE;AAEA,EAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,IAAA,MAAM,IAAI,MAAM,sCAAsC,CAAA;AAAA,EACxD;AAEA,EAAA,MAAM,SAAA,GACH,MAAM,QAAA,CAAS,IAAA,EAAK;AAEvB,EAAA,IAAI,SAAA,CAAU,YAAY,CAAA,EAAG;AAC3B,IAAA,MAAM,IAAI,KAAA,CAAM,SAAA,CAAU,MAAA,IAAU,aAAa,CAAA;AAAA,EACnD;AAEA,EAAA,OAAO,SAAA;AACT","file":"chunk-VW3D4BVO.js","sourcesContent":["export const BYBIT_CONSTANTS = {\n baseUrl: process.env.BYBIT_BASE_URL || \"https://api-demo.bybit.com\",\n fetchTimeoutMs: Number(process.env.BYBIT_FETCH_TIMEOUT_MS) || 10000,\n recvWindowTimeoutMs: process.env.BYBIT_RECV_WINDOW_TIMEOUT_MS || \"20000\",\n}","import { BYBIT_CONSTANTS } from \"./constants\";\nimport { IBybitCredentials, IBybitApiKeyInfo, IBybitApiResponse} from \"../../types/bybit\";\nimport { signBybitRequest } from \"../../utils/bybitHelper\";\n\nexport async function getApiKeyInfo(\n credentials: IBybitCredentials,\n): Promise<IBybitApiResponse<IBybitApiKeyInfo>> {\n const { apiKey, apiSecret } = credentials;\n\n if (!apiKey || !apiSecret) {\n throw new Error(\"ByBit API key and API secret are required\");\n }\n\n const { signature, timestamp } = signBybitRequest(apiSecret, apiKey);\n\n let bybitRes: Response;\n try {\n bybitRes = await fetch(`${BYBIT_CONSTANTS.baseUrl}/v5/user/query-api`, {\n headers: {\n \"X-BAPI-API-KEY\": apiKey,\n \"X-BAPI-SIGN\": signature,\n \"X-BAPI-SIGN-TYPE\": \"2\",\n \"X-BAPI-TIMESTAMP\": timestamp,\n \"X-BAPI-RECV-WINDOW\": BYBIT_CONSTANTS.recvWindowTimeoutMs,\n },\n //signal: AbortSignal.timeout(BYBIT_CONSTANTS.fetchTimeoutMs),\n cache: \"no-store\",\n });\n } catch (error) {\n console.error(\"ByBit API Key Info network error\", error);\n throw new Error(\"ByBit API Key Info network error\", { cause: error });\n }\n\n if (!bybitRes.ok) {\n console.error(\"ByBit API Key Info request failed\", bybitRes);\n throw new Error(\"ByBit API Key Info request failed\");\n }\n\n const bybitJson =\n (await bybitRes.json()) as IBybitApiResponse<IBybitApiKeyInfo>;\n\n if (bybitJson.retCode !== 0) {\n console.error(\"ByBit API Key Info API error\", bybitJson);\n throw new Error(bybitJson.retMsg ?? \"ByBit error\");\n }\n\n if (!bybitJson) {\n console.error(\"Invalid ByBit API Key Info response\", bybitJson);\n throw new Error(\"Invalid ByBit API Key Info response\");\n }\n\n return bybitJson;\n}\n","import {\n IBybitCredentials,\n IBybitAccountInfo,\n IBybitApiResponse,\n} from \"../../types/bybit\";\nimport { signBybitRequest } from \"../../utils/bybitHelper\";\nimport { BYBIT_CONSTANTS } from \"./constants\";\n\nexport async function getAccountInfo(\n credentials: IBybitCredentials,\n): Promise<IBybitApiResponse<IBybitAccountInfo>> {\n const { apiKey, apiSecret } = credentials;\n const queryString = \"accountType=UNIFIED\";\n const { signature, timestamp } = signBybitRequest(\n apiSecret,\n apiKey,\n queryString,\n );\n\n let bybitRes: Response;\n try {\n bybitRes = await fetch(`${BYBIT_CONSTANTS.baseUrl}/v5/account/info`, {\n headers: {\n \"X-BAPI-API-KEY\": apiKey,\n \"X-BAPI-SIGN\": signature,\n \"X-BAPI-SIGN-TYPE\": \"2\",\n \"X-BAPI-TIMESTAMP\": timestamp,\n \"X-BAPI-RECV-WINDOW\": BYBIT_CONSTANTS.recvWindowTimeoutMs,\n },\n signal: AbortSignal.timeout(BYBIT_CONSTANTS.fetchTimeoutMs),\n cache: \"no-store\",\n });\n } catch (error) {\n console.error(\"ByBit Account API network error\", error);\n throw new Error(\"ByBit Account API network error\", { cause: error });\n }\n\n if (!bybitRes.ok) {\n console.error(\"ByBit Account API request failed\", bybitRes);\n throw new Error(\"ByBit Account API request failed\");\n }\n\n const bybitJson =\n (await bybitRes.json()) as IBybitApiResponse<IBybitAccountInfo>;\n\n if (bybitJson.retCode !== 0) {\n console.error(\"ByBit Account API error\", bybitJson);\n throw new Error(bybitJson.retMsg ?? \"ByBit error\");\n }\n\n const raw = bybitJson.result?.list?.[0];\n\n if (!raw) {\n console.error(\"No account info returned\", bybitJson);\n throw new Error(\"No account info returned\");\n }\n\n return bybitJson;\n}\n","import { BYBIT_CONSTANTS } from \"./constants\";\nimport { IBybitApiResponse, IBybitWalletAccount, IBybitCredentials } from \"../../types/bybit\";\n\nimport { signBybitRequest } from \"../../utils/bybitHelper\";\n\n// GET /api/bybit/wallet-balance?accountType=UNIFIED\nexport async function getWalletBalance(\n credentials: IBybitCredentials\n): Promise<IBybitApiResponse<IBybitWalletAccount>> {\n const { apiKey, apiSecret } = credentials;\n\n const query = new URLSearchParams({\n accountType: \"UNIFIED\",\n coin: \"USDT\",\n });\n const queryString = query.toString();\n\n const { signature, timestamp } = signBybitRequest(\n apiSecret,\n apiKey,\n queryString,\n );\n\n let bybitRes: Response;\n try {\n bybitRes = await fetch(\n `${BYBIT_CONSTANTS.baseUrl}/v5/account/wallet-balance?${queryString}`,\n {\n headers: {\n \"X-BAPI-API-KEY\": apiKey,\n \"X-BAPI-SIGN\": signature,\n \"X-BAPI-SIGN-TYPE\": \"2\",\n \"X-BAPI-TIMESTAMP\": timestamp,\n \"X-BAPI-RECV-WINDOW\": BYBIT_CONSTANTS.recvWindowTimeoutMs,\n },\n },\n );\n } catch (error) {\n console.error(\"ByBit Wallet API network error\", error);\n throw new Error(\"ByBit Wallet API network error\", { cause: error });\n }\n\n if (!bybitRes.ok) {\n console.error(\"ByBit Wallet API request failed\", bybitRes);\n throw new Error(\"ByBit Wallet API request failed: \" + bybitRes.statusText);\n }\n\n const bybitJson = (await bybitRes.json()) as IBybitApiResponse<IBybitWalletAccount>;\n\n if (bybitJson.retCode !== 0) {\n console.error(\"ByBit Wallet API error\", bybitJson);\n throw new Error(bybitJson.retMsg ?? \"ByBit error\");\n }\n\n return bybitJson;\n}\n","import { BYBIT_CONSTANTS } from \"./constants\";\nimport { IBybitCredentials, IBybitApiResponse, IBybitApiResponseList, IBybitClosedPnl } from \"../../types/bybit\";\nimport { signBybitRequest } from \"../../utils/bybitHelper\";\n\n// GET /api/bybit/wallet-balance?accountType=UNIFIED\nexport async function getClosedPnl(\n credentials: IBybitCredentials,\n startTime?: number,\n cursor?: string,\n): Promise<IBybitApiResponse<IBybitApiResponseList<IBybitClosedPnl>>> {\n const { apiKey, apiSecret } = credentials;\n const query = new URLSearchParams({\n category: \"linear\",\n //symbol: \"BTCUSDT\",\n limit: \"50\", //default limit\n });\n\n if (typeof startTime === \"number\") {\n query.set(\"startTime\", String(startTime));\n }\n\n if (typeof cursor === \"string\") {\n query.set(\"cursor\", String(cursor));\n }\n\n const queryString = query.toString();\n\n const { signature, timestamp } = signBybitRequest(\n apiSecret,\n apiKey,\n queryString,\n );\n\n let bybitRes: Response;\n try {\n bybitRes = await fetch(\n `${BYBIT_CONSTANTS.baseUrl}/v5/position/closed-pnl?${queryString}`,\n {\n headers: {\n \"X-BAPI-API-KEY\": apiKey,\n \"X-BAPI-SIGN\": signature,\n \"X-BAPI-SIGN-TYPE\": \"2\",\n \"X-BAPI-TIMESTAMP\": timestamp,\n \"X-BAPI-RECV-WINDOW\": BYBIT_CONSTANTS.recvWindowTimeoutMs,\n },\n },\n );\n } catch (error) {\n console.error(\"ByBit Closed PNL API network error\", error);\n throw new Error(\"ByBit Closed PNL API network error\", { cause: error });\n }\n\n if (!bybitRes.ok) {\n console.error(\"ByBit Closed PNL API request failed\", bybitRes);\n throw new Error(\"ByBit Closed PNL API request failed\");\n }\n\n const bybitJson = (await bybitRes.json()) as IBybitApiResponse<IBybitApiResponseList<IBybitClosedPnl>>;\n\n if (bybitJson.retCode !== 0) {\n console.error(\"ByBit Closed PNL API error\", bybitJson);\n throw new Error(bybitJson.retMsg ?? \"ByBit error\");\n }\n\n return bybitJson;\n}\n","import { BYBIT_CONSTANTS } from \"./constants\";\nimport {\n IBybitCredentials,\n IBybitApiResponse,\n IBybitApiResponseList,\n IBybitPositionInfo,\n} from \"../../types/bybit\";\n\nimport { signBybitRequest } from \"../../utils/bybitHelper\";\n\n// Query real-time position data, such as position size, cumulative realized PNL, etc.\nexport async function getPositionInfo(\n credentials: IBybitCredentials,\n category?: string,\n symbol?: string,\n settleCoin?: string,\n cursor?: string,\n): Promise<IBybitApiResponse<IBybitApiResponseList<IBybitPositionInfo>>> {\n const { apiKey, apiSecret } = credentials;\n\n const query = new URLSearchParams({\n category: category ?? \"linear\",\n limit: \"50\", //default limit\n });\n\n if (typeof symbol === \"string\") {\n query.set(\"symbol\", String(symbol));\n }\n\n if (typeof settleCoin === \"string\") {\n query.set(\"settleCoin\", String(settleCoin));\n }\n\n if (typeof cursor === \"string\") {\n query.set(\"cursor\", String(cursor));\n }\n\n const queryString = query.toString();\n\n const { signature, timestamp } = signBybitRequest(\n apiSecret,\n apiKey,\n queryString,\n );\n\n let bybitRes: Response;\n try {\n bybitRes = await fetch(\n `${BYBIT_CONSTANTS.baseUrl}/v5/position/list?${queryString}`,\n {\n headers: {\n \"X-BAPI-API-KEY\": apiKey,\n \"X-BAPI-SIGN\": signature,\n \"X-BAPI-SIGN-TYPE\": \"2\",\n \"X-BAPI-TIMESTAMP\": timestamp,\n \"X-BAPI-RECV-WINDOW\": BYBIT_CONSTANTS.recvWindowTimeoutMs,\n },\n signal: AbortSignal.timeout(BYBIT_CONSTANTS.fetchTimeoutMs),\n cache: \"no-store\",\n },\n );\n } catch (error) {\n console.error(\"ByBit Position Info API network error\", { cause: error });\n throw new Error(\"ByBit Position Info API network error\", { cause: error });\n }\n\n if (!bybitRes.ok) {\n console.error(\"ByBit Position Info API request failed\", bybitRes);\n throw new Error(\"ByBit Position Info API request failed\");\n }\n\n const bybitJson = (await bybitRes.json()) as IBybitApiResponse<IBybitApiResponseList<IBybitPositionInfo>>;\n \n if (bybitJson.retCode !== 0) {\n console.error(\"ByBit Position Info API error\", bybitJson);\n throw new Error(bybitJson.retMsg ?? \"ByBit error\");\n }\n\n return bybitJson;\n}\n","import { BYBIT_CONSTANTS } from \"./constants\";\n\nimport {\n IBybitCredentials,\n IBybitApiResponse,\n IBybitAccountInfo,\n IBybitDemoApplyMoneyRequest,\n} from \"../../types/bybit\";\nimport { signBybitRequest } from \"../../utils/bybitHelper\";\nimport { IBybitDemoApplyMoney } from \"../../types/bybit/IBybitDemoApplyMoney\";\n\n// POST /api/bybit/apply-money\nexport async function applyDemoMoney(\n credentials: IBybitCredentials,\n payload: IBybitDemoApplyMoneyRequest,\n): Promise<IBybitApiResponse<IBybitDemoApplyMoney>> {\n const { apiKey, apiSecret } = credentials;\n\n const requestBody = JSON.stringify(payload);\n const { signature, timestamp } = signBybitRequest(apiSecret, apiKey, requestBody);\n \n let bybitRes: Response;\n try {\n bybitRes = await fetch(\n `${BYBIT_CONSTANTS.baseUrl}/v5/account/demo-apply-money`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-BAPI-API-KEY\": apiKey,\n \"X-BAPI-SIGN\": signature,\n \"X-BAPI-SIGN-TYPE\": \"2\",\n \"X-BAPI-TIMESTAMP\": timestamp,\n \"X-BAPI-RECV-WINDOW\": BYBIT_CONSTANTS.recvWindowTimeoutMs,\n },\n body: requestBody,\n signal: AbortSignal.timeout(BYBIT_CONSTANTS.fetchTimeoutMs),\n cache: \"no-store\",\n },\n );\n } catch (error) {\n throw new Error(\"ByBit Apply Money API network error\", { cause: error });\n }\n\n if (!bybitRes.ok) {\n throw new Error(\"ByBit Apply Money API request failed\");\n }\n\n const bybitJson =\n (await bybitRes.json()) as IBybitApiResponse<IBybitAccountInfo>;\n\n if (bybitJson.retCode !== 0) {\n throw new Error(bybitJson.retMsg ?? \"ByBit error\");\n }\n\n return bybitJson;\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -38,16 +38,20 @@ async function getApiKeyInfo(credentials) {
|
|
|
38
38
|
cache: "no-store"
|
|
39
39
|
});
|
|
40
40
|
} catch (error) {
|
|
41
|
+
console.error("ByBit API Key Info network error", error);
|
|
41
42
|
throw new Error("ByBit API Key Info network error", { cause: error });
|
|
42
43
|
}
|
|
43
44
|
if (!bybitRes.ok) {
|
|
45
|
+
console.error("ByBit API Key Info request failed", bybitRes);
|
|
44
46
|
throw new Error("ByBit API Key Info request failed");
|
|
45
47
|
}
|
|
46
48
|
const bybitJson = await bybitRes.json();
|
|
47
49
|
if (bybitJson.retCode !== 0) {
|
|
50
|
+
console.error("ByBit API Key Info API error", bybitJson);
|
|
48
51
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
49
52
|
}
|
|
50
53
|
if (!bybitJson) {
|
|
54
|
+
console.error("Invalid ByBit API Key Info response", bybitJson);
|
|
51
55
|
throw new Error("Invalid ByBit API Key Info response");
|
|
52
56
|
}
|
|
53
57
|
return bybitJson;
|
|
@@ -76,17 +80,21 @@ async function getAccountInfo(credentials) {
|
|
|
76
80
|
cache: "no-store"
|
|
77
81
|
});
|
|
78
82
|
} catch (error) {
|
|
83
|
+
console.error("ByBit Account API network error", error);
|
|
79
84
|
throw new Error("ByBit Account API network error", { cause: error });
|
|
80
85
|
}
|
|
81
86
|
if (!bybitRes.ok) {
|
|
87
|
+
console.error("ByBit Account API request failed", bybitRes);
|
|
82
88
|
throw new Error("ByBit Account API request failed");
|
|
83
89
|
}
|
|
84
90
|
const bybitJson = await bybitRes.json();
|
|
85
91
|
if (bybitJson.retCode !== 0) {
|
|
92
|
+
console.error("ByBit Account API error", bybitJson);
|
|
86
93
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
87
94
|
}
|
|
88
95
|
const raw = bybitJson.result?.list?.[0];
|
|
89
96
|
if (!raw) {
|
|
97
|
+
console.error("No account info returned", bybitJson);
|
|
90
98
|
throw new Error("No account info returned");
|
|
91
99
|
}
|
|
92
100
|
return bybitJson;
|
|
@@ -120,13 +128,16 @@ async function getWalletBalance(credentials) {
|
|
|
120
128
|
}
|
|
121
129
|
);
|
|
122
130
|
} catch (error) {
|
|
131
|
+
console.error("ByBit Wallet API network error", error);
|
|
123
132
|
throw new Error("ByBit Wallet API network error", { cause: error });
|
|
124
133
|
}
|
|
125
134
|
if (!bybitRes.ok) {
|
|
135
|
+
console.error("ByBit Wallet API request failed", bybitRes);
|
|
126
136
|
throw new Error("ByBit Wallet API request failed: " + bybitRes.statusText);
|
|
127
137
|
}
|
|
128
138
|
const bybitJson = await bybitRes.json();
|
|
129
139
|
if (bybitJson.retCode !== 0) {
|
|
140
|
+
console.error("ByBit Wallet API error", bybitJson);
|
|
130
141
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
131
142
|
}
|
|
132
143
|
return bybitJson;
|
|
@@ -168,13 +179,16 @@ async function getClosedPnl(credentials, startTime, cursor) {
|
|
|
168
179
|
}
|
|
169
180
|
);
|
|
170
181
|
} catch (error) {
|
|
182
|
+
console.error("ByBit Closed PNL API network error", error);
|
|
171
183
|
throw new Error("ByBit Closed PNL API network error", { cause: error });
|
|
172
184
|
}
|
|
173
185
|
if (!bybitRes.ok) {
|
|
186
|
+
console.error("ByBit Closed PNL API request failed", bybitRes);
|
|
174
187
|
throw new Error("ByBit Closed PNL API request failed");
|
|
175
188
|
}
|
|
176
189
|
const bybitJson = await bybitRes.json();
|
|
177
190
|
if (bybitJson.retCode !== 0) {
|
|
191
|
+
console.error("ByBit Closed PNL API error", bybitJson);
|
|
178
192
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
179
193
|
}
|
|
180
194
|
return bybitJson;
|
|
@@ -220,13 +234,16 @@ async function getPositionInfo(credentials, category, symbol, settleCoin, cursor
|
|
|
220
234
|
}
|
|
221
235
|
);
|
|
222
236
|
} catch (error) {
|
|
223
|
-
|
|
237
|
+
console.error("ByBit Position Info API network error", { cause: error });
|
|
238
|
+
throw new Error("ByBit Position Info API network error", { cause: error });
|
|
224
239
|
}
|
|
225
240
|
if (!bybitRes.ok) {
|
|
226
|
-
|
|
241
|
+
console.error("ByBit Position Info API request failed", bybitRes);
|
|
242
|
+
throw new Error("ByBit Position Info API request failed");
|
|
227
243
|
}
|
|
228
244
|
const bybitJson = await bybitRes.json();
|
|
229
245
|
if (bybitJson.retCode !== 0) {
|
|
246
|
+
console.error("ByBit Position Info API error", bybitJson);
|
|
230
247
|
throw new Error(bybitJson.retMsg ?? "ByBit error");
|
|
231
248
|
}
|
|
232
249
|
return bybitJson;
|
|
@@ -323,20 +340,21 @@ var createDefaultWallet = (challengeId = "", capital = 0) => ({
|
|
|
323
340
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
324
341
|
});
|
|
325
342
|
var createDefaultProgress = (challengeId = "", currentEquity = 0) => ({
|
|
343
|
+
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
326
344
|
challengeId,
|
|
327
345
|
currentEquity,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
346
|
+
totalLoss: 0,
|
|
347
|
+
tradingDays: 0,
|
|
348
|
+
dailyDrawdown: 0,
|
|
349
|
+
profitTarget: 0,
|
|
332
350
|
dailyStartingEquity: 0,
|
|
333
351
|
dailyStartingUpdatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
352
|
+
dailyMaxEquity: 0,
|
|
353
|
+
dailyMinEquity: 0,
|
|
354
|
+
dailyMaxUpdatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
355
|
+
dailyMinUpdatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
338
356
|
});
|
|
339
|
-
var
|
|
357
|
+
var tradingDaysCountCalculation = async (closedPnlData, minPositionSize) => {
|
|
340
358
|
if (!closedPnlData || closedPnlData.length === 0) {
|
|
341
359
|
return 0;
|
|
342
360
|
}
|
|
@@ -370,31 +388,31 @@ var currentDailyEquity = (wallet, progress) => {
|
|
|
370
388
|
const { equity, unrealisedPnl } = wallet;
|
|
371
389
|
const {
|
|
372
390
|
dailyStartingEquity,
|
|
373
|
-
|
|
374
|
-
|
|
391
|
+
dailyMaxEquity,
|
|
392
|
+
dailyMinEquity,
|
|
375
393
|
dailyStartingUpdatedAt,
|
|
376
|
-
|
|
377
|
-
|
|
394
|
+
dailyMaxUpdatedAt,
|
|
395
|
+
dailyMinUpdatedAt
|
|
378
396
|
} = progress;
|
|
379
397
|
let isSameDay = isSameUtcDay(dailyStartingUpdatedAt, startDateStr);
|
|
380
398
|
const newDailyStartingUpdatedAt = isSameDay ? dailyStartingUpdatedAt : startDateStr;
|
|
381
399
|
const newDailyStartingEquity = isSameDay ? dailyStartingEquity : equity;
|
|
382
|
-
isSameDay = isSameUtcDay(
|
|
383
|
-
let newMaxUpdatedAt = isSameDay ?
|
|
384
|
-
const
|
|
385
|
-
isSameDay = isSameUtcDay(
|
|
386
|
-
const newMinUpdatedAt = isSameDay ?
|
|
387
|
-
const
|
|
388
|
-
const dailyEquityDrawdown = equity -
|
|
400
|
+
isSameDay = isSameUtcDay(dailyMaxUpdatedAt, today);
|
|
401
|
+
let newMaxUpdatedAt = isSameDay ? dailyMaxUpdatedAt : today;
|
|
402
|
+
const newdailyMaxEquity = Math.max(isSameDay ? dailyMaxEquity : equity, equity);
|
|
403
|
+
isSameDay = isSameUtcDay(dailyMinUpdatedAt, today);
|
|
404
|
+
const newMinUpdatedAt = isSameDay ? dailyMinUpdatedAt : today;
|
|
405
|
+
const newdailyMinEquity = Math.min(isSameDay ? dailyMinEquity : equity, equity);
|
|
406
|
+
const dailyEquityDrawdown = equity - newdailyMaxEquity;
|
|
389
407
|
return {
|
|
390
408
|
currentEquity: equity,
|
|
391
|
-
|
|
409
|
+
dailyDrawdown: dailyEquityDrawdown,
|
|
392
410
|
dailyStartingEquity: newDailyStartingEquity,
|
|
393
411
|
dailyStartingUpdatedAt: newDailyStartingUpdatedAt.slice(0, 10),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
412
|
+
dailyMaxEquity: newdailyMaxEquity,
|
|
413
|
+
dailyMaxUpdatedAt: newMaxUpdatedAt,
|
|
414
|
+
dailyMinEquity: newdailyMinEquity,
|
|
415
|
+
dailyMinUpdatedAt: newMinUpdatedAt
|
|
398
416
|
};
|
|
399
417
|
};
|
|
400
418
|
|
|
@@ -402,7 +420,6 @@ exports.applyDemoMoney = applyDemoMoney;
|
|
|
402
420
|
exports.createDefaultProgress = createDefaultProgress;
|
|
403
421
|
exports.createDefaultWallet = createDefaultWallet;
|
|
404
422
|
exports.currentDailyEquity = currentDailyEquity;
|
|
405
|
-
exports.currentTradingDaysCountCalculation = currentTradingDaysCountCalculation;
|
|
406
423
|
exports.getAccountInfo = getAccountInfo;
|
|
407
424
|
exports.getApiKeyInfo = getApiKeyInfo;
|
|
408
425
|
exports.getClosedPnl = getClosedPnl;
|
|
@@ -412,5 +429,6 @@ exports.isSameUtcDay = isSameUtcDay;
|
|
|
412
429
|
exports.parseNumber = parseNumber;
|
|
413
430
|
exports.signBybitRequest = signBybitRequest;
|
|
414
431
|
exports.toIsoDate = toIsoDate;
|
|
432
|
+
exports.tradingDaysCountCalculation = tradingDaysCountCalculation;
|
|
415
433
|
//# sourceMappingURL=index.cjs.map
|
|
416
434
|
//# sourceMappingURL=index.cjs.map
|