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.
@@ -827,6 +827,7 @@ class kucoin(Exchange, ImplicitAPI):
827
827
  async def fetch_time(self, params={}):
828
828
  """
829
829
  fetches the current integer timestamp in milliseconds from the exchange server
830
+ see https://docs.kucoin.com/#server-time
830
831
  :param dict [params]: extra parameters specific to the kucoin api endpoint
831
832
  :returns int: the current integer timestamp in milliseconds from the exchange server
832
833
  """
@@ -843,6 +844,7 @@ class kucoin(Exchange, ImplicitAPI):
843
844
  async def fetch_status(self, params={}):
844
845
  """
845
846
  the latest known information on the availability of the exchange API
847
+ see https://docs.kucoin.com/#service-status
846
848
  :param dict [params]: extra parameters specific to the kucoin api endpoint
847
849
  :returns dict: a `status structure <https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure>`
848
850
  """
@@ -869,6 +871,8 @@ class kucoin(Exchange, ImplicitAPI):
869
871
  async def fetch_markets(self, params={}):
870
872
  """
871
873
  retrieves data on all markets for kucoin
874
+ see https://docs.kucoin.com/#get-symbols-list-deprecated
875
+ see https://docs.kucoin.com/#get-all-tickers
872
876
  :param dict [params]: extra parameters specific to the exchange api endpoint
873
877
  :returns dict[]: an array of objects representing market data
874
878
  """
@@ -1003,6 +1007,7 @@ class kucoin(Exchange, ImplicitAPI):
1003
1007
  async def fetch_currencies(self, params={}):
1004
1008
  """
1005
1009
  fetches all available currencies on an exchange
1010
+ see https://docs.kucoin.com/#get-currencies
1006
1011
  :param dict params: extra parameters specific to the kucoin api endpoint
1007
1012
  :returns dict: an associative dictionary of currencies
1008
1013
  """
@@ -1099,7 +1104,7 @@ class kucoin(Exchange, ImplicitAPI):
1099
1104
  isDepositEnabled = False
1100
1105
  for j in range(0, chainsLength):
1101
1106
  chain = chains[j]
1102
- chainId = self.safe_string(chain, 'chain')
1107
+ chainId = self.safe_string(chain, 'chainId')
1103
1108
  networkCode = self.network_id_to_code(chainId)
1104
1109
  chainWithdrawEnabled = self.safe_value(chain, 'isWithdrawEnabled', False)
1105
1110
  if isWithdrawEnabled is None:
@@ -1154,6 +1159,7 @@ class kucoin(Exchange, ImplicitAPI):
1154
1159
  async def fetch_accounts(self, params={}):
1155
1160
  """
1156
1161
  fetch all the accounts associated with a profile
1162
+ see https://docs.kucoin.com/#list-accounts
1157
1163
  :param dict [params]: extra parameters specific to the kucoin api endpoint
1158
1164
  :returns dict: a dictionary of `account structures <https://github.com/ccxt/ccxt/wiki/Manual#account-structure>` indexed by the account type
1159
1165
  """
@@ -1418,6 +1424,7 @@ class kucoin(Exchange, ImplicitAPI):
1418
1424
  async def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
1419
1425
  """
1420
1426
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1427
+ see https://docs.kucoin.com/#get-all-tickers
1421
1428
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1422
1429
  :param dict [params]: extra parameters specific to the kucoin api endpoint
1423
1430
  :returns dict: a dictionary of `ticker structures <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
@@ -1468,6 +1475,7 @@ class kucoin(Exchange, ImplicitAPI):
1468
1475
  async def fetch_ticker(self, symbol: str, params={}):
1469
1476
  """
1470
1477
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1478
+ see https://docs.kucoin.com/#get-24hr-stats
1471
1479
  :param str symbol: unified symbol of the market to fetch the ticker for
1472
1480
  :param dict [params]: extra parameters specific to the kucoin api endpoint
1473
1481
  :returns dict: a `ticker structure <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
@@ -1527,6 +1535,7 @@ class kucoin(Exchange, ImplicitAPI):
1527
1535
  async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
1528
1536
  """
1529
1537
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1538
+ see https://docs.kucoin.com/#get-klines
1530
1539
  :param str symbol: unified symbol of the market to fetch OHLCV data for
1531
1540
  :param str timeframe: the length of time each candle represents
1532
1541
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -1598,6 +1607,7 @@ class kucoin(Exchange, ImplicitAPI):
1598
1607
  async def fetch_deposit_address(self, code: str, params={}):
1599
1608
  """
1600
1609
  fetch the deposit address for a currency associated with self account
1610
+ see https://docs.kucoin.com/#get-deposit-addresses-v2
1601
1611
  :param str code: unified currency code
1602
1612
  :param dict [params]: extra parameters specific to the kucoin api endpoint
1603
1613
  :param str [params.network]: the blockchain network name
@@ -1686,6 +1696,8 @@ class kucoin(Exchange, ImplicitAPI):
1686
1696
  async def fetch_order_book(self, symbol: str, limit: Optional[int] = None, params={}):
1687
1697
  """
1688
1698
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
1699
+ see https://docs.kucoin.com/#get-part-order-book-aggregated
1700
+ see https://docs.kucoin.com/#get-full-order-book-aggregated
1689
1701
  :param str symbol: unified symbol of the market to fetch the order book for
1690
1702
  :param int [limit]: the maximum amount of order book entries to return
1691
1703
  :param dict [params]: extra parameters specific to the kucoin api endpoint
@@ -2093,6 +2105,10 @@ class kucoin(Exchange, ImplicitAPI):
2093
2105
  async def fetch_closed_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2094
2106
  """
2095
2107
  fetches information on multiple closed orders made by the user
2108
+ see https://docs.kucoin.com/spot#list-orders
2109
+ see https://docs.kucoin.com/spot#list-stop-orders
2110
+ see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2111
+ see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2096
2112
  :param str symbol: unified market symbol of the market orders were made in
2097
2113
  :param int [since]: the earliest time in ms to fetch orders for
2098
2114
  :param int [limit]: the maximum number of orde structures to retrieve
@@ -2110,6 +2126,10 @@ class kucoin(Exchange, ImplicitAPI):
2110
2126
  async def fetch_open_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2111
2127
  """
2112
2128
  fetch all unfilled currently open orders
2129
+ see https://docs.kucoin.com/spot#list-orders
2130
+ see https://docs.kucoin.com/spot#list-stop-orders
2131
+ see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
2132
+ see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
2113
2133
  :param str symbol: unified market symbol
2114
2134
  :param int [since]: the earliest time in ms to fetch open orders for
2115
2135
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -2362,6 +2382,8 @@ class kucoin(Exchange, ImplicitAPI):
2362
2382
  async def fetch_order_trades(self, id: str, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2363
2383
  """
2364
2384
  fetch all the trades made from a single order
2385
+ see https://docs.kucoin.com/#list-fills
2386
+ see https://docs.kucoin.com/spot-hf/#transaction-details
2365
2387
  :param str id: order id
2366
2388
  :param str symbol: unified market symbol
2367
2389
  :param int [since]: the earliest time in ms to fetch trades for
@@ -2471,6 +2493,7 @@ class kucoin(Exchange, ImplicitAPI):
2471
2493
  async def fetch_trades(self, symbol: str, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2472
2494
  """
2473
2495
  get the list of most recent trades for a particular symbol
2496
+ see https://docs.kucoin.com/#get-trade-histories
2474
2497
  :param str symbol: unified symbol of the market to fetch trades for
2475
2498
  :param int [since]: timestamp in ms of the earliest trade to fetch
2476
2499
  :param int [limit]: the maximum amount of trades to fetch
@@ -2635,6 +2658,7 @@ class kucoin(Exchange, ImplicitAPI):
2635
2658
  async def fetch_trading_fee(self, symbol: str, params={}):
2636
2659
  """
2637
2660
  fetch the trading fees for a market
2661
+ see https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
2638
2662
  :param str symbol: unified market symbol
2639
2663
  :param dict [params]: extra parameters specific to the kucoin api endpoint
2640
2664
  :returns dict: a `fee structure <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -2672,6 +2696,7 @@ class kucoin(Exchange, ImplicitAPI):
2672
2696
  async def withdraw(self, code: str, amount, address, tag=None, params={}):
2673
2697
  """
2674
2698
  make a withdrawal
2699
+ see https://docs.kucoin.com/#apply-withdraw-2
2675
2700
  :param str code: unified currency code
2676
2701
  :param float amount: the amount to withdraw
2677
2702
  :param str address: the address to withdraw to
@@ -2830,6 +2855,8 @@ class kucoin(Exchange, ImplicitAPI):
2830
2855
  async def fetch_deposits(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2831
2856
  """
2832
2857
  fetch all deposits made to an account
2858
+ see https://docs.kucoin.com/#get-deposit-list
2859
+ see https://docs.kucoin.com/#get-v1-historical-deposits-list
2833
2860
  :param str code: unified currency code
2834
2861
  :param int [since]: the earliest time in ms to fetch deposits for
2835
2862
  :param int [limit]: the maximum number of deposits structures to retrieve
@@ -2897,6 +2924,8 @@ class kucoin(Exchange, ImplicitAPI):
2897
2924
  async def fetch_withdrawals(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2898
2925
  """
2899
2926
  fetch all withdrawals made from an account
2927
+ see https://docs.kucoin.com/#get-withdrawals-list
2928
+ see https://docs.kucoin.com/#get-v1-historical-withdrawals-list
2900
2929
  :param str code: unified currency code
2901
2930
  :param int [since]: the earliest time in ms to fetch withdrawals for
2902
2931
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -3373,6 +3402,7 @@ class kucoin(Exchange, ImplicitAPI):
3373
3402
  async def fetch_ledger(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3374
3403
  """
3375
3404
  fetch the history of changes, actions done by the user or operations that altered balance of the user
3405
+ see https://docs.kucoin.com/#get-account-ledgers
3376
3406
  :param str code: unified currency code, default is None
3377
3407
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
3378
3408
  :param int [limit]: max number of ledger entrys to return, default is None
ccxt/async_support/okx.py CHANGED
@@ -2041,13 +2041,23 @@ class okx(Exchange, ImplicitAPI):
2041
2041
  defaultType = self.safe_string(options, 'type', defaultType) # Candles or HistoryCandles
2042
2042
  type = self.safe_string(params, 'type', defaultType)
2043
2043
  params = self.omit(params, 'type')
2044
- method = 'publicGetMarket' + type
2045
2044
  isHistoryCandles = (type == 'HistoryCandles')
2045
+ response = None
2046
2046
  if price == 'mark':
2047
- method = 'publicGetMarketHistoryMarkPriceCandles' if (isHistoryCandles) else 'publicGetMarketMarkPriceCandles'
2047
+ if isHistoryCandles:
2048
+ response = await self.publicGetMarketHistoryMarkPriceCandles(self.extend(request, params))
2049
+ else:
2050
+ response = await self.publicGetMarketMarkPriceCandles(self.extend(request, params))
2048
2051
  elif price == 'index':
2049
- method = 'publicGetMarketHistoryIndexCandles' if (isHistoryCandles) else 'publicGetMarketIndexCandles'
2050
- response = await getattr(self, method)(self.extend(request, params))
2052
+ if isHistoryCandles:
2053
+ response = await self.publicGetMarketHistoryIndexCandles(self.extend(request, params))
2054
+ else:
2055
+ response = await self.publicGetMarketIndexCandles(self.extend(request, params))
2056
+ else:
2057
+ if isHistoryCandles:
2058
+ response = await self.publicGetMarketHistoryCandles(self.extend(request, params))
2059
+ else:
2060
+ response = await self.publicGetMarketCandles(self.extend(request, params))
2051
2061
  #
2052
2062
  # {
2053
2063
  # "code": "0",
@@ -2240,15 +2250,14 @@ class okx(Exchange, ImplicitAPI):
2240
2250
  """
2241
2251
  await self.load_markets()
2242
2252
  marketType, query = self.handle_market_type_and_params('fetchBalance', None, params)
2243
- method = None
2244
- if marketType == 'funding':
2245
- method = 'privateGetAssetBalances'
2246
- else:
2247
- method = 'privateGetAccountBalance'
2248
2253
  request = {
2249
2254
  # 'ccy': 'BTC,ETH', # comma-separated list of currency ids
2250
2255
  }
2251
- response = await getattr(self, method)(self.extend(request, query))
2256
+ response = None
2257
+ if marketType == 'funding':
2258
+ response = await self.privateGetAssetBalances(self.extend(request, query))
2259
+ else:
2260
+ response = await self.privateGetAccountBalance(self.extend(request, query))
2252
2261
  #
2253
2262
  # {
2254
2263
  # "code": "0",
ccxt/base/exchange.py CHANGED
@@ -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
 
@@ -1858,6 +1858,12 @@ class Exchange(object):
1858
1858
  def watch_trades_for_symbols(self, symbols: List[str], since: Optional[int] = None, limit: Optional[int] = None, params={}):
1859
1859
  raise NotSupported(self.id + ' watchTradesForSymbols() is not supported yet')
1860
1860
 
1861
+ def watch_my_trades_for_symbols(self, symbols: List[str], since: Optional[int] = None, limit: Optional[int] = None, params={}):
1862
+ raise NotSupported(self.id + ' watchMyTradesForSymbols() is not supported yet')
1863
+
1864
+ def watch_orders_for_symbols(self, symbols: List[str], since: Optional[int] = None, limit: Optional[int] = None, params={}):
1865
+ raise NotSupported(self.id + ' watchOrdersForSymbols() is not supported yet')
1866
+
1861
1867
  def watch_ohlcv_for_symbols(self, symbolsAndTimeframes: List[List[str]], since: Optional[int] = None, limit: Optional[int] = None, params={}):
1862
1868
  raise NotSupported(self.id + ' watchOHLCVForSymbols() is not supported yet')
1863
1869
 
ccxt/binance.py CHANGED
@@ -3200,6 +3200,14 @@ class binance(Exchange, ImplicitAPI):
3200
3200
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
3201
3201
  """
3202
3202
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
3203
+ see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
3204
+ see https://binance-docs.github.io/apidocs/voptions/en/#kline-candlestick-data
3205
+ see https://binance-docs.github.io/apidocs/futures/en/#index-price-kline-candlestick-data
3206
+ see https://binance-docs.github.io/apidocs/futures/en/#mark-price-kline-candlestick-data
3207
+ see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
3208
+ see https://binance-docs.github.io/apidocs/delivery/en/#index-price-kline-candlestick-data
3209
+ see https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-data
3210
+ see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
3203
3211
  :param str symbol: unified symbol of the market to fetch OHLCV data for
3204
3212
  :param str timeframe: the length of time each candle represents
3205
3213
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -4359,6 +4367,11 @@ class binance(Exchange, ImplicitAPI):
4359
4367
  def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
4360
4368
  """
4361
4369
  fetches information on an order made by the user
4370
+ see https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data
4371
+ see https://binance-docs.github.io/apidocs/futures/en/#query-order-user_data
4372
+ see https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data
4373
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-single-order-trade
4374
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-order-user_data
4362
4375
  :param str symbol: unified symbol of the market the order was made in
4363
4376
  :param dict [params]: extra parameters specific to the binance api endpoint
4364
4377
  :param str [params.marginMode]: 'cross' or 'isolated', for spot margin trading
@@ -4399,6 +4412,11 @@ class binance(Exchange, ImplicitAPI):
4399
4412
  def fetch_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4400
4413
  """
4401
4414
  fetches information on multiple orders made by the user
4415
+ see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
4416
+ see https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data
4417
+ see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
4418
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
4419
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
4402
4420
  :param str symbol: unified market symbol of the market orders were made in
4403
4421
  :param int [since]: the earliest time in ms to fetch orders for
4404
4422
  :param int [limit]: the maximum number of order structures to retrieve
@@ -4510,6 +4528,11 @@ class binance(Exchange, ImplicitAPI):
4510
4528
  def fetch_open_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4511
4529
  """
4512
4530
  fetch all unfilled currently open orders
4531
+ see https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data
4532
+ see https://binance-docs.github.io/apidocs/futures/en/#current-all-open-orders-user_data
4533
+ see https://binance-docs.github.io/apidocs/delivery/en/#current-all-open-orders-user_data
4534
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-current-open-option-orders-user_data
4535
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-orders-user_data
4513
4536
  :param str symbol: unified market symbol
4514
4537
  :param int [since]: the earliest time in ms to fetch open orders for
4515
4538
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -4564,6 +4587,11 @@ class binance(Exchange, ImplicitAPI):
4564
4587
  def fetch_closed_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4565
4588
  """
4566
4589
  fetches information on multiple closed orders made by the user
4590
+ see https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data
4591
+ see https://binance-docs.github.io/apidocs/futures/en/#all-orders-user_data
4592
+ see https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
4593
+ see https://binance-docs.github.io/apidocs/voptions/en/#query-option-order-history-trade
4594
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data
4567
4595
  :param str symbol: unified market symbol of the market orders were made in
4568
4596
  :param int [since]: the earliest time in ms to fetch orders for
4569
4597
  :param int [limit]: the maximum number of order structures to retrieve
@@ -4598,6 +4626,11 @@ class binance(Exchange, ImplicitAPI):
4598
4626
  def cancel_order(self, id: str, symbol: Optional[str] = None, params={}):
4599
4627
  """
4600
4628
  cancels an open order
4629
+ see https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade
4630
+ see https://binance-docs.github.io/apidocs/futures/en/#cancel-order-trade
4631
+ see https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade
4632
+ see https://binance-docs.github.io/apidocs/voptions/en/#cancel-option-order-trade
4633
+ see https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade
4601
4634
  :param str id: order id
4602
4635
  :param str symbol: unified symbol of the market the order was made in
4603
4636
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -4680,6 +4713,7 @@ class binance(Exchange, ImplicitAPI):
4680
4713
  """
4681
4714
  cancel multiple orders
4682
4715
  see https://binance-docs.github.io/apidocs/futures/en/#cancel-multiple-orders-trade
4716
+ see https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
4683
4717
  :param [str] ids: order ids
4684
4718
  :param str [symbol]: unified market symbol
4685
4719
  :param dict [params]: extra parameters specific to the bingx api endpoint
@@ -4743,6 +4777,10 @@ class binance(Exchange, ImplicitAPI):
4743
4777
  def fetch_order_trades(self, id: str, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4744
4778
  """
4745
4779
  fetch all the trades made from a single order
4780
+ see https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
4781
+ see https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data
4782
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
4783
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data
4746
4784
  :param str id: order id
4747
4785
  :param str symbol: unified market symbol
4748
4786
  :param int [since]: the earliest time in ms to fetch trades for
@@ -4766,6 +4804,10 @@ class binance(Exchange, ImplicitAPI):
4766
4804
  def fetch_my_trades(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4767
4805
  """
4768
4806
  fetch all trades made by the user
4807
+ see https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
4808
+ see https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data
4809
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
4810
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data
4769
4811
  :param str symbol: unified market symbol
4770
4812
  :param int [since]: the earliest time in ms to fetch trades for
4771
4813
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -4889,6 +4931,7 @@ class binance(Exchange, ImplicitAPI):
4889
4931
  def fetch_my_dust_trades(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4890
4932
  """
4891
4933
  fetch all dust trades made by the user
4934
+ see https://binance-docs.github.io/apidocs/spot/en/#dustlog-user_data
4892
4935
  :param str symbol: not used by binance fetchMyDustTrades()
4893
4936
  :param int [since]: the earliest time in ms to fetch my dust trades for
4894
4937
  :param int [limit]: the maximum number of dust trades to retrieve
@@ -5017,6 +5060,8 @@ class binance(Exchange, ImplicitAPI):
5017
5060
  def fetch_deposits(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
5018
5061
  """
5019
5062
  fetch all deposits made to an account
5063
+ see https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
5064
+ see https://binance-docs.github.io/apidocs/spot/en/#deposit-history-supporting-network-user_data
5020
5065
  :param str code: unified currency code
5021
5066
  :param int [since]: the earliest time in ms to fetch deposits for
5022
5067
  :param int [limit]: the maximum number of deposits structures to retrieve
@@ -5109,6 +5154,8 @@ class binance(Exchange, ImplicitAPI):
5109
5154
  def fetch_withdrawals(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
5110
5155
  """
5111
5156
  fetch all withdrawals made from an account
5157
+ see https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data
5158
+ see https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
5112
5159
  :param str code: unified currency code
5113
5160
  :param int [since]: the earliest time in ms to fetch withdrawals for
5114
5161
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -5536,6 +5583,7 @@ class binance(Exchange, ImplicitAPI):
5536
5583
  def fetch_transfers(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
5537
5584
  """
5538
5585
  fetch a history of internal transfers made on an account
5586
+ see https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history-user_data
5539
5587
  :param str code: unified currency code of the currency transferred
5540
5588
  :param int [since]: the earliest time in ms to fetch transfers for
5541
5589
  :param int [limit]: the maximum number of transfers structures to retrieve
@@ -5591,6 +5639,7 @@ class binance(Exchange, ImplicitAPI):
5591
5639
  def fetch_deposit_address(self, code: str, params={}):
5592
5640
  """
5593
5641
  fetch the deposit address for a currency associated with self account
5642
+ see https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data
5594
5643
  :param str code: unified currency code
5595
5644
  :param dict [params]: extra parameters specific to the binance api endpoint
5596
5645
  :returns dict: an `address structure <https://github.com/ccxt/ccxt/wiki/Manual#address-structure>`
@@ -5658,6 +5707,7 @@ class binance(Exchange, ImplicitAPI):
5658
5707
  """
5659
5708
  * @deprecated
5660
5709
  please use fetchDepositWithdrawFees instead
5710
+ see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
5661
5711
  :param str[]|None codes: not used by binance fetchTransactionFees()
5662
5712
  :param dict [params]: extra parameters specific to the binance api endpoint
5663
5713
  :returns dict[]: a list of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5767,6 +5817,7 @@ class binance(Exchange, ImplicitAPI):
5767
5817
  def fetch_deposit_withdraw_fees(self, codes: Optional[List[str]] = None, params={}):
5768
5818
  """
5769
5819
  fetch deposit and withdraw fees
5820
+ see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
5770
5821
  :param str[]|None codes: not used by binance fetchDepositWithdrawFees()
5771
5822
  :param dict [params]: extra parameters specific to the binance api endpoint
5772
5823
  :returns dict[]: a list of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5886,6 +5937,7 @@ class binance(Exchange, ImplicitAPI):
5886
5937
  def withdraw(self, code: str, amount, address, tag=None, params={}):
5887
5938
  """
5888
5939
  make a withdrawal
5940
+ see https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data
5889
5941
  :param str code: unified currency code
5890
5942
  :param float amount: the amount to withdraw
5891
5943
  :param str address: the address to withdraw to
@@ -5937,6 +5989,7 @@ class binance(Exchange, ImplicitAPI):
5937
5989
  def fetch_trading_fee(self, symbol: str, params={}):
5938
5990
  """
5939
5991
  fetch the trading fees for a market
5992
+ see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
5940
5993
  :param str symbol: unified market symbol
5941
5994
  :param dict [params]: extra parameters specific to the binance api endpoint
5942
5995
  :returns dict: a `fee structure <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5962,6 +6015,9 @@ class binance(Exchange, ImplicitAPI):
5962
6015
  def fetch_trading_fees(self, params={}):
5963
6016
  """
5964
6017
  fetch the trading fees for multiple markets
6018
+ see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
6019
+ see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
6020
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
5965
6021
  :param dict [params]: extra parameters specific to the binance api endpoint
5966
6022
  :returns dict: a dictionary of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>` indexed by market symbols
5967
6023
  """
@@ -6126,6 +6182,7 @@ class binance(Exchange, ImplicitAPI):
6126
6182
  def futures_transfer(self, code: str, amount, type, params={}):
6127
6183
  """
6128
6184
  transfer between futures account
6185
+ see https://binance-docs.github.io/apidocs/spot/en/#new-future-account-transfer-user_data
6129
6186
  :param str code: unified currency code
6130
6187
  :param float amount: the amount to transfer
6131
6188
  :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
@@ -6153,6 +6210,8 @@ class binance(Exchange, ImplicitAPI):
6153
6210
  def fetch_funding_rate(self, symbol: str, params={}):
6154
6211
  """
6155
6212
  fetch the current funding rate
6213
+ see https://binance-docs.github.io/apidocs/futures/en/#mark-price
6214
+ see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
6156
6215
  :param str symbol: unified market symbol
6157
6216
  :param dict [params]: extra parameters specific to the binance api endpoint
6158
6217
  :returns dict: a `funding rate structure <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure>`
@@ -6189,6 +6248,8 @@ class binance(Exchange, ImplicitAPI):
6189
6248
  def fetch_funding_rate_history(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
6190
6249
  """
6191
6250
  fetches historical funding rate prices
6251
+ see https://binance-docs.github.io/apidocs/futures/en/#get-funding-rate-history
6252
+ see https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures
6192
6253
  :param str symbol: unified symbol of the market to fetch the funding rate history for
6193
6254
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
6194
6255
  :param int [limit]: the maximum amount of `funding rate structures <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure>` to fetch
@@ -6249,6 +6310,8 @@ class binance(Exchange, ImplicitAPI):
6249
6310
  def fetch_funding_rates(self, symbols: Optional[List[str]] = None, params={}):
6250
6311
  """
6251
6312
  fetch the funding rate for multiple markets
6313
+ see https://binance-docs.github.io/apidocs/futures/en/#mark-price
6314
+ see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
6252
6315
  :param str[]|None symbols: list of unified market symbols
6253
6316
  :param dict [params]: extra parameters specific to the binance api endpoint
6254
6317
  :returns dict: a dictionary of `funding rates structures <https://github.com/ccxt/ccxt/wiki/Manual#funding-rates-structure>`, indexe by market symbols
@@ -6729,6 +6792,8 @@ class binance(Exchange, ImplicitAPI):
6729
6792
  def fetch_leverage_tiers(self, symbols: Optional[List[str]] = None, params={}):
6730
6793
  """
6731
6794
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
6795
+ see https://binance-docs.github.io/apidocs/futures/en/#notional-and-leverage-brackets-user_data
6796
+ see https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-symbol-user_data
6732
6797
  :param str[]|None symbols: list of unified market symbols
6733
6798
  :param dict [params]: extra parameters specific to the binance api endpoint
6734
6799
  :returns dict: a dictionary of `leverage tiers structures <https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure>`, indexed by market symbols
@@ -6993,6 +7058,8 @@ class binance(Exchange, ImplicitAPI):
6993
7058
  def fetch_account_positions(self, symbols: Optional[List[str]] = None, params={}):
6994
7059
  """
6995
7060
  fetch account positions
7061
+ see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
7062
+ see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
6996
7063
  :param str[]|None symbols: list of unified market symbols
6997
7064
  :param dict [params]: extra parameters specific to the binance api endpoint
6998
7065
  :returns dict: data on account positions
@@ -7023,6 +7090,7 @@ class binance(Exchange, ImplicitAPI):
7023
7090
  """
7024
7091
  fetch positions risk
7025
7092
  see https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
7093
+ see https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
7026
7094
  :param str[]|None symbols: list of unified market symbols
7027
7095
  :param dict [params]: extra parameters specific to the binance api endpoint
7028
7096
  :returns dict: data on the positions risk
@@ -7111,6 +7179,8 @@ class binance(Exchange, ImplicitAPI):
7111
7179
  def fetch_funding_history(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
7112
7180
  """
7113
7181
  fetch the history of funding payments paid and received on self account
7182
+ see https://binance-docs.github.io/apidocs/futures/en/#get-income-history-user_data
7183
+ see https://binance-docs.github.io/apidocs/delivery/en/#get-income-history-user_data
7114
7184
  :param str symbol: unified market symbol
7115
7185
  :param int [since]: the earliest time in ms to fetch funding history for
7116
7186
  :param int [limit]: the maximum number of funding history structures to retrieve
@@ -7149,6 +7219,8 @@ class binance(Exchange, ImplicitAPI):
7149
7219
  def set_leverage(self, leverage, symbol: Optional[str] = None, params={}):
7150
7220
  """
7151
7221
  set the level of leverage for a market
7222
+ see https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade
7223
+ see https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade
7152
7224
  :param float leverage: the rate of leverage
7153
7225
  :param str symbol: unified market symbol
7154
7226
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7178,6 +7250,8 @@ class binance(Exchange, ImplicitAPI):
7178
7250
  def set_margin_mode(self, marginMode: str, symbol: Optional[str] = None, params={}):
7179
7251
  """
7180
7252
  set margin mode to 'cross' or 'isolated'
7253
+ see https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade
7254
+ see https://binance-docs.github.io/apidocs/delivery/en/#change-margin-type-trade
7181
7255
  :param str marginMode: 'cross' or 'isolated'
7182
7256
  :param str symbol: unified market symbol
7183
7257
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7232,6 +7306,8 @@ class binance(Exchange, ImplicitAPI):
7232
7306
  def set_position_mode(self, hedged, symbol: Optional[str] = None, params={}):
7233
7307
  """
7234
7308
  set hedged to True or False for a market
7309
+ see https://binance-docs.github.io/apidocs/futures/en/#change-position-mode-trade
7310
+ see https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
7235
7311
  :param bool hedged: set to True to use dualSidePosition
7236
7312
  :param str symbol: not used by binance setPositionMode()
7237
7313
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7829,6 +7905,7 @@ class binance(Exchange, ImplicitAPI):
7829
7905
  def fetch_borrow_rate(self, code: str, params={}):
7830
7906
  """
7831
7907
  fetch the rate of interest to borrow a currency for margin trading
7908
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
7832
7909
  :param str code: unified currency code
7833
7910
  :param dict [params]: extra parameters specific to the binance api endpoint
7834
7911
  :returns dict: a `borrow rate structure <https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure>`
@@ -7856,6 +7933,7 @@ class binance(Exchange, ImplicitAPI):
7856
7933
  def fetch_borrow_rate_history(self, code: str, since: Optional[int] = None, limit: Optional[int] = None, params={}):
7857
7934
  """
7858
7935
  retrieves a history of a currencies borrow interest rate at specific time slots
7936
+ see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
7859
7937
  :param str code: unified currency code
7860
7938
  :param int [since]: timestamp for the earliest borrow rate
7861
7939
  :param int [limit]: the maximum number of `borrow rate structures <https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure>` to retrieve
@@ -7923,6 +8001,7 @@ class binance(Exchange, ImplicitAPI):
7923
8001
  def create_gift_code(self, code: str, amount, params={}):
7924
8002
  """
7925
8003
  create gift code
8004
+ see https://binance-docs.github.io/apidocs/spot/en/#create-a-single-token-gift-card-user_data
7926
8005
  :param str code: gift code
7927
8006
  :param float amount: amount of currency for the gift
7928
8007
  :param dict [params]: extra parameters specific to the binance api endpoint
@@ -7958,6 +8037,7 @@ class binance(Exchange, ImplicitAPI):
7958
8037
  def redeem_gift_code(self, giftcardCode, params={}):
7959
8038
  """
7960
8039
  redeem gift code
8040
+ see https://binance-docs.github.io/apidocs/spot/en/#redeem-a-binance-gift-card-user_data
7961
8041
  :param str giftcardCode:
7962
8042
  :param dict [params]: extra parameters specific to the binance api endpoint
7963
8043
  :returns dict: response from the exchange
@@ -7982,6 +8062,7 @@ class binance(Exchange, ImplicitAPI):
7982
8062
  def verify_gift_code(self, id: str, params={}):
7983
8063
  """
7984
8064
  verify gift code
8065
+ see https://binance-docs.github.io/apidocs/spot/en/#verify-binance-gift-card-by-gift-card-number-user_data
7985
8066
  :param str id: reference number id
7986
8067
  :param dict [params]: extra parameters specific to the binance api endpoint
7987
8068
  :returns dict: response from the exchange
@@ -8003,6 +8084,7 @@ class binance(Exchange, ImplicitAPI):
8003
8084
  def fetch_borrow_interest(self, code: Optional[str] = None, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
8004
8085
  """
8005
8086
  fetch the interest owed by the user for borrowing currency for margin trading
8087
+ see https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data
8006
8088
  :param str code: unified currency code
8007
8089
  :param str symbol: unified market symbol when fetch interest in isolated markets
8008
8090
  :param int [since]: the earliest time in ms to fetch borrrow interest for
@@ -8143,6 +8225,8 @@ class binance(Exchange, ImplicitAPI):
8143
8225
  def fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
8144
8226
  """
8145
8227
  Retrieves the open interest history of a currency
8228
+ see https://binance-docs.github.io/apidocs/delivery/en/#open-interest-statistics
8229
+ see https://binance-docs.github.io/apidocs/futures/en/#open-interest-statistics
8146
8230
  :param str symbol: Unified CCXT market symbol
8147
8231
  :param str timeframe: "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
8148
8232
  :param int [since]: the time(ms) of the earliest record to retrieve unix timestamp
ccxt/bitrue.py CHANGED
@@ -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'),