ccxt 4.0.112__py2.py3-none-any.whl → 4.1.2__py2.py3-none-any.whl

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.
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.0.112'
25
+ __version__ = '4.1.2'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -12,6 +12,7 @@ class ImplicitAPI:
12
12
  public_get_products_id_trades = publicGetProductsIdTrades = Entry('products/{id}/trades', 'public', 'GET', {})
13
13
  public_get_time = publicGetTime = Entry('time', 'public', 'GET', {})
14
14
  public_get_products_spark_lines = publicGetProductsSparkLines = Entry('products/spark-lines', 'public', 'GET', {})
15
+ private_get_address_book = privateGetAddressBook = Entry('address-book', 'private', 'GET', {})
15
16
  private_get_accounts = privateGetAccounts = Entry('accounts', 'private', 'GET', {})
16
17
  private_get_accounts_id = privateGetAccountsId = Entry('accounts/{id}', 'private', 'GET', {})
17
18
  private_get_accounts_id_holds = privateGetAccountsIdHolds = Entry('accounts/{id}/holds', 'private', 'GET', {})
@@ -12,6 +12,7 @@ class ImplicitAPI:
12
12
  public_get_products_id_trades = publicGetProductsIdTrades = Entry('products/{id}/trades', 'public', 'GET', {})
13
13
  public_get_time = publicGetTime = Entry('time', 'public', 'GET', {})
14
14
  public_get_products_spark_lines = publicGetProductsSparkLines = Entry('products/spark-lines', 'public', 'GET', {})
15
+ private_get_address_book = privateGetAddressBook = Entry('address-book', 'private', 'GET', {})
15
16
  private_get_accounts = privateGetAccounts = Entry('accounts', 'private', 'GET', {})
16
17
  private_get_accounts_id = privateGetAccountsId = Entry('accounts/{id}', 'private', 'GET', {})
17
18
  private_get_accounts_id_holds = privateGetAccountsIdHolds = Entry('accounts/{id}/holds', 'private', 'GET', {})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.0.112'
7
+ __version__ = '4.1.2'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.0.112'
5
+ __version__ = '4.1.2'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -670,6 +670,12 @@ class Exchange(BaseExchange):
670
670
  async def watch_trades_for_symbols(self, symbols: List[str], since: Optional[int] = None, limit: Optional[int] = None, params={}):
671
671
  raise NotSupported(self.id + ' watchTradesForSymbols() is not supported yet')
672
672
 
673
+ async def watch_my_trades_for_symbols(self, symbols: List[str], since: Optional[int] = None, limit: Optional[int] = None, params={}):
674
+ raise NotSupported(self.id + ' watchMyTradesForSymbols() is not supported yet')
675
+
676
+ async def watch_orders_for_symbols(self, symbols: List[str], since: Optional[int] = None, limit: Optional[int] = None, params={}):
677
+ raise NotSupported(self.id + ' watchOrdersForSymbols() is not supported yet')
678
+
673
679
  async def watch_ohlcv_for_symbols(self, symbolsAndTimeframes: List[List[str]], since: Optional[int] = None, limit: Optional[int] = None, params={}):
674
680
  raise NotSupported(self.id + ' watchOHLCVForSymbols() is not supported yet')
675
681
 
@@ -3201,6 +3201,14 @@ class binance(Exchange, ImplicitAPI):
3201
3201
  async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
3202
3202
  """
3203
3203
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3204
+ see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
3205
+ see https://binance-docs.github.io/apidocs/voptions/en/#kline-candlestick-data
3206
+ see https://binance-docs.github.io/apidocs/futures/en/#index-price-kline-candlestick-data
3207
+ see https://binance-docs.github.io/apidocs/futures/en/#mark-price-kline-candlestick-data
3208
+ see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
3209
+ see https://binance-docs.github.io/apidocs/delivery/en/#index-price-kline-candlestick-data
3210
+ see https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-data
3211
+ see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
3204
3212
  :param str symbol: unified symbol of the market to fetch OHLCV data for
3205
3213
  :param str timeframe: the length of time each candle represents
3206
3214
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -4360,6 +4368,11 @@ class binance(Exchange, ImplicitAPI):
4360
4368
  async def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
4361
4369
  """
4362
4370
  fetches information on an order made by the user
4371
+ see https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data
4372
+ see https://binance-docs.github.io/apidocs/futures/en/#query-order-user_data
4373
+ see https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data
4374
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-single-order-trade
4375
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-order-user_data
4363
4376
  :param str symbol: unified symbol of the market the order was made in
4364
4377
  :param dict [params]: extra parameters specific to the binance api endpoint
4365
4378
  :param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
@@ -4400,6 +4413,11 @@ class binance(Exchange, ImplicitAPI):
4400
4413
  async def fetch_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4401
4414
  """
4402
4415
  fetches information on multiple orders made by the user
4416
+ see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
4417
+ see https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data
4418
+ see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
4419
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
4420
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
4403
4421
  :param str symbol: unified market symbol of the market orders were made in
4404
4422
  :param int [since]: the earliest time in ms to fetch orders for
4405
4423
  :param int [limit]: the maximum number of order structures to retrieve
@@ -4511,6 +4529,11 @@ class binance(Exchange, ImplicitAPI):
4511
4529
  async def fetch_open_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4512
4530
  """
4513
4531
  fetch all unfilled currently open orders
4532
+ see https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data
4533
+ see https://binance-docs.github.io/apidocs/futures/en/#current-all-open-orders-user_data
4534
+ see https://binance-docs.github.io/apidocs/delivery/en/#current-all-open-orders-user_data
4535
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-current-open-option-orders-user_data
4536
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-orders-user_data
4514
4537
  :param str symbol: unified market symbol
4515
4538
  :param int [since]: the earliest time in ms to fetch open orders for
4516
4539
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -4565,6 +4588,11 @@ class binance(Exchange, ImplicitAPI):
4565
4588
  async def fetch_closed_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4566
4589
  """
4567
4590
  fetches information on multiple closed orders made by the user
4591
+ see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
4592
+ see https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data
4593
+ see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
4594
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
4595
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
4568
4596
  :param str symbol: unified market symbol of the market orders were made in
4569
4597
  :param int [since]: the earliest time in ms to fetch orders for
4570
4598
  :param int [limit]: the maximum number of order structures to retrieve
@@ -4599,6 +4627,11 @@ class binance(Exchange, ImplicitAPI):
4599
4627
  async def cancel_order(self, id: str, symbol: Optional[str] = None, params={}):
4600
4628
  """
4601
4629
  cancels an open order
4630
+ see https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade
4631
+ see https://binance-docs.github.io/apidocs/futures/en/#cancel-order-trade
4632
+ see https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade
4633
+ see https://binance-docs.github.io/apidocs/voptions/en/#cancel-option-order-trade
4634
+ see https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade
4602
4635
  :param str id: order id
4603
4636
  :param str symbol: unified symbol of the market the order was made in
4604
4637
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -4681,6 +4714,7 @@ class binance(Exchange, ImplicitAPI):
4681
4714
  """
4682
4715
  cancel multiple orders
4683
4716
  see https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade
4717
+ see https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
4684
4718
  :param [str] ids: order ids
4685
4719
  :param str [symbol]: unified market symbol
4686
4720
  :param dict [params]: extra parameters specific to the bingx api endpoint
@@ -4744,6 +4778,10 @@ class binance(Exchange, ImplicitAPI):
4744
4778
  async def fetch_order_trades(self, id: str, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4745
4779
  """
4746
4780
  fetch all the trades made from a single order
4781
+ see https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
4782
+ see https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data
4783
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
4784
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data
4747
4785
  :param str id: order id
4748
4786
  :param str symbol: unified market symbol
4749
4787
  :param int [since]: the earliest time in ms to fetch trades for
@@ -4767,6 +4805,10 @@ class binance(Exchange, ImplicitAPI):
4767
4805
  async def fetch_my_trades(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4768
4806
  """
4769
4807
  fetch all trades made by the user
4808
+ see https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
4809
+ see https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data
4810
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
4811
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data
4770
4812
  :param str symbol: unified market symbol
4771
4813
  :param int [since]: the earliest time in ms to fetch trades for
4772
4814
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -4890,6 +4932,7 @@ class binance(Exchange, ImplicitAPI):
4890
4932
  async def fetch_my_dust_trades(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4891
4933
  """
4892
4934
  fetch all dust trades made by the user
4935
+ see https://binance-docs.github.io/apidocs/spot/en/#dustlog-user_data
4893
4936
  :param str symbol: not used by binance fetchMyDustTrades()
4894
4937
  :param int [since]: the earliest time in ms to fetch my dust trades for
4895
4938
  :param int [limit]: the maximum number of dust trades to retrieve
@@ -5018,6 +5061,8 @@ class binance(Exchange, ImplicitAPI):
5018
5061
  async def fetch_deposits(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
5019
5062
  """
5020
5063
  fetch all deposits made to an account
5064
+ see https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
5065
+ see https://binance-docs.github.io/apidocs/spot/en/#deposit-history-supporting-network-user_data
5021
5066
  :param str code: unified currency code
5022
5067
  :param int [since]: the earliest time in ms to fetch deposits for
5023
5068
  :param int [limit]: the maximum number of deposits structures to retrieve
@@ -5110,6 +5155,8 @@ class binance(Exchange, ImplicitAPI):
5110
5155
  async def fetch_withdrawals(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
5111
5156
  """
5112
5157
  fetch all withdrawals made from an account
5158
+ see https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
5159
+ see https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
5113
5160
  :param str code: unified currency code
5114
5161
  :param int [since]: the earliest time in ms to fetch withdrawals for
5115
5162
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -5537,6 +5584,7 @@ class binance(Exchange, ImplicitAPI):
5537
5584
  async def fetch_transfers(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
5538
5585
  """
5539
5586
  fetch a history of internal transfers made on an account
5587
+ see https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history-user_data
5540
5588
  :param str code: unified currency code of the currency transferred
5541
5589
  :param int [since]: the earliest time in ms to fetch transfers for
5542
5590
  :param int [limit]: the maximum number of transfers structures to retrieve
@@ -5592,6 +5640,7 @@ class binance(Exchange, ImplicitAPI):
5592
5640
  async def fetch_deposit_address(self, code: str, params={}):
5593
5641
  """
5594
5642
  fetch the deposit address for a currency associated with self account
5643
+ see https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data
5595
5644
  :param str code: unified currency code
5596
5645
  :param dict [params]: extra parameters specific to the binance api endpoint
5597
5646
  :returns dict: an `address structure <https://github.com/ccxt/ccxt/wiki/Manual#address-structure>`
@@ -5659,6 +5708,7 @@ class binance(Exchange, ImplicitAPI):
5659
5708
  """
5660
5709
  * @deprecated
5661
5710
  please use fetchDepositWithdrawFees instead
5711
+ see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
5662
5712
  :param str[]|None codes: not used by binance fetchTransactionFees()
5663
5713
  :param dict [params]: extra parameters specific to the binance api endpoint
5664
5714
  :returns dict[]: a list of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5768,6 +5818,7 @@ class binance(Exchange, ImplicitAPI):
5768
5818
  async def fetch_deposit_withdraw_fees(self, codes: Optional[List[str]] = None, params={}):
5769
5819
  """
5770
5820
  fetch deposit and withdraw fees
5821
+ see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
5771
5822
  :param str[]|None codes: not used by binance fetchDepositWithdrawFees()
5772
5823
  :param dict [params]: extra parameters specific to the binance api endpoint
5773
5824
  :returns dict[]: a list of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5887,6 +5938,7 @@ class binance(Exchange, ImplicitAPI):
5887
5938
  async def withdraw(self, code: str, amount, address, tag=None, params={}):
5888
5939
  """
5889
5940
  make a withdrawal
5941
+ see https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data
5890
5942
  :param str code: unified currency code
5891
5943
  :param float amount: the amount to withdraw
5892
5944
  :param str address: the address to withdraw to
@@ -5938,6 +5990,7 @@ class binance(Exchange, ImplicitAPI):
5938
5990
  async def fetch_trading_fee(self, symbol: str, params={}):
5939
5991
  """
5940
5992
  fetch the trading fees for a market
5993
+ see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
5941
5994
  :param str symbol: unified market symbol
5942
5995
  :param dict [params]: extra parameters specific to the binance api endpoint
5943
5996
  :returns dict: a `fee structure <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5963,6 +6016,9 @@ class binance(Exchange, ImplicitAPI):
5963
6016
  async def fetch_trading_fees(self, params={}):
5964
6017
  """
5965
6018
  fetch the trading fees for multiple markets
6019
+ see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
6020
+ see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
6021
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
5966
6022
  :param dict [params]: extra parameters specific to the binance api endpoint
5967
6023
  :returns dict: a dictionary of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>` indexed by market symbols
5968
6024
  """
@@ -6127,6 +6183,7 @@ class binance(Exchange, ImplicitAPI):
6127
6183
  async def futures_transfer(self, code: str, amount, type, params={}):
6128
6184
  """
6129
6185
  transfer between futures account
6186
+ see https://binance-docs.github.io/apidocs/spot/en/#new-future-account-transfer-user_data
6130
6187
  :param str code: unified currency code
6131
6188
  :param float amount: the amount to transfer
6132
6189
  :param str 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
@@ -6154,6 +6211,8 @@ class binance(Exchange, ImplicitAPI):
6154
6211
  async def fetch_funding_rate(self, symbol: str, params={}):
6155
6212
  """
6156
6213
  fetch the current funding rate
6214
+ see https://binance-docs.github.io/apidocs/futures/en/#mark-price
6215
+ see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
6157
6216
  :param str symbol: unified market symbol
6158
6217
  :param dict [params]: extra parameters specific to the binance api endpoint
6159
6218
  :returns dict: a `funding rate structure <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure>`
@@ -6190,6 +6249,8 @@ class binance(Exchange, ImplicitAPI):
6190
6249
  async def fetch_funding_rate_history(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
6191
6250
  """
6192
6251
  fetches historical funding rate prices
6252
+ see https://binance-docs.github.io/apidocs/futures/en/#get-funding-rate-history
6253
+ see https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures
6193
6254
  :param str symbol: unified symbol of the market to fetch the funding rate history for
6194
6255
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
6195
6256
  :param int [limit]: the maximum amount of `funding rate structures <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure>` to fetch
@@ -6250,6 +6311,8 @@ class binance(Exchange, ImplicitAPI):
6250
6311
  async def fetch_funding_rates(self, symbols: Optional[List[str]] = None, params={}):
6251
6312
  """
6252
6313
  fetch the funding rate for multiple markets
6314
+ see https://binance-docs.github.io/apidocs/futures/en/#mark-price
6315
+ see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
6253
6316
  :param str[]|None symbols: list of unified market symbols
6254
6317
  :param dict [params]: extra parameters specific to the binance api endpoint
6255
6318
  :returns dict: a dictionary of `funding rates structures <https://github.com/ccxt/ccxt/wiki/Manual#funding-rates-structure>`, indexe by market symbols
@@ -6730,6 +6793,8 @@ class binance(Exchange, ImplicitAPI):
6730
6793
  async def fetch_leverage_tiers(self, symbols: Optional[List[str]] = None, params={}):
6731
6794
  """
6732
6795
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
6796
+ see https://binance-docs.github.io/apidocs/futures/en/#notional-and-leverage-brackets-user_data
6797
+ see https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-symbol-user_data
6733
6798
  :param str[]|None symbols: list of unified market symbols
6734
6799
  :param dict [params]: extra parameters specific to the binance api endpoint
6735
6800
  :returns dict: a dictionary of `leverage tiers structures <https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure>`, indexed by market symbols
@@ -6994,6 +7059,8 @@ class binance(Exchange, ImplicitAPI):
6994
7059
  async def fetch_account_positions(self, symbols: Optional[List[str]] = None, params={}):
6995
7060
  """
6996
7061
  fetch account positions
7062
+ see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
7063
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
6997
7064
  :param str[]|None symbols: list of unified market symbols
6998
7065
  :param dict [params]: extra parameters specific to the binance api endpoint
6999
7066
  :returns dict: data on account positions
@@ -7024,6 +7091,7 @@ class binance(Exchange, ImplicitAPI):
7024
7091
  """
7025
7092
  fetch positions risk
7026
7093
  see https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
7094
+ see https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
7027
7095
  :param str[]|None symbols: list of unified market symbols
7028
7096
  :param dict [params]: extra parameters specific to the binance api endpoint
7029
7097
  :returns dict: data on the positions risk
@@ -7112,6 +7180,8 @@ class binance(Exchange, ImplicitAPI):
7112
7180
  async def fetch_funding_history(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
7113
7181
  """
7114
7182
  fetch the history of funding payments paid and received on self account
7183
+ see https://binance-docs.github.io/apidocs/futures/en/#get-income-history-user_data
7184
+ see https://binance-docs.github.io/apidocs/delivery/en/#get-income-history-user_data
7115
7185
  :param str symbol: unified market symbol
7116
7186
  :param int [since]: the earliest time in ms to fetch funding history for
7117
7187
  :param int [limit]: the maximum number of funding history structures to retrieve
@@ -7150,6 +7220,8 @@ class binance(Exchange, ImplicitAPI):
7150
7220
  async def set_leverage(self, leverage, symbol: Optional[str] = None, params={}):
7151
7221
  """
7152
7222
  set the level of leverage for a market
7223
+ see https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade
7224
+ see https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade
7153
7225
  :param float leverage: the rate of leverage
7154
7226
  :param str symbol: unified market symbol
7155
7227
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7179,6 +7251,8 @@ class binance(Exchange, ImplicitAPI):
7179
7251
  async def set_margin_mode(self, marginMode: str, symbol: Optional[str] = None, params={}):
7180
7252
  """
7181
7253
  set margin mode to 'cross' or 'isolated'
7254
+ see https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade
7255
+ see https://binance-docs.github.io/apidocs/delivery/en/#change-margin-type-trade
7182
7256
  :param str marginMode: 'cross' or 'isolated'
7183
7257
  :param str symbol: unified market symbol
7184
7258
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7233,6 +7307,8 @@ class binance(Exchange, ImplicitAPI):
7233
7307
  async def set_position_mode(self, hedged, symbol: Optional[str] = None, params={}):
7234
7308
  """
7235
7309
  set hedged to True or False for a market
7310
+ see https://binance-docs.github.io/apidocs/futures/en/#change-position-mode-trade
7311
+ see https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
7236
7312
  :param bool hedged: set to True to use dualSidePosition
7237
7313
  :param str symbol: not used by binance setPositionMode()
7238
7314
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7830,6 +7906,7 @@ class binance(Exchange, ImplicitAPI):
7830
7906
  async def fetch_borrow_rate(self, code: str, params={}):
7831
7907
  """
7832
7908
  fetch the rate of interest to borrow a currency for margin trading
7909
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
7833
7910
  :param str code: unified currency code
7834
7911
  :param dict [params]: extra parameters specific to the binance api endpoint
7835
7912
  :returns dict: a `borrow rate structure <https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure>`
@@ -7857,6 +7934,7 @@ class binance(Exchange, ImplicitAPI):
7857
7934
  async def fetch_borrow_rate_history(self, code: str, since: Optional[int] = None, limit: Optional[int] = None, params={}):
7858
7935
  """
7859
7936
  retrieves a history of a currencies borrow interest rate at specific time slots
7937
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
7860
7938
  :param str code: unified currency code
7861
7939
  :param int [since]: timestamp for the earliest borrow rate
7862
7940
  :param int [limit]: the maximum number of `borrow rate structures <https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure>` to retrieve
@@ -7924,6 +8002,7 @@ class binance(Exchange, ImplicitAPI):
7924
8002
  async def create_gift_code(self, code: str, amount, params={}):
7925
8003
  """
7926
8004
  create gift code
8005
+ see https://binance-docs.github.io/apidocs/spot/en/#create-a-single-token-gift-card-user_data
7927
8006
  :param str code: gift code
7928
8007
  :param float amount: amount of currency for the gift
7929
8008
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7959,6 +8038,7 @@ class binance(Exchange, ImplicitAPI):
7959
8038
  async def redeem_gift_code(self, giftcardCode, params={}):
7960
8039
  """
7961
8040
  redeem gift code
8041
+ see https://binance-docs.github.io/apidocs/spot/en/#redeem-a-binance-gift-card-user_data
7962
8042
  :param str giftcardCode:
7963
8043
  :param dict [params]: extra parameters specific to the binance api endpoint
7964
8044
  :returns dict: response from the exchange
@@ -7983,6 +8063,7 @@ class binance(Exchange, ImplicitAPI):
7983
8063
  async def verify_gift_code(self, id: str, params={}):
7984
8064
  """
7985
8065
  verify gift code
8066
+ see https://binance-docs.github.io/apidocs/spot/en/#verify-binance-gift-card-by-gift-card-number-user_data
7986
8067
  :param str id: reference number id
7987
8068
  :param dict [params]: extra parameters specific to the binance api endpoint
7988
8069
  :returns dict: response from the exchange
@@ -8004,6 +8085,7 @@ class binance(Exchange, ImplicitAPI):
8004
8085
  async def fetch_borrow_interest(self, code: Optional[str] = None, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
8005
8086
  """
8006
8087
  fetch the interest owed by the user for borrowing currency for margin trading
8088
+ see https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data
8007
8089
  :param str code: unified currency code
8008
8090
  :param str symbol: unified market symbol when fetch interest in isolated markets
8009
8091
  :param int [since]: the earliest time in ms to fetch borrrow interest for
@@ -8144,6 +8226,8 @@ class binance(Exchange, ImplicitAPI):
8144
8226
  async def fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
8145
8227
  """
8146
8228
  Retrieves the open interest history of a currency
8229
+ see https://binance-docs.github.io/apidocs/delivery/en/#open-interest-statistics
8230
+ see https://binance-docs.github.io/apidocs/futures/en/#open-interest-statistics
8147
8231
  :param str symbol: Unified CCXT market symbol
8148
8232
  :param str timeframe: "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
8149
8233
  :param int [since]: the time(ms) of the earliest record to retrieve unix timestamp
@@ -827,7 +827,7 @@ class bitrue(Exchange, ImplicitAPI):
827
827
  'last': last,
828
828
  'previousClose': None,
829
829
  'change': None,
830
- 'percentage': self.safe_string(ticker, 'percentChange'),
830
+ 'percentage': Precise.string_mul(self.safe_string(ticker, 'percentChange'), '10000'),
831
831
  'average': None,
832
832
  'baseVolume': self.safe_string(ticker, 'baseVolume'),
833
833
  'quoteVolume': self.safe_string(ticker, 'quoteVolume'),
@@ -3806,6 +3806,16 @@ class bybit(Exchange, ImplicitAPI):
3806
3806
  :param float amount: how much of currency you want to trade in units of base currency
3807
3807
  :param float price: the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
3808
3808
  :param dict [params]: extra parameters specific to the bybit api endpoint
3809
+ :param float [params.triggerPrice]: The price that a trigger order is triggered at
3810
+ :param float [params.stopLossPrice]: The price that a stop loss order is triggered at
3811
+ :param float [params.takeProfitPrice]: The price that a take profit order is triggered at
3812
+ :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered
3813
+ :param float [params.takeProfit.triggerPrice]: take profit trigger price
3814
+ :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered
3815
+ :param float [params.stopLoss.triggerPrice]: stop loss trigger price
3816
+ :param str [params.triggerBy]: 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice
3817
+ :param str [params.slTriggerBy]: 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss
3818
+ :param str [params.tpTriggerby]: 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
3809
3819
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
3810
3820
  """
3811
3821
  self.check_required_symbol('editOrder', symbol)
@@ -3841,9 +3851,9 @@ class bybit(Exchange, ImplicitAPI):
3841
3851
  request['price'] = self.price_to_precision(symbol, price)
3842
3852
  if amount is not None:
3843
3853
  request['qty'] = self.amount_to_precision(symbol, amount)
3844
- triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
3845
- stopLossTriggerPrice = self.safe_value(params, 'stopLossPrice')
3846
- takeProfitTriggerPrice = self.safe_value(params, 'takeProfitPrice')
3854
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
3855
+ stopLossTriggerPrice = self.safe_string(params, 'stopLossPrice')
3856
+ takeProfitTriggerPrice = self.safe_string(params, 'takeProfitPrice')
3847
3857
  stopLoss = self.safe_value(params, 'stopLoss')
3848
3858
  takeProfit = self.safe_value(params, 'takeProfit')
3849
3859
  isStopLossTriggerOrder = stopLossTriggerPrice is not None
@@ -3853,14 +3863,23 @@ class bybit(Exchange, ImplicitAPI):
3853
3863
  if isStopLossTriggerOrder or isTakeProfitTriggerOrder:
3854
3864
  triggerPrice = stopLossTriggerPrice if isStopLossTriggerOrder else takeProfitTriggerPrice
3855
3865
  if triggerPrice is not None:
3856
- request['triggerPrice'] = triggerPrice
3866
+ triggerPriceRequest = triggerPrice if (triggerPrice == '0') else self.price_to_precision(symbol, triggerPrice)
3867
+ request['triggerPrice'] = triggerPriceRequest
3868
+ triggerBy = self.safe_string(params, 'triggerBy', 'LastPrice')
3869
+ request['triggerBy'] = triggerBy
3857
3870
  if isStopLoss or isTakeProfit:
3858
3871
  if isStopLoss:
3859
- slTriggerPrice = self.safe_value_2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss)
3860
- request['stopLoss'] = slTriggerPrice
3872
+ slTriggerPrice = self.safe_string_2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss)
3873
+ stopLossRequest = slTriggerPrice if (slTriggerPrice == '0') else self.price_to_precision(symbol, slTriggerPrice)
3874
+ request['stopLoss'] = stopLossRequest
3875
+ slTriggerBy = self.safe_string(params, 'slTriggerBy', 'LastPrice')
3876
+ request['slTriggerBy'] = slTriggerBy
3861
3877
  if isTakeProfit:
3862
- tpTriggerPrice = self.safe_value_2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit)
3863
- request['takeProfit'] = tpTriggerPrice
3878
+ tpTriggerPrice = self.safe_string_2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit)
3879
+ takeProfitRequest = tpTriggerPrice if (tpTriggerPrice == '0') else self.price_to_precision(symbol, tpTriggerPrice)
3880
+ request['takeProfit'] = takeProfitRequest
3881
+ tpTriggerBy = self.safe_string(params, 'tpTriggerBy', 'LastPrice')
3882
+ request['tpTriggerBy'] = tpTriggerBy
3864
3883
  clientOrderId = self.safe_string(params, 'clientOrderId')
3865
3884
  if clientOrderId is not None:
3866
3885
  request['orderLinkId'] = clientOrderId
@@ -125,6 +125,7 @@ class coinbasepro(Exchange, ImplicitAPI):
125
125
  },
126
126
  'private': {
127
127
  'get': [
128
+ 'address-book',
128
129
  'accounts',
129
130
  'accounts/{id}',
130
131
  'accounts/{id}/holds',