-
Notifications
You must be signed in to change notification settings - Fork 1
/
node-binance-api.d.ts
1589 lines (1352 loc) · 63 KB
/
node-binance-api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @author tripolskypetr
* @see https://github.com/tripolskypetr
*/
declare module "node-binance-api" {
type _callback = (...args: any) => any;
type _symbol = string;
type _interval = keyof {
'1m': never;
'3m': never;
'5m': never;
'15m': never;
'30m': never;
'1h': never;
'2h': never;
'4h': never;
'6h': never;
'8h': never;
'12h': never;
'1d': never;
'3d': never;
'1w': never;
'1M': never;
};
interface IWebsockets {
/**
* Userdata websockets function
* @param {function} callback - the callback function
* @param {function} execution_callback - optional execution callback
* @param {function} subscribed_callback - subscription callback
* @param {function} list_status_callback - status callback
* @return {undefined}
*/
userData(callback: _callback, execution_callback: _callback, subscribed_callback: _callback, list_status_callback: _callback): any;
userData(...args: any): any;
/**
* Margin Userdata websockets function
* @param {function} callback - the callback function
* @param {function} execution_callback - optional execution callback
* @param {function} subscribed_callback - subscription callback
* @param {function} list_status_callback - status callback
* @return {undefined}
*/
userMarginData(callback: _callback, execution_callback: _callback, subscribed_callback: _callback, list_status_callback: _callback): any;
userMarginData(...args: any): any;
/**
* Future Userdata websockets function
* @param {function} margin_call_callback
* @param {function} account_update_callback
* @param {function} order_update_callback
* @param {Function} subscribed_callback - subscription callback
*/
userFutureData(margin_call_callback: _callback, account_update_callback: _callback, order_update_callback: _callback, subscribed_callback: _callback): any;
userFutureData(...args: any): any;
/**
* Delivery Userdata websockets function
* @param {function} margin_call_callback
* @param {function} account_update_callback
* @param {function} order_update_callback
* @param {Function} subscribed_callback - subscription callback
*/
userDeliveryData(margin_call_callback: _callback, account_update_callback: _callback, order_update_callback: _callback, subscribed_callback: _callback): any;
userDeliveryData(...args: any): any;
/**
* Subscribe to a generic websocket
* @param {string} url - the websocket endpoint
* @param {function} callback - optional execution callback
* @param {boolean} reconnect - subscription callback
* @return {WebSocket} the websocket reference
*/
subscribe(url: string, callback: _callback, reconnect?: boolean): any;
subscribe(...args: any): any;
/**
* Subscribe to a generic combined websocket
* @param {string} url - the websocket endpoint
* @param {function} callback - optional execution callback
* @param {boolean} reconnect - subscription callback
* @return {WebSocket} the websocket reference
*/
subscribeCombined(url: string, callback: _callback, reconnect?: boolean): any;
subscribeCombined(...args: any): any;
/**
* Returns the known websockets subscriptions
* @return {array} array of web socket subscriptions
*/
subscriptions(...args: any): any[];
subscriptions(...args: any): any;
/**
* Terminates a web socket
* @param {string} endpoint - the string associated with the endpoint
* @return {undefined}
*/
terminate(endpoint: string): any;
terminate(...args: any): any;
depth(...args: any): any;
depth(...args: any): any;
/**
* Websocket depth chart
* @param {array/string} symbols - an array or string of symbols to query
* @param {function} callback - callback function
* @return {string} the websocket endpoint
*/
depthCache(symbols: _symbol[] | _symbol, ): any;
depthCache(...args: any): any;
/**
* Clear Websocket depth cache
* @param {String|Array} symbols - a single symbol, or an array of symbols, to clear the cache of
* @returns {void}
*/
clearDepthCache(symbols: _symbol | _symbol[]): any;
clearDepthCache(...args: any): any;
/**
* Websocket staggered depth cache
* @param {array/string} symbols - an array of symbols to query
* @param {function} callback - callback function
* @param {int} limit - the number of entries
* @param {int} stagger - ms between each depth cache
* @return {Promise} the websocket endpoint
*/
depthCacheStaggered(symbols: _symbol | _symbol[], callback: _callback, limit?: number, stagger?: number): Promise<any>;
depthCacheStaggered(...args: any): any;
/**
* Websocket aggregated trades
* @param {array/string} symbols - an array or string of symbols to query
* @param {function} callback - callback function
* @return {string} the websocket endpoint
*/
aggTrades(symbols: _symbol | _symbol[], callback: _callback): any;
aggTrades(...args: any): any;
/**
* Websocket raw trades
* @param {array/string} symbols - an array or string of symbols to query
* @param {function} callback - callback function
* @return {string} the websocket endpoint
*/
trades(symbols: _symbol | _symbol[], callback: _callback): string;
trades(...args: any): any;
/**
* Websocket klines
* @param {array/string} symbols - an array or string of symbols to query
* @param {string} interval - the time interval
* @param {function} callback - callback function
* @param {int} limit - maximum results, no more than 1000
* @return {string} the websocket endpoint
*/
chart(symbols: _symbol | _symbol[], interval: _interval, callback: _callback, limit?: number): string;
chart(...args: any): any;
/**
* Websocket candle sticks
* @param {array/string} symbols - an array or string of symbols to query
* @param {string} interval - the time interval
* @param {function} callback - callback function
* @return {string} the websocket endpoint
*/
candlesticks(symbols: _symbol | _symbol[], interval: _interval, callback: _callback): string;
candlesticks(...args: any): any;
/**
* Websocket mini ticker
* @param {function} callback - callback function
* @return {string} the websocket endpoint
*/
miniTicker(callback: _callback): string;
miniTicker(...args: any): any;
/**
* Spot WebSocket bookTicker (bid/ask quotes including price & amount)
* @param {symbol} symbol name or false. can also be a callback
* @param {function} callback - callback function
* @return {string} the websocket endpoint
*/
bookTickers(symbol: _symbol, callback: _callback): string;
bookTickers(...args: any): any;
/**
* Websocket prevday percentage
* @param {array/string} symbols - an array or string of symbols to query
* @param {function} callback - callback function
* @param {boolean} singleCallback - avoid call one callback for each symbol in data array
* @return {string} the websocket endpoint
*/
prevDay(symbols: _symbol | _symbol[], callback: _callback, singleCallback: boolean): string;
prevDay(...args: any): any;
}
interface IConstructorArgs {
recvWindow: number;
useServerTime: boolean;
reconnect: boolean;
test: boolean;
hedgeMode: boolean;
log: (...args: any[]) => void;
verbose: boolean;
keepAlive: boolean;
localAddress: boolean;
family: boolean;
urls: Partial<{
base: string;
wapi: string;
sapi: string;
fapi: string;
fapiTest: string;
stream: string;
combineStream: string;
fstream: string;
fstreamSingle: string;
fstreamTest: string;
fstreamSingleTest: string;
dstream: string;
dstreamSingle: string;
dstreamTest: string;
dstreamSingleTest: string;
}>;
timeOffset: number;
}
class Binance {
constructor(options?: Partial<IConstructorArgs>);
constructor(pathToFile?: string);
constructor(...args: any);
/**
* Gets depth cache for given symbol
* @param {symbol} symbol - get depch cache for this symbol
* @return {object} - object
*/
depthCache(symbols: _symbol | _symbol[], callback: _callback, limit: number): string;
depthCache(...args: any): any;
/**
* Gets depth volume for given symbol
* @param {symbol} symbol - get depch volume for this symbol
* @return {object} - object
*/
depthVolume(symbol: _symbol): any;
depthVolume(...args: any): any;
/**
* Count decimal places
* @param {float} float - get the price precision point
* @return {int} - number of place
*/
getPrecision(float: number): number;
getPrecision(...args: any): any;
/**
* rounds number with given step
* @param {float} qty - quantity to round
* @param {float} stepSize - stepSize as specified by exchangeInfo
* @return {float} - number
*/
roundStep(qty: number, stepSize: number): number;
roundStep(...args: any): any;
/**
* rounds price to required precision
* @param {float} price - price to round
* @param {float} tickSize - tickSize as specified by exchangeInfo
* @return {float} - number
*/
roundTicks(price: number, tickSize: number): any;
roundTicks(...args: any): any;
/**
* Gets percentage of given numbers
* @param {float} min - the smaller number
* @param {float} max - the bigger number
* @param {int} width - percentage width
* @return {float} - percentage
*/
percent(min: number, max: number, width?: number): any;
percent(...args: any): any;
/**
* Gets the sum of an array of numbers
* @param {array} array - the number to add
* @return {float} - sum
*/
sum(array: number[]): number;
sum(...args: any): any;
/**
* Reverses the keys of an object
* @param {object} object - the object
* @return {object} - the object
*/
reverse(object: any): any;
reverse(...args: any): any;
/**
* Converts an object to an array
* @param {object} obj - the object
* @return {array} - the array
*/
array(obj: any): any[];
array(...args: any): any;
/**
* Sorts bids
* @param {string} symbol - the object
* @param {int} max - the max number of bids
* @param {string} baseValue - the object
* @return {object} - the object
*/
sortBids(symbol: any, max?: number, baseValue?: string): any;
sortBids(...args: any): any;
/**
* Sorts asks
* @param {string} symbol - the object
* @param {int} max - the max number of bids
* @param {string} baseValue - the object
* @return {object} - the object
*/
sortAsks(symbol: any, max?: number, baseValue?: string): any;
sortAsks(...args: any): any;
/**
* Returns the first property of an object
* @param {object} object - the object to get the first member
* @return {string} - the object key
*/
first(object: any): string;
first(...args: any): any;
/**
* Returns the last property of an object
* @param {object} object - the object to get the first member
* @return {string} - the object key
*/
last(object: any): string;
last(...args: any): any;
/**
* Returns an array of properties starting at start
* @param {object} object - the object to get the properties form
* @param {int} start - the starting index
* @return {array} - the array of entires
*/
slice(object: any, start?: number): any[];
slice(...args: any): any;
/**
* Gets the minimum key form object
* @param {object} object - the object to get the properties form
* @return {string} - the minimum key
*/
min(object: any): string;
min(...args: any): any;
/**
* Gets the maximum key form object
* @param {object} object - the object to get the properties form
* @return {string} - the minimum key
*/
max(object: any): string;
max(...args: any): any;
/**
* Sets an option given a key and value
* @param {string} key - the key to set
* @param {object} value - the value of the key
* @return {undefined}
*/
setOption(key: string, value: any): any;
setOption(...args: any): any;
/**
* Gets an option given a key
* @param {string} key - the key to set
* @return {undefined}
*/
getOption(key: string): any;
getOption(...args: any): any;
/**
* Returns the entire info object
* @return {object} - the info object
*/
getInfo(key: string, value: any): any;
getInfo(...args: any): any;
/**
* Returns the used weight from the last request
* @return {object} - 1m weight used
*/
usedWeight(): any;
usedWeight(...args: any): any;
/**
* Returns the status code from the last http response
* @return {object} - status code
*/
statusCode(): any;
statusCode(...args: any): any;
/**
* Returns the ping time from the last futures request
* @return {object} - latency/ping (2ms)
*/
futuresLatency(): any;
futuresLatency(...args: any): any;
/**
* Returns the complete URL from the last request
* @return {object} - http address including query string
*/
lastURL(): any;
lastURL(...args: any): any;
/**
* Returns the order count from the last request
* @return {object} - orders allowed per 1m
*/
orderCount(...args: any): any;
orderCount(...args: any): any;
/**
* Returns the entire options object
* @return {object} - the options object
*/
getOptions(): any;
getOptions(...args: any): any;
options(...args: any): any;
/**
* Creates an order
* @param {string} side - BUY or SELL
* @param {string} symbol - the symbol to buy
* @param {numeric} quantity - the quantity required
* @param {numeric} price - the price to pay for each unit
* @param {object} flags - aadditionalbuy order flags
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
order(side: 'BUY' | 'SELL', symbol: _symbol, quantity: number, price: number, flags?: any, callback?: _callback): Promise<any>;
order(...args: any): any;
/**
* Creates a buy order
* @param {string} symbol - the symbol to buy
* @param {numeric} quantity - the quantity required
* @param {numeric} price - the price to pay for each unit
* @param {object} flags - additional buy order flags
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
buy(symbol: _symbol, quantity: number, price: number, flags?: any, callback?: _callback): Promise<any>;
buy(...args: any): any;
/**
* Creates a sell order
* @param {string} symbol - the symbol to sell
* @param {numeric} quantity - the quantity required
* @param {numeric} price - the price to sell each unit for
* @param {object} flags - additional order flags
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
sell(symbol: _symbol, quantity: number, price: number, flags?: any, callback?: _callback): Promise<any>;
sell(...args: any): any;
/**
* Creates a market buy order
* @param {string} symbol - the symbol to buy
* @param {numeric} quantity - the quantity required
* @param {object} flags - additional buy order flags
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
marketBuy(symbol: _symbol, quantity: number, flags?: any, callback?: _callback): Promise<any>;
marketBuy(...args: any): any;
/**
* Creates a market sell order
* @param {string} symbol - the symbol to sell
* @param {numeric} quantity - the quantity required
* @param {object} flags - additional sell order flags
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
marketSell(symbol: _symbol, quantity: number, flags?: any, callback?: _callback): Promise<any>;
marketSell(...args: any): any;
/**
* Cancels an order
* @param {string} symbol - the symbol to cancel
* @param {string} orderid - the orderid to cancel
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
cancel(symbol: _symbol, orderid: string, callback?: _callback): Promise<any>;
cancel(...args: any): any;
/**
* Gets the status of an order
* @param {string} symbol - the symbol to check
* @param {string} orderid - the orderid to check
* @param {function} callback - the callback function
* @param {object} flags - any additional flags
* @return {promise or undefined} - omitting the callback returns a promise
*/
orderStatus(symbol: _symbol, orderid: string, callback?: _callback, flags?: any): Promise<any>;
orderStatus(...args: any): any;
/**
* Gets open orders
* @param {string} symbol - the symbol to get
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
openOrders(symbol: _symbol, callback?: _callback): Promise<any>;
openOrders(...args: any): any;
/**
* Cancels all orders of a given symbol
* @param {string} symbol - the symbol to cancel all orders for
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
cancelAll(symbol: _symbol, callback?: _callback): Promise<any>;
cancelAll(...args: any): any;
/**
* Cancels all orders of a given symbol
* @param {string} symbol - the symbol to cancel all orders for
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
cancelOrders(symbol: _symbol, callback?: _callback): Promise<any>;
cancelOrders(...args: any): any;
/**
* Gets all order of a given symbol
* @param {string} symbol - the symbol
* @param {function} callback - the callback function (can also accept options)
* @param {object} options - additional options
* @return {promise or undefined} - omitting the callback returns a promise
*/
allOrders(symbol: _symbol, callback?: _callback, options?: any): Promise<any>;
allOrders(...args: any): any;
/**
* Gets the depth information for a given symbol
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @param {int} limit - limit the number of returned orders
* @return {promise or undefined} - omitting the callback returns a promise
*/
depth(symbol: _symbol, callback?: _callback, limit?: number): Promise<any>;
depth(...args: any): any;
/**
* Gets the average prices of a given symbol
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
avgPrice(symbol: _symbol, callback?: _callback): Promise<any>;
avgPrice(...args: any): any;
/**
* Gets the prices of a given symbol(s)
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
prices(symbol?: _symbol, callback?: _callback): Promise<any>;
prices(...args: any): any;
/**
* Gets the book tickers of given symbol(s)
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
bookTickers(symbol: _symbol, callback?: _callback): Promise<any>;
bookTickers(...args: any): any;
/**
* Gets the prevday percentage change
* @param {string} symbol - the symbol or symbols
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
prevDay(symbol: _symbol, callback?: _callback): Promise<any>;
prevDay(...args: any): any;
/**
* Gets the the exchange info
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
exchangeInfo(callback?: _callback): Promise<any>;
exchangeInfo(...args: any): any;
/**
* Gets the dust log for user
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
dustLog(callback?: _callback): Promise<any>;
dustLog(...args: any): any;
dustTransfer(...args: any): any;
assetDividendRecord(...args: any): any;
/**
* Gets the the system status
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
systemStatus(callback?: _callback): Promise<any>;
systemStatus(...args: any): any;
/**
* Withdraws asset to given wallet id
* @param {string} asset - the asset symbol
* @param {string} address - the wallet to transfer it to
* @param {number} amount - the amount to transfer
* @param {string} addressTag - and addtional address tag
* @param {function} callback - the callback function
* @param {string} name - the name to save the address as. Set falsy to prevent Binance saving to address book
* @return {promise or undefined} - omitting the callback returns a promise
*/
withdraw(asset: string, address: string, amount: number, addressTag?: string, callback?: _callback, name?: string): Promise<any>;
withdraw(...args: any): any;
/**
* Get the Withdraws history for a given asset
* @param {function} callback - the callback function
* @param {object} params - supports limit and fromId parameters
* @return {promise or undefined} - omitting the callback returns a promise
*/
withdrawHistory(callback?: _callback, params?: any): any;
withdrawHistory(...args: any): any;
/**
* Get the deposit history
* @param {function} callback - the callback function
* @param {object} params - additional params
* @return {promise or undefined} - omitting the callback returns a promise
*/
depositHistory(callback?: _callback, params?: any): Promise<any>;
depositHistory(...args: any): any;
/**
* Get the deposit history for given asset
* @param {string} asset - the asset
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
depositAddress(asset: string, callback?: _callback): Promise<any>;
depositAddress(...args: any): any;
/**
* Get the account status
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
accountStatus(callback?: _callback): Promise<any>;
accountStatus(...args: any): any;
/**
* Get the trade fee
* @param {function} callback - the callback function
* @param {string} symbol (optional)
* @return {promise or undefined} - omitting the callback returns a promise
*/
tradeFee(...args: any): any;
tradeFee(...args: any): any;
/**
* Fetch asset detail (minWithdrawAmount, depositStatus, withdrawFee, withdrawStatus, depositTip)
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
assetDetail(callback?: _callback): Promise<any>;
assetDetail(...args: any): any;
/**
* Get the account
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
account(callback?: _callback): Promise<any>;
account(...args: any): any;
/**
* Get the balance data
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
balance(callback?: _callback): Promise<any>;
balance(...args: any): any;
/**
* Get trades for a given symbol
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @param {object} options - additional options
* @return {promise or undefined} - omitting the callback returns a promise
*/
trades(symbol: _symbol, callback: _callback, options?: any): Promise<any>;
trades(...args: any): any;
/**
* Tell api to use the server time to offset time indexes
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
useServerTime(callback?: _callback): Promise<any>;
useServerTime(...args: any): any;
/**
* Get Binance server time
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
time(callback?: _callback): Promise<any>;
time(...args: any): any;
/**
* Get agg trades for given symbol
* @param {string} symbol - the symbol
* @param {object} options - additional optoins
* @param {function} callback - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
aggTrades(symbol: _symbol, options?: any, callback?: _callback): Promise<any>;
aggTrades(...args: any): any;
/**
* Get the recent trades
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @param {int} limit - limit the number of items returned
* @return {promise or undefined} - omitting the callback returns a promise
*/
recentTrades(symbol: _symbol, callback?: _callback, limit?: number): Promise<any>;
recentTrades(...args: any): any;
/**
* Get the historical trade info
* @param {string} symbol - the symbol
* @param {function} callback - the callback function
* @param {int} limit - limit the number of items returned
* @param {int} fromId - from this id
* @return {promise or undefined} - omitting the callback returns a promise
*/
historicalTrades(symbol: _symbol, callback?: _callback, limit?: number, fromId?: boolean): Promise<any>;
historicalTrades(...args: any): any;
/**
* Convert chart data to highstock array [timestamp,open,high,low,close]
* @param {object} chart - the chart
* @param {boolean} include_volume - to include the volume or not
* @return {array} - an array
*/
highstock(chart: any, include_volume?: boolean): any[];
highstock(...args: any): any;
/**
* Populates OHLC information
* @param {object} chart - the chart
* @return {object} - object with candle information
*/
ohlc(chart: any): any;
ohlc(...args: any): any;
/**
* Gets the candles information for a given symbol
* intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M
* @param {string} symbol - the symbol
* @param {function} interval - the callback function
* @param {function} callback - the callback function
* @param {object} options - additional options
* @return {promise or undefined} - omitting the callback returns a promise
*/
candlesticks(symbol: _symbol, interval: _interval, callback?: _callback, options?: any): Promise<any>;
candlesticks(...args: any): any;
/**
* Queries the public api
* @param {string} url - the public api endpoint
* @param {object} data - the data to send
* @param {function} callback - the callback function
* @param {string} method - the http method
* @return {promise or undefined} - omitting the callback returns a promise
*/
publicRequest(url: string, data: any, callback?: _callback, method?: string): Promise<any>;
publicRequest(...args: any): any;
/**
* Queries the futures API by default
* @param {string} url - the signed api endpoint
* @param {object} data - the data to send
* @param {object} flags - type of request, authentication method and endpoint url
*/
promiseRequest(url: string, data?: any, flags?: any): Promise<any>;
promiseRequest(...args: any): any;
/**
* Queries the signed api
* @param {string} url - the signed api endpoint
* @param {object} data - the data to send
* @param {function} callback - the callback function
* @param {string} method - the http method
* @param {boolean} noDataInSignature - Prevents data from being added to signature
* @return {promise or undefined} - omitting the callback returns a promise
*/
signedRequest(url: string, data: any, callback?: _callback, method?: string, noDataInSignature?: boolean): Promise<any>;
signedRequest(...args: any): any;
/**
* Gets the market asset of given symbol
* @param {string} symbol - the public api endpoint
* @return {string or undefined}
*/
getMarket(symbol: _symbol): string | undefined;
getMarket(...args: any): any;
/**
* Get the account binance lending information
* @param {object} params - the callback function
* @return {promise or undefined} - omitting the callback returns a promise
*/
lending(params?: any): Promise<any>;
lending(...args: any): any;
futuresPing(params?: any): Promise<any>;
futuresPing(...args: any): any;
futuresTime(params?: any): Promise<any>;
futuresTime(...args: any): any;
futuresExchangeInfo(): Promise<any>;
futuresExchangeInfo(...args: any): any;
futuresPrices(params?: any): Promise<any>;
futuresPrices(...args: any): any;
futuresDaily(symbol?: _symbol, params?: any): Promise<any>;
futuresDaily(...args: any): any;
futuresOpenInterest(symbol: _symbol): Promise<any>;
futuresOpenInterest(...args: any): any;
futuresCandles(symbol: _symbol, interval?: _interval, params?: any): Promise<any>;
futuresCandles(...args: any): any;
futuresMarkPrice(_symbol?: _symbol): Promise<any>;
futuresMarkPrice(...args: any): any;
futuresTrades(symbol: _symbol, params?: any): Promise<any>;
futuresTrades(...args: any): any;
futuresHistoricalTrades(symbol: _symbol, params?: any): Promise<any>;
futuresHistoricalTrades(...args: any): any;
futuresAggTrades(symbol: _symbol, params?: any): Promise<any>;
futuresAggTrades(...args: any): any;
futuresForceOrders(params?: any): Promise<any>;
futuresForceOrders(...args: any): any;
futuresDeleverageQuantile(params?: any): Promise<any>;
futuresDeleverageQuantile(...args: any): any;
futuresUserTrades(symbol: _symbol, params?: any): Promise<any>;
futuresUserTrades(...args: any): any;
futuresGetDataStream(params?: any): Promise<any>;
futuresGetDataStream(...args: any): any;
futuresKeepDataStream(params?: any): Promise<any>;
futuresKeepDataStream(...args: any): any;
futuresCloseDataStream(params?: any): Promise<any>;
futuresCloseDataStream(...args: any): any;
futuresLiquidationOrders(symbol?: _symbol, params?: any): Promise<any>;
futuresLiquidationOrders(...args: any): any;
futuresPositionRisk(params?: any): Promise<any>;
futuresPositionRisk(...args: any): any;
futuresFundingRate(symbol: _symbol, params?: any): Promise<any>;
futuresFundingRate(...args: any): any;
futuresLeverageBracket(symbol?: _symbol, params?: any): Promise<any>;
futuresLeverageBracket(...args: any): any;
futuresTradingStatus(symbol?: _symbol, params?: any): Promise<any>;
futuresTradingStatus(...args: any): any;
futuresCommissionRate(symbol?: _symbol, params?: any): Promise<any>;
futuresCommissionRate(...args: any): any;
/**
* @see leverage 1 to 125
*/
futuresLeverage(symbol: _symbol, leverage: number, params?: any): Promise<any>;
futuresLeverage(...args: any): any;
futuresMarginType(symbol: _symbol, marginType: 'ISOLATED' | 'CROSSED', params?: any): Promise<any>;
futuresMarginType(...args: any): any;
futuresPositionMargin(symbol: _symbol, amount: number, type?: number, params?: any): Promise<any>;
futuresPositionMargin(...args: any): any;
futuresPositionMarginHistory(symbol: _symbol, params?: any): Promise<any>;
futuresPositionMarginHistory(...args: any): any;
futuresIncome(params?: any): Promise<any>;
futuresIncome(...args: any): any;
futuresBalance(params?: any): Promise<any>;
futuresBalance(...args: any): any;
futuresAccount(params?: any): Promise<any>;
futuresAccount(...args: any): any;
futuresDepth(symbol: _symbol, params?: any): Promise<any>;
futuresDepth(...args: any): any;
futuresQuote(symbol?: _symbol, params?: any): Promise<any>;
futuresQuote(...args: any): any;
futuresBuy(symbol: _symbol, quantity: number, price: number, params?: any): Promise<any>;
futuresBuy(...args: any): any;
futuresSell(symbol: _symbol, quantity: number, price: number, params?: any): Promise<any>;
futuresSell(...args: any): any;
futuresMarketBuy(symbol: _symbol, quantity: number, params?: any): Promise<any>;
futuresMarketBuy(...args: any): any;
futuresMarketSell(symbol: _symbol, quantity: number, params?: any): Promise<any>;
futuresMarketSell(...args: any): any;
futuresOrder(side: 'BUY' | 'SELL', symbol: _symbol, price?: number, params?: any): Promise<any>;
futuresOrder(...args: any): any;
futuresOrderStatus(symbol: _symbol, params?: any): Promise<any>;
futuresOrderStatus(...args: any): any;
futuresCancel(symbol: _symbol, params?: any): Promise<any>;
futuresCancel(...args: any): any;
futuresCancelAll(symbol: _symbol, params?: any): Promise<any>;
futuresCancelAll(...args: any): any;
futuresCountdownCancelAll(symbol: _symbol, countdownTime?: number, params?: any): Promise<any>;
futuresCountdownCancelAll(...args: any): any;
futuresOpenOrders(symbol?: _symbol, params?: any): Promise<any>;
futuresOpenOrders(...args: any): any;
futuresAllOrders(symbol?: _symbol, params?: any): Promise<any>;
futuresAllOrders(...args: any): any;
futuresPositionSideDual(params?: any): Promise<any>;
futuresPositionSideDual(...args: any): any;
futuresChangePositionSideDual(dualSidePosition: any, params?: any): Promise<any>;
futuresChangePositionSideDual(...args: any): any;
futuresTransferAsset(asset: any, amount: any, type: any): Promise<any>;
futuresTransferAsset(...args: any): any;
futuresHistDataId(symbol?: _symbol, params?: any): Promise<any>;
futuresHistDataId(...args: any): any;
futuresDownloadLink(downloadId: string): Promise<any>;
futuresDownloadLink(...args: any): any;
deliveryPing(params?: any): Promise<any>;