ccxt 4.0.112 → 4.1.2

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.
@@ -7836,6 +7836,12 @@ class Exchange {
7836
7836
  async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
7837
7837
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchTradesForSymbols() is not supported yet');
7838
7838
  }
7839
+ async watchMyTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
7840
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchMyTradesForSymbols() is not supported yet');
7841
+ }
7842
+ async watchOrdersForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
7843
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchOrdersForSymbols() is not supported yet');
7844
+ }
7839
7845
  async watchOHLCVForSymbols(symbolsAndTimeframes, since = undefined, limit = undefined, params = {}) {
7840
7846
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' watchOHLCVForSymbols() is not supported yet');
7841
7847
  }
@@ -18979,6 +18985,14 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
18979
18985
  * @method
18980
18986
  * @name binance#fetchOHLCV
18981
18987
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
18988
+ * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
18989
+ * @see https://binance-docs.github.io/apidocs/voptions/en/#kline-candlestick-data
18990
+ * @see https://binance-docs.github.io/apidocs/futures/en/#index-price-kline-candlestick-data
18991
+ * @see https://binance-docs.github.io/apidocs/futures/en/#mark-price-kline-candlestick-data
18992
+ * @see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
18993
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-kline-candlestick-data
18994
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-data
18995
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
18982
18996
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
18983
18997
  * @param {string} timeframe the length of time each candle represents
18984
18998
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -20294,6 +20308,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20294
20308
  * @method
20295
20309
  * @name binance#fetchOrder
20296
20310
  * @description fetches information on an order made by the user
20311
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data
20312
+ * @see https://binance-docs.github.io/apidocs/futures/en/#query-order-user_data
20313
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data
20314
+ * @see https://binance-docs.github.io/apidocs/voptions/en/#query-single-order-trade
20315
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-order-user_data
20297
20316
  * @param {string} symbol unified symbol of the market the order was made in
20298
20317
  * @param {object} [params] extra parameters specific to the binance api endpoint
20299
20318
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
@@ -20345,6 +20364,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20345
20364
  * @method
20346
20365
  * @name binance#fetchOrders
20347
20366
  * @description fetches information on multiple orders made by the user
20367
+ * @see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
20368
+ * @see https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data
20369
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
20370
+ * @see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
20371
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
20348
20372
  * @param {string} symbol unified market symbol of the market orders were made in
20349
20373
  * @param {int} [since] the earliest time in ms to fetch orders for
20350
20374
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -20465,6 +20489,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20465
20489
  * @method
20466
20490
  * @name binance#fetchOpenOrders
20467
20491
  * @description fetch all unfilled currently open orders
20492
+ * @see https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data
20493
+ * @see https://binance-docs.github.io/apidocs/futures/en/#current-all-open-orders-user_data
20494
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#current-all-open-orders-user_data
20495
+ * @see https://binance-docs.github.io/apidocs/voptions/en/#query-current-open-option-orders-user_data
20496
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-orders-user_data
20468
20497
  * @param {string} symbol unified market symbol
20469
20498
  * @param {int} [since] the earliest time in ms to fetch open orders for
20470
20499
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -20532,6 +20561,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20532
20561
  * @method
20533
20562
  * @name binance#fetchClosedOrders
20534
20563
  * @description fetches information on multiple closed orders made by the user
20564
+ * @see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
20565
+ * @see https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data
20566
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
20567
+ * @see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
20568
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
20535
20569
  * @param {string} symbol unified market symbol of the market orders were made in
20536
20570
  * @param {int} [since] the earliest time in ms to fetch orders for
20537
20571
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -20571,6 +20605,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20571
20605
  * @method
20572
20606
  * @name binance#cancelOrder
20573
20607
  * @description cancels an open order
20608
+ * @see https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade
20609
+ * @see https://binance-docs.github.io/apidocs/futures/en/#cancel-order-trade
20610
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade
20611
+ * @see https://binance-docs.github.io/apidocs/voptions/en/#cancel-option-order-trade
20612
+ * @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade
20574
20613
  * @param {string} id order id
20575
20614
  * @param {string} symbol unified symbol of the market the order was made in
20576
20615
  * @param {object} [params] extra parameters specific to the binance api endpoint
@@ -20673,6 +20712,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20673
20712
  * @name binance#cancelOrders
20674
20713
  * @description cancel multiple orders
20675
20714
  * @see https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade
20715
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
20676
20716
  * @param {[string]} ids order ids
20677
20717
  * @param {string} [symbol] unified market symbol
20678
20718
  * @param {object} [params] extra parameters specific to the bingx api endpoint
@@ -20741,6 +20781,10 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20741
20781
  * @method
20742
20782
  * @name binance#fetchOrderTrades
20743
20783
  * @description fetch all the trades made from a single order
20784
+ * @see https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
20785
+ * @see https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data
20786
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
20787
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data
20744
20788
  * @param {string} id order id
20745
20789
  * @param {string} symbol unified market symbol
20746
20790
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -20768,6 +20812,10 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20768
20812
  * @method
20769
20813
  * @name binance#fetchMyTrades
20770
20814
  * @description fetch all trades made by the user
20815
+ * @see https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
20816
+ * @see https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data
20817
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
20818
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data
20771
20819
  * @param {string} symbol unified market symbol
20772
20820
  * @param {int} [since] the earliest time in ms to fetch trades for
20773
20821
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -20907,6 +20955,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
20907
20955
  * @method
20908
20956
  * @name binance#fetchMyDustTrades
20909
20957
  * @description fetch all dust trades made by the user
20958
+ * @see https://binance-docs.github.io/apidocs/spot/en/#dustlog-user_data
20910
20959
  * @param {string} symbol not used by binance fetchMyDustTrades ()
20911
20960
  * @param {int} [since] the earliest time in ms to fetch my dust trades for
20912
20961
  * @param {int} [limit] the maximum number of dust trades to retrieve
@@ -21045,6 +21094,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21045
21094
  * @method
21046
21095
  * @name binance#fetchDeposits
21047
21096
  * @description fetch all deposits made to an account
21097
+ * @see https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
21098
+ * @see https://binance-docs.github.io/apidocs/spot/en/#deposit-history-supporting-network-user_data
21048
21099
  * @param {string} code unified currency code
21049
21100
  * @param {int} [since] the earliest time in ms to fetch deposits for
21050
21101
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -21149,6 +21200,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21149
21200
  * @method
21150
21201
  * @name binance#fetchWithdrawals
21151
21202
  * @description fetch all withdrawals made from an account
21203
+ * @see https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
21204
+ * @see https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
21152
21205
  * @param {string} code unified currency code
21153
21206
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
21154
21207
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -21613,6 +21666,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21613
21666
  * @method
21614
21667
  * @name binance#fetchTransfers
21615
21668
  * @description fetch a history of internal transfers made on an account
21669
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history-user_data
21616
21670
  * @param {string} code unified currency code of the currency transferred
21617
21671
  * @param {int} [since] the earliest time in ms to fetch transfers for
21618
21672
  * @param {int} [limit] the maximum number of transfers structures to retrieve
@@ -21676,6 +21730,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21676
21730
  * @method
21677
21731
  * @name binance#fetchDepositAddress
21678
21732
  * @description fetch the deposit address for a currency associated with this account
21733
+ * @see https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data
21679
21734
  * @param {string} code unified currency code
21680
21735
  * @param {object} [params] extra parameters specific to the binance api endpoint
21681
21736
  * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
@@ -21751,6 +21806,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21751
21806
  * @name binance#fetchTransactionFees
21752
21807
  * @deprecated
21753
21808
  * @description please use fetchDepositWithdrawFees instead
21809
+ * @see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
21754
21810
  * @param {string[]|undefined} codes not used by binance fetchTransactionFees ()
21755
21811
  * @param {object} [params] extra parameters specific to the binance api endpoint
21756
21812
  * @returns {object[]} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
@@ -21864,6 +21920,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21864
21920
  * @method
21865
21921
  * @name binance#fetchDepositWithdrawFees
21866
21922
  * @description fetch deposit and withdraw fees
21923
+ * @see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
21867
21924
  * @param {string[]|undefined} codes not used by binance fetchDepositWithdrawFees ()
21868
21925
  * @param {object} [params] extra parameters specific to the binance api endpoint
21869
21926
  * @returns {object[]} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
@@ -21987,6 +22044,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
21987
22044
  * @method
21988
22045
  * @name binance#withdraw
21989
22046
  * @description make a withdrawal
22047
+ * @see https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data
21990
22048
  * @param {string} code unified currency code
21991
22049
  * @param {float} amount the amount to withdraw
21992
22050
  * @param {string} address the address to withdraw to
@@ -22042,6 +22100,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22042
22100
  * @method
22043
22101
  * @name binance#fetchTradingFee
22044
22102
  * @description fetch the trading fees for a market
22103
+ * @see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
22045
22104
  * @param {string} symbol unified market symbol
22046
22105
  * @param {object} [params] extra parameters specific to the binance api endpoint
22047
22106
  * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
@@ -22069,6 +22128,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22069
22128
  * @method
22070
22129
  * @name binance#fetchTradingFees
22071
22130
  * @description fetch the trading fees for multiple markets
22131
+ * @see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
22132
+ * @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
22133
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
22072
22134
  * @param {object} [params] extra parameters specific to the binance api endpoint
22073
22135
  * @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
22074
22136
  */
@@ -22246,6 +22308,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22246
22308
  * @method
22247
22309
  * @name binance#futuresTransfer
22248
22310
  * @description transfer between futures account
22311
+ * @see https://binance-docs.github.io/apidocs/spot/en/#new-future-account-transfer-user_data
22249
22312
  * @param {string} code unified currency code
22250
22313
  * @param {float} amount the amount to transfer
22251
22314
  * @param {string} type 1 - transfer from spot account to USDT-Ⓜ futures account, 2 - transfer from USDT-Ⓜ futures account to spot account, 3 - transfer from spot account to COIN-Ⓜ futures account, 4 - transfer from COIN-Ⓜ futures account to spot account
@@ -22276,6 +22339,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22276
22339
  * @method
22277
22340
  * @name binance#fetchFundingRate
22278
22341
  * @description fetch the current funding rate
22342
+ * @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
22343
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
22279
22344
  * @param {string} symbol unified market symbol
22280
22345
  * @param {object} [params] extra parameters specific to the binance api endpoint
22281
22346
  * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
@@ -22318,6 +22383,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22318
22383
  * @method
22319
22384
  * @name binance#fetchFundingRateHistory
22320
22385
  * @description fetches historical funding rate prices
22386
+ * @see https://binance-docs.github.io/apidocs/futures/en/#get-funding-rate-history
22387
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures
22321
22388
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
22322
22389
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
22323
22390
  * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
@@ -22388,6 +22455,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22388
22455
  * @method
22389
22456
  * @name binance#fetchFundingRates
22390
22457
  * @description fetch the funding rate for multiple markets
22458
+ * @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
22459
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
22391
22460
  * @param {string[]|undefined} symbols list of unified market symbols
22392
22461
  * @param {object} [params] extra parameters specific to the binance api endpoint
22393
22462
  * @returns {object} a dictionary of [funding rates structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rates-structure}, indexe by market symbols
@@ -22916,6 +22985,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22916
22985
  * @method
22917
22986
  * @name binance#fetchLeverageTiers
22918
22987
  * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
22988
+ * @see https://binance-docs.github.io/apidocs/futures/en/#notional-and-leverage-brackets-user_data
22989
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-symbol-user_data
22919
22990
  * @param {string[]|undefined} symbols list of unified market symbols
22920
22991
  * @param {object} [params] extra parameters specific to the binance api endpoint
22921
22992
  * @returns {object} a dictionary of [leverage tiers structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}, indexed by market symbols
@@ -23204,6 +23275,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23204
23275
  * @method
23205
23276
  * @name binance#fetchAccountPositions
23206
23277
  * @description fetch account positions
23278
+ * @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
23279
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
23207
23280
  * @param {string[]|undefined} symbols list of unified market symbols
23208
23281
  * @param {object} [params] extra parameters specific to the binance api endpoint
23209
23282
  * @returns {object} data on account positions
@@ -23241,6 +23314,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23241
23314
  * @name binance#fetchPositionsRisk
23242
23315
  * @description fetch positions risk
23243
23316
  * @see https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
23317
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
23244
23318
  * @param {string[]|undefined} symbols list of unified market symbols
23245
23319
  * @param {object} [params] extra parameters specific to the binance api endpoint
23246
23320
  * @returns {object} data on the positions risk
@@ -23337,6 +23411,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23337
23411
  * @method
23338
23412
  * @name binance#fetchFundingHistory
23339
23413
  * @description fetch the history of funding payments paid and received on this account
23414
+ * @see https://binance-docs.github.io/apidocs/futures/en/#get-income-history-user_data
23415
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#get-income-history-user_data
23340
23416
  * @param {string} symbol unified market symbol
23341
23417
  * @param {int} [since] the earliest time in ms to fetch funding history for
23342
23418
  * @param {int} [limit] the maximum number of funding history structures to retrieve
@@ -23384,6 +23460,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23384
23460
  * @method
23385
23461
  * @name binance#setLeverage
23386
23462
  * @description set the level of leverage for a market
23463
+ * @see https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade
23464
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade
23387
23465
  * @param {float} leverage the rate of leverage
23388
23466
  * @param {string} symbol unified market symbol
23389
23467
  * @param {object} [params] extra parameters specific to the binance api endpoint
@@ -23420,6 +23498,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23420
23498
  * @method
23421
23499
  * @name binance#setMarginMode
23422
23500
  * @description set margin mode to 'cross' or 'isolated'
23501
+ * @see https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade
23502
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#change-margin-type-trade
23423
23503
  * @param {string} marginMode 'cross' or 'isolated'
23424
23504
  * @param {string} symbol unified market symbol
23425
23505
  * @param {object} [params] extra parameters specific to the binance api endpoint
@@ -23488,6 +23568,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23488
23568
  * @method
23489
23569
  * @name binance#setPositionMode
23490
23570
  * @description set hedged to true or false for a market
23571
+ * @see https://binance-docs.github.io/apidocs/futures/en/#change-position-mode-trade
23572
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
23491
23573
  * @param {bool} hedged set to true to use dualSidePosition
23492
23574
  * @param {string} symbol not used by binance setPositionMode ()
23493
23575
  * @param {object} [params] extra parameters specific to the binance api endpoint
@@ -24176,6 +24258,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24176
24258
  * @method
24177
24259
  * @name binance#fetchBorrowRate
24178
24260
  * @description fetch the rate of interest to borrow a currency for margin trading
24261
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
24179
24262
  * @param {string} code unified currency code
24180
24263
  * @param {object} [params] extra parameters specific to the binance api endpoint
24181
24264
  * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
@@ -24205,6 +24288,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24205
24288
  * @method
24206
24289
  * @name binance#fetchBorrowRateHistory
24207
24290
  * @description retrieves a history of a currencies borrow interest rate at specific time slots
24291
+ * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
24208
24292
  * @param {string} code unified currency code
24209
24293
  * @param {int} [since] timestamp for the earliest borrow rate
24210
24294
  * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} to retrieve
@@ -24278,6 +24362,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24278
24362
  * @method
24279
24363
  * @name binance#createGiftCode
24280
24364
  * @description create gift code
24365
+ * @see https://binance-docs.github.io/apidocs/spot/en/#create-a-single-token-gift-card-user_data
24281
24366
  * @param {string} code gift code
24282
24367
  * @param {float} amount amount of currency for the gift
24283
24368
  * @param {object} [params] extra parameters specific to the binance api endpoint
@@ -24315,6 +24400,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24315
24400
  * @method
24316
24401
  * @name binance#redeemGiftCode
24317
24402
  * @description redeem gift code
24403
+ * @see https://binance-docs.github.io/apidocs/spot/en/#redeem-a-binance-gift-card-user_data
24318
24404
  * @param {string} giftcardCode
24319
24405
  * @param {object} [params] extra parameters specific to the binance api endpoint
24320
24406
  * @returns {object} response from the exchange
@@ -24341,6 +24427,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24341
24427
  * @method
24342
24428
  * @name binance#verifyGiftCode
24343
24429
  * @description verify gift code
24430
+ * @see https://binance-docs.github.io/apidocs/spot/en/#verify-binance-gift-card-by-gift-card-number-user_data
24344
24431
  * @param {string} id reference number id
24345
24432
  * @param {object} [params] extra parameters specific to the binance api endpoint
24346
24433
  * @returns {object} response from the exchange
@@ -24364,6 +24451,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24364
24451
  * @method
24365
24452
  * @name binance#fetchBorrowInterest
24366
24453
  * @description fetch the interest owed by the user for borrowing currency for margin trading
24454
+ * @see https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data
24367
24455
  * @param {string} code unified currency code
24368
24456
  * @param {string} symbol unified market symbol when fetch interest in isolated markets
24369
24457
  * @param {int} [since] the earliest time in ms to fetch borrrow interest for
@@ -24516,6 +24604,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24516
24604
  * @method
24517
24605
  * @name binance#fetchOpenInterestHistory
24518
24606
  * @description Retrieves the open interest history of a currency
24607
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#open-interest-statistics
24608
+ * @see https://binance-docs.github.io/apidocs/futures/en/#open-interest-statistics
24519
24609
  * @param {string} symbol Unified CCXT market symbol
24520
24610
  * @param {string} timeframe "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
24521
24611
  * @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
@@ -54899,7 +54989,7 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
54899
54989
  'last': last,
54900
54990
  'previousClose': undefined,
54901
54991
  'change': undefined,
54902
- 'percentage': this.safeString(ticker, 'percentChange'),
54992
+ 'percentage': _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(this.safeString(ticker, 'percentChange'), '10000'),
54903
54993
  'average': undefined,
54904
54994
  'baseVolume': this.safeString(ticker, 'baseVolume'),
54905
54995
  'quoteVolume': this.safeString(ticker, 'quoteVolume'),
@@ -74626,6 +74716,16 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74626
74716
  * @param {float} amount how much of currency you want to trade in units of base currency
74627
74717
  * @param {float} price the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
74628
74718
  * @param {object} [params] extra parameters specific to the bybit api endpoint
74719
+ * @param {float} [params.triggerPrice] The price that a trigger order is triggered at
74720
+ * @param {float} [params.stopLossPrice] The price that a stop loss order is triggered at
74721
+ * @param {float} [params.takeProfitPrice] The price that a take profit order is triggered at
74722
+ * @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered
74723
+ * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
74724
+ * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered
74725
+ * @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
74726
+ * @param {string} [params.triggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice
74727
+ * @param {string} [params.slTriggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss
74728
+ * @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
74629
74729
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
74630
74730
  */
74631
74731
  this.checkRequiredSymbol('editOrder', symbol);
@@ -74668,9 +74768,9 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74668
74768
  if (amount !== undefined) {
74669
74769
  request['qty'] = this.amountToPrecision(symbol, amount);
74670
74770
  }
74671
- let triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
74672
- const stopLossTriggerPrice = this.safeValue(params, 'stopLossPrice');
74673
- const takeProfitTriggerPrice = this.safeValue(params, 'takeProfitPrice');
74771
+ let triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
74772
+ const stopLossTriggerPrice = this.safeString(params, 'stopLossPrice');
74773
+ const takeProfitTriggerPrice = this.safeString(params, 'takeProfitPrice');
74674
74774
  const stopLoss = this.safeValue(params, 'stopLoss');
74675
74775
  const takeProfit = this.safeValue(params, 'takeProfit');
74676
74776
  const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
@@ -74681,16 +74781,25 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74681
74781
  triggerPrice = isStopLossTriggerOrder ? stopLossTriggerPrice : takeProfitTriggerPrice;
74682
74782
  }
74683
74783
  if (triggerPrice !== undefined) {
74684
- request['triggerPrice'] = triggerPrice;
74784
+ const triggerPriceRequest = (triggerPrice === '0') ? triggerPrice : this.priceToPrecision(symbol, triggerPrice);
74785
+ request['triggerPrice'] = triggerPriceRequest;
74786
+ const triggerBy = this.safeString(params, 'triggerBy', 'LastPrice');
74787
+ request['triggerBy'] = triggerBy;
74685
74788
  }
74686
74789
  if (isStopLoss || isTakeProfit) {
74687
74790
  if (isStopLoss) {
74688
- const slTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
74689
- request['stopLoss'] = slTriggerPrice;
74791
+ const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
74792
+ const stopLossRequest = (slTriggerPrice === '0') ? slTriggerPrice : this.priceToPrecision(symbol, slTriggerPrice);
74793
+ request['stopLoss'] = stopLossRequest;
74794
+ const slTriggerBy = this.safeString(params, 'slTriggerBy', 'LastPrice');
74795
+ request['slTriggerBy'] = slTriggerBy;
74690
74796
  }
74691
74797
  if (isTakeProfit) {
74692
- const tpTriggerPrice = this.safeValue2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit);
74693
- request['takeProfit'] = tpTriggerPrice;
74798
+ const tpTriggerPrice = this.safeString2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit);
74799
+ const takeProfitRequest = (tpTriggerPrice === '0') ? tpTriggerPrice : this.priceToPrecision(symbol, tpTriggerPrice);
74800
+ request['takeProfit'] = takeProfitRequest;
74801
+ const tpTriggerBy = this.safeString(params, 'tpTriggerBy', 'LastPrice');
74802
+ request['tpTriggerBy'] = tpTriggerBy;
74694
74803
  }
74695
74804
  }
74696
74805
  const clientOrderId = this.safeString(params, 'clientOrderId');
@@ -82802,6 +82911,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
82802
82911
  },
82803
82912
  'private': {
82804
82913
  'get': [
82914
+ 'address-book',
82805
82915
  'accounts',
82806
82916
  'accounts/{id}',
82807
82917
  'accounts/{id}/holds',
@@ -145799,6 +145909,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
145799
145909
  * @method
145800
145910
  * @name kucoin#fetchTime
145801
145911
  * @description fetches the current integer timestamp in milliseconds from the exchange server
145912
+ * @see https://docs.kucoin.com/#server-time
145802
145913
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
145803
145914
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
145804
145915
  */
@@ -145817,6 +145928,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
145817
145928
  * @method
145818
145929
  * @name kucoin#fetchStatus
145819
145930
  * @description the latest known information on the availability of the exchange API
145931
+ * @see https://docs.kucoin.com/#service-status
145820
145932
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
145821
145933
  * @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
145822
145934
  */
@@ -145845,6 +145957,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
145845
145957
  * @method
145846
145958
  * @name kucoin#fetchMarkets
145847
145959
  * @description retrieves data on all markets for kucoin
145960
+ * @see https://docs.kucoin.com/#get-symbols-list-deprecated
145961
+ * @see https://docs.kucoin.com/#get-all-tickers
145848
145962
  * @param {object} [params] extra parameters specific to the exchange api endpoint
145849
145963
  * @returns {object[]} an array of objects representing market data
145850
145964
  */
@@ -145983,6 +146097,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
145983
146097
  * @method
145984
146098
  * @name kucoin#fetchCurrencies
145985
146099
  * @description fetches all available currencies on an exchange
146100
+ * @see https://docs.kucoin.com/#get-currencies
145986
146101
  * @param {object} params extra parameters specific to the kucoin api endpoint
145987
146102
  * @returns {object} an associative dictionary of currencies
145988
146103
  */
@@ -146080,7 +146195,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146080
146195
  }
146081
146196
  for (let j = 0; j < chainsLength; j++) {
146082
146197
  const chain = chains[j];
146083
- const chainId = this.safeString(chain, 'chain');
146198
+ const chainId = this.safeString(chain, 'chainId');
146084
146199
  const networkCode = this.networkIdToCode(chainId);
146085
146200
  const chainWithdrawEnabled = this.safeValue(chain, 'isWithdrawEnabled', false);
146086
146201
  if (isWithdrawEnabled === undefined) {
@@ -146143,6 +146258,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146143
146258
  * @method
146144
146259
  * @name kucoin#fetchAccounts
146145
146260
  * @description fetch all the accounts associated with a profile
146261
+ * @see https://docs.kucoin.com/#list-accounts
146146
146262
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
146147
146263
  * @returns {object} a dictionary of [account structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#account-structure} indexed by the account type
146148
146264
  */
@@ -146420,6 +146536,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146420
146536
  * @method
146421
146537
  * @name kucoin#fetchTickers
146422
146538
  * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
146539
+ * @see https://docs.kucoin.com/#get-all-tickers
146423
146540
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
146424
146541
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
146425
146542
  * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -146474,6 +146591,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146474
146591
  * @method
146475
146592
  * @name kucoin#fetchTicker
146476
146593
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
146594
+ * @see https://docs.kucoin.com/#get-24hr-stats
146477
146595
  * @param {string} symbol unified symbol of the market to fetch the ticker for
146478
146596
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
146479
146597
  * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -146535,6 +146653,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146535
146653
  * @method
146536
146654
  * @name kucoin#fetchOHLCV
146537
146655
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
146656
+ * @see https://docs.kucoin.com/#get-klines
146538
146657
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
146539
146658
  * @param {string} timeframe the length of time each candle represents
146540
146659
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -146614,6 +146733,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146614
146733
  * @method
146615
146734
  * @name kucoin#fetchDepositAddress
146616
146735
  * @description fetch the deposit address for a currency associated with this account
146736
+ * @see https://docs.kucoin.com/#get-deposit-addresses-v2
146617
146737
  * @param {string} code unified currency code
146618
146738
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
146619
146739
  * @param {string} [params.network] the blockchain network name
@@ -146711,6 +146831,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
146711
146831
  * @method
146712
146832
  * @name kucoin#fetchOrderBook
146713
146833
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
146834
+ * @see https://docs.kucoin.com/#get-part-order-book-aggregated
146835
+ * @see https://docs.kucoin.com/#get-full-order-book-aggregated
146714
146836
  * @param {string} symbol unified symbol of the market to fetch the order book for
146715
146837
  * @param {int} [limit] the maximum amount of order book entries to return
146716
146838
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
@@ -147181,6 +147303,10 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147181
147303
  * @method
147182
147304
  * @name kucoin#fetchClosedOrders
147183
147305
  * @description fetches information on multiple closed orders made by the user
147306
+ * @see https://docs.kucoin.com/spot#list-orders
147307
+ * @see https://docs.kucoin.com/spot#list-stop-orders
147308
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
147309
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
147184
147310
  * @param {string} symbol unified market symbol of the market orders were made in
147185
147311
  * @param {int} [since] the earliest time in ms to fetch orders for
147186
147312
  * @param {int} [limit] the maximum number of orde structures to retrieve
@@ -147200,6 +147326,10 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147200
147326
  * @method
147201
147327
  * @name kucoin#fetchOpenOrders
147202
147328
  * @description fetch all unfilled currently open orders
147329
+ * @see https://docs.kucoin.com/spot#list-orders
147330
+ * @see https://docs.kucoin.com/spot#list-stop-orders
147331
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
147332
+ * @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
147203
147333
  * @param {string} symbol unified market symbol
147204
147334
  * @param {int} [since] the earliest time in ms to fetch open orders for
147205
147335
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -147476,6 +147606,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147476
147606
  * @method
147477
147607
  * @name kucoin#fetchOrderTrades
147478
147608
  * @description fetch all the trades made from a single order
147609
+ * @see https://docs.kucoin.com/#list-fills
147610
+ * @see https://docs.kucoin.com/spot-hf/#transaction-details
147479
147611
  * @param {string} id order id
147480
147612
  * @param {string} symbol unified market symbol
147481
147613
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -147601,6 +147733,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147601
147733
  * @method
147602
147734
  * @name kucoin#fetchTrades
147603
147735
  * @description get the list of most recent trades for a particular symbol
147736
+ * @see https://docs.kucoin.com/#get-trade-histories
147604
147737
  * @param {string} symbol unified symbol of the market to fetch trades for
147605
147738
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
147606
147739
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -147773,6 +147906,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147773
147906
  * @method
147774
147907
  * @name kucoin#fetchTradingFee
147775
147908
  * @description fetch the trading fees for a market
147909
+ * @see https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
147776
147910
  * @param {string} symbol unified market symbol
147777
147911
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
147778
147912
  * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
@@ -147812,6 +147946,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147812
147946
  * @method
147813
147947
  * @name kucoin#withdraw
147814
147948
  * @description make a withdrawal
147949
+ * @see https://docs.kucoin.com/#apply-withdraw-2
147815
147950
  * @param {string} code unified currency code
147816
147951
  * @param {float} amount the amount to withdraw
147817
147952
  * @param {string} address the address to withdraw to
@@ -147984,6 +148119,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147984
148119
  * @method
147985
148120
  * @name kucoin#fetchDeposits
147986
148121
  * @description fetch all deposits made to an account
148122
+ * @see https://docs.kucoin.com/#get-deposit-list
148123
+ * @see https://docs.kucoin.com/#get-v1-historical-deposits-list
147987
148124
  * @param {string} code unified currency code
147988
148125
  * @param {int} [since] the earliest time in ms to fetch deposits for
147989
148126
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -148058,6 +148195,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
148058
148195
  * @method
148059
148196
  * @name kucoin#fetchWithdrawals
148060
148197
  * @description fetch all withdrawals made from an account
148198
+ * @see https://docs.kucoin.com/#get-withdrawals-list
148199
+ * @see https://docs.kucoin.com/#get-v1-historical-withdrawals-list
148061
148200
  * @param {string} code unified currency code
148062
148201
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
148063
148202
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -148572,6 +148711,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
148572
148711
  * @method
148573
148712
  * @name kucoin#fetchLedger
148574
148713
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
148714
+ * @see https://docs.kucoin.com/#get-account-ledgers
148575
148715
  * @param {string} code unified currency code, default is undefined
148576
148716
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
148577
148717
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -152476,9 +152616,9 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
152476
152616
  'cancelOrder': true,
152477
152617
  'createOrder': true,
152478
152618
  'createPostOnlyOrder': false,
152479
- 'createStopOrder': true,
152480
152619
  'createStopLimitOrder': true,
152481
152620
  'createStopMarketOrder': false,
152621
+ 'createStopOrder': true,
152482
152622
  'fetchBalance': true,
152483
152623
  'fetchBorrowRate': false,
152484
152624
  'fetchBorrowRateHistories': false,
@@ -177408,15 +177548,32 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
177408
177548
  defaultType = this.safeString(options, 'type', defaultType); // Candles or HistoryCandles
177409
177549
  const type = this.safeString(params, 'type', defaultType);
177410
177550
  params = this.omit(params, 'type');
177411
- let method = 'publicGetMarket' + type;
177412
177551
  const isHistoryCandles = (type === 'HistoryCandles');
177552
+ let response = undefined;
177413
177553
  if (price === 'mark') {
177414
- method = (isHistoryCandles) ? 'publicGetMarketHistoryMarkPriceCandles' : 'publicGetMarketMarkPriceCandles';
177554
+ if (isHistoryCandles) {
177555
+ response = await this.publicGetMarketHistoryMarkPriceCandles(this.extend(request, params));
177556
+ }
177557
+ else {
177558
+ response = await this.publicGetMarketMarkPriceCandles(this.extend(request, params));
177559
+ }
177415
177560
  }
177416
177561
  else if (price === 'index') {
177417
- method = (isHistoryCandles) ? 'publicGetMarketHistoryIndexCandles' : 'publicGetMarketIndexCandles';
177562
+ if (isHistoryCandles) {
177563
+ response = await this.publicGetMarketHistoryIndexCandles(this.extend(request, params));
177564
+ }
177565
+ else {
177566
+ response = await this.publicGetMarketIndexCandles(this.extend(request, params));
177567
+ }
177568
+ }
177569
+ else {
177570
+ if (isHistoryCandles) {
177571
+ response = await this.publicGetMarketHistoryCandles(this.extend(request, params));
177572
+ }
177573
+ else {
177574
+ response = await this.publicGetMarketCandles(this.extend(request, params));
177575
+ }
177418
177576
  }
177419
- const response = await this[method](this.extend(request, params));
177420
177577
  //
177421
177578
  // {
177422
177579
  // "code": "0",
@@ -177628,17 +177785,16 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
177628
177785
  */
177629
177786
  await this.loadMarkets();
177630
177787
  const [marketType, query] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
177631
- let method = undefined;
177788
+ const request = {
177789
+ // 'ccy': 'BTC,ETH', // comma-separated list of currency ids
177790
+ };
177791
+ let response = undefined;
177632
177792
  if (marketType === 'funding') {
177633
- method = 'privateGetAssetBalances';
177793
+ response = await this.privateGetAssetBalances(this.extend(request, query));
177634
177794
  }
177635
177795
  else {
177636
- method = 'privateGetAccountBalance';
177796
+ response = await this.privateGetAccountBalance(this.extend(request, query));
177637
177797
  }
177638
- const request = {
177639
- // 'ccy': 'BTC,ETH', // comma-separated list of currency ids
177640
- };
177641
- const response = await this[method](this.extend(request, query));
177642
177798
  //
177643
177799
  // {
177644
177800
  // "code": "0",
@@ -209853,9 +210009,11 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
209853
210009
  'watchTickers': true,
209854
210010
  'watchTrades': true,
209855
210011
  'watchTradesForSymbols': true,
210012
+ 'watchMyTradesForSymbols': true,
209856
210013
  'watchBalance': false,
209857
210014
  'watchStatus': false,
209858
210015
  'watchOrders': true,
210016
+ 'watchOrdersForSymbols': true,
209859
210017
  'watchMyTrades': true,
209860
210018
  },
209861
210019
  'urls': {
@@ -210043,6 +210201,54 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210043
210201
  }
210044
210202
  return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
210045
210203
  }
210204
+ async watchMyTradesForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
210205
+ /**
210206
+ * @method
210207
+ * @name coinbasepro#watchMyTradesForSymbols
210208
+ * @description watches information on multiple trades made by the user
210209
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
210210
+ * @param {int} [since] the earliest time in ms to fetch trades for
210211
+ * @param {int} [limit] the maximum number of trade structures to retrieve
210212
+ * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
210213
+ * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
210214
+ */
210215
+ symbols = this.marketSymbols(symbols, undefined, false);
210216
+ await this.loadMarkets();
210217
+ const name = 'user';
210218
+ const messageHash = 'multipleMyTrades::';
210219
+ const authentication = this.authenticate();
210220
+ const trades = await this.subscribeMultiple(name, symbols, messageHash, this.extend(params, authentication));
210221
+ if (this.newUpdates) {
210222
+ const first = this.safeValue(trades, 0);
210223
+ const tradeSymbol = this.safeString(first, 'symbol');
210224
+ limit = trades.getLimit(tradeSymbol, limit);
210225
+ }
210226
+ return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
210227
+ }
210228
+ async watchOrdersForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
210229
+ /**
210230
+ * @method
210231
+ * @name coinbasepro#watchOrdersForSymbols
210232
+ * @description watches information on multiple orders made by the user
210233
+ * @param {string[]} symbols unified symbol of the market to fetch orders for
210234
+ * @param {int} [since] the earliest time in ms to fetch orders for
210235
+ * @param {int} [limit] the maximum number of trade structures to retrieve
210236
+ * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
210237
+ * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
210238
+ */
210239
+ symbols = this.marketSymbols(symbols, undefined, false);
210240
+ await this.loadMarkets();
210241
+ const name = 'user';
210242
+ const messageHash = 'multipleOrders::';
210243
+ const authentication = this.authenticate();
210244
+ const orders = await this.subscribeMultiple(name, symbols, messageHash, this.extend(params, authentication));
210245
+ if (this.newUpdates) {
210246
+ const first = this.safeValue(orders, 0);
210247
+ const tradeSymbol = this.safeString(first, 'symbol');
210248
+ limit = orders.getLimit(tradeSymbol, limit);
210249
+ }
210250
+ return this.filterBySinceLimit(orders, since, limit, 'timestamp', true);
210251
+ }
210046
210252
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
210047
210253
  /**
210048
210254
  * @method
@@ -210182,6 +210388,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210182
210388
  const marketId = this.safeString(message, 'product_id');
210183
210389
  if (marketId !== undefined) {
210184
210390
  const trade = this.parseWsTrade(message);
210391
+ const symbol = trade['symbol'];
210185
210392
  const type = 'myTrades';
210186
210393
  const messageHash = type + ':' + marketId;
210187
210394
  let tradesArray = this.myTrades;
@@ -210192,6 +210399,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210192
210399
  }
210193
210400
  tradesArray.append(trade);
210194
210401
  client.resolve(tradesArray, messageHash);
210402
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleMyTrades::', symbol, tradesArray);
210195
210403
  }
210196
210404
  return message;
210197
210405
  }
@@ -210248,14 +210456,25 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210248
210456
  // }
210249
210457
  const parsed = super.parseTrade(trade);
210250
210458
  let feeRate = undefined;
210459
+ let isMaker = false;
210251
210460
  if ('maker_fee_rate' in trade) {
210461
+ isMaker = true;
210252
210462
  parsed['takerOrMaker'] = 'maker';
210253
210463
  feeRate = this.safeNumber(trade, 'maker_fee_rate');
210254
210464
  }
210255
210465
  else {
210256
210466
  parsed['takerOrMaker'] = 'taker';
210257
210467
  feeRate = this.safeNumber(trade, 'taker_fee_rate');
210258
- }
210468
+ // side always represents the maker side of the trade
210469
+ // so if we're taker, we invert it
210470
+ const currentSide = parsed['side'];
210471
+ parsed['side'] = this.safeString({
210472
+ 'buy': 'sell',
210473
+ 'sell': 'buy',
210474
+ }, currentSide, currentSide);
210475
+ }
210476
+ const idKey = isMaker ? 'maker_order_id' : 'taker_order_id';
210477
+ parsed['order'] = this.safeString(trade, idKey);
210259
210478
  market = this.market(parsed['symbol']);
210260
210479
  const feeCurrency = market['quote'];
210261
210480
  let feeCost = undefined;
@@ -210381,6 +210600,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210381
210600
  const parsed = this.parseWsOrder(message);
210382
210601
  orders.append(parsed);
210383
210602
  client.resolve(orders, messageHash);
210603
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleOrders::', symbol, orders);
210384
210604
  }
210385
210605
  else {
210386
210606
  const sequence = this.safeInteger(message, 'sequence');
@@ -210424,6 +210644,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210424
210644
  // update the newUpdates count
210425
210645
  orders.append(previousOrder);
210426
210646
  client.resolve(orders, messageHash);
210647
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleOrders::', symbol, orders);
210427
210648
  }
210428
210649
  else if ((type === 'received') || (type === 'done')) {
210429
210650
  const info = this.extend(previousOrder['info'], message);
@@ -210439,6 +210660,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210439
210660
  // update the newUpdates count
210440
210661
  orders.append(previousOrder);
210441
210662
  client.resolve(orders, messageHash);
210663
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleOrders::', symbol, orders);
210442
210664
  }
210443
210665
  }
210444
210666
  }
@@ -210469,11 +210691,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210469
210691
  remaining = amount - filled;
210470
210692
  }
210471
210693
  }
210472
- let cost = undefined;
210473
- if ((price !== undefined) && (amount !== undefined)) {
210474
- cost = price * amount;
210475
- }
210476
- return {
210694
+ return this.safeOrder({
210477
210695
  'info': order,
210478
210696
  'symbol': symbol,
210479
210697
  'id': id,
@@ -210489,14 +210707,14 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210489
210707
  'stopPrice': undefined,
210490
210708
  'triggerPrice': undefined,
210491
210709
  'amount': amount,
210492
- 'cost': cost,
210710
+ 'cost': undefined,
210493
210711
  'average': undefined,
210494
210712
  'filled': filled,
210495
210713
  'remaining': remaining,
210496
210714
  'status': status,
210497
210715
  'fee': undefined,
210498
210716
  'trades': undefined,
210499
- };
210717
+ });
210500
210718
  }
210501
210719
  handleTicker(client, message) {
210502
210720
  //
@@ -230498,8 +230716,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
230498
230716
  // filter orders with no last trade id
230499
230717
  for (let i = 0; i < rawOrders.length; i++) {
230500
230718
  const rawOrder = rawOrders[i];
230501
- const tradeId = this.safeString(rawOrder, 'tradeId');
230502
- if (!this.isEmpty(tradeId)) {
230719
+ const tradeId = this.safeString(rawOrder, 'tradeId', '');
230720
+ if (tradeId.length > 0) {
230503
230721
  const order = this.parseOrder(rawOrder);
230504
230722
  filteredOrders.push(order);
230505
230723
  }
@@ -273577,7 +273795,7 @@ SOFTWARE.
273577
273795
 
273578
273796
  //-----------------------------------------------------------------------------
273579
273797
  // this is updated by vss.js when building
273580
- const version = '4.0.112';
273798
+ const version = '4.1.2';
273581
273799
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273582
273800
  //-----------------------------------------------------------------------------
273583
273801