ccxt 4.2.48 → 4.2.50
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.
- package/README.md +3 -3
- package/build.sh +7 -0
- package/dist/ccxt.browser.js +598 -48
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +5 -0
- package/dist/cjs/src/binance.js +9 -4
- package/dist/cjs/src/bitmart.js +30 -4
- package/dist/cjs/src/bitstamp.js +8 -0
- package/dist/cjs/src/bl3p.js +47 -0
- package/dist/cjs/src/btcalpha.js +4 -0
- package/dist/cjs/src/btcmarkets.js +4 -0
- package/dist/cjs/src/btcturk.js +4 -0
- package/dist/cjs/src/bybit.js +138 -6
- package/dist/cjs/src/independentreserve.js +48 -0
- package/dist/cjs/src/latoken.js +16 -0
- package/dist/cjs/src/luno.js +18 -0
- package/dist/cjs/src/lykke.js +19 -0
- package/dist/cjs/src/ndax.js +18 -0
- package/dist/cjs/src/pro/ascendex.js +22 -7
- package/dist/cjs/src/pro/bequant.js +3 -4
- package/dist/cjs/src/pro/binance.js +29 -2
- package/dist/cjs/src/pro/bitget.js +28 -7
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/gemini.js +89 -1
- package/dist/cjs/src/pro/mexc.js +2 -1
- package/dist/cjs/src/pro/whitebit.js +9 -8
- package/dist/cjs/src/timex.js +35 -1
- package/dist/cjs/src/upbit.js +11 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitstamp.d.ts +8 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +5 -0
- package/js/src/binance.js +9 -4
- package/js/src/bitmart.js +30 -4
- package/js/src/bitstamp.js +8 -0
- package/js/src/bl3p.d.ts +15 -1
- package/js/src/bl3p.js +47 -0
- package/js/src/btcalpha.js +4 -0
- package/js/src/btcmarkets.js +4 -0
- package/js/src/btcturk.js +4 -0
- package/js/src/bybit.d.ts +3 -1
- package/js/src/bybit.js +138 -6
- package/js/src/independentreserve.d.ts +15 -1
- package/js/src/independentreserve.js +48 -0
- package/js/src/latoken.js +16 -0
- package/js/src/luno.js +18 -0
- package/js/src/lykke.js +19 -0
- package/js/src/ndax.js +18 -0
- package/js/src/pro/ascendex.d.ts +1 -0
- package/js/src/pro/ascendex.js +22 -7
- package/js/src/pro/bequant.js +3 -4
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +29 -2
- package/js/src/pro/bitget.js +28 -7
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/gemini.d.ts +3 -1
- package/js/src/pro/gemini.js +89 -1
- package/js/src/pro/mexc.js +2 -1
- package/js/src/pro/whitebit.js +9 -8
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/timex.d.ts +1 -0
- package/js/src/timex.js +35 -1
- package/js/src/upbit.js +11 -2
- package/package.json +3 -1
- package/skip-tests.json +4 -3
package/dist/cjs/src/luno.js
CHANGED
|
@@ -182,6 +182,7 @@ class luno extends luno$1 {
|
|
|
182
182
|
* @method
|
|
183
183
|
* @name luno#fetchMarkets
|
|
184
184
|
* @description retrieves data on all markets for luno
|
|
185
|
+
* @see https://www.luno.com/en/developers/api#tag/Market/operation/Markets
|
|
185
186
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
186
187
|
* @returns {object[]} an array of objects representing market data
|
|
187
188
|
*/
|
|
@@ -272,6 +273,7 @@ class luno extends luno$1 {
|
|
|
272
273
|
* @method
|
|
273
274
|
* @name luno#fetchAccounts
|
|
274
275
|
* @description fetch all the accounts associated with a profile
|
|
276
|
+
* @see https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
|
|
275
277
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
276
278
|
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
277
279
|
*/
|
|
@@ -326,6 +328,7 @@ class luno extends luno$1 {
|
|
|
326
328
|
* @method
|
|
327
329
|
* @name luno#fetchBalance
|
|
328
330
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
331
|
+
* @see https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
|
|
329
332
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
330
333
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
331
334
|
*/
|
|
@@ -348,6 +351,8 @@ class luno extends luno$1 {
|
|
|
348
351
|
* @method
|
|
349
352
|
* @name luno#fetchOrderBook
|
|
350
353
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
354
|
+
* @see https://www.luno.com/en/developers/api#tag/Market/operation/GetOrderBookFull
|
|
355
|
+
* @see https://www.luno.com/en/developers/api#tag/Market/operation/GetOrderBook
|
|
351
356
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
352
357
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
353
358
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -456,6 +461,7 @@ class luno extends luno$1 {
|
|
|
456
461
|
* @method
|
|
457
462
|
* @name luno#fetchOrder
|
|
458
463
|
* @description fetches information on an order made by the user
|
|
464
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/GetOrder
|
|
459
465
|
* @param {string} symbol not used by luno fetchOrder
|
|
460
466
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
461
467
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -487,6 +493,7 @@ class luno extends luno$1 {
|
|
|
487
493
|
* @method
|
|
488
494
|
* @name luno#fetchOrders
|
|
489
495
|
* @description fetches information on multiple orders made by the user
|
|
496
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
|
|
490
497
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
491
498
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
492
499
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -500,6 +507,7 @@ class luno extends luno$1 {
|
|
|
500
507
|
* @method
|
|
501
508
|
* @name luno#fetchOpenOrders
|
|
502
509
|
* @description fetch all unfilled currently open orders
|
|
510
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
|
|
503
511
|
* @param {string} symbol unified market symbol
|
|
504
512
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
505
513
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -513,6 +521,7 @@ class luno extends luno$1 {
|
|
|
513
521
|
* @method
|
|
514
522
|
* @name luno#fetchClosedOrders
|
|
515
523
|
* @description fetches information on multiple closed orders made by the user
|
|
524
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
|
|
516
525
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
517
526
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
518
527
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -563,6 +572,7 @@ class luno extends luno$1 {
|
|
|
563
572
|
* @method
|
|
564
573
|
* @name luno#fetchTickers
|
|
565
574
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
575
|
+
* @see https://www.luno.com/en/developers/api#tag/Market/operation/GetTickers
|
|
566
576
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
567
577
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
568
578
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -587,6 +597,7 @@ class luno extends luno$1 {
|
|
|
587
597
|
* @method
|
|
588
598
|
* @name luno#fetchTicker
|
|
589
599
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
600
|
+
* @see https://www.luno.com/en/developers/api#tag/Market/operation/GetTicker
|
|
590
601
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
591
602
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
592
603
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -708,6 +719,7 @@ class luno extends luno$1 {
|
|
|
708
719
|
* @method
|
|
709
720
|
* @name luno#fetchTrades
|
|
710
721
|
* @description get the list of most recent trades for a particular symbol
|
|
722
|
+
* @see https://www.luno.com/en/developers/api#tag/Market/operation/ListTrades
|
|
711
723
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
712
724
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
713
725
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -808,6 +820,7 @@ class luno extends luno$1 {
|
|
|
808
820
|
* @method
|
|
809
821
|
* @name luno#fetchMyTrades
|
|
810
822
|
* @description fetch all trades made by the user
|
|
823
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/ListUserTrades
|
|
811
824
|
* @param {string} symbol unified market symbol
|
|
812
825
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
813
826
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -858,6 +871,7 @@ class luno extends luno$1 {
|
|
|
858
871
|
* @method
|
|
859
872
|
* @name luno#fetchTradingFee
|
|
860
873
|
* @description fetch the trading fees for a market
|
|
874
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/getFeeInfo
|
|
861
875
|
* @param {string} symbol unified market symbol
|
|
862
876
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
863
877
|
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
@@ -887,6 +901,8 @@ class luno extends luno$1 {
|
|
|
887
901
|
* @method
|
|
888
902
|
* @name luno#createOrder
|
|
889
903
|
* @description create a trade order
|
|
904
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/PostMarketOrder
|
|
905
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/PostLimitOrder
|
|
890
906
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
891
907
|
* @param {string} type 'market' or 'limit'
|
|
892
908
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -928,6 +944,7 @@ class luno extends luno$1 {
|
|
|
928
944
|
* @method
|
|
929
945
|
* @name luno#cancelOrder
|
|
930
946
|
* @description cancels an open order
|
|
947
|
+
* @see https://www.luno.com/en/developers/api#tag/Orders/operation/StopOrder
|
|
931
948
|
* @param {string} id order id
|
|
932
949
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
933
950
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -959,6 +976,7 @@ class luno extends luno$1 {
|
|
|
959
976
|
* @method
|
|
960
977
|
* @name luno#fetchLedger
|
|
961
978
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
979
|
+
* @see https://www.luno.com/en/developers/api#tag/Accounts/operation/ListTransactions
|
|
962
980
|
* @param {string} code unified currency code, default is undefined
|
|
963
981
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
964
982
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
package/dist/cjs/src/lykke.js
CHANGED
|
@@ -184,6 +184,7 @@ class lykke extends lykke$1 {
|
|
|
184
184
|
* @method
|
|
185
185
|
* @name lykke#fetchCurrencies
|
|
186
186
|
* @description fetches all available currencies on an exchange
|
|
187
|
+
* @see https://lykkecity.github.io/Trading-API/#get-all-assets
|
|
187
188
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
188
189
|
* @returns {object} an associative dictionary of currencies
|
|
189
190
|
*/
|
|
@@ -262,6 +263,7 @@ class lykke extends lykke$1 {
|
|
|
262
263
|
* @method
|
|
263
264
|
* @name lykke#fetchMarkets
|
|
264
265
|
* @description retrieves data on all markets for lykke
|
|
266
|
+
* @see https://lykkecity.github.io/Trading-API/#get-asset-by-id
|
|
265
267
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
266
268
|
* @returns {object[]} an array of objects representing market data
|
|
267
269
|
*/
|
|
@@ -421,6 +423,8 @@ class lykke extends lykke$1 {
|
|
|
421
423
|
* @method
|
|
422
424
|
* @name lykke#fetchTicker
|
|
423
425
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
426
|
+
* @see https://lykkecity.github.io/Trading-API/#get-current-prices
|
|
427
|
+
* @see https://lykkecity.github.io/Trading-API/#24hr-ticker-price-change-statistics
|
|
424
428
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
425
429
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
426
430
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -480,6 +484,7 @@ class lykke extends lykke$1 {
|
|
|
480
484
|
* @method
|
|
481
485
|
* @name lykke#fetchTickers
|
|
482
486
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
487
|
+
* @see https://lykkecity.github.io/Trading-API/#24hr-ticker-price-change-statistics
|
|
483
488
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
484
489
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
485
490
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -511,6 +516,7 @@ class lykke extends lykke$1 {
|
|
|
511
516
|
* @method
|
|
512
517
|
* @name lykke#fetchOrderBook
|
|
513
518
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
519
|
+
* @see https://lykkecity.github.io/Trading-API/#asset-pair-order-book-ticker
|
|
514
520
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
515
521
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
516
522
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -615,6 +621,7 @@ class lykke extends lykke$1 {
|
|
|
615
621
|
* @method
|
|
616
622
|
* @name lykke#fetchTrades
|
|
617
623
|
* @description get the list of most recent trades for a particular symbol
|
|
624
|
+
* @see https://lykkecity.github.io/Trading-API/#get-public-trades
|
|
618
625
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
619
626
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
620
627
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -679,6 +686,7 @@ class lykke extends lykke$1 {
|
|
|
679
686
|
* @method
|
|
680
687
|
* @name lykke#fetchBalance
|
|
681
688
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
689
|
+
* @see https://lykkecity.github.io/Trading-API/#get-the-current-balance
|
|
682
690
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
683
691
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
684
692
|
*/
|
|
@@ -774,6 +782,8 @@ class lykke extends lykke$1 {
|
|
|
774
782
|
* @method
|
|
775
783
|
* @name lykke#createOrder
|
|
776
784
|
* @description create a trade order
|
|
785
|
+
* @see https://lykkecity.github.io/Trading-API/#place-a-limit-order
|
|
786
|
+
* @see https://lykkecity.github.io/Trading-API/#place-a-market-order
|
|
777
787
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
778
788
|
* @param {string} type 'market' or 'limit'
|
|
779
789
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -850,6 +860,7 @@ class lykke extends lykke$1 {
|
|
|
850
860
|
* @method
|
|
851
861
|
* @name lykke#cancelOrder
|
|
852
862
|
* @description cancels an open order
|
|
863
|
+
* @see https://lykkecity.github.io/Trading-API/#cancel-orders-by-id
|
|
853
864
|
* @param {string} id order id
|
|
854
865
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
855
866
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -871,6 +882,7 @@ class lykke extends lykke$1 {
|
|
|
871
882
|
* @method
|
|
872
883
|
* @name lykke#cancelAllOrders
|
|
873
884
|
* @description cancel all open orders
|
|
885
|
+
* @see https://lykkecity.github.io/Trading-API/#mass-cancel-orders
|
|
874
886
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
875
887
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
876
888
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -897,6 +909,7 @@ class lykke extends lykke$1 {
|
|
|
897
909
|
* @method
|
|
898
910
|
* @name lykke#fetchOrder
|
|
899
911
|
* @description fetches information on an order made by the user
|
|
912
|
+
* @see https://lykkecity.github.io/Trading-API/#get-order-by-id
|
|
900
913
|
* @param {string} symbol not used by lykke fetchOrder
|
|
901
914
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
902
915
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -933,6 +946,7 @@ class lykke extends lykke$1 {
|
|
|
933
946
|
* @method
|
|
934
947
|
* @name lykke#fetchOpenOrders
|
|
935
948
|
* @description fetch all unfilled currently open orders
|
|
949
|
+
* @see https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
|
|
936
950
|
* @param {string} symbol unified market symbol
|
|
937
951
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
938
952
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -981,6 +995,7 @@ class lykke extends lykke$1 {
|
|
|
981
995
|
* @method
|
|
982
996
|
* @name lykke#fetchClosedOrders
|
|
983
997
|
* @description fetches information on multiple closed orders made by the user
|
|
998
|
+
* @see https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
|
|
984
999
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
985
1000
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
986
1001
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1029,6 +1044,7 @@ class lykke extends lykke$1 {
|
|
|
1029
1044
|
* @method
|
|
1030
1045
|
* @name lykke#fetchMyTrades
|
|
1031
1046
|
* @description fetch all trades made by the user
|
|
1047
|
+
* @see https://lykkecity.github.io/Trading-API/#get-trade-history
|
|
1032
1048
|
* @param {string} symbol unified market symbol
|
|
1033
1049
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1034
1050
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1088,6 +1104,7 @@ class lykke extends lykke$1 {
|
|
|
1088
1104
|
* @method
|
|
1089
1105
|
* @name lykke#fetchDepositAddress
|
|
1090
1106
|
* @description fetch the deposit address for a currency associated with this account
|
|
1107
|
+
* @see https://lykkecity.github.io/Trading-API/#get-deposit-address-for-a-given-asset
|
|
1091
1108
|
* @param {string} code unified currency code
|
|
1092
1109
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1093
1110
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1185,6 +1202,7 @@ class lykke extends lykke$1 {
|
|
|
1185
1202
|
* @method
|
|
1186
1203
|
* @name lykke#fetchDepositsWithdrawals
|
|
1187
1204
|
* @description fetch history of deposits and withdrawals
|
|
1205
|
+
* @see https://lykkecity.github.io/Trading-API/#get-the-history-of-withdrawals-and-deposits
|
|
1188
1206
|
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
1189
1207
|
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
1190
1208
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
@@ -1227,6 +1245,7 @@ class lykke extends lykke$1 {
|
|
|
1227
1245
|
* @method
|
|
1228
1246
|
* @name lykke#withdraw
|
|
1229
1247
|
* @description make a withdrawal
|
|
1248
|
+
* @see https://lykkecity.github.io/Trading-API/#withdrawal
|
|
1230
1249
|
* @param {string} code unified currency code
|
|
1231
1250
|
* @param {float} amount the amount to withdraw
|
|
1232
1251
|
* @param {string} address the address to withdraw to
|
package/dist/cjs/src/ndax.js
CHANGED
|
@@ -280,6 +280,7 @@ class ndax extends ndax$1 {
|
|
|
280
280
|
* @method
|
|
281
281
|
* @name ndax#signIn
|
|
282
282
|
* @description sign in, must be called prior to using other authenticated methods
|
|
283
|
+
* @see https://apidoc.ndax.io/#authenticate2fa
|
|
283
284
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
284
285
|
* @returns response from exchange
|
|
285
286
|
*/
|
|
@@ -333,6 +334,7 @@ class ndax extends ndax$1 {
|
|
|
333
334
|
* @method
|
|
334
335
|
* @name ndax#fetchCurrencies
|
|
335
336
|
* @description fetches all available currencies on an exchange
|
|
337
|
+
* @see https://apidoc.ndax.io/#getproduct
|
|
336
338
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
337
339
|
* @returns {object} an associative dictionary of currencies
|
|
338
340
|
*/
|
|
@@ -402,6 +404,7 @@ class ndax extends ndax$1 {
|
|
|
402
404
|
* @method
|
|
403
405
|
* @name ndax#fetchMarkets
|
|
404
406
|
* @description retrieves data on all markets for ndax
|
|
407
|
+
* @see https://apidoc.ndax.io/#getinstruments
|
|
405
408
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
406
409
|
* @returns {object[]} an array of objects representing market data
|
|
407
410
|
*/
|
|
@@ -561,6 +564,7 @@ class ndax extends ndax$1 {
|
|
|
561
564
|
* @method
|
|
562
565
|
* @name ndax#fetchOrderBook
|
|
563
566
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
567
|
+
* @see https://apidoc.ndax.io/#getl2snapshot
|
|
564
568
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
565
569
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
566
570
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -671,6 +675,7 @@ class ndax extends ndax$1 {
|
|
|
671
675
|
* @method
|
|
672
676
|
* @name ndax#fetchTicker
|
|
673
677
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
678
|
+
* @see https://apidoc.ndax.io/#getlevel1
|
|
674
679
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
675
680
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
676
681
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -743,6 +748,7 @@ class ndax extends ndax$1 {
|
|
|
743
748
|
* @method
|
|
744
749
|
* @name ndax#fetchOHLCV
|
|
745
750
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
751
|
+
* @see https://apidoc.ndax.io/#gettickerhistory
|
|
746
752
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
747
753
|
* @param {string} timeframe the length of time each candle represents
|
|
748
754
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -989,6 +995,7 @@ class ndax extends ndax$1 {
|
|
|
989
995
|
* @method
|
|
990
996
|
* @name ndax#fetchAccounts
|
|
991
997
|
* @description fetch all the accounts associated with a profile
|
|
998
|
+
* @see https://apidoc.ndax.io/#getuseraccounts
|
|
992
999
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
993
1000
|
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
994
1001
|
*/
|
|
@@ -1042,6 +1049,7 @@ class ndax extends ndax$1 {
|
|
|
1042
1049
|
* @method
|
|
1043
1050
|
* @name ndax#fetchBalance
|
|
1044
1051
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1052
|
+
* @see https://apidoc.ndax.io/#getaccountpositions
|
|
1045
1053
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1046
1054
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1047
1055
|
*/
|
|
@@ -1169,6 +1177,7 @@ class ndax extends ndax$1 {
|
|
|
1169
1177
|
* @method
|
|
1170
1178
|
* @name ndax#fetchLedger
|
|
1171
1179
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1180
|
+
* @see https://apidoc.ndax.io/#getaccounttransactions
|
|
1172
1181
|
* @param {string} code unified currency code, default is undefined
|
|
1173
1182
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1174
1183
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -1323,6 +1332,7 @@ class ndax extends ndax$1 {
|
|
|
1323
1332
|
* @method
|
|
1324
1333
|
* @name ndax#createOrder
|
|
1325
1334
|
* @description create a trade order
|
|
1335
|
+
* @see https://apidoc.ndax.io/#sendorder
|
|
1326
1336
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1327
1337
|
* @param {string} type 'market' or 'limit'
|
|
1328
1338
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1441,6 +1451,7 @@ class ndax extends ndax$1 {
|
|
|
1441
1451
|
* @method
|
|
1442
1452
|
* @name ndax#fetchMyTrades
|
|
1443
1453
|
* @description fetch all trades made by the user
|
|
1454
|
+
* @see https://apidoc.ndax.io/#gettradeshistory
|
|
1444
1455
|
* @param {string} symbol unified market symbol
|
|
1445
1456
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1446
1457
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1528,6 +1539,7 @@ class ndax extends ndax$1 {
|
|
|
1528
1539
|
* @method
|
|
1529
1540
|
* @name ndax#cancelAllOrders
|
|
1530
1541
|
* @description cancel all open orders
|
|
1542
|
+
* @see https://apidoc.ndax.io/#cancelallorders
|
|
1531
1543
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1532
1544
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1533
1545
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1562,6 +1574,7 @@ class ndax extends ndax$1 {
|
|
|
1562
1574
|
* @method
|
|
1563
1575
|
* @name ndax#cancelOrder
|
|
1564
1576
|
* @description cancels an open order
|
|
1577
|
+
* @see https://apidoc.ndax.io/#cancelorder
|
|
1565
1578
|
* @param {string} id order id
|
|
1566
1579
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1567
1580
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1601,6 +1614,7 @@ class ndax extends ndax$1 {
|
|
|
1601
1614
|
* @method
|
|
1602
1615
|
* @name ndax#fetchOpenOrders
|
|
1603
1616
|
* @description fetch all unfilled currently open orders
|
|
1617
|
+
* @see https://apidoc.ndax.io/#getopenorders
|
|
1604
1618
|
* @param {string} symbol unified market symbol
|
|
1605
1619
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1606
1620
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1679,6 +1693,7 @@ class ndax extends ndax$1 {
|
|
|
1679
1693
|
* @method
|
|
1680
1694
|
* @name ndax#fetchOrders
|
|
1681
1695
|
* @description fetches information on multiple orders made by the user
|
|
1696
|
+
* @see https://apidoc.ndax.io/#getorderhistory
|
|
1682
1697
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1683
1698
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1684
1699
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1773,6 +1788,7 @@ class ndax extends ndax$1 {
|
|
|
1773
1788
|
* @method
|
|
1774
1789
|
* @name ndax#fetchOrder
|
|
1775
1790
|
* @description fetches information on an order made by the user
|
|
1791
|
+
* @see https://apidoc.ndax.io/#getorderstatus
|
|
1776
1792
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1777
1793
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1778
1794
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1848,6 +1864,7 @@ class ndax extends ndax$1 {
|
|
|
1848
1864
|
* @method
|
|
1849
1865
|
* @name ndax#fetchOrderTrades
|
|
1850
1866
|
* @description fetch all the trades made from a single order
|
|
1867
|
+
* @see https://apidoc.ndax.io/#getorderhistorybyorderid
|
|
1851
1868
|
* @param {string} id order id
|
|
1852
1869
|
* @param {string} symbol unified market symbol
|
|
1853
1870
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -2076,6 +2093,7 @@ class ndax extends ndax$1 {
|
|
|
2076
2093
|
* @method
|
|
2077
2094
|
* @name ndax#fetchWithdrawals
|
|
2078
2095
|
* @description fetch all withdrawals made from an account
|
|
2096
|
+
* @see https://apidoc.ndax.io/#getwithdraws
|
|
2079
2097
|
* @param {string} code unified currency code
|
|
2080
2098
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2081
2099
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -208,7 +208,7 @@ class ascendex extends ascendex$1 {
|
|
|
208
208
|
*/
|
|
209
209
|
await this.loadMarkets();
|
|
210
210
|
const market = this.market(symbol);
|
|
211
|
-
const channel = 'depth
|
|
211
|
+
const channel = 'depth' + ':' + market['id'];
|
|
212
212
|
params = this.extend(params, {
|
|
213
213
|
'ch': channel,
|
|
214
214
|
});
|
|
@@ -218,7 +218,7 @@ class ascendex extends ascendex$1 {
|
|
|
218
218
|
async watchOrderBookSnapshot(symbol, limit = undefined, params = {}) {
|
|
219
219
|
await this.loadMarkets();
|
|
220
220
|
const market = this.market(symbol);
|
|
221
|
-
const action = 'depth-snapshot
|
|
221
|
+
const action = 'depth-snapshot';
|
|
222
222
|
const channel = action + ':' + market['id'];
|
|
223
223
|
params = this.extend(params, {
|
|
224
224
|
'action': action,
|
|
@@ -230,6 +230,15 @@ class ascendex extends ascendex$1 {
|
|
|
230
230
|
const orderbook = await this.watchPublic(channel, params);
|
|
231
231
|
return orderbook.limit();
|
|
232
232
|
}
|
|
233
|
+
async fetchOrderBookSnapshot(symbol, limit = undefined, params = {}) {
|
|
234
|
+
const restOrderBook = await this.fetchRestOrderBookSafe(symbol, limit, params);
|
|
235
|
+
if (!(symbol in this.orderbooks)) {
|
|
236
|
+
this.orderbooks[symbol] = this.orderBook();
|
|
237
|
+
}
|
|
238
|
+
const orderbook = this.orderbooks[symbol];
|
|
239
|
+
orderbook.reset(restOrderBook);
|
|
240
|
+
return orderbook;
|
|
241
|
+
}
|
|
233
242
|
handleOrderBookSnapshot(client, message) {
|
|
234
243
|
//
|
|
235
244
|
// {
|
|
@@ -866,8 +875,8 @@ class ascendex extends ascendex$1 {
|
|
|
866
875
|
'ping': this.handlePing,
|
|
867
876
|
'auth': this.handleAuthenticate,
|
|
868
877
|
'sub': this.handleSubscriptionStatus,
|
|
869
|
-
'depth
|
|
870
|
-
'depth-snapshot
|
|
878
|
+
'depth': this.handleOrderBook,
|
|
879
|
+
'depth-snapshot': this.handleOrderBookSnapshot,
|
|
871
880
|
'trades': this.handleTrades,
|
|
872
881
|
'bar': this.handleOHLCV,
|
|
873
882
|
'balance': this.handleBalance,
|
|
@@ -894,7 +903,7 @@ class ascendex extends ascendex$1 {
|
|
|
894
903
|
// { m: 'sub', id: "1647515701", ch: "depth:BTC/USDT", code: 0 }
|
|
895
904
|
//
|
|
896
905
|
const channel = this.safeString(message, 'ch', '');
|
|
897
|
-
if (channel.indexOf('depth-
|
|
906
|
+
if (channel.indexOf('depth') > -1 && !(channel.indexOf('depth-snapshot') > -1)) {
|
|
898
907
|
this.handleOrderBookSubscription(client, message);
|
|
899
908
|
}
|
|
900
909
|
return message;
|
|
@@ -903,12 +912,18 @@ class ascendex extends ascendex$1 {
|
|
|
903
912
|
const channel = this.safeString(message, 'ch');
|
|
904
913
|
const parts = channel.split(':');
|
|
905
914
|
const marketId = parts[1];
|
|
906
|
-
const
|
|
915
|
+
const market = this.safeMarket(marketId);
|
|
916
|
+
const symbol = market['symbol'];
|
|
907
917
|
if (symbol in this.orderbooks) {
|
|
908
918
|
delete this.orderbooks[symbol];
|
|
909
919
|
}
|
|
910
920
|
this.orderbooks[symbol] = this.orderBook({});
|
|
911
|
-
|
|
921
|
+
if (this.options['defaultType'] === 'swap' || market['contract']) {
|
|
922
|
+
this.spawn(this.fetchOrderBookSnapshot, symbol);
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
this.spawn(this.watchOrderBookSnapshot, symbol);
|
|
926
|
+
}
|
|
912
927
|
}
|
|
913
928
|
async pong(client, message) {
|
|
914
929
|
//
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var hitbtc = require('./hitbtc.js');
|
|
4
|
+
var hitbtc$1 = require('../hitbtc.js');
|
|
4
5
|
var bequant$1 = require('../bequant.js');
|
|
5
6
|
|
|
6
7
|
// ---------------------------------------------------------------------------
|
|
@@ -8,10 +9,8 @@ var bequant$1 = require('../bequant.js');
|
|
|
8
9
|
class bequant extends hitbtc {
|
|
9
10
|
describe() {
|
|
10
11
|
// eslint-disable-next-line new-cap
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
14
|
-
return this.deepExtend(extended, {
|
|
12
|
+
const describeExtended = this.getDescribeForExtendedWsExchange(new bequant$1(), new hitbtc$1(), super.describe());
|
|
13
|
+
return this.deepExtend(describeExtended, {
|
|
15
14
|
'id': 'bequant',
|
|
16
15
|
'name': 'Bequant',
|
|
17
16
|
'countries': ['MT'],
|
|
@@ -34,10 +34,15 @@ class binance extends binance$1 {
|
|
|
34
34
|
'cancelOrderWs': true,
|
|
35
35
|
'cancelOrdersWs': false,
|
|
36
36
|
'cancelAllOrdersWs': true,
|
|
37
|
-
'fetchOrderWs': true,
|
|
38
|
-
'fetchOrdersWs': true,
|
|
39
37
|
'fetchBalanceWs': true,
|
|
38
|
+
'fetchDepositsWs': false,
|
|
39
|
+
'fetchMarketsWs': false,
|
|
40
40
|
'fetchMyTradesWs': true,
|
|
41
|
+
'fetchOpenOrdersWs': true,
|
|
42
|
+
'fetchOrderWs': true,
|
|
43
|
+
'fetchOrdersWs': true,
|
|
44
|
+
'fetchTradingFeesWs': false,
|
|
45
|
+
'fetchWithdrawalsWs': false,
|
|
41
46
|
},
|
|
42
47
|
'urls': {
|
|
43
48
|
'test': {
|
|
@@ -1938,6 +1943,28 @@ class binance extends binance$1 {
|
|
|
1938
1943
|
const orders = await this.watch(url, messageHash, message, messageHash, subscription);
|
|
1939
1944
|
return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
|
|
1940
1945
|
}
|
|
1946
|
+
async fetchClosedOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1947
|
+
/**
|
|
1948
|
+
* @method
|
|
1949
|
+
* @name binance#fetchClosedOrdersWs
|
|
1950
|
+
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data
|
|
1951
|
+
* @description fetch closed orders
|
|
1952
|
+
* @param {string} symbol unified market symbol
|
|
1953
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1954
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1955
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1956
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1957
|
+
*/
|
|
1958
|
+
const orders = await this.fetchOrdersWs(symbol, since, limit, params);
|
|
1959
|
+
const closedOrders = [];
|
|
1960
|
+
for (let i = 0; i < orders.length; i++) {
|
|
1961
|
+
const order = orders[i];
|
|
1962
|
+
if (order['status'] === 'closed') {
|
|
1963
|
+
closedOrders.push(order);
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return closedOrders;
|
|
1967
|
+
}
|
|
1941
1968
|
async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1942
1969
|
/**
|
|
1943
1970
|
* @method
|
|
@@ -962,6 +962,7 @@ class bitget extends bitget$1 {
|
|
|
962
962
|
// "clientOid": "798d1425-d31d-4ada-a51b-ec701e00a1d9",
|
|
963
963
|
// "price": "35000.00",
|
|
964
964
|
// "size": "7.0000",
|
|
965
|
+
// "newSize": "500.0000",
|
|
965
966
|
// "notional": "7.000000",
|
|
966
967
|
// "orderType": "limit",
|
|
967
968
|
// "force": "gtc",
|
|
@@ -1129,6 +1130,7 @@ class bitget extends bitget$1 {
|
|
|
1129
1130
|
// "clientOid": "798d1425-d31d-4ada-a51b-ec701e00a1d9",
|
|
1130
1131
|
// "price": "35000.00",
|
|
1131
1132
|
// "size": "7.0000",
|
|
1133
|
+
// "newSize": "500.0000",
|
|
1132
1134
|
// "notional": "7.000000",
|
|
1133
1135
|
// "orderType": "limit",
|
|
1134
1136
|
// "force": "gtc",
|
|
@@ -1236,6 +1238,25 @@ class bitget extends bitget$1 {
|
|
|
1236
1238
|
};
|
|
1237
1239
|
}
|
|
1238
1240
|
const triggerPrice = this.safeNumber(order, 'triggerPrice');
|
|
1241
|
+
const price = this.safeString(order, 'price');
|
|
1242
|
+
const avgPrice = this.omitZero(this.safeString2(order, 'priceAvg', 'fillPrice'));
|
|
1243
|
+
let cost = this.safeStringN(order, ['notional', 'notionalUsd', 'quoteSize']);
|
|
1244
|
+
const side = this.safeString(order, 'side');
|
|
1245
|
+
const type = this.safeString(order, 'orderType');
|
|
1246
|
+
if (side === 'buy' && market['spot'] && (type === 'market')) {
|
|
1247
|
+
cost = this.safeString(order, 'newSize', cost);
|
|
1248
|
+
}
|
|
1249
|
+
let filled = this.safeString2(order, 'accBaseVolume', 'baseVolume');
|
|
1250
|
+
if (market['spot'] && (rawStatus !== 'live')) {
|
|
1251
|
+
filled = Precise["default"].stringDiv(cost, avgPrice);
|
|
1252
|
+
}
|
|
1253
|
+
let amount = this.safeString(order, 'baseVolume');
|
|
1254
|
+
if (!market['spot'] || !(side === 'buy' && type === 'market')) {
|
|
1255
|
+
amount = this.safeString(order, 'newSize', amount);
|
|
1256
|
+
}
|
|
1257
|
+
if (market['swap'] && (amount === undefined)) {
|
|
1258
|
+
amount = this.safeString(order, 'size');
|
|
1259
|
+
}
|
|
1239
1260
|
return this.safeOrder({
|
|
1240
1261
|
'info': order,
|
|
1241
1262
|
'symbol': symbol,
|
|
@@ -1244,17 +1265,17 @@ class bitget extends bitget$1 {
|
|
|
1244
1265
|
'timestamp': timestamp,
|
|
1245
1266
|
'datetime': this.iso8601(timestamp),
|
|
1246
1267
|
'lastTradeTimestamp': this.safeInteger(order, 'uTime'),
|
|
1247
|
-
'type':
|
|
1268
|
+
'type': type,
|
|
1248
1269
|
'timeInForce': this.safeStringUpper(order, 'force'),
|
|
1249
1270
|
'postOnly': undefined,
|
|
1250
|
-
'side':
|
|
1251
|
-
'price':
|
|
1271
|
+
'side': side,
|
|
1272
|
+
'price': price,
|
|
1252
1273
|
'stopPrice': triggerPrice,
|
|
1253
1274
|
'triggerPrice': triggerPrice,
|
|
1254
|
-
'amount':
|
|
1255
|
-
'cost':
|
|
1256
|
-
'average':
|
|
1257
|
-
'filled':
|
|
1275
|
+
'amount': amount,
|
|
1276
|
+
'cost': cost,
|
|
1277
|
+
'average': avgPrice,
|
|
1278
|
+
'filled': filled,
|
|
1258
1279
|
'remaining': undefined,
|
|
1259
1280
|
'status': this.parseWsOrderStatus(rawStatus),
|
|
1260
1281
|
'fee': feeObject,
|
|
@@ -106,7 +106,7 @@ class bitstamp extends bitstamp$1 {
|
|
|
106
106
|
// usually it takes at least 4-5 deltas to resolve
|
|
107
107
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 6);
|
|
108
108
|
if (cacheLength === snapshotDelay) {
|
|
109
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol);
|
|
109
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, null, {});
|
|
110
110
|
}
|
|
111
111
|
storedOrderBook.cache.push(delta);
|
|
112
112
|
return;
|