@medievalrain/binance-ts 0.8.0 → 0.9.6

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 +472 -1208
  2. package/dist/index.js +128 -726
  3. package/package.json +18 -13
package/dist/index.d.ts CHANGED
@@ -1,1042 +1,485 @@
1
- import z$1, { z } from "zod";
2
- import { Client, WebSocket } from "undici";
3
- import * as z4 from "zod/v4/core";
4
1
  import { CallbackOptions } from "@medievalrain/emitter";
5
2
 
6
3
  //#region src/shared/base-rest-client.d.ts
7
4
  type RawSearchParams = Record<string, string | undefined | null | string[] | number | boolean>;
8
5
  declare class BaseRestClient {
9
- private httpCleint;
10
6
  private apiKey?;
11
7
  private apiSecret?;
8
+ private baseUrl;
12
9
  constructor({
13
10
  baseUrl,
14
11
  apiKey,
15
- apiSecret,
16
- httpOptions
12
+ apiSecret
17
13
  }: {
18
14
  baseUrl: string;
19
15
  apiKey?: string;
20
16
  apiSecret?: string;
21
- httpOptions?: Client.Options;
22
17
  });
23
- private toSearchParams;
24
- private parseErrorResponse;
25
- private parseResponse;
26
- protected publicRequest<T extends z4.$ZodType>({
18
+ protected marketRequest: <T extends object>({
27
19
  endpoint,
28
- params,
29
- schema
20
+ params
30
21
  }: {
31
22
  endpoint: string;
32
23
  params?: RawSearchParams;
33
- schema: T;
34
- }): Promise<z4.output<T>>;
35
- protected privateRequest<T extends z4.$ZodType>({
24
+ }) => Promise<NoInfer<T>>;
25
+ protected privateRequest<T extends object>({
36
26
  endpoint,
37
27
  params,
38
- schema,
39
28
  method
40
29
  }: {
41
30
  endpoint: string;
42
31
  params?: RawSearchParams;
43
32
  method: "GET" | "POST" | "DELETE";
44
- schema: T;
45
- }): Promise<z4.output<T>>;
33
+ }): Promise<NoInfer<T>>;
46
34
  private sign;
35
+ private toSearchParams;
36
+ private parseErrorResponse;
47
37
  }
48
38
  //#endregion
49
- //#region src/rest/futures/schema.d.ts
50
- declare const FuturesTestConnectivitySchema: z.ZodObject<{}, z.core.$strip>;
51
- declare const FuturesCheckServerTimeSchema: z.ZodObject<{
52
- serverTime: z.ZodNumber;
53
- }, z.core.$strip>;
54
- declare const FuturesExchangeInfoRateLimitSchema: z.ZodObject<{
55
- interval: z.ZodEnum<{
56
- MINUTE: "MINUTE";
57
- SECOND: "SECOND";
58
- }>;
59
- intervalNum: z.ZodNumber;
60
- limit: z.ZodNumber;
61
- rateLimitType: z.ZodEnum<{
62
- REQUEST_WEIGHT: "REQUEST_WEIGHT";
63
- ORDERS: "ORDERS";
64
- }>;
65
- }, z.core.$strip>;
66
- declare const FuturesExchangeInfoAssetSchema: z.ZodObject<{
67
- asset: z.ZodString;
68
- marginAvailable: z.ZodBoolean;
69
- autoAssetExchange: z.ZodNullable<z.ZodString>;
70
- }, z.core.$strip>;
71
- declare const FuturesExchangeInfoFilterSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
72
- filterType: z.ZodLiteral<"PRICE_FILTER">;
73
- maxPrice: z.ZodCoercedNumber<unknown>;
74
- minPrice: z.ZodCoercedNumber<unknown>;
75
- tickSize: z.ZodCoercedNumber<unknown>;
76
- }, z.core.$strip>, z.ZodObject<{
77
- filterType: z.ZodLiteral<"LOT_SIZE">;
78
- maxQty: z.ZodCoercedNumber<unknown>;
79
- minQty: z.ZodCoercedNumber<unknown>;
80
- stepSize: z.ZodCoercedNumber<unknown>;
81
- }, z.core.$strip>, z.ZodObject<{
82
- filterType: z.ZodLiteral<"MARKET_LOT_SIZE">;
83
- maxQty: z.ZodCoercedNumber<unknown>;
84
- minQty: z.ZodCoercedNumber<unknown>;
85
- stepSize: z.ZodCoercedNumber<unknown>;
86
- }, z.core.$strip>, z.ZodObject<{
87
- filterType: z.ZodLiteral<"MAX_NUM_ORDERS">;
88
- limit: z.ZodNumber;
89
- }, z.core.$strip>, z.ZodObject<{
90
- filterType: z.ZodLiteral<"MAX_NUM_ALGO_ORDERS">;
91
- limit: z.ZodNumber;
92
- }, z.core.$strip>, z.ZodObject<{
93
- filterType: z.ZodLiteral<"MIN_NOTIONAL">;
94
- notional: z.ZodString;
95
- }, z.core.$strip>, z.ZodObject<{
96
- filterType: z.ZodLiteral<"PERCENT_PRICE">;
97
- multiplierUp: z.ZodCoercedNumber<unknown>;
98
- multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
99
- multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
100
- }, z.core.$strip>, z.ZodObject<{
101
- filterType: z.ZodLiteral<"POSITION_RISK_CONTROL">;
102
- positionControlSide: z.ZodLiteral<"NONE">;
103
- multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
104
- multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
105
- }, z.core.$strip>], "filterType">;
106
- declare const FuturesContractTypeSchema: z.ZodEnum<{
107
- PERPETUAL: "PERPETUAL";
108
- CURRENT_QUARTER: "CURRENT_QUARTER";
109
- NEXT_QUARTER: "NEXT_QUARTER";
110
- }>;
111
- declare const FuturesUnderlyingTypeSchema: z.ZodEnum<{
112
- COIN: "COIN";
113
- INDEX: "INDEX";
114
- PREMARKET: "PREMARKET";
115
- }>;
116
- declare const FuturesOrderTypeSchema: z.ZodEnum<{
117
- LIMIT: "LIMIT";
118
- MARKET: "MARKET";
119
- STOP: "STOP";
120
- TAKE_PROFIT: "TAKE_PROFIT";
121
- STOP_MARKET: "STOP_MARKET";
122
- TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
123
- TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
124
- }>;
125
- declare const FuturesExchangeInfoSymbolSchema: z.ZodObject<{
126
- symbol: z.ZodString;
127
- pair: z.ZodString;
128
- contractType: z.ZodEnum<{
129
- PERPETUAL: "PERPETUAL";
130
- CURRENT_QUARTER: "CURRENT_QUARTER";
131
- NEXT_QUARTER: "NEXT_QUARTER";
132
- }>;
133
- deliveryDate: z.ZodNumber;
134
- onboardDate: z.ZodNumber;
135
- status: z.ZodEnum<{
136
- TRADING: "TRADING";
137
- SETTLING: "SETTLING";
138
- PENDING_TRADING: "PENDING_TRADING";
139
- }>;
140
- maintMarginPercent: z.ZodString;
141
- requiredMarginPercent: z.ZodString;
142
- baseAsset: z.ZodString;
143
- quoteAsset: z.ZodString;
144
- marginAsset: z.ZodString;
145
- pricePrecision: z.ZodNumber;
146
- quantityPrecision: z.ZodNumber;
147
- baseAssetPrecision: z.ZodNumber;
148
- quotePrecision: z.ZodNumber;
149
- underlyingType: z.ZodEnum<{
150
- COIN: "COIN";
151
- INDEX: "INDEX";
152
- PREMARKET: "PREMARKET";
153
- }>;
154
- underlyingSubType: z.ZodArray<z.ZodString>;
155
- permissionSets: z.ZodArray<z.ZodEnum<{
156
- COPY: "COPY";
157
- GRID: "GRID";
158
- }>>;
159
- settlePlan: z.ZodOptional<z.ZodNumber>;
160
- triggerProtect: z.ZodString;
161
- filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
162
- filterType: z.ZodLiteral<"PRICE_FILTER">;
163
- maxPrice: z.ZodCoercedNumber<unknown>;
164
- minPrice: z.ZodCoercedNumber<unknown>;
165
- tickSize: z.ZodCoercedNumber<unknown>;
166
- }, z.core.$strip>, z.ZodObject<{
167
- filterType: z.ZodLiteral<"LOT_SIZE">;
168
- maxQty: z.ZodCoercedNumber<unknown>;
169
- minQty: z.ZodCoercedNumber<unknown>;
170
- stepSize: z.ZodCoercedNumber<unknown>;
171
- }, z.core.$strip>, z.ZodObject<{
172
- filterType: z.ZodLiteral<"MARKET_LOT_SIZE">;
173
- maxQty: z.ZodCoercedNumber<unknown>;
174
- minQty: z.ZodCoercedNumber<unknown>;
175
- stepSize: z.ZodCoercedNumber<unknown>;
176
- }, z.core.$strip>, z.ZodObject<{
177
- filterType: z.ZodLiteral<"MAX_NUM_ORDERS">;
178
- limit: z.ZodNumber;
179
- }, z.core.$strip>, z.ZodObject<{
180
- filterType: z.ZodLiteral<"MAX_NUM_ALGO_ORDERS">;
181
- limit: z.ZodNumber;
182
- }, z.core.$strip>, z.ZodObject<{
183
- filterType: z.ZodLiteral<"MIN_NOTIONAL">;
184
- notional: z.ZodString;
185
- }, z.core.$strip>, z.ZodObject<{
186
- filterType: z.ZodLiteral<"PERCENT_PRICE">;
187
- multiplierUp: z.ZodCoercedNumber<unknown>;
188
- multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
189
- multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
190
- }, z.core.$strip>, z.ZodObject<{
191
- filterType: z.ZodLiteral<"POSITION_RISK_CONTROL">;
192
- positionControlSide: z.ZodLiteral<"NONE">;
193
- multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
194
- multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
195
- }, z.core.$strip>], "filterType">>;
196
- OrderType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
197
- LIMIT: "LIMIT";
198
- MARKET: "MARKET";
199
- STOP: "STOP";
200
- TAKE_PROFIT: "TAKE_PROFIT";
201
- STOP_MARKET: "STOP_MARKET";
202
- TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
203
- TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
204
- }>>>;
205
- timeInForce: z.ZodArray<z.ZodString>;
206
- liquidationFee: z.ZodCoercedNumber<unknown>;
207
- marketTakeBound: z.ZodCoercedNumber<unknown>;
208
- }, z.core.$strip>;
209
- declare const FuturesExchangeInfoSchema: z.ZodObject<{
210
- exchangeFilters: z.ZodArray<z.ZodUnknown>;
211
- rateLimits: z.ZodArray<z.ZodObject<{
212
- interval: z.ZodEnum<{
213
- MINUTE: "MINUTE";
214
- SECOND: "SECOND";
215
- }>;
216
- intervalNum: z.ZodNumber;
217
- limit: z.ZodNumber;
218
- rateLimitType: z.ZodEnum<{
219
- REQUEST_WEIGHT: "REQUEST_WEIGHT";
220
- ORDERS: "ORDERS";
221
- }>;
222
- }, z.core.$strip>>;
223
- serverTime: z.ZodNumber;
224
- assets: z.ZodArray<z.ZodObject<{
225
- asset: z.ZodString;
226
- marginAvailable: z.ZodBoolean;
227
- autoAssetExchange: z.ZodNullable<z.ZodString>;
228
- }, z.core.$strip>>;
229
- symbols: z.ZodArray<z.ZodObject<{
230
- symbol: z.ZodString;
231
- pair: z.ZodString;
232
- contractType: z.ZodEnum<{
233
- PERPETUAL: "PERPETUAL";
234
- CURRENT_QUARTER: "CURRENT_QUARTER";
235
- NEXT_QUARTER: "NEXT_QUARTER";
236
- }>;
237
- deliveryDate: z.ZodNumber;
238
- onboardDate: z.ZodNumber;
239
- status: z.ZodEnum<{
240
- TRADING: "TRADING";
241
- SETTLING: "SETTLING";
242
- PENDING_TRADING: "PENDING_TRADING";
243
- }>;
244
- maintMarginPercent: z.ZodString;
245
- requiredMarginPercent: z.ZodString;
246
- baseAsset: z.ZodString;
247
- quoteAsset: z.ZodString;
248
- marginAsset: z.ZodString;
249
- pricePrecision: z.ZodNumber;
250
- quantityPrecision: z.ZodNumber;
251
- baseAssetPrecision: z.ZodNumber;
252
- quotePrecision: z.ZodNumber;
253
- underlyingType: z.ZodEnum<{
254
- COIN: "COIN";
255
- INDEX: "INDEX";
256
- PREMARKET: "PREMARKET";
257
- }>;
258
- underlyingSubType: z.ZodArray<z.ZodString>;
259
- permissionSets: z.ZodArray<z.ZodEnum<{
260
- COPY: "COPY";
261
- GRID: "GRID";
262
- }>>;
263
- settlePlan: z.ZodOptional<z.ZodNumber>;
264
- triggerProtect: z.ZodString;
265
- filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
266
- filterType: z.ZodLiteral<"PRICE_FILTER">;
267
- maxPrice: z.ZodCoercedNumber<unknown>;
268
- minPrice: z.ZodCoercedNumber<unknown>;
269
- tickSize: z.ZodCoercedNumber<unknown>;
270
- }, z.core.$strip>, z.ZodObject<{
271
- filterType: z.ZodLiteral<"LOT_SIZE">;
272
- maxQty: z.ZodCoercedNumber<unknown>;
273
- minQty: z.ZodCoercedNumber<unknown>;
274
- stepSize: z.ZodCoercedNumber<unknown>;
275
- }, z.core.$strip>, z.ZodObject<{
276
- filterType: z.ZodLiteral<"MARKET_LOT_SIZE">;
277
- maxQty: z.ZodCoercedNumber<unknown>;
278
- minQty: z.ZodCoercedNumber<unknown>;
279
- stepSize: z.ZodCoercedNumber<unknown>;
280
- }, z.core.$strip>, z.ZodObject<{
281
- filterType: z.ZodLiteral<"MAX_NUM_ORDERS">;
282
- limit: z.ZodNumber;
283
- }, z.core.$strip>, z.ZodObject<{
284
- filterType: z.ZodLiteral<"MAX_NUM_ALGO_ORDERS">;
285
- limit: z.ZodNumber;
286
- }, z.core.$strip>, z.ZodObject<{
287
- filterType: z.ZodLiteral<"MIN_NOTIONAL">;
288
- notional: z.ZodString;
289
- }, z.core.$strip>, z.ZodObject<{
290
- filterType: z.ZodLiteral<"PERCENT_PRICE">;
291
- multiplierUp: z.ZodCoercedNumber<unknown>;
292
- multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
293
- multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
294
- }, z.core.$strip>, z.ZodObject<{
295
- filterType: z.ZodLiteral<"POSITION_RISK_CONTROL">;
296
- positionControlSide: z.ZodLiteral<"NONE">;
297
- multiplierDown: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
298
- multiplierDecimal: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
299
- }, z.core.$strip>], "filterType">>;
300
- OrderType: z.ZodOptional<z.ZodArray<z.ZodEnum<{
301
- LIMIT: "LIMIT";
302
- MARKET: "MARKET";
303
- STOP: "STOP";
304
- TAKE_PROFIT: "TAKE_PROFIT";
305
- STOP_MARKET: "STOP_MARKET";
306
- TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
307
- TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
308
- }>>>;
309
- timeInForce: z.ZodArray<z.ZodString>;
310
- liquidationFee: z.ZodCoercedNumber<unknown>;
311
- marketTakeBound: z.ZodCoercedNumber<unknown>;
312
- }, z.core.$strip>>;
313
- timezone: z.ZodString;
314
- }, z.core.$strip>;
315
- declare const FuturesOrderBookSchema: z.ZodObject<{
316
- lastUpdateId: z.ZodNumber;
317
- E: z.ZodNumber;
318
- T: z.ZodNumber;
319
- bids: z.ZodArray<z.ZodTuple<[z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>], null>>;
320
- asks: z.ZodArray<z.ZodTuple<[z.ZodCoercedNumber<unknown>, z.ZodCoercedNumber<unknown>], null>>;
321
- }, z.core.$strip>;
322
- declare const FuturesRecentTradesSchema: z.ZodArray<z.ZodObject<{
323
- id: z.ZodNumber;
324
- price: z.ZodCoercedNumber<unknown>;
325
- qty: z.ZodCoercedNumber<unknown>;
326
- quoteQty: z.ZodCoercedNumber<unknown>;
327
- time: z.ZodNumber;
328
- isBuyerMaker: z.ZodBoolean;
329
- }, z.core.$strip>>;
330
- declare const FuturesOldTradesLookupSchema: z.ZodArray<z.ZodObject<{
331
- id: z.ZodNumber;
332
- price: z.ZodCoercedNumber<unknown>;
333
- qty: z.ZodCoercedNumber<unknown>;
334
- quoteQty: z.ZodCoercedNumber<unknown>;
335
- time: z.ZodNumber;
336
- isBuyerMaker: z.ZodBoolean;
337
- }, z.core.$strip>>;
338
- declare const FuturesAggregateTradesSchema: z.ZodArray<z.ZodObject<{
339
- a: z.ZodNumber;
340
- p: z.ZodCoercedNumber<unknown>;
341
- q: z.ZodCoercedNumber<unknown>;
342
- f: z.ZodNumber;
343
- l: z.ZodNumber;
344
- T: z.ZodNumber;
345
- m: z.ZodBoolean;
346
- }, z.core.$strip>>;
347
- 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>>;
348
- declare const FuturesMarkPriceSchema: z.ZodObject<{
349
- symbol: z.ZodString;
350
- markPrice: z.ZodCoercedNumber<unknown>;
351
- indexPrice: z.ZodCoercedNumber<unknown>;
352
- estimatedSettlePrice: z.ZodCoercedNumber<unknown>;
353
- lastFundingRate: z.ZodCoercedNumber<unknown>;
354
- interestRate: z.ZodCoercedNumber<unknown>;
355
- nextFundingTime: z.ZodNumber;
356
- time: z.ZodNumber;
357
- }, z.core.$strip>;
358
- declare const FuturesFundingRateEntrySchema: z.ZodObject<{
359
- symbol: z.ZodString;
360
- fundingRate: z.ZodCoercedNumber<unknown>;
361
- fundingTime: z.ZodNumber;
362
- markPrice: z.ZodCoercedNumber<unknown>;
363
- }, z.core.$strip>;
364
- declare const FuturesFundingRateSchema: z.ZodArray<z.ZodObject<{
365
- symbol: z.ZodString;
366
- fundingRate: z.ZodCoercedNumber<unknown>;
367
- fundingTime: z.ZodNumber;
368
- markPrice: z.ZodCoercedNumber<unknown>;
369
- }, z.core.$strip>>;
370
- declare const FuturesFundingInfoEntrySchema: z.ZodObject<{
371
- symbol: z.ZodString;
372
- adjustedFundingRateCap: z.ZodCoercedNumber<unknown>;
373
- adjustedFundingRateFloor: z.ZodCoercedNumber<unknown>;
374
- fundingIntervalHours: z.ZodNumber;
375
- }, z.core.$strip>;
376
- declare const FuturesFundingInfoSchema: z.ZodArray<z.ZodObject<{
377
- symbol: z.ZodString;
378
- adjustedFundingRateCap: z.ZodCoercedNumber<unknown>;
379
- adjustedFundingRateFloor: z.ZodCoercedNumber<unknown>;
380
- fundingIntervalHours: z.ZodNumber;
381
- }, z.core.$strip>>;
382
- declare const FuturesTicker24hSchema: z.ZodObject<{
383
- symbol: z.ZodString;
384
- priceChange: z.ZodCoercedNumber<unknown>;
385
- priceChangePercent: z.ZodCoercedNumber<unknown>;
386
- weightedAvgPrice: z.ZodCoercedNumber<unknown>;
387
- lastPrice: z.ZodCoercedNumber<unknown>;
388
- lastQty: z.ZodCoercedNumber<unknown>;
389
- openPrice: z.ZodCoercedNumber<unknown>;
390
- highPrice: z.ZodCoercedNumber<unknown>;
391
- lowPrice: z.ZodCoercedNumber<unknown>;
392
- volume: z.ZodCoercedNumber<unknown>;
393
- quoteVolume: z.ZodCoercedNumber<unknown>;
394
- openTime: z.ZodNumber;
395
- closeTime: z.ZodNumber;
396
- firstId: z.ZodNumber;
397
- lastId: z.ZodNumber;
398
- count: z.ZodNumber;
399
- }, z.core.$strip>;
400
- declare const FuturesSymbolPriceSchema: z.ZodObject<{
401
- symbol: z.ZodString;
402
- price: z.ZodCoercedNumber<unknown>;
403
- time: z.ZodNumber;
404
- }, z.core.$strip>;
405
- declare const FuturesBookTickerSchema: z.ZodObject<{
406
- symbol: z.ZodString;
407
- bidPrice: z.ZodCoercedNumber<unknown>;
408
- bidQty: z.ZodCoercedNumber<unknown>;
409
- askPrice: z.ZodCoercedNumber<unknown>;
410
- askQty: z.ZodCoercedNumber<unknown>;
411
- time: z.ZodCoercedNumber<unknown>;
412
- }, z.core.$strip>;
413
- declare const FuturesDeliveryPriceSchema: z.ZodArray<z.ZodObject<{
414
- deliveryTime: z.ZodCoercedNumber<unknown>;
415
- deliveryPrice: z.ZodCoercedNumber<unknown>;
416
- }, z.core.$strip>>;
417
- declare const FuturesOpenInterestSchema: z.ZodObject<{
418
- openInterest: z.ZodCoercedNumber<unknown>;
419
- symbol: z.ZodString;
420
- time: z.ZodCoercedNumber<unknown>;
421
- }, z.core.$strip>;
422
- declare const FuturesOpenInterestStatsSchema: z.ZodArray<z.ZodObject<{
423
- symbol: z.ZodString;
424
- sumOpenInterest: z.ZodCoercedNumber<unknown>;
425
- sumOpenInterestValue: z.ZodCoercedNumber<unknown>;
426
- timestamp: z.ZodCoercedNumber<unknown>;
427
- }, z.core.$strip>>;
428
- declare const FuturesLongShortRatioSchema: z.ZodArray<z.ZodObject<{
429
- symbol: z.ZodString;
430
- longShortRatio: z.ZodCoercedNumber<unknown>;
431
- longAccount: z.ZodCoercedNumber<unknown>;
432
- shortAccount: z.ZodCoercedNumber<unknown>;
433
- timestamp: z.ZodCoercedNumber<unknown>;
434
- }, z.core.$strip>>;
435
- declare const FuturesTakerBuySellRatioItemSchema: z.ZodObject<{
436
- buySellRatio: z.ZodCoercedNumber<unknown>;
437
- buyVol: z.ZodCoercedNumber<unknown>;
438
- sellVol: z.ZodCoercedNumber<unknown>;
439
- timestamp: z.ZodCoercedNumber<unknown>;
440
- }, z.core.$strip>;
441
- declare const FuturesTakerBuySellRatioSchema: z.ZodArray<z.ZodObject<{
442
- buySellRatio: z.ZodCoercedNumber<unknown>;
443
- buyVol: z.ZodCoercedNumber<unknown>;
444
- sellVol: z.ZodCoercedNumber<unknown>;
445
- timestamp: z.ZodCoercedNumber<unknown>;
446
- }, z.core.$strip>>;
447
- declare const FuturesBasisSchema: z.ZodArray<z.ZodObject<{
448
- indexPrice: z.ZodCoercedNumber<unknown>;
449
- contractType: z.ZodEnum<{
450
- PERPETUAL: "PERPETUAL";
451
- CURRENT_QUARTER: "CURRENT_QUARTER";
452
- NEXT_QUARTER: "NEXT_QUARTER";
453
- }>;
454
- basisRate: z.ZodCoercedNumber<unknown>;
455
- futuresPrice: z.ZodCoercedNumber<unknown>;
456
- annualizedBasisRate: z.ZodOptional<z.ZodString>;
457
- basis: z.ZodCoercedNumber<unknown>;
458
- pair: z.ZodString;
459
- timestamp: z.ZodNumber;
460
- }, z.core.$strip>>;
461
- declare const FuturesCompositeIndexAssetSchema: z.ZodObject<{
462
- baseAsset: z.ZodString;
463
- quoteAsset: z.ZodString;
464
- weightInQuantity: z.ZodCoercedNumber<unknown>;
465
- weightInPercentage: z.ZodCoercedNumber<unknown>;
466
- }, z.core.$strip>;
467
- declare const FuturesCompositeIndexSchema: z.ZodObject<{
468
- symbol: z.ZodString;
469
- time: z.ZodCoercedNumber<unknown>;
470
- component: z.ZodString;
471
- baseAssetList: z.ZodArray<z.ZodObject<{
472
- baseAsset: z.ZodString;
473
- quoteAsset: z.ZodString;
474
- weightInQuantity: z.ZodCoercedNumber<unknown>;
475
- weightInPercentage: z.ZodCoercedNumber<unknown>;
476
- }, z.core.$strip>>;
477
- }, z.core.$strip>;
478
- declare const FuturesAssetIndexSchema: z.ZodObject<{
479
- symbol: z.ZodString;
480
- time: z.ZodCoercedNumber<unknown>;
481
- index: z.ZodCoercedNumber<unknown>;
482
- bidBuffer: z.ZodCoercedNumber<unknown>;
483
- askBuffer: z.ZodCoercedNumber<unknown>;
484
- bidRate: z.ZodCoercedNumber<unknown>;
485
- askRate: z.ZodCoercedNumber<unknown>;
486
- autoExchangeBidBuffer: z.ZodCoercedNumber<unknown>;
487
- autoExchangeAskBuffer: z.ZodCoercedNumber<unknown>;
488
- autoExchangeBidRate: z.ZodCoercedNumber<unknown>;
489
- autoExchangeAskRate: z.ZodCoercedNumber<unknown>;
490
- }, z.core.$strip>;
491
- declare const FuturesIndexPriceConstituentItemSchema: z.ZodObject<{
492
- exchange: z.ZodString;
493
- symbol: z.ZodString;
494
- price: z.ZodCoercedNumber<unknown>;
495
- weight: z.ZodCoercedNumber<unknown>;
496
- }, z.core.$strip>;
497
- declare const FuturesIndexPriceConstituentsSchema: z.ZodObject<{
498
- symbol: z.ZodString;
499
- time: z.ZodCoercedNumber<unknown>;
500
- constituents: z.ZodArray<z.ZodObject<{
501
- exchange: z.ZodString;
502
- symbol: z.ZodString;
503
- price: z.ZodCoercedNumber<unknown>;
504
- weight: z.ZodCoercedNumber<unknown>;
505
- }, z.core.$strip>>;
506
- }, z.core.$strip>;
507
- declare const FuturesInsuranceBalanceAssetSchema: z.ZodObject<{
508
- asset: z.ZodString;
509
- marginBalance: z.ZodCoercedNumber<unknown>;
510
- updateTime: z.ZodCoercedNumber<unknown>;
511
- }, z.core.$strip>;
512
- declare const FuturesInsuranceBalanceEntrySchema: z.ZodObject<{
513
- symbols: z.ZodArray<z.ZodString>;
514
- assets: z.ZodArray<z.ZodObject<{
515
- asset: z.ZodString;
516
- marginBalance: z.ZodCoercedNumber<unknown>;
517
- updateTime: z.ZodCoercedNumber<unknown>;
518
- }, z.core.$strip>>;
519
- }, z.core.$strip>;
520
- declare const FuturesAccountBalanceSchema: z.ZodArray<z.ZodObject<{
521
- accountAlias: z.ZodString;
522
- asset: z.ZodString;
523
- balance: z.ZodCoercedNumber<unknown>;
524
- crossWalletBalance: z.ZodCoercedNumber<unknown>;
525
- crossUnPnl: z.ZodCoercedNumber<unknown>;
526
- availableBalance: z.ZodCoercedNumber<unknown>;
527
- maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
528
- marginAvailable: z.ZodBoolean;
529
- updateTime: z.ZodNumber;
530
- }, z.core.$strip>>;
531
- declare const FuturesAccountAssetSchema: z.ZodObject<{
532
- asset: z.ZodString;
533
- walletBalance: z.ZodCoercedNumber<unknown>;
534
- unrealizedProfit: z.ZodCoercedNumber<unknown>;
535
- marginBalance: z.ZodCoercedNumber<unknown>;
536
- maintMargin: z.ZodCoercedNumber<unknown>;
537
- initialMargin: z.ZodCoercedNumber<unknown>;
538
- positionInitialMargin: z.ZodCoercedNumber<unknown>;
539
- openOrderInitialMargin: z.ZodCoercedNumber<unknown>;
540
- crossWalletBalance: z.ZodCoercedNumber<unknown>;
541
- crossUnPnl: z.ZodCoercedNumber<unknown>;
542
- availableBalance: z.ZodCoercedNumber<unknown>;
543
- maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
544
- updateTime: z.ZodNumber;
545
- marginAvailable: z.ZodOptional<z.ZodBoolean>;
546
- }, z.core.$strip>;
547
- declare const FuturesAccountPositionSchema: z.ZodObject<{
548
- symbol: z.ZodString;
549
- positionSide: z.ZodString;
550
- positionAmt: z.ZodCoercedNumber<unknown>;
551
- unrealizedProfit: z.ZodCoercedNumber<unknown>;
552
- isolatedMargin: z.ZodCoercedNumber<unknown>;
553
- notional: z.ZodCoercedNumber<unknown>;
554
- isolatedWallet: z.ZodCoercedNumber<unknown>;
555
- initialMargin: z.ZodCoercedNumber<unknown>;
556
- maintMargin: z.ZodCoercedNumber<unknown>;
557
- updateTime: z.ZodNumber;
558
- }, z.core.$strip>;
559
- declare const FuturesAccountInfoSchema: z.ZodObject<{
560
- totalInitialMargin: z.ZodCoercedNumber<unknown>;
561
- totalMaintMargin: z.ZodCoercedNumber<unknown>;
562
- totalWalletBalance: z.ZodCoercedNumber<unknown>;
563
- totalUnrealizedProfit: z.ZodCoercedNumber<unknown>;
564
- totalMarginBalance: z.ZodCoercedNumber<unknown>;
565
- totalPositionInitialMargin: z.ZodCoercedNumber<unknown>;
566
- totalOpenOrderInitialMargin: z.ZodCoercedNumber<unknown>;
567
- totalCrossWalletBalance: z.ZodCoercedNumber<unknown>;
568
- totalCrossUnPnl: z.ZodCoercedNumber<unknown>;
569
- availableBalance: z.ZodCoercedNumber<unknown>;
570
- maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
571
- assets: z.ZodArray<z.ZodObject<{
572
- asset: z.ZodString;
573
- walletBalance: z.ZodCoercedNumber<unknown>;
574
- unrealizedProfit: z.ZodCoercedNumber<unknown>;
575
- marginBalance: z.ZodCoercedNumber<unknown>;
576
- maintMargin: z.ZodCoercedNumber<unknown>;
577
- initialMargin: z.ZodCoercedNumber<unknown>;
578
- positionInitialMargin: z.ZodCoercedNumber<unknown>;
579
- openOrderInitialMargin: z.ZodCoercedNumber<unknown>;
580
- crossWalletBalance: z.ZodCoercedNumber<unknown>;
581
- crossUnPnl: z.ZodCoercedNumber<unknown>;
582
- availableBalance: z.ZodCoercedNumber<unknown>;
583
- maxWithdrawAmount: z.ZodCoercedNumber<unknown>;
584
- updateTime: z.ZodNumber;
585
- marginAvailable: z.ZodOptional<z.ZodBoolean>;
586
- }, z.core.$strip>>;
587
- positions: z.ZodArray<z.ZodObject<{
588
- symbol: z.ZodString;
589
- positionSide: z.ZodString;
590
- positionAmt: z.ZodCoercedNumber<unknown>;
591
- unrealizedProfit: z.ZodCoercedNumber<unknown>;
592
- isolatedMargin: z.ZodCoercedNumber<unknown>;
593
- notional: z.ZodCoercedNumber<unknown>;
594
- isolatedWallet: z.ZodCoercedNumber<unknown>;
595
- initialMargin: z.ZodCoercedNumber<unknown>;
596
- maintMargin: z.ZodCoercedNumber<unknown>;
597
- updateTime: z.ZodNumber;
598
- }, z.core.$strip>>;
599
- }, z.core.$strip>;
600
- declare const FuturesCommissionRateSchema: z.ZodObject<{
601
- symbol: z.ZodString;
602
- makerCommissionRate: z.ZodCoercedNumber<unknown>;
603
- takerCommissionRate: z.ZodCoercedNumber<unknown>;
604
- }, z.core.$strip>;
605
- declare const FuturesAccountConfigSchema: z.ZodObject<{
606
- feeTier: z.ZodNumber;
607
- canTrade: z.ZodBoolean;
608
- canDeposit: z.ZodBoolean;
609
- canWithdraw: z.ZodBoolean;
610
- dualSidePosition: z.ZodBoolean;
611
- multiAssetsMargin: z.ZodBoolean;
612
- tradeGroupId: z.ZodNumber;
613
- }, z.core.$strip>;
614
- declare const FuturesSymbolConfigSchema: z.ZodArray<z.ZodObject<{
615
- symbol: z.ZodString;
616
- marginType: z.ZodEnum<{
617
- ISOLATED: "ISOLATED";
618
- CROSSED: "CROSSED";
619
- }>;
620
- isAutoAddMargin: z.ZodBoolean;
621
- leverage: z.ZodCoercedNumber<unknown>;
622
- maxNotionalValue: z.ZodPipe<z.ZodUnion<[z.ZodCoercedNumber<unknown>, z.ZodLiteral<"INF">]>, z.ZodTransform<number, number | "INF">>;
623
- }, z.core.$strip>>;
624
- declare const FuturesUserRateLimitSchema: z.ZodArray<z.ZodObject<{
625
- rateLimitType: z.ZodLiteral<"ORDERS">;
626
- interval: z.ZodEnum<{
627
- MINUTE: "MINUTE";
628
- SECOND: "SECOND";
629
- DAY: "DAY";
630
- }>;
631
- intervalNum: z.ZodNumber;
632
- limit: z.ZodNumber;
633
- }, z.core.$strip>>;
634
- declare const FuturesLeverageBracketEntrySchema: z.ZodObject<{
635
- bracket: z.ZodNumber;
636
- initialLeverage: z.ZodNumber;
637
- notionalCap: z.ZodNumber;
638
- notionalFloor: z.ZodNumber;
639
- maintMarginRatio: z.ZodNumber;
640
- cum: z.ZodNumber;
641
- }, z.core.$strip>;
642
- declare const FuturesLeverageBracketSchema: z.ZodArray<z.ZodObject<{
643
- symbol: z.ZodString;
644
- notionalCoef: z.ZodOptional<z.ZodNumber>;
645
- brackets: z.ZodArray<z.ZodObject<{
646
- bracket: z.ZodNumber;
647
- initialLeverage: z.ZodNumber;
648
- notionalCap: z.ZodNumber;
649
- notionalFloor: z.ZodNumber;
650
- maintMarginRatio: z.ZodNumber;
651
- cum: z.ZodNumber;
652
- }, z.core.$strip>>;
653
- }, z.core.$strip>>;
654
- declare const FuturesPositionModeSchema: z.ZodObject<{
655
- dualSidePosition: z.ZodBoolean;
656
- }, z.core.$strip>;
657
- declare const FuturesIncomeTypeSchema: z.ZodEnum<{
658
- TRANSFER: "TRANSFER";
659
- WELCOME_BONUS: "WELCOME_BONUS";
660
- REALIZED_PNL: "REALIZED_PNL";
661
- FUNDING_FEE: "FUNDING_FEE";
662
- COMMISSION: "COMMISSION";
663
- INSURANCE_CLEAR: "INSURANCE_CLEAR";
664
- REFERRAL_KICKBACK: "REFERRAL_KICKBACK";
665
- COMMISSION_REBATE: "COMMISSION_REBATE";
666
- API_REBATE: "API_REBATE";
667
- CONTEST_REWARD: "CONTEST_REWARD";
668
- CROSS_COLLATERAL_TRANSFER: "CROSS_COLLATERAL_TRANSFER";
669
- OPTIONS_PREMIUM_FEE: "OPTIONS_PREMIUM_FEE";
670
- OPTIONS_SETTLE_PROFIT: "OPTIONS_SETTLE_PROFIT";
671
- INTERNAL_TRANSFER: "INTERNAL_TRANSFER";
672
- AUTO_EXCHANGE: "AUTO_EXCHANGE";
673
- DELIVERED_SETTELMENT: "DELIVERED_SETTELMENT";
674
- COIN_SWAP_DEPOSIT: "COIN_SWAP_DEPOSIT";
675
- COIN_SWAP_WITHDRAW: "COIN_SWAP_WITHDRAW";
676
- POSITION_LIMIT_INCREASE_FEE: "POSITION_LIMIT_INCREASE_FEE";
677
- STRATEGY_UMFUTURES_TRANSFER: "STRATEGY_UMFUTURES_TRANSFER";
678
- FEE_RETURN: "FEE_RETURN";
679
- BFUSD_REWARD: "BFUSD_REWARD";
680
- }>;
681
- declare const FuturesIncomeHistorySchema: z.ZodArray<z.ZodObject<{
682
- symbol: z.ZodOptional<z.ZodString>;
683
- incomeType: z.ZodEnum<{
684
- TRANSFER: "TRANSFER";
685
- WELCOME_BONUS: "WELCOME_BONUS";
686
- REALIZED_PNL: "REALIZED_PNL";
687
- FUNDING_FEE: "FUNDING_FEE";
688
- COMMISSION: "COMMISSION";
689
- INSURANCE_CLEAR: "INSURANCE_CLEAR";
690
- REFERRAL_KICKBACK: "REFERRAL_KICKBACK";
691
- COMMISSION_REBATE: "COMMISSION_REBATE";
692
- API_REBATE: "API_REBATE";
693
- CONTEST_REWARD: "CONTEST_REWARD";
694
- CROSS_COLLATERAL_TRANSFER: "CROSS_COLLATERAL_TRANSFER";
695
- OPTIONS_PREMIUM_FEE: "OPTIONS_PREMIUM_FEE";
696
- OPTIONS_SETTLE_PROFIT: "OPTIONS_SETTLE_PROFIT";
697
- INTERNAL_TRANSFER: "INTERNAL_TRANSFER";
698
- AUTO_EXCHANGE: "AUTO_EXCHANGE";
699
- DELIVERED_SETTELMENT: "DELIVERED_SETTELMENT";
700
- COIN_SWAP_DEPOSIT: "COIN_SWAP_DEPOSIT";
701
- COIN_SWAP_WITHDRAW: "COIN_SWAP_WITHDRAW";
702
- POSITION_LIMIT_INCREASE_FEE: "POSITION_LIMIT_INCREASE_FEE";
703
- STRATEGY_UMFUTURES_TRANSFER: "STRATEGY_UMFUTURES_TRANSFER";
704
- FEE_RETURN: "FEE_RETURN";
705
- BFUSD_REWARD: "BFUSD_REWARD";
706
- }>;
707
- income: z.ZodCoercedNumber<unknown>;
708
- asset: z.ZodString;
709
- info: z.ZodString;
710
- time: z.ZodNumber;
711
- tranId: z.ZodNumber;
712
- tradeId: z.ZodOptional<z.ZodString>;
713
- }, z.core.$strip>>;
714
- declare const FuturesOrderSideSchema: z.ZodEnum<{
715
- BUY: "BUY";
716
- SELL: "SELL";
717
- }>;
718
- declare const FuturesPositionSideSchema: z.ZodEnum<{
719
- BOTH: "BOTH";
720
- LONG: "LONG";
721
- SHORT: "SHORT";
722
- }>;
723
- declare const FuturesTimeInForceSchema: z.ZodEnum<{
724
- GTC: "GTC";
725
- IOC: "IOC";
726
- FOK: "FOK";
727
- GTX: "GTX";
728
- GTD: "GTD";
729
- }>;
730
- declare const FuturesWorkingTypeSchema: z.ZodEnum<{
731
- MARK_PRICE: "MARK_PRICE";
732
- CONTRACT_PRICE: "CONTRACT_PRICE";
733
- }>;
734
- declare const FuturesNewOrderRespTypeSchema: z.ZodEnum<{
735
- ACK: "ACK";
736
- RESULT: "RESULT";
737
- }>;
738
- declare const FuturesPriceMatchSchema: z.ZodEnum<{
739
- NONE: "NONE";
740
- OPPONENT: "OPPONENT";
741
- OPPONENT_5: "OPPONENT_5";
742
- OPPONENT_10: "OPPONENT_10";
743
- OPPONENT_20: "OPPONENT_20";
744
- QUEUE: "QUEUE";
745
- QUEUE_5: "QUEUE_5";
746
- QUEUE_10: "QUEUE_10";
747
- QUEUE_20: "QUEUE_20";
748
- }>;
749
- declare const FuturesSelfTradePreventionSchema: z.ZodEnum<{
750
- NONE: "NONE";
751
- EXPIRE_TAKER: "EXPIRE_TAKER";
752
- EXPIRE_MAKER: "EXPIRE_MAKER";
753
- EXPIRE_BOTH: "EXPIRE_BOTH";
754
- }>;
755
- declare const FuturesNewOrderSchema: z.ZodObject<{
756
- clientOrderId: z.ZodString;
757
- cumQty: z.ZodCoercedNumber<unknown>;
758
- cumQuote: z.ZodCoercedNumber<unknown>;
759
- executedQty: z.ZodCoercedNumber<unknown>;
760
- orderId: z.ZodNumber;
761
- avgPrice: z.ZodCoercedNumber<unknown>;
762
- origQty: z.ZodCoercedNumber<unknown>;
763
- price: z.ZodCoercedNumber<unknown>;
764
- reduceOnly: z.ZodBoolean;
765
- side: z.ZodEnum<{
766
- BUY: "BUY";
767
- SELL: "SELL";
768
- }>;
769
- positionSide: z.ZodEnum<{
770
- BOTH: "BOTH";
771
- LONG: "LONG";
772
- SHORT: "SHORT";
773
- }>;
774
- status: z.ZodString;
775
- stopPrice: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
776
- closePosition: z.ZodOptional<z.ZodBoolean>;
777
- symbol: z.ZodString;
778
- timeInForce: z.ZodEnum<{
779
- GTC: "GTC";
780
- IOC: "IOC";
781
- FOK: "FOK";
782
- GTX: "GTX";
783
- GTD: "GTD";
784
- }>;
785
- type: z.ZodEnum<{
786
- LIMIT: "LIMIT";
787
- MARKET: "MARKET";
788
- STOP: "STOP";
789
- TAKE_PROFIT: "TAKE_PROFIT";
790
- STOP_MARKET: "STOP_MARKET";
791
- TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
792
- TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
793
- }>;
794
- origType: z.ZodEnum<{
795
- LIMIT: "LIMIT";
796
- MARKET: "MARKET";
797
- STOP: "STOP";
798
- TAKE_PROFIT: "TAKE_PROFIT";
799
- STOP_MARKET: "STOP_MARKET";
800
- TAKE_PROFIT_MARKET: "TAKE_PROFIT_MARKET";
801
- TRAILING_STOP_MARKET: "TRAILING_STOP_MARKET";
802
- }>;
803
- activatePrice: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
804
- priceRate: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
805
- updateTime: z.ZodNumber;
806
- workingType: z.ZodEnum<{
807
- MARK_PRICE: "MARK_PRICE";
808
- CONTRACT_PRICE: "CONTRACT_PRICE";
809
- }>;
810
- priceProtect: z.ZodBoolean;
811
- priceMatch: z.ZodOptional<z.ZodEnum<{
812
- NONE: "NONE";
813
- OPPONENT: "OPPONENT";
814
- OPPONENT_5: "OPPONENT_5";
815
- OPPONENT_10: "OPPONENT_10";
816
- OPPONENT_20: "OPPONENT_20";
817
- QUEUE: "QUEUE";
818
- QUEUE_5: "QUEUE_5";
819
- QUEUE_10: "QUEUE_10";
820
- QUEUE_20: "QUEUE_20";
821
- }>>;
822
- selfTradePreventionMode: z.ZodOptional<z.ZodEnum<{
823
- NONE: "NONE";
824
- EXPIRE_TAKER: "EXPIRE_TAKER";
825
- EXPIRE_MAKER: "EXPIRE_MAKER";
826
- EXPIRE_BOTH: "EXPIRE_BOTH";
827
- }>>;
828
- goodTillDate: z.ZodOptional<z.ZodNumber>;
829
- }, z.core.$strip>;
830
- //#endregion
831
39
  //#region src/rest/futures/types.d.ts
40
+ type FuturesTestConnectivity = {};
41
+ type FuturesCheckServerTime = {
42
+ serverTime: number;
43
+ };
44
+ type FuturesExchangeInfoRateLimit = {
45
+ interval: "MINUTE" | "SECOND";
46
+ intervalNum: number;
47
+ limit: number;
48
+ rateLimitType: "REQUEST_WEIGHT" | "ORDERS";
49
+ };
50
+ type FuturesExchangeInfoAsset = {
51
+ asset: string;
52
+ marginAvailable: boolean;
53
+ autoAssetExchange: string | null;
54
+ };
55
+ type FuturesExchangeInfoFilter = {
56
+ filterType: "PRICE_FILTER";
57
+ minPrice: string;
58
+ tickSize: string;
59
+ maxPrice: string;
60
+ } | {
61
+ filterType: "LOT_SIZE";
62
+ minQty: string;
63
+ stepSize: string;
64
+ maxQty: string;
65
+ } | {
66
+ filterType: "MARKET_LOT_SIZE";
67
+ maxQty: string;
68
+ minQty: string;
69
+ stepSize: string;
70
+ } | {
71
+ filterType: "MAX_NUM_ORDERS";
72
+ limit: number;
73
+ } | {
74
+ filterType: "MAX_NUM_ALGO_ORDERS";
75
+ limit: number;
76
+ } | {
77
+ filterType: "MIN_NOTIONAL";
78
+ notional: string;
79
+ } | {
80
+ filterType: "PERCENT_PRICE";
81
+ multiplierUp: string;
82
+ multiplierDown: string;
83
+ multiplierDecimal: string;
84
+ } | {
85
+ filterType: "POSITION_RISK_CONTROL";
86
+ positionControlSide: "NONE";
87
+ };
88
+ type FuturesContractType = "PERPETUAL" | "CURRENT_QUARTER" | "NEXT_QUARTER";
89
+ type FuturesUnderlyingType = "COIN" | "INDEX" | "PREMARKET";
90
+ type FuturesOrderType = "LIMIT" | "MARKET" | "STOP" | "TAKE_PROFIT" | "STOP_MARKET" | "TAKE_PROFIT_MARKET" | "TRAILING_STOP_MARKET";
91
+ type PermissionSet = "COPY" | "GRID" | "DCA";
92
+ type FuturesExchangeInfoSymbol = {
93
+ symbol: string;
94
+ pair: string;
95
+ contractType: FuturesContractType;
96
+ deliveryDate: number;
97
+ onboardDate: number;
98
+ status: "TRADING" | "SETTLING" | "PENDING_TRADING";
99
+ maintMarginPercent: string;
100
+ requiredMarginPercent: string;
101
+ baseAsset: string;
102
+ quoteAsset: string;
103
+ marginAsset: string;
104
+ pricePrecision: number;
105
+ quantityPrecision: number;
106
+ baseAssetPrecision: number;
107
+ quotePrecision: number;
108
+ underlyingType: FuturesUnderlyingType;
109
+ underlyingSubType: string[];
110
+ permissionSets: PermissionSet[];
111
+ settlePlan?: number;
112
+ triggerProtect: string;
113
+ filters: FuturesExchangeInfoFilter[];
114
+ OrderType?: FuturesOrderType[];
115
+ timeInForce: string[];
116
+ liquidationFee: string;
117
+ marketTakeBound: string;
118
+ };
119
+ type FuturesExchangeInfo = {
120
+ exchangeFilters: unknown[];
121
+ rateLimits: FuturesExchangeInfoRateLimit[];
122
+ serverTime: number;
123
+ assets: FuturesExchangeInfoAsset[];
124
+ symbols: FuturesExchangeInfoSymbol[];
125
+ timezone: string;
126
+ };
127
+ type FuturesOrderBook = {
128
+ lastUpdateId: number;
129
+ E: number;
130
+ T: number;
131
+ bids: [string, string][];
132
+ asks: [string, string][];
133
+ };
134
+ type FuturesTrade = {
135
+ id: number;
136
+ price: string;
137
+ qty: string;
138
+ quoteQty: string;
139
+ time: number;
140
+ isBuyerMaker: boolean;
141
+ isRPITrade: boolean;
142
+ };
143
+ type FuturesAggregateTrade = {
144
+ a: number;
145
+ p: string;
146
+ q: string;
147
+ f: number;
148
+ l: number;
149
+ T: number;
150
+ m: boolean;
151
+ };
832
152
  type FuturesKlineInterval = "1s" | "1m" | "3m" | "5m" | "30m" | "1h" | "2h" | "6h" | "8h" | "12h" | "3d" | "1M";
833
- type FuturesContractType = z$1.infer<typeof FuturesContractTypeSchema>;
834
- type FuturesUnderlyingType = z$1.infer<typeof FuturesUnderlyingTypeSchema>;
153
+ type FuturesKline = [number, string, string, string, string, string, number, string, number, string, string, string];
154
+ type FuturesMarkPrice = {
155
+ symbol: string;
156
+ markPrice: string;
157
+ indexPrice: string;
158
+ estimatedSettlePrice: string;
159
+ lastFundingRate: string;
160
+ interestRate: string;
161
+ nextFundingTime: number;
162
+ time: number;
163
+ };
164
+ type FuturesFundingRate = {
165
+ symbol: string;
166
+ fundingRate: string;
167
+ fundingTime: number;
168
+ markPrice: string;
169
+ };
170
+ type FuturesFundingInfo = {
171
+ adjustedFundingRateCap: string;
172
+ adjustedFundingRateFloor: string;
173
+ disclaimer: boolean;
174
+ fundingIntervalHours: number;
175
+ symbol: string;
176
+ updateTime: number | null;
177
+ };
178
+ type FuturesTicker24h = {
179
+ closeTime: number;
180
+ count: number;
181
+ firstId: number;
182
+ highPrice: string;
183
+ lastId: number;
184
+ lastPrice: string;
185
+ lastQty: string;
186
+ lowPrice: string;
187
+ openPrice: string;
188
+ openTime: number;
189
+ priceChange: string;
190
+ priceChangePercent: string;
191
+ quoteVolume: string;
192
+ symbol: string;
193
+ volume: string;
194
+ weightedAvgPrice: string;
195
+ };
196
+ type FuturesSymbolPrice = {
197
+ symbol: string;
198
+ price: string;
199
+ time: number;
200
+ };
201
+ type FuturesBookTicker = {
202
+ symbol: string;
203
+ bidPrice: string;
204
+ bidQty: string;
205
+ askPrice: string;
206
+ askQty: string;
207
+ time: number;
208
+ lastUpdateId: number;
209
+ };
210
+ type FuturesDeliveryPrice = {
211
+ deliveryTime: number;
212
+ deliveryPrice: number;
213
+ };
214
+ type FuturesOpenInterest = {
215
+ openInterest: string;
216
+ symbol: string;
217
+ time: number;
218
+ };
219
+ type FuturesOpenInterestStats = {
220
+ symbol: string;
221
+ CMCCirculatingSupply: string;
222
+ sumOpenInterest: string;
223
+ sumOpenInterestValue: string;
224
+ timestamp: number;
225
+ };
226
+ type FuturesLongShortRatio = {
227
+ symbol: string;
228
+ longShortRatio: string;
229
+ longAccount: string;
230
+ shortAccount: string;
231
+ timestamp: number;
232
+ };
835
233
  type FuturesOpenInterestPeriod = "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "12h" | "1d";
836
- type FuturesTestConnectivity = z$1.infer<typeof FuturesTestConnectivitySchema>;
837
- type FuturesCheckServerTime = z$1.infer<typeof FuturesCheckServerTimeSchema>;
838
- type FuturesExchangeInfoRateLimit = z$1.infer<typeof FuturesExchangeInfoRateLimitSchema>;
839
- type FuturesExchangeInfoAsset = z$1.infer<typeof FuturesExchangeInfoAssetSchema>;
840
- type FuturesExchangeInfoFilter = z$1.infer<typeof FuturesExchangeInfoFilterSchema>;
841
- type FuturesExchangeInfoSymbol = z$1.infer<typeof FuturesExchangeInfoSymbolSchema>;
842
- type FuturesExchangeInfo = z$1.infer<typeof FuturesExchangeInfoSchema>;
843
- type FuturesOrderBook = z$1.infer<typeof FuturesOrderBookSchema>;
844
- type FuturesRecentTrades = z$1.infer<typeof FuturesRecentTradesSchema>;
845
- type FuturesOldTradesLookup = z$1.infer<typeof FuturesOldTradesLookupSchema>;
846
- type FuturesggregateTrades = z$1.infer<typeof FuturesAggregateTradesSchema>;
847
- type KlineData = z$1.infer<typeof FuturesKlineDataSchema>;
848
- type MarkPrice = z$1.infer<typeof FuturesMarkPriceSchema>;
849
- type FundingRateEntry = z$1.infer<typeof FuturesFundingRateEntrySchema>;
850
- type FundingRate = z$1.infer<typeof FuturesFundingRateSchema>;
851
- type FundingInfoEntry = z$1.infer<typeof FuturesFundingInfoEntrySchema>;
852
- type FundingInfo = z$1.infer<typeof FuturesFundingInfoSchema>;
853
- type FuturesTicker24h = z$1.infer<typeof FuturesTicker24hSchema>;
854
- type FuturesSymbolPrice = z$1.infer<typeof FuturesSymbolPriceSchema>;
855
- type FuturesBookTicker = z$1.infer<typeof FuturesBookTickerSchema>;
856
- type FuturesDeliveryPrice = z$1.infer<typeof FuturesDeliveryPriceSchema>;
857
- type FuturesOpenInterest = z$1.infer<typeof FuturesOpenInterestSchema>;
858
- type FuturesOpenInterestStats = z$1.infer<typeof FuturesOpenInterestStatsSchema>;
859
- type FuturesLongShortRatio = z$1.infer<typeof FuturesLongShortRatioSchema>;
860
- type FuturesTakerBuySellRatioItem = z$1.infer<typeof FuturesTakerBuySellRatioItemSchema>;
861
- type FuturesTakerBuySellRatio = z$1.infer<typeof FuturesTakerBuySellRatioSchema>;
862
- type FuturesBasis = z$1.infer<typeof FuturesBasisSchema>;
863
- type FuturesCompositeIndexAsset = z$1.infer<typeof FuturesCompositeIndexAssetSchema>;
864
- type FuturesCompositeIndex = z$1.infer<typeof FuturesCompositeIndexSchema>;
865
- type FuturesAssetIndex = z$1.infer<typeof FuturesAssetIndexSchema>;
866
- type FuturesIndexPriceConstituent = z$1.infer<typeof FuturesIndexPriceConstituentItemSchema>;
867
- type FuturesIndexPriceConstituents = z$1.infer<typeof FuturesIndexPriceConstituentsSchema>;
868
- type FuturesInsuranceBalanceAsset = z$1.infer<typeof FuturesInsuranceBalanceAssetSchema>;
869
- type FuturesInsuranceBalanceEntry = z$1.infer<typeof FuturesInsuranceBalanceEntrySchema>;
870
- type FuturesAccountBalance = z$1.infer<typeof FuturesAccountBalanceSchema>;
871
- type FuturesAccountAsset = z$1.infer<typeof FuturesAccountAssetSchema>;
872
- type FuturesAccountPosition = z$1.infer<typeof FuturesAccountPositionSchema>;
873
- type FuturesAccountInfo = z$1.infer<typeof FuturesAccountInfoSchema>;
874
- type FuturesCommissionRate = z$1.infer<typeof FuturesCommissionRateSchema>;
875
- type FuturesAccountConfig = z$1.infer<typeof FuturesAccountConfigSchema>;
876
- type FuturesSymbolConfig = z$1.infer<typeof FuturesSymbolConfigSchema>;
877
- type FuturesUserRateLimit = z$1.infer<typeof FuturesUserRateLimitSchema>;
878
- type FuturesLeverageBracketEntry = z$1.infer<typeof FuturesLeverageBracketEntrySchema>;
879
- type FuturesLeverageBracket = z$1.infer<typeof FuturesLeverageBracketSchema>;
880
- type FuturesPositionMode = z$1.infer<typeof FuturesPositionModeSchema>;
881
- type FuturesIncomeType = z$1.infer<typeof FuturesIncomeTypeSchema>;
882
- type FuturesIncomeHistory = z$1.infer<typeof FuturesIncomeHistorySchema>;
883
- type FuturesOrderSide = z$1.infer<typeof FuturesOrderSideSchema>;
884
- type FuturesPositionSide = z$1.infer<typeof FuturesPositionSideSchema>;
885
- type FuturesOrderType = z$1.infer<typeof FuturesOrderTypeSchema>;
886
- type FuturesTimeInForce = z$1.infer<typeof FuturesTimeInForceSchema>;
887
- type FuturesWorkingType = z$1.infer<typeof FuturesWorkingTypeSchema>;
888
- type FuturesNewOrderRespType = z$1.infer<typeof FuturesNewOrderRespTypeSchema>;
889
- type FuturesPriceMatch = z$1.infer<typeof FuturesPriceMatchSchema>;
890
- type FuturesSelfTradePrevention = z$1.infer<typeof FuturesSelfTradePreventionSchema>;
891
- type FuturesNewOrder = z$1.infer<typeof FuturesNewOrderSchema>;
234
+ type FuturesTakerBuySellRatio = {
235
+ buySellRatio: string;
236
+ buyVol: string;
237
+ sellVol: string;
238
+ timestamp: number;
239
+ };
240
+ type FuturesBasis = {
241
+ indexPrice: string;
242
+ contractType: FuturesContractType;
243
+ basisRate: string;
244
+ futuresPrice: string;
245
+ annualizedBasisRate: string;
246
+ basis: string;
247
+ pair: string;
248
+ timestamp: number;
249
+ };
250
+ type FuturesCompositeIndexAsset = {
251
+ baseAsset: string;
252
+ quoteAsset: string;
253
+ weightInQuantity: string;
254
+ weightInPercentage: string;
255
+ };
256
+ type FuturesCompositeIndex = {
257
+ symbol: string;
258
+ time: number;
259
+ component: string;
260
+ baseAssetList: FuturesCompositeIndexAsset[];
261
+ };
262
+ type FuturesAssetIndex = {
263
+ askBuffer: string;
264
+ askRate: string;
265
+ autoExchangeAskBuffer: string;
266
+ autoExchangeAskRate: string;
267
+ autoExchangeBidBuffer: string;
268
+ autoExchangeBidRate: string;
269
+ bidBuffer: string;
270
+ bidRate: string;
271
+ index: string;
272
+ symbol: string;
273
+ time: number;
274
+ };
275
+ type FuturesIndexPriceConstituentItem = {
276
+ exchange: string;
277
+ symbol: string;
278
+ price: string;
279
+ weight: string;
280
+ };
281
+ type FuturesIndexPriceConstituents = {
282
+ symbol: string;
283
+ time: number;
284
+ constituents: FuturesIndexPriceConstituentItem[];
285
+ };
286
+ type FuturesInsuranceBalanceAsset = {
287
+ asset: string;
288
+ marginBalance: string;
289
+ updateTime: number;
290
+ };
291
+ type FuturesInsuranceBalance = {
292
+ symbols: string[];
293
+ assets: FuturesInsuranceBalanceAsset[];
294
+ };
295
+ type FuturesAccountBalance = {
296
+ accountAlias: string;
297
+ asset: string;
298
+ balance: string;
299
+ crossWalletBalance: string;
300
+ crossUnPnl: string;
301
+ availableBalance: string;
302
+ maxWithdrawAmount: string;
303
+ marginAvailable: boolean;
304
+ updateTime: number;
305
+ };
306
+ type FuturesAccountAsset = {
307
+ asset: string;
308
+ walletBalance: string;
309
+ unrealizedProfit: string;
310
+ marginBalance: string;
311
+ maintMargin: string;
312
+ initialMargin: string;
313
+ positionInitialMargin: string;
314
+ openOrderInitialMargin: string;
315
+ crossWalletBalance: string;
316
+ crossUnPnl: string;
317
+ availableBalance: string;
318
+ maxWithdrawAmount: string;
319
+ updateTime: number;
320
+ marginAvailable?: boolean;
321
+ };
322
+ type FuturesAccountPosition = {
323
+ symbol: string;
324
+ positionSide: string;
325
+ positionAmt: string;
326
+ unrealizedProfit: string;
327
+ isolatedMargin: string;
328
+ notional: string;
329
+ isolatedWallet: string;
330
+ initialMargin: string;
331
+ maintMargin: string;
332
+ updateTime: number;
333
+ };
334
+ type FuturesAccountInfo = {
335
+ totalInitialMargin: string;
336
+ totalMaintMargin: string;
337
+ totalWalletBalance: string;
338
+ totalUnrealizedProfit: string;
339
+ totalMarginBalance: string;
340
+ totalPositionInitialMargin: string;
341
+ totalOpenOrderInitialMargin: string;
342
+ totalCrossWalletBalance: string;
343
+ totalCrossUnPnl: string;
344
+ availableBalance: string;
345
+ maxWithdrawAmount: string;
346
+ assets: FuturesAccountAsset[];
347
+ positions: FuturesAccountPosition[];
348
+ };
349
+ type FuturesCommissionRate = {
350
+ symbol: string;
351
+ makerCommissionRate: string;
352
+ takerCommissionRate: string;
353
+ };
354
+ type FuturesAccountConfig = {
355
+ feeTier: number;
356
+ canTrade: boolean;
357
+ canDeposit: boolean;
358
+ canWithdraw: boolean;
359
+ dualSidePosition: boolean;
360
+ multiAssetsMargin: boolean;
361
+ tradeGroupId: number;
362
+ };
363
+ type FuturesSymbolConfig = {
364
+ symbol: string;
365
+ marginType: "ISOLATED" | "CROSSED";
366
+ isAutoAddMargin: boolean;
367
+ leverage: number;
368
+ maxNotionalValue: string | "INF";
369
+ };
370
+ type FuturesUserRateLimit = {
371
+ rateLimitType: "ORDERS";
372
+ interval: "SECOND" | "MINUTE" | "DAY";
373
+ intervalNum: number;
374
+ limit: number;
375
+ };
376
+ type FuturesLeverageBracketEntry = {
377
+ bracket: number;
378
+ initialLeverage: number;
379
+ notionalCap: number;
380
+ notionalFloor: number;
381
+ maintMarginRatio: number;
382
+ cum: number;
383
+ };
384
+ type FuturesLeverageBracket = {
385
+ symbol: string;
386
+ notionalCoef?: number;
387
+ brackets: FuturesLeverageBracketEntry[];
388
+ };
389
+ type FuturesPositionMode = {
390
+ dualSidePosition: boolean;
391
+ };
392
+ type FuturesIncomeType = "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";
393
+ type FuturesIncomeHistory = {
394
+ symbol?: string;
395
+ incomeType: FuturesIncomeType;
396
+ income: string;
397
+ asset: string;
398
+ info: string;
399
+ time: number;
400
+ tranId: number;
401
+ tradeId: string;
402
+ };
403
+ type FuturesOrderSide = "BUY" | "SELL";
404
+ type FuturesPositionSide = "BOTH" | "LONG" | "SHORT";
405
+ type FuturesTimeInForce = "GTC" | "IOC" | "FOK" | "GTX" | "GTD";
406
+ type FuturesWorkingType = "MARK_PRICE" | "CONTRACT_PRICE";
407
+ type FuturesNewOrderRespType = "ACK" | "RESULT";
408
+ type FuturesPriceMatch = "OPPONENT" | "OPPONENT_5" | "OPPONENT_10" | "OPPONENT_20" | "QUEUE" | "QUEUE_5" | "QUEUE_10" | "QUEUE_20" | "NONE";
409
+ type FuturesSelfTradePrevention = "NONE" | "EXPIRE_TAKER" | "EXPIRE_MAKER" | "EXPIRE_BOTH";
410
+ type FuturesNewOrder = {
411
+ clientOrderId: string;
412
+ cumQty: string;
413
+ cumQuote: string;
414
+ executedQty: string;
415
+ orderId: string;
416
+ avgPrice: string;
417
+ origQty: string;
418
+ price: string;
419
+ reduceOnly: boolean;
420
+ side: FuturesOrderSide;
421
+ positionSide: FuturesPositionSide;
422
+ status: string;
423
+ stopPrice?: string;
424
+ closePosition?: boolean;
425
+ symbol: string;
426
+ timeInForce: FuturesTimeInForce;
427
+ type: FuturesOrderType;
428
+ origType: FuturesOrderType;
429
+ activatePrice?: string;
430
+ priceRate?: string;
431
+ updateTime: string;
432
+ workingType: FuturesWorkingType;
433
+ priceProtect: boolean;
434
+ priceMatch?: FuturesPriceMatch;
435
+ selfTradePreventionMode?: FuturesSelfTradePrevention;
436
+ goodTillDate?: string;
437
+ };
438
+ type FuturesGetListenKey = {
439
+ listenKey: string;
440
+ };
892
441
  //#endregion
893
442
  //#region src/rest/futures/client.d.ts
894
443
  declare class FuturesRestClient extends BaseRestClient {
895
444
  constructor({
896
445
  baseUrl,
897
446
  apiKey,
898
- apiSecret,
899
- httpOptions
447
+ apiSecret
900
448
  }: {
901
449
  apiKey?: string;
902
450
  apiSecret?: string;
903
451
  baseUrl?: string;
904
- httpOptions?: Client.Options;
905
452
  });
906
453
  testConnectivity(): Promise<FuturesTestConnectivity>;
907
454
  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
- }>;
455
+ exchangeInformation(): Promise<FuturesExchangeInfo>;
985
456
  orderBook(params: {
986
457
  symbol: string;
987
458
  limit?: number;
988
- }): Promise<{
989
- lastUpdateId: number;
990
- E: number;
991
- T: number;
992
- bids: [number, number][];
993
- asks: [number, number][];
994
- }>;
459
+ }): Promise<FuturesOrderBook>;
995
460
  recentTrades(params: {
996
461
  symbol: string;
997
462
  limit?: number;
998
- }): Promise<{
999
- id: number;
1000
- price: number;
1001
- qty: number;
1002
- quoteQty: number;
1003
- time: number;
1004
- isBuyerMaker: boolean;
1005
- }[]>;
463
+ }): Promise<FuturesTrade[]>;
1006
464
  oldTradesLookup(params: {
1007
465
  symbol: string;
1008
466
  limit?: number;
1009
467
  fromId?: number;
1010
- }): Promise<{
1011
- id: number;
1012
- price: number;
1013
- qty: number;
1014
- quoteQty: number;
1015
- time: number;
1016
- isBuyerMaker: boolean;
1017
- }[]>;
468
+ }): Promise<FuturesTrade[]>;
1018
469
  aggregateTrades(params: {
1019
470
  symbol: string;
1020
471
  fromId?: number;
1021
472
  startTime?: number;
1022
473
  endTime?: number;
1023
474
  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
- }[]>;
475
+ }): Promise<FuturesAggregateTrade[]>;
1033
476
  klineData(params: {
1034
477
  symbol: string;
1035
478
  interval: FuturesKlineInterval;
1036
479
  startTime?: number;
1037
480
  endTime?: number;
1038
481
  limit?: number;
1039
- }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
482
+ }): Promise<FuturesKline[]>;
1040
483
  continuousContractKlineData(params: {
1041
484
  pair: string;
1042
485
  contractType: FuturesContractType;
@@ -1044,49 +487,39 @@ declare class FuturesRestClient extends BaseRestClient {
1044
487
  startTime?: number;
1045
488
  endTime?: number;
1046
489
  limit?: number;
1047
- }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
490
+ }): Promise<FuturesKline[]>;
1048
491
  indexPriceKlineData(params: {
1049
492
  pair: string;
1050
493
  interval: FuturesKlineInterval;
1051
494
  startTime?: number;
1052
495
  endTime?: number;
1053
496
  limit?: number;
1054
- }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
497
+ }): Promise<FuturesKline[]>;
1055
498
  markPriceKlineData(params: {
1056
499
  symbol: string;
1057
500
  interval: FuturesKlineInterval;
1058
501
  startTime?: number;
1059
502
  endTime?: number;
1060
503
  limit?: number;
1061
- }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
504
+ }): Promise<FuturesKline[]>;
1062
505
  premiumIndexKlineData(params: {
1063
506
  symbol: string;
1064
507
  interval: FuturesKlineInterval;
1065
508
  startTime?: number;
1066
509
  endTime?: number;
1067
510
  limit?: number;
1068
- }): Promise<[number, number, number, number, number, number, number, number, number, number, number, number][]>;
511
+ }): Promise<FuturesKline[]>;
1069
512
  markPrice(params: {
1070
513
  symbol: string;
1071
- }): Promise<MarkPrice>;
1072
- markPrice(): Promise<MarkPrice[]>;
514
+ }): Promise<FuturesMarkPrice>;
515
+ markPrice(): Promise<FuturesMarkPrice[]>;
1073
516
  fundingRateHistory(params?: {
1074
517
  symbol?: string;
1075
518
  startTime?: number;
1076
519
  endTime?: number;
1077
520
  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
- }[]>;
521
+ }): Promise<FuturesFundingRate[]>;
522
+ fundingRateInfo(): Promise<FuturesFundingInfo[]>;
1090
523
  ticker24h(params: {
1091
524
  symbol: string;
1092
525
  }): Promise<FuturesTicker24h>;
@@ -1101,80 +534,45 @@ declare class FuturesRestClient extends BaseRestClient {
1101
534
  bookTicker(): Promise<FuturesBookTicker[]>;
1102
535
  quarterlySettlementPrices(params: {
1103
536
  pair: string;
1104
- }): Promise<{
1105
- deliveryTime: number;
1106
- deliveryPrice: number;
1107
- }[]>;
537
+ }): Promise<FuturesDeliveryPrice[]>;
1108
538
  openInterest(params: {
1109
539
  symbol: string;
1110
- }): Promise<{
1111
- openInterest: number;
1112
- symbol: string;
1113
- time: number;
1114
- }>;
540
+ }): Promise<FuturesOpenInterest>;
1115
541
  openInterestStats(params: {
1116
542
  symbol: string;
1117
543
  period: FuturesOpenInterestPeriod;
1118
544
  limit?: number;
1119
545
  startTime?: number;
1120
546
  endTime?: number;
1121
- }): Promise<{
1122
- symbol: string;
1123
- sumOpenInterest: number;
1124
- sumOpenInterestValue: number;
1125
- timestamp: number;
1126
- }[]>;
547
+ }): Promise<FuturesOpenInterestStats[]>;
1127
548
  topLongShortPositionRatio(params: {
1128
549
  symbol: string;
1129
550
  period: FuturesOpenInterestPeriod;
1130
551
  limit?: number;
1131
552
  startTime?: number;
1132
553
  endTime?: number;
1133
- }): Promise<{
1134
- symbol: string;
1135
- longShortRatio: number;
1136
- longAccount: number;
1137
- shortAccount: number;
1138
- timestamp: number;
1139
- }[]>;
554
+ }): Promise<FuturesLongShortRatio[]>;
1140
555
  topLongShortAccountRatio(params: {
1141
556
  symbol: string;
1142
557
  period: FuturesOpenInterestPeriod;
1143
558
  limit?: number;
1144
559
  startTime?: number;
1145
560
  endTime?: number;
1146
- }): Promise<{
1147
- symbol: string;
1148
- longShortRatio: number;
1149
- longAccount: number;
1150
- shortAccount: number;
1151
- timestamp: number;
1152
- }[]>;
561
+ }): Promise<FuturesLongShortRatio[]>;
1153
562
  globalLongShortAccountRatio(params: {
1154
563
  symbol: string;
1155
564
  period: FuturesOpenInterestPeriod;
1156
565
  limit?: number;
1157
566
  startTime?: number;
1158
567
  endTime?: number;
1159
- }): Promise<{
1160
- symbol: string;
1161
- longShortRatio: number;
1162
- longAccount: number;
1163
- shortAccount: number;
1164
- timestamp: number;
1165
- }[]>;
568
+ }): Promise<FuturesLongShortRatio[]>;
1166
569
  takerBuySellRatio(params: {
1167
570
  symbol: string;
1168
571
  period: FuturesOpenInterestPeriod;
1169
572
  limit?: number;
1170
573
  startTime?: number;
1171
574
  endTime?: number;
1172
- }): Promise<{
1173
- buySellRatio: number;
1174
- buyVol: number;
1175
- sellVol: number;
1176
- timestamp: number;
1177
- }[]>;
575
+ }): Promise<FuturesTakerBuySellRatio[]>;
1178
576
  basisData(params: {
1179
577
  pair: string;
1180
578
  contractType: FuturesContractType;
@@ -1182,16 +580,7 @@ declare class FuturesRestClient extends BaseRestClient {
1182
580
  limit: number;
1183
581
  startTime?: number;
1184
582
  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
- }[]>;
583
+ }): Promise<FuturesBasis>;
1195
584
  compositeIndexInfo(params: {
1196
585
  symbol: string;
1197
586
  }): Promise<FuturesCompositeIndex>;
@@ -1202,120 +591,25 @@ declare class FuturesRestClient extends BaseRestClient {
1202
591
  assetIndex(): Promise<FuturesAssetIndex[]>;
1203
592
  indexPriceConstituents(params: {
1204
593
  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
- }>;
594
+ }): Promise<FuturesIndexPriceConstituents>;
1215
595
  insuranceBalance(params: {
1216
596
  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
- }>;
597
+ }): Promise<FuturesInsuranceBalance>;
598
+ insuranceBalance(): Promise<FuturesInsuranceBalance[]>;
599
+ accountBalance(): Promise<FuturesAccountBalance[]>;
600
+ accountInformation(): Promise<FuturesAccountInfo>;
1271
601
  userCommissionRate(params: {
1272
602
  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
- }>;
603
+ }): Promise<FuturesCommissionRate>;
604
+ accountConfig(): Promise<FuturesAccountConfig>;
1287
605
  symbolConfig(params?: {
1288
606
  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
- }[]>;
607
+ }): Promise<FuturesSymbolConfig[]>;
608
+ userRateLimit(): Promise<FuturesUserRateLimit[]>;
1302
609
  leverageBrackets(params?: {
1303
610
  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
- }>;
611
+ }): Promise<FuturesLeverageBracket[]>;
612
+ positionMode(): Promise<FuturesPositionMode>;
1319
613
  incomeHistory(params?: {
1320
614
  symbol?: string;
1321
615
  incomeType?: FuturesIncomeType;
@@ -1323,16 +617,7 @@ declare class FuturesRestClient extends BaseRestClient {
1323
617
  endTime?: number;
1324
618
  page?: number;
1325
619
  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
- }[]>;
620
+ }): Promise<FuturesIncomeHistory[]>;
1336
621
  newOrder(params: {
1337
622
  symbol: string;
1338
623
  side: FuturesOrderSide;
@@ -1354,53 +639,29 @@ declare class FuturesRestClient extends BaseRestClient {
1354
639
  selfTradePreventionMode?: FuturesSelfTradePrevention;
1355
640
  goodTillDate?: number;
1356
641
  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
- }>;
642
+ }): Promise<FuturesNewOrder>;
643
+ getListenKey(): Promise<FuturesGetListenKey>;
1385
644
  }
1386
645
  //#endregion
646
+ //#region src/rest/spot/types.d.ts
647
+ type SpotTestConnectivity = {};
648
+ type SpotCheckServerTime = {
649
+ serverTime: number;
650
+ };
651
+ //#endregion
1387
652
  //#region src/rest/spot/client.d.ts
1388
653
  declare class SpotRestClient extends BaseRestClient {
1389
654
  constructor({
1390
655
  baseUrl,
1391
656
  apiKey,
1392
- apiSecret,
1393
- httpOptions
657
+ apiSecret
1394
658
  }: {
1395
659
  apiKey?: string;
1396
660
  apiSecret?: string;
1397
661
  baseUrl?: string;
1398
- httpOptions?: Client.Options;
1399
662
  });
1400
- testConnectivity(): Promise<Record<string, never>>;
1401
- checkServerTime(): Promise<{
1402
- serverTime: number;
1403
- }>;
663
+ testConnectivity(): Promise<SpotTestConnectivity>;
664
+ checkServerTime(): Promise<SpotCheckServerTime>;
1404
665
  }
1405
666
  //#endregion
1406
667
  //#region src/rest/client.d.ts
@@ -1428,19 +689,6 @@ declare class ApiError extends Error {
1428
689
  metadata: Record<string, unknown>;
1429
690
  });
1430
691
  }
1431
- declare class ValidationError<T extends z4.$ZodType> extends ApiError {
1432
- error?: z4.$ZodError<z4.output<T>>;
1433
- input: unknown;
1434
- constructor({
1435
- error,
1436
- input,
1437
- endpoint
1438
- }: {
1439
- error?: z4.$ZodError<z4.output<T>>;
1440
- input?: unknown;
1441
- endpoint: string;
1442
- });
1443
- }
1444
692
  declare class ResponseError extends ApiError {
1445
693
  code: number;
1446
694
  status: number;
@@ -1488,7 +736,7 @@ type ChannelsMap = Record<string, {
1488
736
  messageSchema: object;
1489
737
  subscriptionOptions?: object;
1490
738
  }>;
1491
- type OptArgs<CM extends ChannelsMap, K extends keyof CM> = CM[K]["subscriptionOptions"] extends never | undefined ? [] : [options: CM[K]["subscriptionOptions"]];
739
+ type OptArgs<CM extends ChannelsMap, K$1 extends keyof CM> = CM[K$1]["subscriptionOptions"] extends never | undefined ? [] : [options: CM[K$1]["subscriptionOptions"]];
1492
740
  type WebsocketClient<CM extends ChannelsMap> = { [K in keyof CM]: {
1493
741
  subscribe: (symbols: string[], ...args: OptArgs<CM, K>) => Promise<void>;
1494
742
  unsubscribe: (symbols: string[], ...args: OptArgs<CM, K>) => Promise<void>;
@@ -1515,6 +763,18 @@ type FuturesBookDepthEvent = {
1515
763
  b: [string, string][];
1516
764
  a: [string, string][];
1517
765
  };
766
+ type FuturesAggTradeEvent = {
767
+ e: "aggTrade";
768
+ E: number;
769
+ s: string;
770
+ a: number;
771
+ p: string;
772
+ q: string;
773
+ f: number;
774
+ l: number;
775
+ T: number;
776
+ m: boolean;
777
+ };
1518
778
  type FuturesChannels = {
1519
779
  bookTicker: {
1520
780
  messageSchema: FuturesBookTickerEvent;
@@ -1527,9 +787,13 @@ type FuturesChannels = {
1527
787
  updateSpeedMs?: number;
1528
788
  };
1529
789
  };
790
+ aggTrade: {
791
+ messageSchema: FuturesAggTradeEvent;
792
+ subscriptionOptions: never;
793
+ };
1530
794
  };
1531
795
  //#endregion
1532
796
  //#region src/websocket/futures/client.d.ts
1533
797
  declare const createFuturesWebsocketClient: (baseUrl?: string) => WebsocketClient<FuturesChannels>;
1534
798
  //#endregion
1535
- export { ApiError, BinanceRestClient, 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, FuturesNewOrder, FuturesNewOrderRespType, FuturesOldTradesLookup, FuturesOpenInterest, FuturesOpenInterestPeriod, FuturesOpenInterestStats, FuturesOrderBook, FuturesOrderSide, FuturesOrderType, FuturesPositionMode, FuturesPositionSide, FuturesPriceMatch, FuturesRecentTrades, FuturesSelfTradePrevention, FuturesSymbolConfig, FuturesSymbolPrice, FuturesTakerBuySellRatio, FuturesTakerBuySellRatioItem, FuturesTestConnectivity, FuturesTicker24h, FuturesTimeInForce, FuturesUnderlyingType, FuturesUserRateLimit, FuturesWorkingType, FuturesggregateTrades, KlineData, MalformedParamError, MarkPrice, ResponseError, ValidationError, WeightError, createFuturesWebsocketClient };
799
+ export { ApiError, BinanceRestClient, ErrorMessageParsingError, FuturesAccountAsset, FuturesAccountBalance, FuturesAccountConfig, FuturesAccountInfo, FuturesAccountPosition, FuturesAggregateTrade, FuturesAssetIndex, FuturesBasis, FuturesBookDepthEvent, FuturesBookTicker, FuturesBookTickerEvent, FuturesCheckServerTime, FuturesCommissionRate, FuturesCompositeIndex, FuturesCompositeIndexAsset, FuturesContractType, FuturesDeliveryPrice, FuturesExchangeInfo, FuturesExchangeInfoAsset, FuturesExchangeInfoFilter, FuturesExchangeInfoRateLimit, FuturesExchangeInfoSymbol, FuturesFundingInfo, FuturesFundingRate, FuturesGetListenKey, FuturesIncomeHistory, FuturesIncomeType, FuturesIndexPriceConstituentItem, FuturesIndexPriceConstituents, FuturesInsuranceBalance, FuturesInsuranceBalanceAsset, FuturesKline, FuturesKlineInterval, FuturesLeverageBracket, FuturesLeverageBracketEntry, FuturesLongShortRatio, FuturesMarkPrice, FuturesNewOrder, FuturesNewOrderRespType, FuturesOpenInterest, FuturesOpenInterestPeriod, FuturesOpenInterestStats, FuturesOrderBook, FuturesOrderSide, FuturesOrderType, FuturesPositionMode, FuturesPositionSide, FuturesPriceMatch, FuturesSelfTradePrevention, FuturesSymbolConfig, FuturesSymbolPrice, FuturesTakerBuySellRatio, FuturesTestConnectivity, FuturesTicker24h, FuturesTimeInForce, FuturesTrade, FuturesUnderlyingType, FuturesUserRateLimit, FuturesWorkingType, MalformedParamError, PermissionSet, ResponseError, WeightError, createFuturesWebsocketClient };