@anrmk/str-package 0.2.11 → 0.2.12

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.
Files changed (38) hide show
  1. package/dist/IBybitSignRequest-cA1RCbDS.d.cts +13 -0
  2. package/dist/IBybitSignRequest-cA1RCbDS.d.ts +13 -0
  3. package/dist/{chunk-EMX46ZCF.js → chunk-A26C5LUZ.js} +3 -3
  4. package/dist/{chunk-EMX46ZCF.js.map → chunk-A26C5LUZ.js.map} +1 -1
  5. package/dist/{chunk-ZD6QLSNZ.js → chunk-T23XINGG.js} +48 -10
  6. package/dist/chunk-T23XINGG.js.map +1 -0
  7. package/dist/chunk-V45RVFQE.js +39 -0
  8. package/dist/chunk-V45RVFQE.js.map +1 -0
  9. package/dist/clients/index.cjs +5 -7
  10. package/dist/clients/index.cjs.map +1 -1
  11. package/dist/clients/index.d.cts +3 -2
  12. package/dist/clients/index.d.ts +3 -2
  13. package/dist/clients/index.js +3 -2
  14. package/dist/{enums-Dmg2vIi2.d.cts → enums-CFM0khJf.d.cts} +16 -1
  15. package/dist/{enums-Dmg2vIi2.d.ts → enums-CFM0khJf.d.ts} +16 -1
  16. package/dist/index.cjs +46 -7
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +4 -3
  19. package/dist/index.d.ts +4 -3
  20. package/dist/index.js +3 -2
  21. package/dist/providers/bybit/index.cjs +46 -7
  22. package/dist/providers/bybit/index.cjs.map +1 -1
  23. package/dist/providers/bybit/index.d.cts +6 -3
  24. package/dist/providers/bybit/index.d.ts +6 -3
  25. package/dist/providers/bybit/index.js +2 -1
  26. package/dist/types/bybit/index.cjs +15 -0
  27. package/dist/types/bybit/index.cjs.map +1 -1
  28. package/dist/types/bybit/index.d.cts +137 -112
  29. package/dist/types/bybit/index.d.ts +137 -112
  30. package/dist/types/bybit/index.js +1 -24
  31. package/dist/types/bybit/index.js.map +1 -1
  32. package/dist/types/challenge/index.d.cts +1 -1
  33. package/dist/types/challenge/index.d.ts +1 -1
  34. package/dist/utils/index.d.cts +1 -2
  35. package/dist/utils/index.d.ts +1 -2
  36. package/dist/utils/index.js +2 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-ZD6QLSNZ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/bybit/enums.ts"],"names":["IBybitAccountType","IBybitCoinType","IBybitApiKeyVipLevel"],"mappings":";;;AAAO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAFG,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;AAKL,IAAK,cAAA,qBAAAC,eAAAA,KAAL;AACL,EAAAA,gBAAA,KAAA,CAAA,GAAM,KAAA;AACN,EAAAA,gBAAA,KAAA,CAAA,GAAM,KAAA;AACN,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AAJG,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAoBL,IAAK,oBAAA,qBAAAC,qBAAAA,KAAL;AACL,EAAAA,sBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AANE,EAAA,OAAAA,qBAAAA;AAAA,CAAA,EAAA,oBAAA,IAAA,EAAA","file":"index.cjs","sourcesContent":["export enum IBybitAccountType {\n UNIFIED = \"UNIFIED\",\n FUND = \"FUND\",\n}\n\nexport enum IBybitCoinType {\n BTC = \"BTC\",\n ETH = \"ETH\",\n USDT = \"USDT\",\n USDC = \"USDC\",\n}\n\nexport enum IBybitOrderType {\n MARKET = \"Market\",\n LIMIT = \"Limit\",\n}\n\nexport enum IBybitUnifiedMarginStatus {\n CLASSIC_ACCOUNT = 1,\n UNIFIED_TRADING_ACCOUNT_1_0 = 3,\n UNIFIED_TRADING_ACCOUNT_1_0_PRO = 4,\n UNIFIED_TRADING_ACCOUNT_2_0 = 5,\n UNIFIED_TRADING_ACCOUNT_2_0_PRO = 6,\n}\n\nexport enum IBybitApiKeyVipLevel {\n NO_VIP = \"No VIP\",\n VIP_1 = \"VIP 1\",\n VIP_2 = \"VIP 2\",\n VIP_3 = \"VIP 3\",\n VIP_4 = \"VIP 4\",\n VIP_5 = \"VIP 5\",\n}\n\n// Position side. Buy: long, Sell: short\n// return an empty string \"\" for an empty position\nexport enum IBybitPositionSide {\n SELL = \"Sell\",\n BUY = \"Buy\",\n EMPTY = \"\",\n}"]}
1
+ {"version":3,"sources":["../../../src/types/bybit/enums.ts"],"names":["IBybitAccountType","IBybitCoinType","IBybitApiKeyVipLevel","IBybitCategory","IBybitMarginMode"],"mappings":";;;AAAO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAFG,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;AAKL,IAAK,cAAA,qBAAAC,eAAAA,KAAL;AACL,EAAAA,gBAAA,KAAA,CAAA,GAAM,KAAA;AACN,EAAAA,gBAAA,KAAA,CAAA,GAAM,KAAA;AACN,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AAJG,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAoBL,IAAK,oBAAA,qBAAAC,qBAAAA,KAAL;AACL,EAAAA,sBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AANE,EAAA,OAAAA,qBAAAA;AAAA,CAAA,EAAA,oBAAA,IAAA,EAAA;AAiBL,IAAK,cAAA,qBAAAC,eAAAA,KAAL;AACL,EAAAA,gBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,gBAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,gBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AAJG,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAOL,IAAK,gBAAA,qBAAAC,iBAAAA,KAAL;AACL,EAAAA,kBAAA,iBAAA,CAAA,GAAkB,iBAAA;AAClB,EAAAA,kBAAA,gBAAA,CAAA,GAAiB,gBAAA;AACjB,EAAAA,kBAAA,kBAAA,CAAA,GAAmB,kBAAA;AAHT,EAAA,OAAAA,iBAAAA;AAAA,CAAA,EAAA,gBAAA,IAAA,EAAA","file":"index.cjs","sourcesContent":["export enum IBybitAccountType {\n UNIFIED = \"UNIFIED\",\n FUND = \"FUND\",\n}\n\nexport enum IBybitCoinType {\n BTC = \"BTC\",\n ETH = \"ETH\",\n USDT = \"USDT\",\n USDC = \"USDC\",\n}\n\nexport enum IBybitOrderType {\n MARKET = \"Market\",\n LIMIT = \"Limit\",\n}\n\nexport enum IBybitUnifiedMarginStatus {\n CLASSIC_ACCOUNT = 1,\n UNIFIED_TRADING_ACCOUNT_1_0 = 3,\n UNIFIED_TRADING_ACCOUNT_1_0_PRO = 4,\n UNIFIED_TRADING_ACCOUNT_2_0 = 5,\n UNIFIED_TRADING_ACCOUNT_2_0_PRO = 6,\n}\n\nexport enum IBybitApiKeyVipLevel {\n NO_VIP = \"No VIP\",\n VIP_1 = \"VIP 1\",\n VIP_2 = \"VIP 2\",\n VIP_3 = \"VIP 3\",\n VIP_4 = \"VIP 4\",\n VIP_5 = \"VIP 5\",\n}\n\n// Position side. Buy: long, Sell: short\n// return an empty string \"\" for an empty position\nexport enum IBybitPositionSide {\n SELL = \"Sell\",\n BUY = \"Buy\",\n EMPTY = \"\",\n}\n\nexport enum IBybitCategory {\n LINEAR = \"linear\",\n INVERSE = \"inverse\",\n OPTION = \"option\",\n SPOT = \"spot\",\n}\n\nexport enum IBybitMarginMode {\n ISOLATED_MARGIN = \"ISOLATED_MARGIN\",\n REGULAR_MARGIN = \"REGULAR_MARGIN\",\n PORTFOLIO_MARGIN = \"PORTFOLIO_MARGIN\",\n}"]}
@@ -1,4 +1,61 @@
1
- import { I as IBybitAccountType, c as IBybitPositionSide, a as IBybitApiKeyVipLevel, d as IBybitUnifiedMarginStatus, b as IBybitCoinType } from '../../enums-Dmg2vIi2.cjs';
1
+ import { e as IBybitUnifiedMarginStatus, d as IBybitMarginMode, a as IBybitApiKeyVipLevel, I as IBybitAccountType, c as IBybitCoinType, b as IBybitCategory, f as IBybitPositionSide, g as IBybitOrderType } from '../../enums-CFM0khJf.cjs';
2
+ export { I as IBybitCredentials, a as IBybitSignRequest } from '../../IBybitSignRequest-cA1RCbDS.cjs';
3
+
4
+ type IBybitAccountInfo = {
5
+ unifiedMarginStatus: IBybitUnifiedMarginStatus | number;
6
+ marginMode: IBybitMarginMode;
7
+ isMasterTrader: boolean;
8
+ spotHedgingStatus: "ON" | "OFF";
9
+ updatedTime: string;
10
+ };
11
+
12
+ type IBybitServerTime = {
13
+ timeSecond: string;
14
+ timeNano: string;
15
+ };
16
+
17
+ type IBybitApiKeyInfo = {
18
+ id: string;
19
+ note: string;
20
+ apiKey: string;
21
+ readOnly: number;
22
+ permissions: IBybitApiKeyPermissions;
23
+ ips: string[];
24
+ type: number;
25
+ deadlineDay: number;
26
+ expiredAt: string;
27
+ createdAt: string;
28
+ uta: number;
29
+ userID: number;
30
+ inviterID: number;
31
+ vipLevel: IBybitApiKeyVipLevel;
32
+ mktMakerLevel: string;
33
+ affiliateID: number;
34
+ rsaPublicKey: string;
35
+ isMaster: boolean;
36
+ parentUid: string;
37
+ kycLevel: string;
38
+ kycRegion: string;
39
+ };
40
+ type IBybitApiKeyPermissions = {
41
+ ContractTrade?: string[];
42
+ Spot?: string[];
43
+ Wallet?: string[];
44
+ Options?: string[];
45
+ Derivatives?: string[];
46
+ Exchange?: string[];
47
+ Earn?: string[];
48
+ FiatP2P?: string[];
49
+ FiatBitPay?: string[];
50
+ FiatConvertBroker?: string[];
51
+ BitCard?: string[];
52
+ ByXPost?: string[];
53
+ Affiliate?: string[];
54
+ BlockTrade?: string[];
55
+ FiatBybitPay?: string[];
56
+ NFT?: string[];
57
+ CopyTrading?: string[];
58
+ };
2
59
 
3
60
  type IBybitWalletAccount = {
4
61
  accountIMRate: string;
@@ -40,6 +97,21 @@ type IBybitCoinBalance = {
40
97
  spotBorrow: string;
41
98
  };
42
99
 
100
+ type IBybitDemoApplyMoneyItem = {
101
+ coin: IBybitCoinType;
102
+ amountStr: string;
103
+ };
104
+ type IBybitDemoApplyMoneyRequest = {
105
+ adjustType?: 0 | 1;
106
+ utaDemoApplyMoney: IBybitDemoApplyMoneyItem[];
107
+ };
108
+ type IBybitDemoApplyMoney = {
109
+ resultCode: string;
110
+ utaDemoApplyMoneyConfig: IBybitDemoApplyMoneyItem[];
111
+ orderStatus: string;
112
+ retMsg: string;
113
+ };
114
+
43
115
  type IBybitClosedPnl = {
44
116
  symbol: string;
45
117
  orderId: string;
@@ -61,10 +133,13 @@ type IBybitClosedPnl = {
61
133
  openFee: string;
62
134
  closeFee: string;
63
135
  };
64
-
65
- type IBybitCredentials = {
66
- apiKey: string;
67
- apiSecret: string;
136
+ type IBybitClosedPnlRequest = {
137
+ category?: IBybitCategory.LINEAR | IBybitCategory.INVERSE;
138
+ symbol?: string;
139
+ startTime?: number;
140
+ endTime?: number;
141
+ limit?: number;
142
+ cursor?: string;
68
143
  };
69
144
 
70
145
  type IBybitPositionInfo = {
@@ -102,82 +177,69 @@ type IBybitPositionInfo = {
102
177
  mmrSysUpdatedTime: string;
103
178
  leverageSysUpdatedTime: string;
104
179
  };
105
-
106
- type IBybitApiKeyInfo = {
107
- id: string;
108
- note: string;
109
- apiKey: string;
110
- readOnly: number;
111
- permissions: IBybitApiKeyPermissions;
112
- ips: string[];
113
- type: number;
114
- deadlineDay: number;
115
- expiredAt: string;
116
- createdAt: string;
117
- uta: number;
118
- userID: number;
119
- inviterID: number;
120
- vipLevel: IBybitApiKeyVipLevel;
121
- mktMakerLevel: string;
122
- affiliateID: number;
123
- rsaPublicKey: string;
124
- isMaster: boolean;
125
- parentUid: string;
126
- kycLevel: string;
127
- kycRegion: string;
128
- };
129
- type IBybitApiKeyPermissions = {
130
- ContractTrade?: string[];
131
- Spot?: string[];
132
- Wallet?: string[];
133
- Options?: string[];
134
- Derivatives?: string[];
135
- Exchange?: string[];
136
- Earn?: string[];
137
- FiatP2P?: string[];
138
- FiatBitPay?: string[];
139
- FiatConvertBroker?: string[];
140
- BitCard?: string[];
141
- ByXPost?: string[];
142
- Affiliate?: string[];
143
- BlockTrade?: string[];
144
- FiatBybitPay?: string[];
145
- NFT?: string[];
146
- CopyTrading?: string[];
180
+ type IBybitPositionInfoRequest = {
181
+ category: IBybitCategory.LINEAR | IBybitCategory.INVERSE | IBybitCategory.OPTION;
182
+ symbol?: string;
183
+ baseCoin?: string;
184
+ settleCoin?: string;
185
+ limit?: number;
186
+ cursor?: string;
147
187
  };
148
-
149
- type IBybitAccountInfo = {
150
- unifiedMarginStatus: IBybitUnifiedMarginStatus | number;
151
- marginMode: "ISOLATED_MARGIN" | "REGULAR_MARGIN" | "PORTFOLIO_MARGIN";
152
- isMasterTrader: boolean;
153
- spotHedgingStatus: "ON" | "OFF";
154
- updatedTime: string;
155
- dcpStatus?: "ON" | "OFF";
156
- timeWindow?: number;
157
- smpGroup?: number;
188
+ type IBybitPositionInfoResponse = {
189
+ category: IBybitCategory;
190
+ list?: IBybitPositionInfo[];
191
+ nextPageCursor?: string;
158
192
  };
159
193
 
160
- type IBybitDemoApplyMoneyItem = {
161
- coin: IBybitCoinType;
162
- amountStr: string;
194
+ type IBybitOrderCreateBatchPayload = {
195
+ symbol: string;
196
+ isLeverage?: 0 | 1;
197
+ side: IBybitPositionSide.BUY | IBybitPositionSide.SELL;
198
+ orderType: IBybitOrderType;
199
+ qty: string;
200
+ marketUnit?: "baseCoin" | "quoteCoin";
201
+ price?: string;
202
+ triggerDirection?: 1 | 2;
203
+ orderFilter?: "Order" | "tpslOrder" | "StopOrder";
204
+ triggerPrice?: string;
205
+ triggerBy?: "LastPrice" | "IndexPrice" | "MarkPrice";
206
+ orderIv?: string;
207
+ timeInForce?: "GTC" | "IOC" | "FOK" | "PostOnly";
208
+ positionIdx?: 0 | 1 | 2;
209
+ orderLinkId?: string;
210
+ takeProfit?: string;
211
+ stopLoss?: string;
212
+ tpTriggerBy?: "LastPrice" | "IndexPrice" | "MarkPrice";
213
+ slTriggerBy?: "LastPrice" | "IndexPrice" | "MarkPrice";
214
+ reduceOnly?: boolean;
215
+ closeOnTrigger?: boolean;
216
+ smpType?: string;
217
+ mmp?: boolean;
218
+ tpslMode?: "Full" | "Partial";
219
+ tpLimitPrice?: string;
220
+ slLimitPrice?: string;
221
+ tpOrderType?: IBybitOrderType;
222
+ slOrderType?: IBybitOrderType;
163
223
  };
164
- type IBybitDemoApplyMoneyRequest = {
165
- adjustType?: 0 | 1;
166
- utaDemoApplyMoney: IBybitDemoApplyMoneyItem[];
224
+ type IBybitOrderCreateBatch = {
225
+ category: IBybitCategory;
226
+ symbol: string;
227
+ orderId: string;
228
+ orderLinkId: string;
229
+ createAt: string;
167
230
  };
168
- type IBybitDemoApplyMoneyPayload = IBybitDemoApplyMoneyRequest & {
169
- challengeId?: string;
231
+ type IBybitOrderCreateBatchExtInfo = {
232
+ code: number;
233
+ msg: string;
170
234
  };
171
- type IBybitDemoApplyMoney = {
172
- resultCode: string;
173
- utaDemoApplyMoneyConfig: IBybitDemoApplyMoneyItem[];
174
- orderStatus: string;
175
- retMsg: string;
235
+ type IBybitOrderCreateBatchRequest = {
236
+ category: IBybitCategory;
237
+ request: IBybitOrderCreateBatchPayload[];
176
238
  };
177
-
178
- type IBybitServerTime = {
179
- timeSecond: string;
180
- timeNano: string;
239
+ type IBybitOrderCreateBatchResponse = IBybitApiResponse<IBybitApiResponseList<IBybitOrderCreateBatch>> & {
240
+ retExtInfo: {
241
+ list: IBybitOrderCreateBatchExtInfo[];
242
+ };
181
243
  };
182
244
 
183
245
  type IBybitApiResponse<T> = {
@@ -190,42 +252,5 @@ type IBybitApiResponseList<T> = {
190
252
  nextPageCursor?: string;
191
253
  list?: T[];
192
254
  };
193
- type IBybitResponse = {
194
- updatedAt: number;
195
- };
196
- type IBybitWalletResponse = IBybitResponse & {
197
- topic: string;
198
- list?: IBybitWalletAccount[];
199
- };
200
- type IBybitClosedPnlRequest = {
201
- category: string;
202
- symbol?: string;
203
- startTime?: number;
204
- endTime?: number;
205
- limit?: number;
206
- cursor?: string;
207
- };
208
- type IBybitClosedPnlResponse = {
209
- category: string;
210
- list?: IBybitClosedPnl[];
211
- nextPageCursor?: string;
212
- };
213
- type IBybitSignRequest = {
214
- credentials: IBybitCredentials;
215
- recvWindow?: string;
216
- queryString?: string;
217
- timeOffset?: number;
218
- };
219
- type IBybitPositionInfoRequest = {
220
- category?: string;
221
- symbol?: string;
222
- settleCoin?: string;
223
- cursor?: string;
224
- };
225
- type IBybitPositionInfoResponse = {
226
- category: string;
227
- list?: IBybitPositionInfo[];
228
- nextPageCursor?: string;
229
- };
230
255
 
231
- export { type IBybitAccountInfo, IBybitAccountType, type IBybitApiKeyInfo, IBybitApiKeyVipLevel, type IBybitApiResponse, type IBybitApiResponseList, type IBybitClosedPnl, type IBybitClosedPnlRequest, type IBybitClosedPnlResponse, type IBybitCoinBalance, IBybitCoinType, type IBybitCredentials, type IBybitDemoApplyMoneyItem, type IBybitDemoApplyMoneyPayload, type IBybitDemoApplyMoneyRequest, type IBybitDemoApplyMoney as IBybitDemoApplyMoneyResponse, type IBybitPositionInfo, type IBybitPositionInfoRequest, type IBybitPositionInfoResponse, type IBybitServerTime, type IBybitSignRequest, type IBybitWalletAccount, type IBybitWalletResponse };
256
+ export { type IBybitAccountInfo, IBybitAccountType, type IBybitApiKeyInfo, type IBybitApiKeyPermissions, IBybitApiKeyVipLevel, type IBybitApiResponse, type IBybitApiResponseList, IBybitCategory, type IBybitClosedPnl, type IBybitClosedPnlRequest, type IBybitCoinBalance, IBybitCoinType, type IBybitDemoApplyMoney, type IBybitDemoApplyMoneyItem, type IBybitDemoApplyMoneyRequest, IBybitMarginMode, type IBybitOrderCreateBatchPayload, type IBybitOrderCreateBatchRequest, type IBybitOrderCreateBatchResponse, type IBybitPositionInfo, type IBybitPositionInfoRequest, type IBybitPositionInfoResponse, type IBybitServerTime, type IBybitWalletAccount };
@@ -1,4 +1,61 @@
1
- import { I as IBybitAccountType, c as IBybitPositionSide, a as IBybitApiKeyVipLevel, d as IBybitUnifiedMarginStatus, b as IBybitCoinType } from '../../enums-Dmg2vIi2.js';
1
+ import { e as IBybitUnifiedMarginStatus, d as IBybitMarginMode, a as IBybitApiKeyVipLevel, I as IBybitAccountType, c as IBybitCoinType, b as IBybitCategory, f as IBybitPositionSide, g as IBybitOrderType } from '../../enums-CFM0khJf.js';
2
+ export { I as IBybitCredentials, a as IBybitSignRequest } from '../../IBybitSignRequest-cA1RCbDS.js';
3
+
4
+ type IBybitAccountInfo = {
5
+ unifiedMarginStatus: IBybitUnifiedMarginStatus | number;
6
+ marginMode: IBybitMarginMode;
7
+ isMasterTrader: boolean;
8
+ spotHedgingStatus: "ON" | "OFF";
9
+ updatedTime: string;
10
+ };
11
+
12
+ type IBybitServerTime = {
13
+ timeSecond: string;
14
+ timeNano: string;
15
+ };
16
+
17
+ type IBybitApiKeyInfo = {
18
+ id: string;
19
+ note: string;
20
+ apiKey: string;
21
+ readOnly: number;
22
+ permissions: IBybitApiKeyPermissions;
23
+ ips: string[];
24
+ type: number;
25
+ deadlineDay: number;
26
+ expiredAt: string;
27
+ createdAt: string;
28
+ uta: number;
29
+ userID: number;
30
+ inviterID: number;
31
+ vipLevel: IBybitApiKeyVipLevel;
32
+ mktMakerLevel: string;
33
+ affiliateID: number;
34
+ rsaPublicKey: string;
35
+ isMaster: boolean;
36
+ parentUid: string;
37
+ kycLevel: string;
38
+ kycRegion: string;
39
+ };
40
+ type IBybitApiKeyPermissions = {
41
+ ContractTrade?: string[];
42
+ Spot?: string[];
43
+ Wallet?: string[];
44
+ Options?: string[];
45
+ Derivatives?: string[];
46
+ Exchange?: string[];
47
+ Earn?: string[];
48
+ FiatP2P?: string[];
49
+ FiatBitPay?: string[];
50
+ FiatConvertBroker?: string[];
51
+ BitCard?: string[];
52
+ ByXPost?: string[];
53
+ Affiliate?: string[];
54
+ BlockTrade?: string[];
55
+ FiatBybitPay?: string[];
56
+ NFT?: string[];
57
+ CopyTrading?: string[];
58
+ };
2
59
 
3
60
  type IBybitWalletAccount = {
4
61
  accountIMRate: string;
@@ -40,6 +97,21 @@ type IBybitCoinBalance = {
40
97
  spotBorrow: string;
41
98
  };
42
99
 
100
+ type IBybitDemoApplyMoneyItem = {
101
+ coin: IBybitCoinType;
102
+ amountStr: string;
103
+ };
104
+ type IBybitDemoApplyMoneyRequest = {
105
+ adjustType?: 0 | 1;
106
+ utaDemoApplyMoney: IBybitDemoApplyMoneyItem[];
107
+ };
108
+ type IBybitDemoApplyMoney = {
109
+ resultCode: string;
110
+ utaDemoApplyMoneyConfig: IBybitDemoApplyMoneyItem[];
111
+ orderStatus: string;
112
+ retMsg: string;
113
+ };
114
+
43
115
  type IBybitClosedPnl = {
44
116
  symbol: string;
45
117
  orderId: string;
@@ -61,10 +133,13 @@ type IBybitClosedPnl = {
61
133
  openFee: string;
62
134
  closeFee: string;
63
135
  };
64
-
65
- type IBybitCredentials = {
66
- apiKey: string;
67
- apiSecret: string;
136
+ type IBybitClosedPnlRequest = {
137
+ category?: IBybitCategory.LINEAR | IBybitCategory.INVERSE;
138
+ symbol?: string;
139
+ startTime?: number;
140
+ endTime?: number;
141
+ limit?: number;
142
+ cursor?: string;
68
143
  };
69
144
 
70
145
  type IBybitPositionInfo = {
@@ -102,82 +177,69 @@ type IBybitPositionInfo = {
102
177
  mmrSysUpdatedTime: string;
103
178
  leverageSysUpdatedTime: string;
104
179
  };
105
-
106
- type IBybitApiKeyInfo = {
107
- id: string;
108
- note: string;
109
- apiKey: string;
110
- readOnly: number;
111
- permissions: IBybitApiKeyPermissions;
112
- ips: string[];
113
- type: number;
114
- deadlineDay: number;
115
- expiredAt: string;
116
- createdAt: string;
117
- uta: number;
118
- userID: number;
119
- inviterID: number;
120
- vipLevel: IBybitApiKeyVipLevel;
121
- mktMakerLevel: string;
122
- affiliateID: number;
123
- rsaPublicKey: string;
124
- isMaster: boolean;
125
- parentUid: string;
126
- kycLevel: string;
127
- kycRegion: string;
128
- };
129
- type IBybitApiKeyPermissions = {
130
- ContractTrade?: string[];
131
- Spot?: string[];
132
- Wallet?: string[];
133
- Options?: string[];
134
- Derivatives?: string[];
135
- Exchange?: string[];
136
- Earn?: string[];
137
- FiatP2P?: string[];
138
- FiatBitPay?: string[];
139
- FiatConvertBroker?: string[];
140
- BitCard?: string[];
141
- ByXPost?: string[];
142
- Affiliate?: string[];
143
- BlockTrade?: string[];
144
- FiatBybitPay?: string[];
145
- NFT?: string[];
146
- CopyTrading?: string[];
180
+ type IBybitPositionInfoRequest = {
181
+ category: IBybitCategory.LINEAR | IBybitCategory.INVERSE | IBybitCategory.OPTION;
182
+ symbol?: string;
183
+ baseCoin?: string;
184
+ settleCoin?: string;
185
+ limit?: number;
186
+ cursor?: string;
147
187
  };
148
-
149
- type IBybitAccountInfo = {
150
- unifiedMarginStatus: IBybitUnifiedMarginStatus | number;
151
- marginMode: "ISOLATED_MARGIN" | "REGULAR_MARGIN" | "PORTFOLIO_MARGIN";
152
- isMasterTrader: boolean;
153
- spotHedgingStatus: "ON" | "OFF";
154
- updatedTime: string;
155
- dcpStatus?: "ON" | "OFF";
156
- timeWindow?: number;
157
- smpGroup?: number;
188
+ type IBybitPositionInfoResponse = {
189
+ category: IBybitCategory;
190
+ list?: IBybitPositionInfo[];
191
+ nextPageCursor?: string;
158
192
  };
159
193
 
160
- type IBybitDemoApplyMoneyItem = {
161
- coin: IBybitCoinType;
162
- amountStr: string;
194
+ type IBybitOrderCreateBatchPayload = {
195
+ symbol: string;
196
+ isLeverage?: 0 | 1;
197
+ side: IBybitPositionSide.BUY | IBybitPositionSide.SELL;
198
+ orderType: IBybitOrderType;
199
+ qty: string;
200
+ marketUnit?: "baseCoin" | "quoteCoin";
201
+ price?: string;
202
+ triggerDirection?: 1 | 2;
203
+ orderFilter?: "Order" | "tpslOrder" | "StopOrder";
204
+ triggerPrice?: string;
205
+ triggerBy?: "LastPrice" | "IndexPrice" | "MarkPrice";
206
+ orderIv?: string;
207
+ timeInForce?: "GTC" | "IOC" | "FOK" | "PostOnly";
208
+ positionIdx?: 0 | 1 | 2;
209
+ orderLinkId?: string;
210
+ takeProfit?: string;
211
+ stopLoss?: string;
212
+ tpTriggerBy?: "LastPrice" | "IndexPrice" | "MarkPrice";
213
+ slTriggerBy?: "LastPrice" | "IndexPrice" | "MarkPrice";
214
+ reduceOnly?: boolean;
215
+ closeOnTrigger?: boolean;
216
+ smpType?: string;
217
+ mmp?: boolean;
218
+ tpslMode?: "Full" | "Partial";
219
+ tpLimitPrice?: string;
220
+ slLimitPrice?: string;
221
+ tpOrderType?: IBybitOrderType;
222
+ slOrderType?: IBybitOrderType;
163
223
  };
164
- type IBybitDemoApplyMoneyRequest = {
165
- adjustType?: 0 | 1;
166
- utaDemoApplyMoney: IBybitDemoApplyMoneyItem[];
224
+ type IBybitOrderCreateBatch = {
225
+ category: IBybitCategory;
226
+ symbol: string;
227
+ orderId: string;
228
+ orderLinkId: string;
229
+ createAt: string;
167
230
  };
168
- type IBybitDemoApplyMoneyPayload = IBybitDemoApplyMoneyRequest & {
169
- challengeId?: string;
231
+ type IBybitOrderCreateBatchExtInfo = {
232
+ code: number;
233
+ msg: string;
170
234
  };
171
- type IBybitDemoApplyMoney = {
172
- resultCode: string;
173
- utaDemoApplyMoneyConfig: IBybitDemoApplyMoneyItem[];
174
- orderStatus: string;
175
- retMsg: string;
235
+ type IBybitOrderCreateBatchRequest = {
236
+ category: IBybitCategory;
237
+ request: IBybitOrderCreateBatchPayload[];
176
238
  };
177
-
178
- type IBybitServerTime = {
179
- timeSecond: string;
180
- timeNano: string;
239
+ type IBybitOrderCreateBatchResponse = IBybitApiResponse<IBybitApiResponseList<IBybitOrderCreateBatch>> & {
240
+ retExtInfo: {
241
+ list: IBybitOrderCreateBatchExtInfo[];
242
+ };
181
243
  };
182
244
 
183
245
  type IBybitApiResponse<T> = {
@@ -190,42 +252,5 @@ type IBybitApiResponseList<T> = {
190
252
  nextPageCursor?: string;
191
253
  list?: T[];
192
254
  };
193
- type IBybitResponse = {
194
- updatedAt: number;
195
- };
196
- type IBybitWalletResponse = IBybitResponse & {
197
- topic: string;
198
- list?: IBybitWalletAccount[];
199
- };
200
- type IBybitClosedPnlRequest = {
201
- category: string;
202
- symbol?: string;
203
- startTime?: number;
204
- endTime?: number;
205
- limit?: number;
206
- cursor?: string;
207
- };
208
- type IBybitClosedPnlResponse = {
209
- category: string;
210
- list?: IBybitClosedPnl[];
211
- nextPageCursor?: string;
212
- };
213
- type IBybitSignRequest = {
214
- credentials: IBybitCredentials;
215
- recvWindow?: string;
216
- queryString?: string;
217
- timeOffset?: number;
218
- };
219
- type IBybitPositionInfoRequest = {
220
- category?: string;
221
- symbol?: string;
222
- settleCoin?: string;
223
- cursor?: string;
224
- };
225
- type IBybitPositionInfoResponse = {
226
- category: string;
227
- list?: IBybitPositionInfo[];
228
- nextPageCursor?: string;
229
- };
230
255
 
231
- export { type IBybitAccountInfo, IBybitAccountType, type IBybitApiKeyInfo, IBybitApiKeyVipLevel, type IBybitApiResponse, type IBybitApiResponseList, type IBybitClosedPnl, type IBybitClosedPnlRequest, type IBybitClosedPnlResponse, type IBybitCoinBalance, IBybitCoinType, type IBybitCredentials, type IBybitDemoApplyMoneyItem, type IBybitDemoApplyMoneyPayload, type IBybitDemoApplyMoneyRequest, type IBybitDemoApplyMoney as IBybitDemoApplyMoneyResponse, type IBybitPositionInfo, type IBybitPositionInfoRequest, type IBybitPositionInfoResponse, type IBybitServerTime, type IBybitSignRequest, type IBybitWalletAccount, type IBybitWalletResponse };
256
+ export { type IBybitAccountInfo, IBybitAccountType, type IBybitApiKeyInfo, type IBybitApiKeyPermissions, IBybitApiKeyVipLevel, type IBybitApiResponse, type IBybitApiResponseList, IBybitCategory, type IBybitClosedPnl, type IBybitClosedPnlRequest, type IBybitCoinBalance, IBybitCoinType, type IBybitDemoApplyMoney, type IBybitDemoApplyMoneyItem, type IBybitDemoApplyMoneyRequest, IBybitMarginMode, type IBybitOrderCreateBatchPayload, type IBybitOrderCreateBatchRequest, type IBybitOrderCreateBatchResponse, type IBybitPositionInfo, type IBybitPositionInfoRequest, type IBybitPositionInfoResponse, type IBybitServerTime, type IBybitWalletAccount };
@@ -1,26 +1,3 @@
1
- // src/types/bybit/enums.ts
2
- var IBybitAccountType = /* @__PURE__ */ ((IBybitAccountType2) => {
3
- IBybitAccountType2["UNIFIED"] = "UNIFIED";
4
- IBybitAccountType2["FUND"] = "FUND";
5
- return IBybitAccountType2;
6
- })(IBybitAccountType || {});
7
- var IBybitCoinType = /* @__PURE__ */ ((IBybitCoinType2) => {
8
- IBybitCoinType2["BTC"] = "BTC";
9
- IBybitCoinType2["ETH"] = "ETH";
10
- IBybitCoinType2["USDT"] = "USDT";
11
- IBybitCoinType2["USDC"] = "USDC";
12
- return IBybitCoinType2;
13
- })(IBybitCoinType || {});
14
- var IBybitApiKeyVipLevel = /* @__PURE__ */ ((IBybitApiKeyVipLevel2) => {
15
- IBybitApiKeyVipLevel2["NO_VIP"] = "No VIP";
16
- IBybitApiKeyVipLevel2["VIP_1"] = "VIP 1";
17
- IBybitApiKeyVipLevel2["VIP_2"] = "VIP 2";
18
- IBybitApiKeyVipLevel2["VIP_3"] = "VIP 3";
19
- IBybitApiKeyVipLevel2["VIP_4"] = "VIP 4";
20
- IBybitApiKeyVipLevel2["VIP_5"] = "VIP 5";
21
- return IBybitApiKeyVipLevel2;
22
- })(IBybitApiKeyVipLevel || {});
23
-
24
- export { IBybitAccountType, IBybitApiKeyVipLevel, IBybitCoinType };
1
+ export { IBybitAccountType, IBybitApiKeyVipLevel, IBybitCategory, IBybitCoinType, IBybitMarginMode } from '../../chunk-V45RVFQE.js';
25
2
  //# sourceMappingURL=index.js.map
26
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/bybit/enums.ts"],"names":["IBybitAccountType","IBybitCoinType","IBybitApiKeyVipLevel"],"mappings":";AAAO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACL,EAAAA,mBAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAFG,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;AAKL,IAAK,cAAA,qBAAAC,eAAAA,KAAL;AACL,EAAAA,gBAAA,KAAA,CAAA,GAAM,KAAA;AACN,EAAAA,gBAAA,KAAA,CAAA,GAAM,KAAA;AACN,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,gBAAA,MAAA,CAAA,GAAO,MAAA;AAJG,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAoBL,IAAK,oBAAA,qBAAAC,qBAAAA,KAAL;AACL,EAAAA,sBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,sBAAA,OAAA,CAAA,GAAQ,OAAA;AANE,EAAA,OAAAA,qBAAAA;AAAA,CAAA,EAAA,oBAAA,IAAA,EAAA","file":"index.js","sourcesContent":["export enum IBybitAccountType {\n UNIFIED = \"UNIFIED\",\n FUND = \"FUND\",\n}\n\nexport enum IBybitCoinType {\n BTC = \"BTC\",\n ETH = \"ETH\",\n USDT = \"USDT\",\n USDC = \"USDC\",\n}\n\nexport enum IBybitOrderType {\n MARKET = \"Market\",\n LIMIT = \"Limit\",\n}\n\nexport enum IBybitUnifiedMarginStatus {\n CLASSIC_ACCOUNT = 1,\n UNIFIED_TRADING_ACCOUNT_1_0 = 3,\n UNIFIED_TRADING_ACCOUNT_1_0_PRO = 4,\n UNIFIED_TRADING_ACCOUNT_2_0 = 5,\n UNIFIED_TRADING_ACCOUNT_2_0_PRO = 6,\n}\n\nexport enum IBybitApiKeyVipLevel {\n NO_VIP = \"No VIP\",\n VIP_1 = \"VIP 1\",\n VIP_2 = \"VIP 2\",\n VIP_3 = \"VIP 3\",\n VIP_4 = \"VIP 4\",\n VIP_5 = \"VIP 5\",\n}\n\n// Position side. Buy: long, Sell: short\n// return an empty string \"\" for an empty position\nexport enum IBybitPositionSide {\n SELL = \"Sell\",\n BUY = \"Buy\",\n EMPTY = \"\",\n}"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,4 +1,4 @@
1
- import { a as IBybitApiKeyVipLevel, I as IBybitAccountType, b as IBybitCoinType } from '../../enums-Dmg2vIi2.cjs';
1
+ import { a as IBybitApiKeyVipLevel, I as IBybitAccountType, c as IBybitCoinType } from '../../enums-CFM0khJf.cjs';
2
2
  export { TSyncResponse } from '../index.cjs';
3
3
 
4
4
  type TChallengeType = "ONE_STEP" | "TWO_STEPS" | "THREE_STEPS";
@@ -1,4 +1,4 @@
1
- import { a as IBybitApiKeyVipLevel, I as IBybitAccountType, b as IBybitCoinType } from '../../enums-Dmg2vIi2.js';
1
+ import { a as IBybitApiKeyVipLevel, I as IBybitAccountType, c as IBybitCoinType } from '../../enums-CFM0khJf.js';
2
2
  export { TSyncResponse } from '../index.js';
3
3
 
4
4
  type TChallengeType = "ONE_STEP" | "TWO_STEPS" | "THREE_STEPS";
@@ -1,5 +1,4 @@
1
- import { IBybitSignRequest } from '../types/bybit/index.cjs';
2
- import '../enums-Dmg2vIi2.cjs';
1
+ import { a as IBybitSignRequest } from '../IBybitSignRequest-cA1RCbDS.cjs';
3
2
 
4
3
  declare function signBybitRequest(request: IBybitSignRequest): {
5
4
  signature: string;
@@ -1,5 +1,4 @@
1
- import { IBybitSignRequest } from '../types/bybit/index.js';
2
- import '../enums-Dmg2vIi2.js';
1
+ import { a as IBybitSignRequest } from '../IBybitSignRequest-cA1RCbDS.js';
3
2
 
4
3
  declare function signBybitRequest(request: IBybitSignRequest): {
5
4
  signature: string;
@@ -1,4 +1,5 @@
1
1
  export { isSameUtcDay, parseNumber, toIsoDate } from '../chunk-36QZINNQ.js';
2
- export { getBybitTimestamp, signBybitRequest, syncBybitServerTime } from '../chunk-ZD6QLSNZ.js';
2
+ export { getBybitTimestamp, signBybitRequest, syncBybitServerTime } from '../chunk-T23XINGG.js';
3
+ import '../chunk-V45RVFQE.js';
3
4
  //# sourceMappingURL=index.js.map
4
5
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anrmk/str-package",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Shared providers, types, and utils for STR services",
5
5
  "license": "MIT",
6
6
  "type": "module",