bitget-api 2.0.13 → 2.1.0

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.
@@ -0,0 +1,121 @@
1
+ /**
2
+ *
3
+ * * Margin | Cross/Isolated | Order Record
4
+ *
5
+ */
6
+ export interface GetBorrowHistoryRequestV2 {
7
+ loanId?: string;
8
+ coin?: string;
9
+ startTime: string;
10
+ endTime?: string;
11
+ limit?: string;
12
+ idLessThan?: string;
13
+ }
14
+ export interface GetRepayHistoryRequestV2 {
15
+ repayId?: string;
16
+ coin?: string;
17
+ startTime: string;
18
+ endTime?: string;
19
+ limit?: string;
20
+ idLessThan?: string;
21
+ }
22
+ export interface GetInterestHistoryRequestV2 {
23
+ coin?: string;
24
+ startTime: string;
25
+ endTime?: string;
26
+ limit?: string;
27
+ idLessThan?: string;
28
+ }
29
+ export interface GetLiquidationHistoryRequestV2 {
30
+ startTime: string;
31
+ endTime?: string;
32
+ limit?: string;
33
+ idLessThan?: string;
34
+ }
35
+ export interface GetFinancialHistoryRequestV2 {
36
+ marginType?: string;
37
+ coin?: string;
38
+ startTime: string;
39
+ endTime?: string;
40
+ limit?: string;
41
+ idLessThan?: string;
42
+ }
43
+ /**
44
+ *
45
+ * * Margin | Cross/Isolated | Account
46
+ *
47
+ */
48
+ /**
49
+ *
50
+ * * Margin | Cross/Isolated | Trade
51
+ *
52
+ */
53
+ export declare type MarginOrderTypeV2 = 'limit' | 'market';
54
+ export declare type MarginLoanTypeV2 = 'normal' | 'autoLoan' | 'autoRepay' | 'autoLoanAndRepay';
55
+ export declare type MarginTimeInForceV2 = 'gtc' | 'post_only' | 'fok' | 'ioc';
56
+ export declare type MarginOrderSideV2 = 'buy' | 'sell';
57
+ export declare type MarginSTPModeV2 = 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
58
+ export interface MarginPlaceOrderRequestV2 {
59
+ symbol: string;
60
+ orderType: MarginOrderTypeV2;
61
+ price?: string;
62
+ loanType: MarginLoanTypeV2;
63
+ force: MarginTimeInForceV2;
64
+ baseSize?: string;
65
+ quoteSize?: string;
66
+ clientOid?: string;
67
+ side: MarginOrderSideV2;
68
+ stpMode?: MarginSTPModeV2;
69
+ }
70
+ export interface MarginBatchOrderEntry {
71
+ orderType: MarginOrderTypeV2;
72
+ price?: string;
73
+ loanType: MarginLoanTypeV2;
74
+ force: MarginTimeInForceV2;
75
+ baseSize?: string;
76
+ quoteSize?: string;
77
+ clientOid?: string;
78
+ side: MarginOrderSideV2;
79
+ stpMode?: MarginSTPModeV2;
80
+ }
81
+ export interface MarginBatchOrdersRequestV2 {
82
+ symbol: string;
83
+ orderList: MarginBatchOrderEntry[];
84
+ }
85
+ export interface GetMarginCurrentOrdersRequestV2 {
86
+ symbol: string;
87
+ orderId?: string;
88
+ clientOid?: string;
89
+ startTime: string;
90
+ endTime?: string;
91
+ limit?: string;
92
+ idLessThan?: string;
93
+ }
94
+ export interface GetHistoryOrdersRequestV2 {
95
+ symbol: string;
96
+ orderId?: string;
97
+ enterPointSource?: string;
98
+ clientOid?: string;
99
+ startTime: string;
100
+ endTime?: string;
101
+ limit?: string;
102
+ idLessThan?: string;
103
+ }
104
+ export interface GetMarginOrderFillsRequestV2 {
105
+ symbol: string;
106
+ orderId?: string;
107
+ idLessThan?: string;
108
+ startTime: string;
109
+ endTime?: string;
110
+ limit?: string;
111
+ }
112
+ export interface GetMarginLiquidationOrdersRequestV2 {
113
+ type?: 'swap' | 'place_order';
114
+ symbol?: string;
115
+ fromCoin?: string;
116
+ toCoin?: string;
117
+ startTime?: string;
118
+ endTime?: string;
119
+ limit?: string;
120
+ idLessThan?: string;
121
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * * Margin | Cross/Isolated | Order Record
5
+ *
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=margin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"margin.js","sourceRoot":"","sources":["../../../../src/types/request/v2/margin.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -6,4 +6,260 @@ export interface SpotCandlesRequestV2 {
6
6
  endTime?: string;
7
7
  limit?: string;
8
8
  }
9
+ export interface SpotHistoricCandlesRequestV2 {
10
+ symbol: string;
11
+ granularity: SpotKlineIntervalV2;
12
+ endTime?: string;
13
+ limit?: string;
14
+ }
15
+ export interface SpotHistoricTradesRequestV2 {
16
+ symbol: string;
17
+ limit?: string;
18
+ idLessThan?: string;
19
+ startTime?: string;
20
+ endTime?: string;
21
+ }
22
+ /**
23
+ *
24
+ * * Spot | Trade
25
+ *
26
+ */
27
+ export declare type SpotOrderSideV2 = 'buy' | 'sell';
28
+ export declare type SpotOrderTypeV2 = 'limit' | 'market';
29
+ export declare type SpotOrderForceV2 = 'gtc' | 'post_only' | 'fok' | 'ioc';
30
+ export declare type SpotTPSLTypeV2 = 'normal' | 'tpsl';
31
+ export declare type SpotSTPModeV2 = 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
32
+ export declare type SpotBatchModeV2 = 'single' | 'multiple';
33
+ export interface SpotOrderRequestV2 {
34
+ symbol: string;
35
+ side: SpotOrderSideV2;
36
+ orderType: SpotOrderTypeV2;
37
+ force: SpotOrderForceV2;
38
+ price?: string;
39
+ size: string;
40
+ clientOid?: string;
41
+ triggerPrice?: string;
42
+ tpslType?: SpotTPSLTypeV2;
43
+ requestTime?: string;
44
+ receiveWindow?: string;
45
+ stpMode?: SpotSTPModeV2;
46
+ presetTakeProfitPrice?: string;
47
+ executeTakeProfitPrice?: string;
48
+ presetStopLossPrice?: string;
49
+ executeStopLossPrice?: string;
50
+ }
51
+ export interface SpotCancelandSubmitOrderRequestV2 {
52
+ symbol: string;
53
+ price: string;
54
+ size: string;
55
+ orderId?: string;
56
+ clientOid?: string;
57
+ newClientOid?: string;
58
+ presetTakeProfitPrice?: string;
59
+ executeTakeProfitPrice?: string;
60
+ presetStopLossPrice?: string;
61
+ executeStopLossPrice?: string;
62
+ }
63
+ export interface SpotCancelOrderRequestV2 {
64
+ symbol: string;
65
+ tpslType?: SpotTPSLTypeV2;
66
+ orderId?: string;
67
+ clientOid?: string;
68
+ }
69
+ export interface SpotBatchOrderRequestItemV2 {
70
+ symbol?: string;
71
+ side: SpotOrderSideV2;
72
+ orderType: SpotOrderTypeV2;
73
+ force: SpotOrderForceV2;
74
+ price?: string;
75
+ size: string;
76
+ clientOid?: string;
77
+ stpMode?: SpotSTPModeV2;
78
+ presetTakeProfitPrice?: string;
79
+ executeTakeProfitPrice?: string;
80
+ presetStopLossPrice?: string;
81
+ executeStopLossPrice?: string;
82
+ }
83
+ export interface SpotBatchOrderRequestV2 {
84
+ symbol?: string;
85
+ batchMode?: SpotBatchModeV2;
86
+ orderList: SpotBatchOrderRequestItemV2[];
87
+ }
88
+ export interface SpotBatchCancelOrderRequestV2 {
89
+ symbol?: string;
90
+ batchMode?: SpotBatchModeV2;
91
+ orderList: {
92
+ symbol?: string;
93
+ orderId?: string;
94
+ clientOid?: string;
95
+ }[];
96
+ }
97
+ export interface GetSpotOrderInfoRequestV2 {
98
+ orderId?: string;
99
+ clientOid?: string;
100
+ requestTime?: string;
101
+ receiveWindow?: string;
102
+ }
103
+ export interface GetSpotOpenOrdersRequestV2 {
104
+ symbol?: string;
105
+ startTime?: string;
106
+ endTime?: string;
107
+ idLessThan?: string;
108
+ limit?: string;
109
+ orderId?: string;
110
+ tpslType?: SpotTPSLTypeV2;
111
+ requestTime?: string;
112
+ receiveWindow?: string;
113
+ }
114
+ export interface GetSpotHistoryOrdersRequestV2 {
115
+ symbol?: string;
116
+ startTime?: string;
117
+ endTime?: string;
118
+ idLessThan?: string;
119
+ limit?: string;
120
+ orderId?: string;
121
+ tpslType?: SpotTPSLTypeV2;
122
+ requestTime?: string;
123
+ receiveWindow?: string;
124
+ }
125
+ export interface GetSpotFillsRequestV2 {
126
+ symbol: string;
127
+ orderId?: string;
128
+ startTime?: string;
129
+ endTime?: string;
130
+ limit?: string;
131
+ idLessThan?: string;
132
+ }
133
+ /**
134
+ *
135
+ * * Spot | Trigger Orders
136
+ *
137
+ */
138
+ export declare type SpotPlanTypeV2 = 'amount' | 'total';
139
+ export declare type SpotTriggerTypeV2 = 'fill_price' | 'mark_price';
140
+ export interface SpotPlanOrderRequestV2 {
141
+ symbol: string;
142
+ side: SpotOrderSideV2;
143
+ triggerPrice: string;
144
+ orderType: SpotOrderTypeV2;
145
+ executePrice?: string;
146
+ planType?: SpotPlanTypeV2;
147
+ size: string;
148
+ triggerType: SpotTriggerTypeV2;
149
+ clientOid?: string;
150
+ force?: SpotOrderForceV2;
151
+ stpMode?: SpotSTPModeV2;
152
+ }
153
+ export interface SpotModifyPlanOrderRequestV2 {
154
+ orderId?: string;
155
+ clientOid?: string;
156
+ triggerPrice: string;
157
+ orderType: SpotOrderTypeV2;
158
+ executePrice?: string;
159
+ size: string;
160
+ }
161
+ export interface GetSpotCurrentPlanOrdersRequestV2 {
162
+ symbol: string;
163
+ limit?: string;
164
+ idLessThan?: string;
165
+ startTime?: string;
166
+ endTime?: string;
167
+ }
168
+ export interface GetSpotHistoryPlanOrdersRequestV2 {
169
+ symbol: string;
170
+ startTime: string;
171
+ endTime: string;
172
+ limit?: string;
173
+ }
174
+ /**
175
+ *
176
+ * * Spot | Account
177
+ *
178
+ */
179
+ export declare type SpotBillGroupTypeV2 = 'deposit' | 'withdraw' | 'transaction' | 'transfer' | 'other';
180
+ export declare type SpotBusinessTypeV2 = 'deposit' | 'withdraw' | 'buy' | 'sell' | 'deduction of handling fee' | 'transfer-in' | 'transfer-out' | 'rebate rewards' | 'airdrop rewards' | 'USDT contract rewards' | 'mix contract rewards' | 'system lock' | 'user lock';
181
+ export declare type SpotAccountTypeV2 = 'spot' | 'p2p' | 'coin_futures' | 'usdt_futures' | 'usdc_futures' | 'crossed_margin' | 'isolated_margin';
182
+ export interface GetSpotAccountBillsRequestV2 {
183
+ coin?: string;
184
+ groupType?: SpotBillGroupTypeV2;
185
+ businessType?: SpotBusinessTypeV2;
186
+ startTime?: string;
187
+ endTime?: string;
188
+ limit?: string;
189
+ idLessThan?: string;
190
+ }
191
+ export interface SpotTransferRequestV2 {
192
+ fromType: SpotAccountTypeV2;
193
+ toType: SpotAccountTypeV2;
194
+ amount: string;
195
+ coin: string;
196
+ symbol: string;
197
+ clientOid?: string;
198
+ }
199
+ export interface SpotSubAccountTransferRequestV2 {
200
+ fromType: SpotAccountTypeV2;
201
+ toType: SpotAccountTypeV2;
202
+ amount: string;
203
+ coin: string;
204
+ symbol?: string;
205
+ clientOid?: string;
206
+ fromUserId: string;
207
+ toUserId: string;
208
+ }
209
+ export interface SpotWithdrawalRequestV2 {
210
+ coin: string;
211
+ transferType: 'on_chain' | 'internal_transfer';
212
+ address: string;
213
+ chain?: string;
214
+ innerToType?: 'email' | 'mobile' | 'uid';
215
+ areaCode?: string;
216
+ tag?: string;
217
+ size: string;
218
+ remark?: string;
219
+ clientOid?: string;
220
+ }
221
+ export interface SpotMainSubTransferRecordRequestV2 {
222
+ coin?: string;
223
+ role?: 'initiator' | 'receiver';
224
+ subUid?: string;
225
+ startTime?: string;
226
+ endTime?: string;
227
+ clientOid?: string;
228
+ limit?: string;
229
+ idLessThan?: string;
230
+ }
231
+ export interface GetSpotTransferRecordRequestV2 {
232
+ coin: string;
233
+ fromType: SpotAccountTypeV2;
234
+ startTime?: string;
235
+ endTime?: string;
236
+ clientOid?: string;
237
+ limit?: string;
238
+ idLessThan?: string;
239
+ }
240
+ export interface GetSpotSubAccountDepositRecordRequestV2 {
241
+ subUid: string;
242
+ coin?: string;
243
+ startTime?: string;
244
+ endTime?: string;
245
+ idLessThan?: string;
246
+ limit?: string;
247
+ }
248
+ export interface GetSpotWithdrawalRecordRequestV2 {
249
+ coin?: string;
250
+ clientOid?: string;
251
+ startTime: string;
252
+ endTime: string;
253
+ idLessThan?: string;
254
+ orderId?: string;
255
+ limit?: string;
256
+ }
257
+ export interface GetSpotDepositRecordRequestV2 {
258
+ coin?: string;
259
+ orderId?: string;
260
+ startTime: string;
261
+ endTime: string;
262
+ idLessThan?: string;
263
+ limit?: string;
264
+ }
9
265
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitget-api",
3
- "version": "2.0.13",
3
+ "version": "2.1.0",
4
4
  "description": "Node.js & JavaScript SDK for Bitget REST APIs & WebSockets, with TypeScript & end-to-end tests.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",