ccxt 4.1.1 → 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',
@@ -177438,15 +177548,32 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
177438
177548
  defaultType = this.safeString(options, 'type', defaultType); // Candles or HistoryCandles
177439
177549
  const type = this.safeString(params, 'type', defaultType);
177440
177550
  params = this.omit(params, 'type');
177441
- let method = 'publicGetMarket' + type;
177442
177551
  const isHistoryCandles = (type === 'HistoryCandles');
177552
+ let response = undefined;
177443
177553
  if (price === 'mark') {
177444
- 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
+ }
177445
177560
  }
177446
177561
  else if (price === 'index') {
177447
- 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
+ }
177448
177576
  }
177449
- const response = await this[method](this.extend(request, params));
177450
177577
  //
177451
177578
  // {
177452
177579
  // "code": "0",
@@ -177658,17 +177785,16 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
177658
177785
  */
177659
177786
  await this.loadMarkets();
177660
177787
  const [marketType, query] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
177661
- let method = undefined;
177788
+ const request = {
177789
+ // 'ccy': 'BTC,ETH', // comma-separated list of currency ids
177790
+ };
177791
+ let response = undefined;
177662
177792
  if (marketType === 'funding') {
177663
- method = 'privateGetAssetBalances';
177793
+ response = await this.privateGetAssetBalances(this.extend(request, query));
177664
177794
  }
177665
177795
  else {
177666
- method = 'privateGetAccountBalance';
177796
+ response = await this.privateGetAccountBalance(this.extend(request, query));
177667
177797
  }
177668
- const request = {
177669
- // 'ccy': 'BTC,ETH', // comma-separated list of currency ids
177670
- };
177671
- const response = await this[method](this.extend(request, query));
177672
177798
  //
177673
177799
  // {
177674
177800
  // "code": "0",
@@ -209883,9 +210009,11 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
209883
210009
  'watchTickers': true,
209884
210010
  'watchTrades': true,
209885
210011
  'watchTradesForSymbols': true,
210012
+ 'watchMyTradesForSymbols': true,
209886
210013
  'watchBalance': false,
209887
210014
  'watchStatus': false,
209888
210015
  'watchOrders': true,
210016
+ 'watchOrdersForSymbols': true,
209889
210017
  'watchMyTrades': true,
209890
210018
  },
209891
210019
  'urls': {
@@ -210073,6 +210201,54 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210073
210201
  }
210074
210202
  return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
210075
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
+ }
210076
210252
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
210077
210253
  /**
210078
210254
  * @method
@@ -210212,6 +210388,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210212
210388
  const marketId = this.safeString(message, 'product_id');
210213
210389
  if (marketId !== undefined) {
210214
210390
  const trade = this.parseWsTrade(message);
210391
+ const symbol = trade['symbol'];
210215
210392
  const type = 'myTrades';
210216
210393
  const messageHash = type + ':' + marketId;
210217
210394
  let tradesArray = this.myTrades;
@@ -210222,6 +210399,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210222
210399
  }
210223
210400
  tradesArray.append(trade);
210224
210401
  client.resolve(tradesArray, messageHash);
210402
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleMyTrades::', symbol, tradesArray);
210225
210403
  }
210226
210404
  return message;
210227
210405
  }
@@ -210278,14 +210456,25 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210278
210456
  // }
210279
210457
  const parsed = super.parseTrade(trade);
210280
210458
  let feeRate = undefined;
210459
+ let isMaker = false;
210281
210460
  if ('maker_fee_rate' in trade) {
210461
+ isMaker = true;
210282
210462
  parsed['takerOrMaker'] = 'maker';
210283
210463
  feeRate = this.safeNumber(trade, 'maker_fee_rate');
210284
210464
  }
210285
210465
  else {
210286
210466
  parsed['takerOrMaker'] = 'taker';
210287
210467
  feeRate = this.safeNumber(trade, 'taker_fee_rate');
210288
- }
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);
210289
210478
  market = this.market(parsed['symbol']);
210290
210479
  const feeCurrency = market['quote'];
210291
210480
  let feeCost = undefined;
@@ -210411,6 +210600,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210411
210600
  const parsed = this.parseWsOrder(message);
210412
210601
  orders.append(parsed);
210413
210602
  client.resolve(orders, messageHash);
210603
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleOrders::', symbol, orders);
210414
210604
  }
210415
210605
  else {
210416
210606
  const sequence = this.safeInteger(message, 'sequence');
@@ -210454,6 +210644,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210454
210644
  // update the newUpdates count
210455
210645
  orders.append(previousOrder);
210456
210646
  client.resolve(orders, messageHash);
210647
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleOrders::', symbol, orders);
210457
210648
  }
210458
210649
  else if ((type === 'received') || (type === 'done')) {
210459
210650
  const info = this.extend(previousOrder['info'], message);
@@ -210469,6 +210660,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210469
210660
  // update the newUpdates count
210470
210661
  orders.append(previousOrder);
210471
210662
  client.resolve(orders, messageHash);
210663
+ this.resolvePromiseIfMessagehashMatches(client, 'multipleOrders::', symbol, orders);
210472
210664
  }
210473
210665
  }
210474
210666
  }
@@ -210499,11 +210691,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210499
210691
  remaining = amount - filled;
210500
210692
  }
210501
210693
  }
210502
- let cost = undefined;
210503
- if ((price !== undefined) && (amount !== undefined)) {
210504
- cost = price * amount;
210505
- }
210506
- return {
210694
+ return this.safeOrder({
210507
210695
  'info': order,
210508
210696
  'symbol': symbol,
210509
210697
  'id': id,
@@ -210519,14 +210707,14 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
210519
210707
  'stopPrice': undefined,
210520
210708
  'triggerPrice': undefined,
210521
210709
  'amount': amount,
210522
- 'cost': cost,
210710
+ 'cost': undefined,
210523
210711
  'average': undefined,
210524
210712
  'filled': filled,
210525
210713
  'remaining': remaining,
210526
210714
  'status': status,
210527
210715
  'fee': undefined,
210528
210716
  'trades': undefined,
210529
- };
210717
+ });
210530
210718
  }
210531
210719
  handleTicker(client, message) {
210532
210720
  //
@@ -273607,7 +273795,7 @@ SOFTWARE.
273607
273795
 
273608
273796
  //-----------------------------------------------------------------------------
273609
273797
  // this is updated by vss.js when building
273610
- const version = '4.1.1';
273798
+ const version = '4.1.2';
273611
273799
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273612
273800
  //-----------------------------------------------------------------------------
273613
273801