@medievalrain/binance-ts 0.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +1548 -0
  2. package/dist/index.js +1145 -0
  3. package/package.json +42 -0
@@ -0,0 +1,1548 @@
1
+ import z$1, { z } from "zod";
2
+ import { Client } from "undici";
3
+ import * as z4 from "zod/v4/core";
4
+
5
+ //#region src/types.d.ts
6
+ type ApiCredentials = {
7
+ key: string;
8
+ secret: string;
9
+ };
10
+ //#endregion
11
+ //#region src/rest/futures/schema.d.ts
12
+ declare const FuturesTestConnectivitySchema: z.ZodObject<{}, z.core.$strip>;
13
+ declare const FuturesCheckServerTimeSchema: z.ZodObject<{
14
+ serverTime: z.ZodNumber;
15
+ }, z.core.$strip>;
16
+ declare const FuturesExchangeInfoRateLimitSchema: z.ZodObject<{
17
+ interval: z.ZodEnum<{
18
+ MINUTE: "MINUTE";
19
+ SECOND: "SECOND";
20
+ }>;
21
+ intervalNum: z.ZodNumber;
22
+ limit: z.ZodNumber;
23
+ rateLimitType: z.ZodEnum<{
24
+ REQUEST_WEIGHT: "REQUEST_WEIGHT";
25
+ ORDERS: "ORDERS";
26
+ }>;
27
+ }, z.core.$strip>;
28
+ declare const FuturesExchangeInfoAssetSchema: z.ZodObject<{
29
+ asset: z.ZodString;
30
+ marginAvailable: z.ZodBoolean;
31
+ autoAssetExchange: z.ZodNullable<z.ZodString>;
32
+ }, z.core.$strip>;
33
+ declare const FuturesExchangeInfoFilterSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ filterType: z.ZodLiteral<"PRICE_FILTER">;
35
+ maxPrice: z.ZodCoercedNumber<unknown>;
36
+ minPrice: z.ZodCoercedNumber<unknown>;
37
+ tickSize: z.ZodCoercedNumber<unknown>;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ filterType: z.ZodLiteral<"LOT_SIZE">;
40
+ maxQty: z.ZodCoercedNumber<unknown>;
41
+ minQty: z.ZodCoercedNumber<unknown>;
42
+ stepSize: z.ZodCoercedNumber<unknown>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ filterType: z.ZodLiteral<"MARKET_LOT_SIZE">;
45
+ maxQty: z.ZodCoercedNumber<unknown>;
46
+ minQty: z.ZodCoercedNumber<unknown>;
47
+ stepSize: z.ZodCoercedNumber<unknown>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ filterType: z.ZodLiteral<"MAX_NUM_ORDERS">;
50
+ limit: z.ZodNumber;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ filterType: z.ZodLiteral<"MAX_NUM_ALGO_ORDERS">;
53
+ limit: z.ZodNumber;
54
+ }, z.core.$strip>, z.ZodObject<{
55
+ filterType: z.ZodLiteral<"MIN_NOTIONAL">;
56
+ notional: z.ZodString;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ filterType: z.ZodLiteral<"PERCENT_PRICE">;
59
+ multiplierUp: z.ZodCoercedNumber<unknown>;
60
+ multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
61
+ multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ filterType: z.ZodLiteral<"POSITION_RISK_CONTROL">;
64
+ positionControlSide: z.ZodLiteral<"NONE">;
65
+ multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
66
+ multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
67
+ }, z.core.$strip>], "filterType">;
68
+ declare const FuturesContractTypeSchema: z.ZodEnum<{
69
+ PERPETUAL: "PERPETUAL";
70
+ CURRENT_QUARTER: "CURRENT_QUARTER";
71
+ NEXT_QUARTER: "NEXT_QUARTER";
72
+ }>;
73
+ declare const FuturesUnderlyingTypeSchema: z.ZodEnum<{
74
+ COIN: "COIN";
75
+ INDEX: "INDEX";
76
+ PREMARKET: "PREMARKET";
77
+ }>;
78
+ declare const FuturesOrderTypeSchema: z.ZodEnum<{
79
+ LIMIT: "LIMIT";
80
+ MARKET: "MARKET";
81
+ STOP: "STOP";
82
+ TAKE_PROFIT: "TAKE_PROFIT";
83
+ STOP_MARKET: "STOP_MARKET";
84
+ TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
85
+ TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
86
+ }>;
87
+ declare const FuturesExchangeInfoSymbolSchema: z.ZodObject<{
88
+ symbol: z.ZodString;
89
+ pair: z.ZodString;
90
+ contractType: z.ZodEnum<{
91
+ PERPETUAL: "PERPETUAL";
92
+ CURRENT_QUARTER: "CURRENT_QUARTER";
93
+ NEXT_QUARTER: "NEXT_QUARTER";
94
+ }>;
95
+ deliveryDate: z.ZodNumber;
96
+ onboardDate: z.ZodNumber;
97
+ status: z.ZodEnum<{
98
+ TRADING: "TRADING";
99
+ SETTLING: "SETTLING";
100
+ PENDING_TRADING: "PENDING_TRADING";
101
+ }>;
102
+ maintMarginPercent: z.ZodString;
103
+ requiredMarginPercent: z.ZodString;
104
+ baseAsset: z.ZodString;
105
+ quoteAsset: z.ZodString;
106
+ marginAsset: z.ZodString;
107
+ pricePrecision: z.ZodNumber;
108
+ quantityPrecision: z.ZodNumber;
109
+ baseAssetPrecision: z.ZodNumber;
110
+ quotePrecision: z.ZodNumber;
111
+ underlyingType: z.ZodEnum<{
112
+ COIN: "COIN";
113
+ INDEX: "INDEX";
114
+ PREMARKET: "PREMARKET";
115
+ }>;
116
+ underlyingSubType: z.ZodArray<z.ZodString>;
117
+ permissionSets: z.ZodArray<z.ZodEnum<{
118
+ COPY: "COPY";
119
+ GRID: "GRID";
120
+ }>>;
121
+ settlePlan: z.ZodOptional<z.ZodNumber>;
122
+ triggerProtect: z.ZodString;
123
+ filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
124
+ filterType: z.ZodLiteral<"PRICE_FILTER">;
125
+ maxPrice: z.ZodCoercedNumber<unknown>;
126
+ minPrice: z.ZodCoercedNumber<unknown>;
127
+ tickSize: z.ZodCoercedNumber<unknown>;
128
+ }, z.core.$strip>, z.ZodObject<{
129
+ filterType: z.ZodLiteral<"LOT_SIZE">;
130
+ maxQty: z.ZodCoercedNumber<unknown>;
131
+ minQty: z.ZodCoercedNumber<unknown>;
132
+ stepSize: z.ZodCoercedNumber<unknown>;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ filterType: z.ZodLiteral<"MARKET_LOT_SIZE">;
135
+ maxQty: z.ZodCoercedNumber<unknown>;
136
+ minQty: z.ZodCoercedNumber<unknown>;
137
+ stepSize: z.ZodCoercedNumber<unknown>;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ filterType: z.ZodLiteral<"MAX_NUM_ORDERS">;
140
+ limit: z.ZodNumber;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ filterType: z.ZodLiteral<"MAX_NUM_ALGO_ORDERS">;
143
+ limit: z.ZodNumber;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ filterType: z.ZodLiteral<"MIN_NOTIONAL">;
146
+ notional: z.ZodString;
147
+ }, z.core.$strip>, z.ZodObject<{
148
+ filterType: z.ZodLiteral<"PERCENT_PRICE">;
149
+ multiplierUp: z.ZodCoercedNumber<unknown>;
150
+ multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
151
+ multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ filterType: z.ZodLiteral<"POSITION_RISK_CONTROL">;
154
+ positionControlSide: z.ZodLiteral<"NONE">;
155
+ multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
156
+ multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
157
+ }, z.core.$strip>], "filterType">>;
158
+ OrderType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
159
+ LIMIT: "LIMIT";
160
+ MARKET: "MARKET";
161
+ STOP: "STOP";
162
+ TAKE_PROFIT: "TAKE_PROFIT";
163
+ STOP_MARKET: "STOP_MARKET";
164
+ TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
165
+ TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
166
+ }>>>;
167
+ timeInForce: z.ZodArray<z.ZodString>;
168
+ liquidationFee: z.ZodCoercedNumber<unknown>;
169
+ marketTakeBound: z.ZodCoercedNumber<unknown>;
170
+ }, z.core.$strip>;
171
+ declare const FuturesExchangeInfoSchema: z.ZodObject<{
172
+ exchangeFilters: z.ZodArray<z.ZodUnknown>;
173
+ rateLimits: z.ZodArray<z.ZodObject<{
174
+ interval: z.ZodEnum<{
175
+ MINUTE: "MINUTE";
176
+ SECOND: "SECOND";
177
+ }>;
178
+ intervalNum: z.ZodNumber;
179
+ limit: z.ZodNumber;
180
+ rateLimitType: z.ZodEnum<{
181
+ REQUEST_WEIGHT: "REQUEST_WEIGHT";
182
+ ORDERS: "ORDERS";
183
+ }>;
184
+ }, z.core.$strip>>;
185
+ serverTime: z.ZodNumber;
186
+ assets: z.ZodArray<z.ZodObject<{
187
+ asset: z.ZodString;
188
+ marginAvailable: z.ZodBoolean;
189
+ autoAssetExchange: z.ZodNullable<z.ZodString>;
190
+ }, z.core.$strip>>;
191
+ symbols: z.ZodArray<z.ZodObject<{
192
+ symbol: z.ZodString;
193
+ pair: z.ZodString;
194
+ contractType: z.ZodEnum<{
195
+ PERPETUAL: "PERPETUAL";
196
+ CURRENT_QUARTER: "CURRENT_QUARTER";
197
+ NEXT_QUARTER: "NEXT_QUARTER";
198
+ }>;
199
+ deliveryDate: z.ZodNumber;
200
+ onboardDate: z.ZodNumber;
201
+ status: z.ZodEnum<{
202
+ TRADING: "TRADING";
203
+ SETTLING: "SETTLING";
204
+ PENDING_TRADING: "PENDING_TRADING";
205
+ }>;
206
+ maintMarginPercent: z.ZodString;
207
+ requiredMarginPercent: z.ZodString;
208
+ baseAsset: z.ZodString;
209
+ quoteAsset: z.ZodString;
210
+ marginAsset: z.ZodString;
211
+ pricePrecision: z.ZodNumber;
212
+ quantityPrecision: z.ZodNumber;
213
+ baseAssetPrecision: z.ZodNumber;
214
+ quotePrecision: z.ZodNumber;
215
+ underlyingType: z.ZodEnum<{
216
+ COIN: "COIN";
217
+ INDEX: "INDEX";
218
+ PREMARKET: "PREMARKET";
219
+ }>;
220
+ underlyingSubType: z.ZodArray<z.ZodString>;
221
+ permissionSets: z.ZodArray<z.ZodEnum<{
222
+ COPY: "COPY";
223
+ GRID: "GRID";
224
+ }>>;
225
+ settlePlan: z.ZodOptional<z.ZodNumber>;
226
+ triggerProtect: z.ZodString;
227
+ filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
228
+ filterType: z.ZodLiteral<"PRICE_FILTER">;
229
+ maxPrice: z.ZodCoercedNumber<unknown>;
230
+ minPrice: z.ZodCoercedNumber<unknown>;
231
+ tickSize: z.ZodCoercedNumber<unknown>;
232
+ }, z.core.$strip>, z.ZodObject<{
233
+ filterType: z.ZodLiteral<"LOT_SIZE">;
234
+ maxQty: z.ZodCoercedNumber<unknown>;
235
+ minQty: z.ZodCoercedNumber<unknown>;
236
+ stepSize: z.ZodCoercedNumber<unknown>;
237
+ }, z.core.$strip>, z.ZodObject<{
238
+ filterType: z.ZodLiteral<"MARKET_LOT_SIZE">;
239
+ maxQty: z.ZodCoercedNumber<unknown>;
240
+ minQty: z.ZodCoercedNumber<unknown>;
241
+ stepSize: z.ZodCoercedNumber<unknown>;
242
+ }, z.core.$strip>, z.ZodObject<{
243
+ filterType: z.ZodLiteral<"MAX_NUM_ORDERS">;
244
+ limit: z.ZodNumber;
245
+ }, z.core.$strip>, z.ZodObject<{
246
+ filterType: z.ZodLiteral<"MAX_NUM_ALGO_ORDERS">;
247
+ limit: z.ZodNumber;
248
+ }, z.core.$strip>, z.ZodObject<{
249
+ filterType: z.ZodLiteral<"MIN_NOTIONAL">;
250
+ notional: z.ZodString;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ filterType: z.ZodLiteral<"PERCENT_PRICE">;
253
+ multiplierUp: z.ZodCoercedNumber<unknown>;
254
+ multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
255
+ multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
256
+ }, z.core.$strip>, z.ZodObject<{
257
+ filterType: z.ZodLiteral<"POSITION_RISK_CONTROL">;
258
+ positionControlSide: z.ZodLiteral<"NONE">;
259
+ multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
260
+ multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
261
+ }, z.core.$strip>], "filterType">>;
262
+ OrderType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
263
+ LIMIT: "LIMIT";
264
+ MARKET: "MARKET";
265
+ STOP: "STOP";
266
+ TAKE_PROFIT: "TAKE_PROFIT";
267
+ STOP_MARKET: "STOP_MARKET";
268
+ TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
269
+ TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
270
+ }>>>;
271
+ timeInForce: z.ZodArray<z.ZodString>;
272
+ liquidationFee: z.ZodCoercedNumber<unknown>;
273
+ marketTakeBound: z.ZodCoercedNumber<unknown>;
274
+ }, z.core.$strip>>;
275
+ timezone: z.ZodString;
276
+ }, z.core.$strip>;
277
+ declare const FuturesOrderBookSchema: z.ZodObject<{
278
+ lastUpdateId: z.ZodNumber;
279
+ E: z.ZodNumber;
280
+ T: z.ZodNumber;
281
+ bids: z.ZodArray<z.ZodTuple<[z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>], null>>;
282
+ asks: z.ZodArray<z.ZodTuple<[z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>], null>>;
283
+ }, z.core.$strip>;
284
+ declare const FuturesRecentTradesSchema: z.ZodArray<z.ZodObject<{
285
+ id: z.ZodNumber;
286
+ price: z.ZodCoercedNumber<unknown>;
287
+ qty: z.ZodCoercedNumber<unknown>;
288
+ quoteQty: z.ZodCoercedNumber<unknown>;
289
+ time: z.ZodNumber;
290
+ isBuyerMaker: z.ZodBoolean;
291
+ }, z.core.$strip>>;
292
+ declare const FuturesOldTradesLookupSchema: z.ZodArray<z.ZodObject<{
293
+ id: z.ZodNumber;
294
+ price: z.ZodCoercedNumber<unknown>;
295
+ qty: z.ZodCoercedNumber<unknown>;
296
+ quoteQty: z.ZodCoercedNumber<unknown>;
297
+ time: z.ZodNumber;
298
+ isBuyerMaker: z.ZodBoolean;
299
+ }, z.core.$strip>>;
300
+ declare const FuturesAggregateTradesSchema: z.ZodArray<z.ZodObject<{
301
+ a: z.ZodNumber;
302
+ p: z.ZodCoercedNumber<unknown>;
303
+ q: z.ZodCoercedNumber<unknown>;
304
+ f: z.ZodNumber;
305
+ l: z.ZodNumber;
306
+ T: z.ZodNumber;
307
+ m: z.ZodBoolean;
308
+ }, z.core.$strip>>;
309
+ declare const FuturesKlineDataSchema: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>, z.ZodNumber, z.ZodCoercedNumber<unknown>, z.ZodNumber, z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>], null>>;
310
+ declare const FuturesMarkPriceSchema: z.ZodObject<{
311
+ symbol: z.ZodString;
312
+ markPrice: z.ZodCoercedNumber<unknown>;
313
+ indexPrice: z.ZodCoercedNumber<unknown>;
314
+ estimatedSettlePrice: z.ZodCoercedNumber<unknown>;
315
+ lastFundingRate: z.ZodCoercedNumber<unknown>;
316
+ interestRate: z.ZodCoercedNumber<unknown>;
317
+ nextFundingTime: z.ZodNumber;
318
+ time: z.ZodNumber;
319
+ }, z.core.$strip>;
320
+ declare const FuturesFundingRateEntrySchema: z.ZodObject<{
321
+ symbol: z.ZodString;
322
+ fundingRate: z.ZodCoercedNumber<unknown>;
323
+ fundingTime: z.ZodNumber;
324
+ markPrice: z.ZodCoercedNumber<unknown>;
325
+ }, z.core.$strip>;
326
+ declare const FuturesFundingRateSchema: z.ZodArray<z.ZodObject<{
327
+ symbol: z.ZodString;
328
+ fundingRate: z.ZodCoercedNumber<unknown>;
329
+ fundingTime: z.ZodNumber;
330
+ markPrice: z.ZodCoercedNumber<unknown>;
331
+ }, z.core.$strip>>;
332
+ declare const FuturesFundingInfoEntrySchema: z.ZodObject<{
333
+ symbol: z.ZodString;
334
+ adjustedFundingRateCap: z.ZodCoercedNumber<unknown>;
335
+ adjustedFundingRateFloor: z.ZodCoercedNumber<unknown>;
336
+ fundingIntervalHours: z.ZodNumber;
337
+ }, z.core.$strip>;
338
+ declare const FuturesFundingInfoSchema: z.ZodArray<z.ZodObject<{
339
+ symbol: z.ZodString;
340
+ adjustedFundingRateCap: z.ZodCoercedNumber<unknown>;
341
+ adjustedFundingRateFloor: z.ZodCoercedNumber<unknown>;
342
+ fundingIntervalHours: z.ZodNumber;
343
+ }, z.core.$strip>>;
344
+ declare const FuturesTicker24hSchema: z.ZodObject<{
345
+ symbol: z.ZodString;
346
+ priceChange: z.ZodCoercedNumber<unknown>;
347
+ priceChangePercent: z.ZodCoercedNumber<unknown>;
348
+ weightedAvgPrice: z.ZodCoercedNumber<unknown>;
349
+ lastPrice: z.ZodCoercedNumber<unknown>;
350
+ lastQty: z.ZodCoercedNumber<unknown>;
351
+ openPrice: z.ZodCoercedNumber<unknown>;
352
+ highPrice: z.ZodCoercedNumber<unknown>;
353
+ lowPrice: z.ZodCoercedNumber<unknown>;
354
+ volume: z.ZodCoercedNumber<unknown>;
355
+ quoteVolume: z.ZodCoercedNumber<unknown>;
356
+ openTime: z.ZodNumber;
357
+ closeTime: z.ZodNumber;
358
+ firstId: z.ZodNumber;
359
+ lastId: z.ZodNumber;
360
+ count: z.ZodNumber;
361
+ }, z.core.$strip>;
362
+ declare const FuturesSymbolPriceSchema: z.ZodObject<{
363
+ symbol: z.ZodString;
364
+ price: z.ZodCoercedNumber<unknown>;
365
+ time: z.ZodNumber;
366
+ }, z.core.$strip>;
367
+ declare const FuturesBookTickerSchema: z.ZodObject<{
368
+ symbol: z.ZodString;
369
+ bidPrice: z.ZodCoercedNumber<unknown>;
370
+ bidQty: z.ZodCoercedNumber<unknown>;
371
+ askPrice: z.ZodCoercedNumber<unknown>;
372
+ askQty: z.ZodCoercedNumber<unknown>;
373
+ time: z.ZodCoercedNumber<unknown>;
374
+ }, z.core.$strip>;
375
+ declare const FuturesDeliveryPriceSchema: z.ZodArray<z.ZodObject<{
376
+ deliveryTime: z.ZodCoercedNumber<unknown>;
377
+ deliveryPrice: z.ZodCoercedNumber<unknown>;
378
+ }, z.core.$strip>>;
379
+ declare const FuturesOpenInterestSchema: z.ZodObject<{
380
+ openInterest: z.ZodCoercedNumber<unknown>;
381
+ symbol: z.ZodString;
382
+ time: z.ZodCoercedNumber<unknown>;
383
+ }, z.core.$strip>;
384
+ declare const FuturesOpenInterestStatsSchema: z.ZodArray<z.ZodObject<{
385
+ symbol: z.ZodString;
386
+ sumOpenInterest: z.ZodCoercedNumber<unknown>;
387
+ sumOpenInterestValue: z.ZodCoercedNumber<unknown>;
388
+ timestamp: z.ZodCoercedNumber<unknown>;
389
+ }, z.core.$strip>>;
390
+ declare const FuturesLongShortRatioSchema: z.ZodArray<z.ZodObject<{
391
+ symbol: z.ZodString;
392
+ longShortRatio: z.ZodCoercedNumber<unknown>;
393
+ longAccount: z.ZodCoercedNumber<unknown>;
394
+ shortAccount: z.ZodCoercedNumber<unknown>;
395
+ timestamp: z.ZodCoercedNumber<unknown>;
396
+ }, z.core.$strip>>;
397
+ declare const FuturesTakerBuySellRatioItemSchema: z.ZodObject<{
398
+ buySellRatio: z.ZodCoercedNumber<unknown>;
399
+ buyVol: z.ZodCoercedNumber<unknown>;
400
+ sellVol: z.ZodCoercedNumber<unknown>;
401
+ timestamp: z.ZodCoercedNumber<unknown>;
402
+ }, z.core.$strip>;
403
+ declare const FuturesTakerBuySellRatioSchema: z.ZodArray<z.ZodObject<{
404
+ buySellRatio: z.ZodCoercedNumber<unknown>;
405
+ buyVol: z.ZodCoercedNumber<unknown>;
406
+ sellVol: z.ZodCoercedNumber<unknown>;
407
+ timestamp: z.ZodCoercedNumber<unknown>;
408
+ }, z.core.$strip>>;
409
+ declare const FuturesBasisSchema: z.ZodArray<z.ZodObject<{
410
+ indexPrice: z.ZodCoercedNumber<unknown>;
411
+ contractType: z.ZodEnum<{
412
+ PERPETUAL: "PERPETUAL";
413
+ CURRENT_QUARTER: "CURRENT_QUARTER";
414
+ NEXT_QUARTER: "NEXT_QUARTER";
415
+ }>;
416
+ basisRate: z.ZodCoercedNumber<unknown>;
417
+ futuresPrice: z.ZodCoercedNumber<unknown>;
418
+ annualizedBasisRate: z.ZodOptional<z.ZodString>;
419
+ basis: z.ZodCoercedNumber<unknown>;
420
+ pair: z.ZodString;
421
+ timestamp: z.ZodNumber;
422
+ }, z.core.$strip>>;
423
+ declare const FuturesCompositeIndexAssetSchema: z.ZodObject<{
424
+ baseAsset: z.ZodString;
425
+ quoteAsset: z.ZodString;
426
+ weightInQuantity: z.ZodCoercedNumber<unknown>;
427
+ weightInPercentage: z.ZodCoercedNumber<unknown>;
428
+ }, z.core.$strip>;
429
+ declare const FuturesCompositeIndexSchema: z.ZodObject<{
430
+ symbol: z.ZodString;
431
+ time: z.ZodCoercedNumber<unknown>;
432
+ component: z.ZodString;
433
+ baseAssetList: z.ZodArray<z.ZodObject<{
434
+ baseAsset: z.ZodString;
435
+ quoteAsset: z.ZodString;
436
+ weightInQuantity: z.ZodCoercedNumber<unknown>;
437
+ weightInPercentage: z.ZodCoercedNumber<unknown>;
438
+ }, z.core.$strip>>;
439
+ }, z.core.$strip>;
440
+ declare const FuturesAssetIndexSchema: z.ZodObject<{
441
+ symbol: z.ZodString;
442
+ time: z.ZodCoercedNumber<unknown>;
443
+ index: z.ZodCoercedNumber<unknown>;
444
+ bidBuffer: z.ZodCoercedNumber<unknown>;
445
+ askBuffer: z.ZodCoercedNumber<unknown>;
446
+ bidRate: z.ZodCoercedNumber<unknown>;
447
+ askRate: z.ZodCoercedNumber<unknown>;
448
+ autoExchangeBidBuffer: z.ZodCoercedNumber<unknown>;
449
+ autoExchangeAskBuffer: z.ZodCoercedNumber<unknown>;
450
+ autoExchangeBidRate: z.ZodCoercedNumber<unknown>;
451
+ autoExchangeAskRate: z.ZodCoercedNumber<unknown>;
452
+ }, z.core.$strip>;
453
+ declare const FuturesIndexPriceConstituentItemSchema: z.ZodObject<{
454
+ exchange: z.ZodString;
455
+ symbol: z.ZodString;
456
+ price: z.ZodCoercedNumber<unknown>;
457
+ weight: z.ZodCoercedNumber<unknown>;
458
+ }, z.core.$strip>;
459
+ declare const FuturesIndexPriceConstituentsSchema: z.ZodObject<{
460
+ symbol: z.ZodString;
461
+ time: z.ZodCoercedNumber<unknown>;
462
+ constituents: z.ZodArray<z.ZodObject<{
463
+ exchange: z.ZodString;
464
+ symbol: z.ZodString;
465
+ price: z.ZodCoercedNumber<unknown>;
466
+ weight: z.ZodCoercedNumber<unknown>;
467
+ }, z.core.$strip>>;
468
+ }, z.core.$strip>;
469
+ declare const FuturesInsuranceBalanceAssetSchema: z.ZodObject<{
470
+ asset: z.ZodString;
471
+ marginBalance: z.ZodCoercedNumber<unknown>;
472
+ updateTime: z.ZodCoercedNumber<unknown>;
473
+ }, z.core.$strip>;
474
+ declare const FuturesInsuranceBalanceEntrySchema: z.ZodObject<{
475
+ symbols: z.ZodArray<z.ZodString>;
476
+ assets: z.ZodArray<z.ZodObject<{
477
+ asset: z.ZodString;
478
+ marginBalance: z.ZodCoercedNumber<unknown>;
479
+ updateTime: z.ZodCoercedNumber<unknown>;
480
+ }, z.core.$strip>>;
481
+ }, z.core.$strip>;
482
+ declare const FuturesAccountBalanceSchema: z.ZodArray<z.ZodObject<{
483
+ accountAlias: z.ZodString;
484
+ asset: z.ZodString;
485
+ balance: z.ZodCoercedNumber<unknown>;
486
+ crossWalletBalance: z.ZodCoercedNumber<unknown>;
487
+ crossUnPnl: z.ZodCoercedNumber<unknown>;
488
+ availableBalance: z.ZodCoercedNumber<unknown>;
489
+ maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
490
+ marginAvailable: z.ZodBoolean;
491
+ updateTime: z.ZodNumber;
492
+ }, z.core.$strip>>;
493
+ declare const FuturesAccountAssetSchema: z.ZodObject<{
494
+ asset: z.ZodString;
495
+ walletBalance: z.ZodCoercedNumber<unknown>;
496
+ unrealizedProfit: z.ZodCoercedNumber<unknown>;
497
+ marginBalance: z.ZodCoercedNumber<unknown>;
498
+ maintMargin: z.ZodCoercedNumber<unknown>;
499
+ initialMargin: z.ZodCoercedNumber<unknown>;
500
+ positionInitialMargin: z.ZodCoercedNumber<unknown>;
501
+ openOrderInitialMargin: z.ZodCoercedNumber<unknown>;
502
+ crossWalletBalance: z.ZodCoercedNumber<unknown>;
503
+ crossUnPnl: z.ZodCoercedNumber<unknown>;
504
+ availableBalance: z.ZodCoercedNumber<unknown>;
505
+ maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
506
+ updateTime: z.ZodNumber;
507
+ marginAvailable: z.ZodOptional<z.ZodBoolean>;
508
+ }, z.core.$strip>;
509
+ declare const FuturesAccountPositionSchema: z.ZodObject<{
510
+ symbol: z.ZodString;
511
+ positionSide: z.ZodString;
512
+ positionAmt: z.ZodCoercedNumber<unknown>;
513
+ unrealizedProfit: z.ZodCoercedNumber<unknown>;
514
+ isolatedMargin: z.ZodCoercedNumber<unknown>;
515
+ notional: z.ZodCoercedNumber<unknown>;
516
+ isolatedWallet: z.ZodCoercedNumber<unknown>;
517
+ initialMargin: z.ZodCoercedNumber<unknown>;
518
+ maintMargin: z.ZodCoercedNumber<unknown>;
519
+ updateTime: z.ZodNumber;
520
+ }, z.core.$strip>;
521
+ declare const FuturesAccountInfoSchema: z.ZodObject<{
522
+ totalInitialMargin: z.ZodCoercedNumber<unknown>;
523
+ totalMaintMargin: z.ZodCoercedNumber<unknown>;
524
+ totalWalletBalance: z.ZodCoercedNumber<unknown>;
525
+ totalUnrealizedProfit: z.ZodCoercedNumber<unknown>;
526
+ totalMarginBalance: z.ZodCoercedNumber<unknown>;
527
+ totalPositionInitialMargin: z.ZodCoercedNumber<unknown>;
528
+ totalOpenOrderInitialMargin: z.ZodCoercedNumber<unknown>;
529
+ totalCrossWalletBalance: z.ZodCoercedNumber<unknown>;
530
+ totalCrossUnPnl: z.ZodCoercedNumber<unknown>;
531
+ availableBalance: z.ZodCoercedNumber<unknown>;
532
+ maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
533
+ assets: z.ZodArray<z.ZodObject<{
534
+ asset: z.ZodString;
535
+ walletBalance: z.ZodCoercedNumber<unknown>;
536
+ unrealizedProfit: z.ZodCoercedNumber<unknown>;
537
+ marginBalance: z.ZodCoercedNumber<unknown>;
538
+ maintMargin: z.ZodCoercedNumber<unknown>;
539
+ initialMargin: z.ZodCoercedNumber<unknown>;
540
+ positionInitialMargin: z.ZodCoercedNumber<unknown>;
541
+ openOrderInitialMargin: z.ZodCoercedNumber<unknown>;
542
+ crossWalletBalance: z.ZodCoercedNumber<unknown>;
543
+ crossUnPnl: z.ZodCoercedNumber<unknown>;
544
+ availableBalance: z.ZodCoercedNumber<unknown>;
545
+ maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
546
+ updateTime: z.ZodNumber;
547
+ marginAvailable: z.ZodOptional<z.ZodBoolean>;
548
+ }, z.core.$strip>>;
549
+ positions: z.ZodArray<z.ZodObject<{
550
+ symbol: z.ZodString;
551
+ positionSide: z.ZodString;
552
+ positionAmt: z.ZodCoercedNumber<unknown>;
553
+ unrealizedProfit: z.ZodCoercedNumber<unknown>;
554
+ isolatedMargin: z.ZodCoercedNumber<unknown>;
555
+ notional: z.ZodCoercedNumber<unknown>;
556
+ isolatedWallet: z.ZodCoercedNumber<unknown>;
557
+ initialMargin: z.ZodCoercedNumber<unknown>;
558
+ maintMargin: z.ZodCoercedNumber<unknown>;
559
+ updateTime: z.ZodNumber;
560
+ }, z.core.$strip>>;
561
+ }, z.core.$strip>;
562
+ declare const FuturesCommissionRateSchema: z.ZodObject<{
563
+ symbol: z.ZodString;
564
+ makerCommissionRate: z.ZodCoercedNumber<unknown>;
565
+ takerCommissionRate: z.ZodCoercedNumber<unknown>;
566
+ }, z.core.$strip>;
567
+ declare const FuturesAccountConfigSchema: z.ZodObject<{
568
+ feeTier: z.ZodNumber;
569
+ canTrade: z.ZodBoolean;
570
+ canDeposit: z.ZodBoolean;
571
+ canWithdraw: z.ZodBoolean;
572
+ dualSidePosition: z.ZodBoolean;
573
+ multiAssetsMargin: z.ZodBoolean;
574
+ tradeGroupId: z.ZodNumber;
575
+ }, z.core.$strip>;
576
+ declare const FuturesSymbolConfigSchema: z.ZodArray<z.ZodObject<{
577
+ symbol: z.ZodString;
578
+ marginType: z.ZodEnum<{
579
+ ISOLATED: "ISOLATED";
580
+ CROSSED: "CROSSED";
581
+ }>;
582
+ isAutoAddMargin: z.ZodBoolean;
583
+ leverage: z.ZodCoercedNumber<unknown>;
584
+ maxNotionalValue: z.ZodPipe<z.ZodUnion<[z.ZodCoercedNumber<unknown>, z.ZodLiteral<"INF">]>, z.ZodTransform<number, number | "INF">>;
585
+ }, z.core.$strip>>;
586
+ declare const FuturesUserRateLimitSchema: z.ZodArray<z.ZodObject<{
587
+ rateLimitType: z.ZodLiteral<"ORDERS">;
588
+ interval: z.ZodEnum<{
589
+ MINUTE: "MINUTE";
590
+ SECOND: "SECOND";
591
+ DAY: "DAY";
592
+ }>;
593
+ intervalNum: z.ZodNumber;
594
+ limit: z.ZodNumber;
595
+ }, z.core.$strip>>;
596
+ declare const FuturesLeverageBracketEntrySchema: z.ZodObject<{
597
+ bracket: z.ZodNumber;
598
+ initialLeverage: z.ZodNumber;
599
+ notionalCap: z.ZodNumber;
600
+ notionalFloor: z.ZodNumber;
601
+ maintMarginRatio: z.ZodNumber;
602
+ cum: z.ZodNumber;
603
+ }, z.core.$strip>;
604
+ declare const FuturesLeverageBracketSchema: z.ZodArray<z.ZodObject<{
605
+ symbol: z.ZodString;
606
+ notionalCoef: z.ZodOptional<z.ZodNumber>;
607
+ brackets: z.ZodArray<z.ZodObject<{
608
+ bracket: z.ZodNumber;
609
+ initialLeverage: z.ZodNumber;
610
+ notionalCap: z.ZodNumber;
611
+ notionalFloor: z.ZodNumber;
612
+ maintMarginRatio: z.ZodNumber;
613
+ cum: z.ZodNumber;
614
+ }, z.core.$strip>>;
615
+ }, z.core.$strip>>;
616
+ declare const FuturesPositionModeSchema: z.ZodObject<{
617
+ dualSidePosition: z.ZodBoolean;
618
+ }, z.core.$strip>;
619
+ declare const FuturesIncomeTypeSchema: z.ZodEnum<{
620
+ TRANSFER: "TRANSFER";
621
+ WELCOME_BONUS: "WELCOME_BONUS";
622
+ REALIZED_PNL: "REALIZED_PNL";
623
+ FUNDING_FEE: "FUNDING_FEE";
624
+ COMMISSION: "COMMISSION";
625
+ INSURANCE_CLEAR: "INSURANCE_CLEAR";
626
+ REFERRAL_KICKBACK: "REFERRAL_KICKBACK";
627
+ COMMISSION_REBATE: "COMMISSION_REBATE";
628
+ API_REBATE: "API_REBATE";
629
+ CONTEST_REWARD: "CONTEST_REWARD";
630
+ CROSS_COLLATERAL_TRANSFER: "CROSS_COLLATERAL_TRANSFER";
631
+ OPTIONS_PREMIUM_FEE: "OPTIONS_PREMIUM_FEE";
632
+ OPTIONS_SETTLE_PROFIT: "OPTIONS_SETTLE_PROFIT";
633
+ INTERNAL_TRANSFER: "INTERNAL_TRANSFER";
634
+ AUTO_EXCHANGE: "AUTO_EXCHANGE";
635
+ DELIVERED_SETTELMENT: "DELIVERED_SETTELMENT";
636
+ COIN_SWAP_DEPOSIT: "COIN_SWAP_DEPOSIT";
637
+ COIN_SWAP_WITHDRAW: "COIN_SWAP_WITHDRAW";
638
+ POSITION_LIMIT_INCREASE_FEE: "POSITION_LIMIT_INCREASE_FEE";
639
+ STRATEGY_UMFUTURES_TRANSFER: "STRATEGY_UMFUTURES_TRANSFER";
640
+ FEE_RETURN: "FEE_RETURN";
641
+ BFUSD_REWARD: "BFUSD_REWARD";
642
+ }>;
643
+ declare const FuturesIncomeHistorySchema: z.ZodArray<z.ZodObject<{
644
+ symbol: z.ZodOptional<z.ZodString>;
645
+ incomeType: z.ZodEnum<{
646
+ TRANSFER: "TRANSFER";
647
+ WELCOME_BONUS: "WELCOME_BONUS";
648
+ REALIZED_PNL: "REALIZED_PNL";
649
+ FUNDING_FEE: "FUNDING_FEE";
650
+ COMMISSION: "COMMISSION";
651
+ INSURANCE_CLEAR: "INSURANCE_CLEAR";
652
+ REFERRAL_KICKBACK: "REFERRAL_KICKBACK";
653
+ COMMISSION_REBATE: "COMMISSION_REBATE";
654
+ API_REBATE: "API_REBATE";
655
+ CONTEST_REWARD: "CONTEST_REWARD";
656
+ CROSS_COLLATERAL_TRANSFER: "CROSS_COLLATERAL_TRANSFER";
657
+ OPTIONS_PREMIUM_FEE: "OPTIONS_PREMIUM_FEE";
658
+ OPTIONS_SETTLE_PROFIT: "OPTIONS_SETTLE_PROFIT";
659
+ INTERNAL_TRANSFER: "INTERNAL_TRANSFER";
660
+ AUTO_EXCHANGE: "AUTO_EXCHANGE";
661
+ DELIVERED_SETTELMENT: "DELIVERED_SETTELMENT";
662
+ COIN_SWAP_DEPOSIT: "COIN_SWAP_DEPOSIT";
663
+ COIN_SWAP_WITHDRAW: "COIN_SWAP_WITHDRAW";
664
+ POSITION_LIMIT_INCREASE_FEE: "POSITION_LIMIT_INCREASE_FEE";
665
+ STRATEGY_UMFUTURES_TRANSFER: "STRATEGY_UMFUTURES_TRANSFER";
666
+ FEE_RETURN: "FEE_RETURN";
667
+ BFUSD_REWARD: "BFUSD_REWARD";
668
+ }>;
669
+ income: z.ZodCoercedNumber<unknown>;
670
+ asset: z.ZodString;
671
+ info: z.ZodString;
672
+ time: z.ZodNumber;
673
+ tranId: z.ZodNumber;
674
+ tradeId: z.ZodOptional<z.ZodString>;
675
+ }, z.core.$strip>>;
676
+ declare const FuturesOrderSideSchema: z.ZodEnum<{
677
+ BUY: "BUY";
678
+ SELL: "SELL";
679
+ }>;
680
+ declare const FuturesPositionSideSchema: z.ZodEnum<{
681
+ BOTH: "BOTH";
682
+ LONG: "LONG";
683
+ SHORT: "SHORT";
684
+ }>;
685
+ declare const FuturesTimeInForceSchema: z.ZodEnum<{
686
+ GTC: "GTC";
687
+ IOC: "IOC";
688
+ FOK: "FOK";
689
+ GTX: "GTX";
690
+ GTD: "GTD";
691
+ }>;
692
+ declare const FuturesWorkingTypeSchema: z.ZodEnum<{
693
+ MARK_PRICE: "MARK_PRICE";
694
+ CONTRACT_PRICE: "CONTRACT_PRICE";
695
+ }>;
696
+ declare const FuturesNewOrderRespTypeSchema: z.ZodEnum<{
697
+ ACK: "ACK";
698
+ RESULT: "RESULT";
699
+ }>;
700
+ declare const FuturesPriceMatchSchema: z.ZodEnum<{
701
+ NONE: "NONE";
702
+ OPPONENT: "OPPONENT";
703
+ OPPONENT_5: "OPPONENT_5";
704
+ OPPONENT_10: "OPPONENT_10";
705
+ OPPONENT_20: "OPPONENT_20";
706
+ QUEUE: "QUEUE";
707
+ QUEUE_5: "QUEUE_5";
708
+ QUEUE_10: "QUEUE_10";
709
+ QUEUE_20: "QUEUE_20";
710
+ }>;
711
+ declare const FuturesSelfTradePreventionSchema: z.ZodEnum<{
712
+ NONE: "NONE";
713
+ EXPIRE_TAKER: "EXPIRE_TAKER";
714
+ EXPIRE_MAKER: "EXPIRE_MAKER";
715
+ EXPIRE_BOTH: "EXPIRE_BOTH";
716
+ }>;
717
+ declare const FuturesNewOrderSchema: z.ZodObject<{
718
+ clientOrderId: z.ZodString;
719
+ cumQty: z.ZodCoercedNumber<unknown>;
720
+ cumQuote: z.ZodCoercedNumber<unknown>;
721
+ executedQty: z.ZodCoercedNumber<unknown>;
722
+ orderId: z.ZodNumber;
723
+ avgPrice: z.ZodCoercedNumber<unknown>;
724
+ origQty: z.ZodCoercedNumber<unknown>;
725
+ price: z.ZodCoercedNumber<unknown>;
726
+ reduceOnly: z.ZodBoolean;
727
+ side: z.ZodEnum<{
728
+ BUY: "BUY";
729
+ SELL: "SELL";
730
+ }>;
731
+ positionSide: z.ZodEnum<{
732
+ BOTH: "BOTH";
733
+ LONG: "LONG";
734
+ SHORT: "SHORT";
735
+ }>;
736
+ status: z.ZodString;
737
+ stopPrice: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
738
+ closePosition: z.ZodOptional<z.ZodBoolean>;
739
+ symbol: z.ZodString;
740
+ timeInForce: z.ZodEnum<{
741
+ GTC: "GTC";
742
+ IOC: "IOC";
743
+ FOK: "FOK";
744
+ GTX: "GTX";
745
+ GTD: "GTD";
746
+ }>;
747
+ type: z.ZodEnum<{
748
+ LIMIT: "LIMIT";
749
+ MARKET: "MARKET";
750
+ STOP: "STOP";
751
+ TAKE_PROFIT: "TAKE_PROFIT";
752
+ STOP_MARKET: "STOP_MARKET";
753
+ TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
754
+ TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
755
+ }>;
756
+ origType: z.ZodEnum<{
757
+ LIMIT: "LIMIT";
758
+ MARKET: "MARKET";
759
+ STOP: "STOP";
760
+ TAKE_PROFIT: "TAKE_PROFIT";
761
+ STOP_MARKET: "STOP_MARKET";
762
+ TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
763
+ TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
764
+ }>;
765
+ activatePrice: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
766
+ priceRate: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
767
+ updateTime: z.ZodNumber;
768
+ workingType: z.ZodEnum<{
769
+ MARK_PRICE: "MARK_PRICE";
770
+ CONTRACT_PRICE: "CONTRACT_PRICE";
771
+ }>;
772
+ priceProtect: z.ZodBoolean;
773
+ priceMatch: z.ZodOptional<z.ZodEnum<{
774
+ NONE: "NONE";
775
+ OPPONENT: "OPPONENT";
776
+ OPPONENT_5: "OPPONENT_5";
777
+ OPPONENT_10: "OPPONENT_10";
778
+ OPPONENT_20: "OPPONENT_20";
779
+ QUEUE: "QUEUE";
780
+ QUEUE_5: "QUEUE_5";
781
+ QUEUE_10: "QUEUE_10";
782
+ QUEUE_20: "QUEUE_20";
783
+ }>>;
784
+ selfTradePreventionMode: z.ZodOptional<z.ZodEnum<{
785
+ NONE: "NONE";
786
+ EXPIRE_TAKER: "EXPIRE_TAKER";
787
+ EXPIRE_MAKER: "EXPIRE_MAKER";
788
+ EXPIRE_BOTH: "EXPIRE_BOTH";
789
+ }>>;
790
+ goodTillDate: z.ZodOptional<z.ZodNumber>;
791
+ }, z.core.$strip>;
792
+ //#endregion
793
+ //#region src/shared/base-rest-client.d.ts
794
+ type RawSearchParams = Record<string, string | undefined | null | string[] | number | boolean>;
795
+ declare class BaseRestClient {
796
+ private credentials?;
797
+ private httpCleint;
798
+ constructor({
799
+ baseUrl,
800
+ credentials,
801
+ httpOptions
802
+ }: {
803
+ baseUrl: string;
804
+ credentials?: ApiCredentials;
805
+ httpOptions?: Client.Options;
806
+ });
807
+ private toSearchParams;
808
+ private parseErrorResponse;
809
+ private parseResponse;
810
+ protected publicRequest<T extends z4.$ZodType>({
811
+ endpoint,
812
+ params,
813
+ schema
814
+ }: {
815
+ endpoint: string;
816
+ params?: RawSearchParams;
817
+ schema: T;
818
+ }): Promise<z4.output<T>>;
819
+ protected privateRequest<T extends z4.$ZodType>({
820
+ endpoint,
821
+ params,
822
+ schema,
823
+ method
824
+ }: {
825
+ endpoint: string;
826
+ params?: RawSearchParams;
827
+ method: "GET" | "POST" | "DELETE";
828
+ schema: T;
829
+ }): Promise<z4.output<T>>;
830
+ private sign;
831
+ }
832
+ //#endregion
833
+ //#region src/rest/futures/types.d.ts
834
+ type FuturesKlineInterval = "1s" | "1m" | "3m" | "5m" | "30m" | "1h" | "2h" | "6h" | "8h" | "12h" | "3d" | "1M";
835
+ type FuturesContractType = z$1.infer<typeof FuturesContractTypeSchema>;
836
+ type FuturesUnderlyingType = z$1.infer<typeof FuturesUnderlyingTypeSchema>;
837
+ type FuturesOpenInterestPeriod = "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "12h" | "1d";
838
+ type FuturesTestConnectivity = z$1.infer<typeof FuturesTestConnectivitySchema>;
839
+ type FuturesCheckServerTime = z$1.infer<typeof FuturesCheckServerTimeSchema>;
840
+ type FuturesExchangeInfoRateLimit = z$1.infer<typeof FuturesExchangeInfoRateLimitSchema>;
841
+ type FuturesExchangeInfoAsset = z$1.infer<typeof FuturesExchangeInfoAssetSchema>;
842
+ type FuturesExchangeInfoFilter = z$1.infer<typeof FuturesExchangeInfoFilterSchema>;
843
+ type FuturesExchangeInfoSymbol = z$1.infer<typeof FuturesExchangeInfoSymbolSchema>;
844
+ type FuturesExchangeInfo = z$1.infer<typeof FuturesExchangeInfoSchema>;
845
+ type FuturesOrderBook = z$1.infer<typeof FuturesOrderBookSchema>;
846
+ type FuturesRecentTrades = z$1.infer<typeof FuturesRecentTradesSchema>;
847
+ type FuturesOldTradesLookup = z$1.infer<typeof FuturesOldTradesLookupSchema>;
848
+ type FuturesggregateTrades = z$1.infer<typeof FuturesAggregateTradesSchema>;
849
+ type KlineData = z$1.infer<typeof FuturesKlineDataSchema>;
850
+ type MarkPrice = z$1.infer<typeof FuturesMarkPriceSchema>;
851
+ type FundingRateEntry = z$1.infer<typeof FuturesFundingRateEntrySchema>;
852
+ type FundingRate = z$1.infer<typeof FuturesFundingRateSchema>;
853
+ type FundingInfoEntry = z$1.infer<typeof FuturesFundingInfoEntrySchema>;
854
+ type FundingInfo = z$1.infer<typeof FuturesFundingInfoSchema>;
855
+ type FuturesTicker24h = z$1.infer<typeof FuturesTicker24hSchema>;
856
+ type FuturesSymbolPrice = z$1.infer<typeof FuturesSymbolPriceSchema>;
857
+ type FuturesBookTicker = z$1.infer<typeof FuturesBookTickerSchema>;
858
+ type FuturesDeliveryPrice = z$1.infer<typeof FuturesDeliveryPriceSchema>;
859
+ type FuturesOpenInterest = z$1.infer<typeof FuturesOpenInterestSchema>;
860
+ type FuturesOpenInterestStats = z$1.infer<typeof FuturesOpenInterestStatsSchema>;
861
+ type FuturesLongShortRatio = z$1.infer<typeof FuturesLongShortRatioSchema>;
862
+ type FuturesTakerBuySellRatioItem = z$1.infer<typeof FuturesTakerBuySellRatioItemSchema>;
863
+ type FuturesTakerBuySellRatio = z$1.infer<typeof FuturesTakerBuySellRatioSchema>;
864
+ type FuturesBasis = z$1.infer<typeof FuturesBasisSchema>;
865
+ type FuturesCompositeIndexAsset = z$1.infer<typeof FuturesCompositeIndexAssetSchema>;
866
+ type FuturesCompositeIndex = z$1.infer<typeof FuturesCompositeIndexSchema>;
867
+ type FuturesAssetIndex = z$1.infer<typeof FuturesAssetIndexSchema>;
868
+ type FuturesIndexPriceConstituent = z$1.infer<typeof FuturesIndexPriceConstituentItemSchema>;
869
+ type FuturesIndexPriceConstituents = z$1.infer<typeof FuturesIndexPriceConstituentsSchema>;
870
+ type FuturesInsuranceBalanceAsset = z$1.infer<typeof FuturesInsuranceBalanceAssetSchema>;
871
+ type FuturesInsuranceBalanceEntry = z$1.infer<typeof FuturesInsuranceBalanceEntrySchema>;
872
+ type FuturesAccountBalance = z$1.infer<typeof FuturesAccountBalanceSchema>;
873
+ type FuturesAccountAsset = z$1.infer<typeof FuturesAccountAssetSchema>;
874
+ type FuturesAccountPosition = z$1.infer<typeof FuturesAccountPositionSchema>;
875
+ type FuturesAccountInfo = z$1.infer<typeof FuturesAccountInfoSchema>;
876
+ type FuturesCommissionRate = z$1.infer<typeof FuturesCommissionRateSchema>;
877
+ type FuturesAccountConfig = z$1.infer<typeof FuturesAccountConfigSchema>;
878
+ type FuturesSymbolConfig = z$1.infer<typeof FuturesSymbolConfigSchema>;
879
+ type FuturesUserRateLimit = z$1.infer<typeof FuturesUserRateLimitSchema>;
880
+ type FuturesLeverageBracketEntry = z$1.infer<typeof FuturesLeverageBracketEntrySchema>;
881
+ type FuturesLeverageBracket = z$1.infer<typeof FuturesLeverageBracketSchema>;
882
+ type FuturesPositionMode = z$1.infer<typeof FuturesPositionModeSchema>;
883
+ type FuturesIncomeType = z$1.infer<typeof FuturesIncomeTypeSchema>;
884
+ type FuturesIncomeHistory = z$1.infer<typeof FuturesIncomeHistorySchema>;
885
+ type FuturesOrderSide = z$1.infer<typeof FuturesOrderSideSchema>;
886
+ type FuturesPositionSide = z$1.infer<typeof FuturesPositionSideSchema>;
887
+ type FuturesOrderType = z$1.infer<typeof FuturesOrderTypeSchema>;
888
+ type FuturesTimeInForce = z$1.infer<typeof FuturesTimeInForceSchema>;
889
+ type FuturesWorkingType = z$1.infer<typeof FuturesWorkingTypeSchema>;
890
+ type FuturesNewOrderRespType = z$1.infer<typeof FuturesNewOrderRespTypeSchema>;
891
+ type FuturesPriceMatch = z$1.infer<typeof FuturesPriceMatchSchema>;
892
+ type FuturesSelfTradePrevention = z$1.infer<typeof FuturesSelfTradePreventionSchema>;
893
+ type FuturesNewOrder = z$1.infer<typeof FuturesNewOrderSchema>;
894
+ //#endregion
895
+ //#region src/rest/futures/client.d.ts
896
+ declare class FuturesRestClient extends BaseRestClient {
897
+ constructor({
898
+ baseUrl,
899
+ credentials,
900
+ httpOptions
901
+ }: {
902
+ credentials?: ApiCredentials;
903
+ baseUrl?: string;
904
+ httpOptions?: Client.Options;
905
+ });
906
+ testConnectivity(): Promise<FuturesTestConnectivity>;
907
+ checkServerTime(): Promise<FuturesCheckServerTime>;
908
+ exchangeInformation(): Promise<{
909
+ exchangeFilters: unknown[];
910
+ rateLimits: {
911
+ interval: "MINUTE" | "SECOND";
912
+ intervalNum: number;
913
+ limit: number;
914
+ rateLimitType: "REQUEST_WEIGHT" | "ORDERS";
915
+ }[];
916
+ serverTime: number;
917
+ assets: {
918
+ asset: string;
919
+ marginAvailable: boolean;
920
+ autoAssetExchange: string | null;
921
+ }[];
922
+ symbols: {
923
+ symbol: string;
924
+ pair: string;
925
+ contractType: "PERPETUAL" | "CURRENT_QUARTER" | "NEXT_QUARTER";
926
+ deliveryDate: number;
927
+ onboardDate: number;
928
+ status: "TRADING" | "SETTLING" | "PENDING_TRADING";
929
+ maintMarginPercent: string;
930
+ requiredMarginPercent: string;
931
+ baseAsset: string;
932
+ quoteAsset: string;
933
+ marginAsset: string;
934
+ pricePrecision: number;
935
+ quantityPrecision: number;
936
+ baseAssetPrecision: number;
937
+ quotePrecision: number;
938
+ underlyingType: "COIN" | "INDEX" | "PREMARKET";
939
+ underlyingSubType: string[];
940
+ permissionSets: ("COPY" | "GRID")[];
941
+ triggerProtect: string;
942
+ filters: ({
943
+ filterType: "PRICE_FILTER";
944
+ maxPrice: number;
945
+ minPrice: number;
946
+ tickSize: number;
947
+ } | {
948
+ filterType: "LOT_SIZE";
949
+ maxQty: number;
950
+ minQty: number;
951
+ stepSize: number;
952
+ } | {
953
+ filterType: "MARKET_LOT_SIZE";
954
+ maxQty: number;
955
+ minQty: number;
956
+ stepSize: number;
957
+ } | {
958
+ filterType: "MAX_NUM_ORDERS";
959
+ limit: number;
960
+ } | {
961
+ filterType: "MAX_NUM_ALGO_ORDERS";
962
+ limit: number;
963
+ } | {
964
+ filterType: "MIN_NOTIONAL";
965
+ notional: string;
966
+ } | {
967
+ filterType: "PERCENT_PRICE";
968
+ multiplierUp: number;
969
+ multiplierDown?: number | undefined;
970
+ multiplierDecimal?: number | undefined;
971
+ } | {
972
+ filterType: "POSITION_RISK_CONTROL";
973
+ positionControlSide: "NONE";
974
+ multiplierDown?: number | undefined;
975
+ multiplierDecimal?: number | undefined;
976
+ })[];
977
+ timeInForce: string[];
978
+ liquidationFee: number;
979
+ marketTakeBound: number;
980
+ settlePlan?: number | undefined;
981
+ OrderType?: ("LIMIT" | "MARKET" | "STOP" | "TAKE_PROFIT" | "STOP_MARKET" | "TAKE_PROFIT_MARKET" | "TRAILING_STOP_MARKET")[] | undefined;
982
+ }[];
983
+ timezone: string;
984
+ }>;
985
+ orderBook(params: {
986
+ symbol: string;
987
+ limit?: number;
988
+ }): Promise<{
989
+ lastUpdateId: number;
990
+ E: number;
991
+ T: number;
992
+ bids: [number, number][];
993
+ asks: [number, number][];
994
+ }>;
995
+ recentTrades(params: {
996
+ symbol: string;
997
+ limit?: number;
998
+ }): Promise<{
999
+ id: number;
1000
+ price: number;
1001
+ qty: number;
1002
+ quoteQty: number;
1003
+ time: number;
1004
+ isBuyerMaker: boolean;
1005
+ }[]>;
1006
+ oldTradesLookup(params: {
1007
+ symbol: string;
1008
+ limit?: number;
1009
+ fromId?: number;
1010
+ }): Promise<{
1011
+ id: number;
1012
+ price: number;
1013
+ qty: number;
1014
+ quoteQty: number;
1015
+ time: number;
1016
+ isBuyerMaker: boolean;
1017
+ }[]>;
1018
+ aggregateTrades(params: {
1019
+ symbol: string;
1020
+ fromId?: number;
1021
+ startTime?: number;
1022
+ endTime?: number;
1023
+ limit?: number;
1024
+ }): Promise<{
1025
+ a: number;
1026
+ p: number;
1027
+ q: number;
1028
+ f: number;
1029
+ l: number;
1030
+ T: number;
1031
+ m: boolean;
1032
+ }[]>;
1033
+ klineData(params: {
1034
+ symbol: string;
1035
+ interval: FuturesKlineInterval;
1036
+ startTime?: number;
1037
+ endTime?: number;
1038
+ limit?: number;
1039
+ }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
1040
+ continuousContractKlineData(params: {
1041
+ pair: string;
1042
+ contractType: FuturesContractType;
1043
+ interval: FuturesKlineInterval;
1044
+ startTime?: number;
1045
+ endTime?: number;
1046
+ limit?: number;
1047
+ }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
1048
+ indexPriceKlineData(params: {
1049
+ pair: string;
1050
+ interval: FuturesKlineInterval;
1051
+ startTime?: number;
1052
+ endTime?: number;
1053
+ limit?: number;
1054
+ }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
1055
+ markPriceKlineData(params: {
1056
+ symbol: string;
1057
+ interval: FuturesKlineInterval;
1058
+ startTime?: number;
1059
+ endTime?: number;
1060
+ limit?: number;
1061
+ }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
1062
+ premiumIndexKlineData(params: {
1063
+ symbol: string;
1064
+ interval: FuturesKlineInterval;
1065
+ startTime?: number;
1066
+ endTime?: number;
1067
+ limit?: number;
1068
+ }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
1069
+ markPrice(params: {
1070
+ symbol: string;
1071
+ }): Promise<MarkPrice>;
1072
+ markPrice(): Promise<MarkPrice[]>;
1073
+ fundingRateHistory(params?: {
1074
+ symbol?: string;
1075
+ startTime?: number;
1076
+ endTime?: number;
1077
+ limit?: number;
1078
+ }): Promise<{
1079
+ symbol: string;
1080
+ fundingRate: number;
1081
+ fundingTime: number;
1082
+ markPrice: number;
1083
+ }[]>;
1084
+ fundingRateInfo(): Promise<{
1085
+ symbol: string;
1086
+ adjustedFundingRateCap: number;
1087
+ adjustedFundingRateFloor: number;
1088
+ fundingIntervalHours: number;
1089
+ }[]>;
1090
+ ticker24h(params: {
1091
+ symbol: string;
1092
+ }): Promise<FuturesTicker24h>;
1093
+ ticker24h(): Promise<FuturesTicker24h[]>;
1094
+ symbolPriceTicker(params: {
1095
+ symbol: string;
1096
+ }): Promise<FuturesSymbolPrice>;
1097
+ symbolPriceTicker(): Promise<FuturesSymbolPrice[]>;
1098
+ bookTicker(params: {
1099
+ symbol: string;
1100
+ }): Promise<FuturesBookTicker>;
1101
+ bookTicker(): Promise<FuturesBookTicker[]>;
1102
+ quarterlySettlementPrices(params: {
1103
+ pair: string;
1104
+ }): Promise<{
1105
+ deliveryTime: number;
1106
+ deliveryPrice: number;
1107
+ }[]>;
1108
+ openInterest(params: {
1109
+ symbol: string;
1110
+ }): Promise<{
1111
+ openInterest: number;
1112
+ symbol: string;
1113
+ time: number;
1114
+ }>;
1115
+ openInterestStats(params: {
1116
+ symbol: string;
1117
+ period: FuturesOpenInterestPeriod;
1118
+ limit?: number;
1119
+ startTime?: number;
1120
+ endTime?: number;
1121
+ }): Promise<{
1122
+ symbol: string;
1123
+ sumOpenInterest: number;
1124
+ sumOpenInterestValue: number;
1125
+ timestamp: number;
1126
+ }[]>;
1127
+ topLongShortPositionRatio(params: {
1128
+ symbol: string;
1129
+ period: FuturesOpenInterestPeriod;
1130
+ limit?: number;
1131
+ startTime?: number;
1132
+ endTime?: number;
1133
+ }): Promise<{
1134
+ symbol: string;
1135
+ longShortRatio: number;
1136
+ longAccount: number;
1137
+ shortAccount: number;
1138
+ timestamp: number;
1139
+ }[]>;
1140
+ topLongShortAccountRatio(params: {
1141
+ symbol: string;
1142
+ period: FuturesOpenInterestPeriod;
1143
+ limit?: number;
1144
+ startTime?: number;
1145
+ endTime?: number;
1146
+ }): Promise<{
1147
+ symbol: string;
1148
+ longShortRatio: number;
1149
+ longAccount: number;
1150
+ shortAccount: number;
1151
+ timestamp: number;
1152
+ }[]>;
1153
+ globalLongShortAccountRatio(params: {
1154
+ symbol: string;
1155
+ period: FuturesOpenInterestPeriod;
1156
+ limit?: number;
1157
+ startTime?: number;
1158
+ endTime?: number;
1159
+ }): Promise<{
1160
+ symbol: string;
1161
+ longShortRatio: number;
1162
+ longAccount: number;
1163
+ shortAccount: number;
1164
+ timestamp: number;
1165
+ }[]>;
1166
+ takerBuySellRatio(params: {
1167
+ symbol: string;
1168
+ period: FuturesOpenInterestPeriod;
1169
+ limit?: number;
1170
+ startTime?: number;
1171
+ endTime?: number;
1172
+ }): Promise<{
1173
+ buySellRatio: number;
1174
+ buyVol: number;
1175
+ sellVol: number;
1176
+ timestamp: number;
1177
+ }[]>;
1178
+ basisData(params: {
1179
+ pair: string;
1180
+ contractType: FuturesContractType;
1181
+ period: FuturesOpenInterestPeriod;
1182
+ limit: number;
1183
+ startTime?: number;
1184
+ endTime?: number;
1185
+ }): Promise<{
1186
+ indexPrice: number;
1187
+ contractType: "PERPETUAL" | "CURRENT_QUARTER" | "NEXT_QUARTER";
1188
+ basisRate: number;
1189
+ futuresPrice: number;
1190
+ basis: number;
1191
+ pair: string;
1192
+ timestamp: number;
1193
+ annualizedBasisRate?: string | undefined;
1194
+ }[]>;
1195
+ compositeIndexInfo(params: {
1196
+ symbol: string;
1197
+ }): Promise<FuturesCompositeIndex>;
1198
+ compositeIndexInfo(): Promise<FuturesCompositeIndex[]>;
1199
+ assetIndex(params: {
1200
+ symbol: string;
1201
+ }): Promise<FuturesAssetIndex>;
1202
+ assetIndex(): Promise<FuturesAssetIndex[]>;
1203
+ indexPriceConstituents(params: {
1204
+ symbol: string;
1205
+ }): Promise<{
1206
+ symbol: string;
1207
+ time: number;
1208
+ constituents: {
1209
+ exchange: string;
1210
+ symbol: string;
1211
+ price: number;
1212
+ weight: number;
1213
+ }[];
1214
+ }>;
1215
+ insuranceBalance(params: {
1216
+ symbol: string;
1217
+ }): Promise<FuturesInsuranceBalanceEntry>;
1218
+ insuranceBalance(): Promise<FuturesInsuranceBalanceEntry[]>;
1219
+ accountBalance(): Promise<{
1220
+ accountAlias: string;
1221
+ asset: string;
1222
+ balance: number;
1223
+ crossWalletBalance: number;
1224
+ crossUnPnl: number;
1225
+ availableBalance: number;
1226
+ maxWithdrawAmount: number;
1227
+ marginAvailable: boolean;
1228
+ updateTime: number;
1229
+ }[]>;
1230
+ accountInformation(): Promise<{
1231
+ totalInitialMargin: number;
1232
+ totalMaintMargin: number;
1233
+ totalWalletBalance: number;
1234
+ totalUnrealizedProfit: number;
1235
+ totalMarginBalance: number;
1236
+ totalPositionInitialMargin: number;
1237
+ totalOpenOrderInitialMargin: number;
1238
+ totalCrossWalletBalance: number;
1239
+ totalCrossUnPnl: number;
1240
+ availableBalance: number;
1241
+ maxWithdrawAmount: number;
1242
+ assets: {
1243
+ asset: string;
1244
+ walletBalance: number;
1245
+ unrealizedProfit: number;
1246
+ marginBalance: number;
1247
+ maintMargin: number;
1248
+ initialMargin: number;
1249
+ positionInitialMargin: number;
1250
+ openOrderInitialMargin: number;
1251
+ crossWalletBalance: number;
1252
+ crossUnPnl: number;
1253
+ availableBalance: number;
1254
+ maxWithdrawAmount: number;
1255
+ updateTime: number;
1256
+ marginAvailable?: boolean | undefined;
1257
+ }[];
1258
+ positions: {
1259
+ symbol: string;
1260
+ positionSide: string;
1261
+ positionAmt: number;
1262
+ unrealizedProfit: number;
1263
+ isolatedMargin: number;
1264
+ notional: number;
1265
+ isolatedWallet: number;
1266
+ initialMargin: number;
1267
+ maintMargin: number;
1268
+ updateTime: number;
1269
+ }[];
1270
+ }>;
1271
+ userCommissionRate(params: {
1272
+ symbol: string;
1273
+ }): Promise<{
1274
+ symbol: string;
1275
+ makerCommissionRate: number;
1276
+ takerCommissionRate: number;
1277
+ }>;
1278
+ accountConfig(): Promise<{
1279
+ feeTier: number;
1280
+ canTrade: boolean;
1281
+ canDeposit: boolean;
1282
+ canWithdraw: boolean;
1283
+ dualSidePosition: boolean;
1284
+ multiAssetsMargin: boolean;
1285
+ tradeGroupId: number;
1286
+ }>;
1287
+ symbolConfig(params?: {
1288
+ symbol?: string;
1289
+ }): Promise<{
1290
+ symbol: string;
1291
+ marginType: "ISOLATED" | "CROSSED";
1292
+ isAutoAddMargin: boolean;
1293
+ leverage: number;
1294
+ maxNotionalValue: number;
1295
+ }[]>;
1296
+ userRateLimit(): Promise<{
1297
+ rateLimitType: "ORDERS";
1298
+ interval: "MINUTE" | "SECOND" | "DAY";
1299
+ intervalNum: number;
1300
+ limit: number;
1301
+ }[]>;
1302
+ leverageBrackets(params?: {
1303
+ symbol?: string;
1304
+ }): Promise<{
1305
+ symbol: string;
1306
+ brackets: {
1307
+ bracket: number;
1308
+ initialLeverage: number;
1309
+ notionalCap: number;
1310
+ notionalFloor: number;
1311
+ maintMarginRatio: number;
1312
+ cum: number;
1313
+ }[];
1314
+ notionalCoef?: number | undefined;
1315
+ }[]>;
1316
+ positionMode(): Promise<{
1317
+ dualSidePosition: boolean;
1318
+ }>;
1319
+ incomeHistory(params?: {
1320
+ symbol?: string;
1321
+ incomeType?: z$1.infer<typeof FuturesIncomeTypeSchema>;
1322
+ startTime?: number;
1323
+ endTime?: number;
1324
+ page?: number;
1325
+ limit?: number;
1326
+ }): Promise<{
1327
+ incomeType: "TRANSFER" | "WELCOME_BONUS" | "REALIZED_PNL" | "FUNDING_FEE" | "COMMISSION" | "INSURANCE_CLEAR" | "REFERRAL_KICKBACK" | "COMMISSION_REBATE" | "API_REBATE" | "CONTEST_REWARD" | "CROSS_COLLATERAL_TRANSFER" | "OPTIONS_PREMIUM_FEE" | "OPTIONS_SETTLE_PROFIT" | "INTERNAL_TRANSFER" | "AUTO_EXCHANGE" | "DELIVERED_SETTELMENT" | "COIN_SWAP_DEPOSIT" | "COIN_SWAP_WITHDRAW" | "POSITION_LIMIT_INCREASE_FEE" | "STRATEGY_UMFUTURES_TRANSFER" | "FEE_RETURN" | "BFUSD_REWARD";
1328
+ income: number;
1329
+ asset: string;
1330
+ info: string;
1331
+ time: number;
1332
+ tranId: number;
1333
+ symbol?: string | undefined;
1334
+ tradeId?: string | undefined;
1335
+ }[]>;
1336
+ newOrder(params: {
1337
+ symbol: string;
1338
+ side: FuturesOrderSide;
1339
+ type: FuturesOrderType;
1340
+ positionSide?: FuturesPositionSide;
1341
+ timeInForce?: FuturesTimeInForce;
1342
+ reduceOnly?: "true" | "false";
1343
+ quantity?: number;
1344
+ price?: number;
1345
+ newClientOrderId?: string;
1346
+ stopPrice?: number;
1347
+ closePosition?: "true" | "false";
1348
+ activationPrice?: number;
1349
+ callbackRate?: number;
1350
+ workingType?: FuturesWorkingType;
1351
+ priceProtect?: "TRUE" | "FALSE";
1352
+ newOrderRespType?: FuturesNewOrderRespType;
1353
+ priceMatch?: FuturesPriceMatch;
1354
+ selfTradePreventionMode?: FuturesSelfTradePrevention;
1355
+ goodTillDate?: number;
1356
+ recvWindow?: number;
1357
+ }): Promise<{
1358
+ clientOrderId: string;
1359
+ cumQty: number;
1360
+ cumQuote: number;
1361
+ executedQty: number;
1362
+ orderId: number;
1363
+ avgPrice: number;
1364
+ origQty: number;
1365
+ price: number;
1366
+ reduceOnly: boolean;
1367
+ side: "BUY" | "SELL";
1368
+ positionSide: "BOTH" | "LONG" | "SHORT";
1369
+ status: string;
1370
+ symbol: string;
1371
+ timeInForce: "GTC" | "IOC" | "FOK" | "GTX" | "GTD";
1372
+ type: "LIMIT" | "MARKET" | "STOP" | "TAKE_PROFIT" | "STOP_MARKET" | "TAKE_PROFIT_MARKET" | "TRAILING_STOP_MARKET";
1373
+ origType: "LIMIT" | "MARKET" | "STOP" | "TAKE_PROFIT" | "STOP_MARKET" | "TAKE_PROFIT_MARKET" | "TRAILING_STOP_MARKET";
1374
+ updateTime: number;
1375
+ workingType: "MARK_PRICE" | "CONTRACT_PRICE";
1376
+ priceProtect: boolean;
1377
+ stopPrice?: number | undefined;
1378
+ closePosition?: boolean | undefined;
1379
+ activatePrice?: number | undefined;
1380
+ priceRate?: number | undefined;
1381
+ priceMatch?: "NONE" | "OPPONENT" | "OPPONENT_5" | "OPPONENT_10" | "OPPONENT_20" | "QUEUE" | "QUEUE_5" | "QUEUE_10" | "QUEUE_20" | undefined;
1382
+ selfTradePreventionMode?: "NONE" | "EXPIRE_TAKER" | "EXPIRE_MAKER" | "EXPIRE_BOTH" | undefined;
1383
+ goodTillDate?: number | undefined;
1384
+ }>;
1385
+ }
1386
+ //#endregion
1387
+ //#region src/rest/spot/client.d.ts
1388
+ declare class SpotRestClient extends BaseRestClient {
1389
+ constructor({
1390
+ baseUrl,
1391
+ credentials,
1392
+ httpOptions
1393
+ }: {
1394
+ credentials?: ApiCredentials;
1395
+ baseUrl?: string;
1396
+ httpOptions?: Client.Options;
1397
+ });
1398
+ testConnectivity(): Promise<Record<string, never>>;
1399
+ checkServerTime(): Promise<{
1400
+ serverTime: number;
1401
+ }>;
1402
+ }
1403
+ //#endregion
1404
+ //#region src/rest/client.d.ts
1405
+ declare class BinanceRestClient {
1406
+ futures: FuturesRestClient;
1407
+ spot: SpotRestClient;
1408
+ constructor(options?: {
1409
+ credentials?: ApiCredentials;
1410
+ baseUrls?: {
1411
+ spot?: string;
1412
+ futures?: string;
1413
+ };
1414
+ });
1415
+ }
1416
+ //#endregion
1417
+ //#region src/shared/api-error.d.ts
1418
+ declare class ApiError extends Error {
1419
+ endpoint: string;
1420
+ constructor({
1421
+ endpoint,
1422
+ metadata
1423
+ }: {
1424
+ endpoint: string;
1425
+ metadata: Record<string, unknown>;
1426
+ });
1427
+ }
1428
+ declare class ValidationError<T extends z4.$ZodType> extends ApiError {
1429
+ error?: z4.$ZodError<z4.output<T>>;
1430
+ input: unknown;
1431
+ constructor({
1432
+ error,
1433
+ input,
1434
+ endpoint
1435
+ }: {
1436
+ error?: z4.$ZodError<z4.output<T>>;
1437
+ input?: unknown;
1438
+ endpoint: string;
1439
+ });
1440
+ }
1441
+ declare class ResponseError extends ApiError {
1442
+ code: number;
1443
+ status: number;
1444
+ constructor({
1445
+ metadata,
1446
+ code,
1447
+ status,
1448
+ endpoint
1449
+ }: {
1450
+ metadata?: Record<string, unknown>;
1451
+ endpoint: string;
1452
+ code: number;
1453
+ status: number;
1454
+ });
1455
+ }
1456
+ declare class ErrorMessageParsingError extends Error {
1457
+ constructor(message: string);
1458
+ }
1459
+ declare class WeightError extends ResponseError {
1460
+ ip: string;
1461
+ bannedUntil: number;
1462
+ constructor({
1463
+ message,
1464
+ endpoint
1465
+ }: {
1466
+ message: string;
1467
+ endpoint: string;
1468
+ });
1469
+ private parseWeightResponse;
1470
+ }
1471
+ declare class MalformedParamError extends ResponseError {
1472
+ param: string;
1473
+ constructor({
1474
+ message,
1475
+ endpoint
1476
+ }: {
1477
+ message: string;
1478
+ endpoint: string;
1479
+ });
1480
+ private parseParam;
1481
+ }
1482
+ //#endregion
1483
+ //#region src/websocket/base/types.d.ts
1484
+ type ConnectionSuccessEvent = {
1485
+ result: null;
1486
+ id: number;
1487
+ };
1488
+ type ConnectionErrorEvent = {
1489
+ result: null;
1490
+ id: number;
1491
+ status: number;
1492
+ error: {
1493
+ code: number;
1494
+ msg: string;
1495
+ };
1496
+ };
1497
+ type ConnectionEvent = ConnectionSuccessEvent | ConnectionErrorEvent;
1498
+ //#endregion
1499
+ //#region src/websocket/base/client.d.ts
1500
+ type WebsocketClientEventMap<MarketEvent extends object> = {
1501
+ marketMessage: (data: MarketEvent) => void;
1502
+ connectionMessage: (data: ConnectionEvent) => void;
1503
+ error: (error: Error | ConnectionErrorEvent) => void;
1504
+ };
1505
+ declare class BinanceWebsocketClient<MarketEvent extends object> {
1506
+ private socket;
1507
+ private baseUrl;
1508
+ private emitter;
1509
+ private subscriptionId;
1510
+ private subscriptions;
1511
+ constructor(baseUrl: string);
1512
+ private createSocket;
1513
+ private sendMessage;
1514
+ private parseEvent;
1515
+ subscribe(...channels: string[]): Promise<void>;
1516
+ unsubscribe(...channels: string[]): Promise<void>;
1517
+ reconnect(): Promise<void>;
1518
+ connect(): Promise<void>;
1519
+ addEventListener<E extends keyof WebsocketClientEventMap<MarketEvent>>(event: E, callback: WebsocketClientEventMap<MarketEvent>[E], options?: AddEventListenerOptions): void;
1520
+ }
1521
+ //#endregion
1522
+ //#region src/websocket/futures/types.d.ts
1523
+ type FuturesBookTickerEvent = {
1524
+ u: number;
1525
+ s: string;
1526
+ b: string;
1527
+ B: string;
1528
+ a: string;
1529
+ A: string;
1530
+ };
1531
+ type FuturesBookDepthEvent = {
1532
+ E: number;
1533
+ T: number;
1534
+ s: string;
1535
+ U: number;
1536
+ u: number;
1537
+ pu: number;
1538
+ b: [string, string][];
1539
+ a: [string, string][];
1540
+ };
1541
+ type FuturesMarketEvent = FuturesBookDepthEvent | FuturesBookTickerEvent;
1542
+ //#endregion
1543
+ //#region src/websocket/futures/client.d.ts
1544
+ declare class FuturesWebsocketClient extends BinanceWebsocketClient<FuturesMarketEvent> {
1545
+ constructor(baseUrl?: string);
1546
+ }
1547
+ //#endregion
1548
+ export { ApiError, BinanceRestClient, ConnectionErrorEvent, ConnectionEvent, ConnectionSuccessEvent, ErrorMessageParsingError, FundingInfo, FundingInfoEntry, FundingRate, FundingRateEntry, FuturesAccountAsset, FuturesAccountBalance, FuturesAccountConfig, FuturesAccountInfo, FuturesAccountPosition, FuturesAssetIndex, FuturesBasis, FuturesBookDepthEvent, FuturesBookTicker, FuturesBookTickerEvent, FuturesCheckServerTime, FuturesCommissionRate, FuturesCompositeIndex, FuturesCompositeIndexAsset, FuturesContractType, FuturesDeliveryPrice, FuturesExchangeInfo, FuturesExchangeInfoAsset, FuturesExchangeInfoFilter, FuturesExchangeInfoRateLimit, FuturesExchangeInfoSymbol, FuturesIncomeHistory, FuturesIncomeType, FuturesIndexPriceConstituent, FuturesIndexPriceConstituents, FuturesInsuranceBalanceAsset, FuturesInsuranceBalanceEntry, FuturesKlineInterval, FuturesLeverageBracket, FuturesLeverageBracketEntry, FuturesLongShortRatio, FuturesMarketEvent, FuturesNewOrder, FuturesNewOrderRespType, FuturesOldTradesLookup, FuturesOpenInterest, FuturesOpenInterestPeriod, FuturesOpenInterestStats, FuturesOrderBook, FuturesOrderSide, FuturesOrderType, FuturesPositionMode, FuturesPositionSide, FuturesPriceMatch, FuturesRecentTrades, FuturesSelfTradePrevention, FuturesSymbolConfig, FuturesSymbolPrice, FuturesTakerBuySellRatio, FuturesTakerBuySellRatioItem, FuturesTestConnectivity, FuturesTicker24h, FuturesTimeInForce, FuturesUnderlyingType, FuturesUserRateLimit, FuturesWebsocketClient, FuturesWorkingType, FuturesggregateTrades, KlineData, MalformedParamError, MarkPrice, ResponseError, ValidationError, WeightError };