ccxt 4.1.19__py2.py3-none-any.whl → 4.1.22__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.
Files changed (179) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/okcoin.py +70 -206
  3. ccxt/ace.py +12 -12
  4. ccxt/ascendex.py +5 -5
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ace.py +12 -12
  7. ccxt/async_support/ascendex.py +5 -5
  8. ccxt/async_support/base/exchange.py +1 -1
  9. ccxt/async_support/bigone.py +2 -2
  10. ccxt/async_support/binance.py +184 -184
  11. ccxt/async_support/bingx.py +48 -48
  12. ccxt/async_support/bitbank.py +14 -14
  13. ccxt/async_support/bitbns.py +7 -7
  14. ccxt/async_support/bitfinex.py +2 -2
  15. ccxt/async_support/bitfinex2.py +35 -35
  16. ccxt/async_support/bitflyer.py +17 -17
  17. ccxt/async_support/bitforex.py +9 -9
  18. ccxt/async_support/bitget.py +433 -215
  19. ccxt/async_support/bitmart.py +39 -39
  20. ccxt/async_support/bitmex.py +7 -7
  21. ccxt/async_support/bitopro.py +1 -1
  22. ccxt/async_support/bitpanda.py +1 -1
  23. ccxt/async_support/bitrue.py +2 -2
  24. ccxt/async_support/bitso.py +2 -2
  25. ccxt/async_support/bitstamp.py +3 -3
  26. ccxt/async_support/bitvavo.py +2 -2
  27. ccxt/async_support/bl3p.py +1 -1
  28. ccxt/async_support/btcalpha.py +7 -7
  29. ccxt/async_support/btcturk.py +1 -1
  30. ccxt/async_support/bybit.py +58 -58
  31. ccxt/async_support/cex.py +1 -1
  32. ccxt/async_support/coinbase.py +13 -13
  33. ccxt/async_support/coinbasepro.py +15 -15
  34. ccxt/async_support/coinex.py +19 -19
  35. ccxt/async_support/coinone.py +2 -2
  36. ccxt/async_support/coinsph.py +4 -4
  37. ccxt/async_support/coinspot.py +2 -2
  38. ccxt/async_support/cryptocom.py +28 -28
  39. ccxt/async_support/currencycom.py +1 -1
  40. ccxt/async_support/delta.py +26 -26
  41. ccxt/async_support/deribit.py +9 -9
  42. ccxt/async_support/digifinex.py +38 -38
  43. ccxt/async_support/exmo.py +18 -18
  44. ccxt/async_support/gate.py +59 -59
  45. ccxt/async_support/gemini.py +4 -4
  46. ccxt/async_support/hitbtc.py +6 -6
  47. ccxt/async_support/hollaex.py +2 -2
  48. ccxt/async_support/huobi.py +70 -70
  49. ccxt/async_support/indodax.py +1 -1
  50. ccxt/async_support/kraken.py +33 -33
  51. ccxt/async_support/krakenfutures.py +6 -5
  52. ccxt/async_support/kucoin.py +74 -74
  53. ccxt/async_support/kucoinfutures.py +8 -8
  54. ccxt/async_support/latoken.py +14 -14
  55. ccxt/async_support/lbank2.py +33 -33
  56. ccxt/async_support/mexc.py +22 -22
  57. ccxt/async_support/ndax.py +1 -1
  58. ccxt/async_support/novadax.py +22 -22
  59. ccxt/async_support/oceanex.py +18 -18
  60. ccxt/async_support/okcoin.py +1950 -2758
  61. ccxt/async_support/okx.py +73 -73
  62. ccxt/async_support/paymium.py +11 -11
  63. ccxt/async_support/phemex.py +26 -26
  64. ccxt/async_support/poloniex.py +30 -30
  65. ccxt/async_support/poloniexfutures.py +25 -25
  66. ccxt/async_support/probit.py +21 -21
  67. ccxt/async_support/tokocrypto.py +22 -22
  68. ccxt/async_support/upbit.py +21 -21
  69. ccxt/async_support/wavesexchange.py +2 -2
  70. ccxt/async_support/wazirx.py +14 -14
  71. ccxt/async_support/whitebit.py +6 -6
  72. ccxt/async_support/woo.py +21 -21
  73. ccxt/async_support/yobit.py +16 -16
  74. ccxt/async_support/zaif.py +10 -10
  75. ccxt/async_support/zonda.py +15 -15
  76. ccxt/base/exchange.py +2 -1
  77. ccxt/bigone.py +2 -2
  78. ccxt/binance.py +184 -184
  79. ccxt/bingx.py +48 -48
  80. ccxt/bitbank.py +14 -14
  81. ccxt/bitbns.py +7 -7
  82. ccxt/bitfinex.py +2 -2
  83. ccxt/bitfinex2.py +35 -35
  84. ccxt/bitflyer.py +17 -17
  85. ccxt/bitforex.py +9 -9
  86. ccxt/bitget.py +433 -215
  87. ccxt/bitmart.py +39 -39
  88. ccxt/bitmex.py +7 -7
  89. ccxt/bitopro.py +1 -1
  90. ccxt/bitpanda.py +1 -1
  91. ccxt/bitrue.py +2 -2
  92. ccxt/bitso.py +2 -2
  93. ccxt/bitstamp.py +3 -3
  94. ccxt/bitvavo.py +2 -2
  95. ccxt/bl3p.py +1 -1
  96. ccxt/btcalpha.py +7 -7
  97. ccxt/btcturk.py +1 -1
  98. ccxt/bybit.py +58 -58
  99. ccxt/cex.py +1 -1
  100. ccxt/coinbase.py +13 -13
  101. ccxt/coinbasepro.py +15 -15
  102. ccxt/coinex.py +19 -19
  103. ccxt/coinone.py +2 -2
  104. ccxt/coinsph.py +4 -4
  105. ccxt/coinspot.py +2 -2
  106. ccxt/cryptocom.py +28 -28
  107. ccxt/currencycom.py +1 -1
  108. ccxt/delta.py +26 -26
  109. ccxt/deribit.py +9 -9
  110. ccxt/digifinex.py +38 -38
  111. ccxt/exmo.py +18 -18
  112. ccxt/gate.py +59 -59
  113. ccxt/gemini.py +4 -4
  114. ccxt/hitbtc.py +6 -6
  115. ccxt/hollaex.py +2 -2
  116. ccxt/huobi.py +70 -70
  117. ccxt/indodax.py +1 -1
  118. ccxt/kraken.py +33 -33
  119. ccxt/krakenfutures.py +6 -5
  120. ccxt/kucoin.py +74 -74
  121. ccxt/kucoinfutures.py +8 -8
  122. ccxt/latoken.py +14 -14
  123. ccxt/lbank2.py +33 -33
  124. ccxt/mexc.py +22 -22
  125. ccxt/ndax.py +1 -1
  126. ccxt/novadax.py +22 -22
  127. ccxt/oceanex.py +18 -18
  128. ccxt/okcoin.py +1950 -2758
  129. ccxt/okx.py +73 -73
  130. ccxt/paymium.py +11 -11
  131. ccxt/phemex.py +26 -26
  132. ccxt/poloniex.py +30 -30
  133. ccxt/poloniexfutures.py +25 -25
  134. ccxt/pro/__init__.py +1 -1
  135. ccxt/pro/ascendex.py +1 -1
  136. ccxt/pro/binance.py +9 -9
  137. ccxt/pro/bingx.py +12 -12
  138. ccxt/pro/bitget.py +2 -2
  139. ccxt/pro/bitpanda.py +7 -7
  140. ccxt/pro/bitrue.py +2 -2
  141. ccxt/pro/blockchaincom.py +6 -6
  142. ccxt/pro/bybit.py +15 -15
  143. ccxt/pro/cex.py +8 -8
  144. ccxt/pro/coinbase.py +6 -6
  145. ccxt/pro/coinbasepro.py +1 -1
  146. ccxt/pro/coinex.py +8 -8
  147. ccxt/pro/cryptocom.py +12 -12
  148. ccxt/pro/deribit.py +7 -7
  149. ccxt/pro/gemini.py +4 -4
  150. ccxt/pro/hitbtc.py +17 -17
  151. ccxt/pro/huobi.py +3 -3
  152. ccxt/pro/kraken.py +6 -6
  153. ccxt/pro/krakenfutures.py +10 -10
  154. ccxt/pro/kucoin.py +85 -42
  155. ccxt/pro/kucoinfutures.py +5 -5
  156. ccxt/pro/luno.py +1 -1
  157. ccxt/pro/mexc.py +7 -7
  158. ccxt/pro/okx.py +16 -15
  159. ccxt/pro/phemex.py +15 -15
  160. ccxt/pro/poloniex.py +9 -9
  161. ccxt/pro/poloniexfutures.py +5 -5
  162. ccxt/pro/probit.py +5 -5
  163. ccxt/pro/wazirx.py +5 -5
  164. ccxt/pro/woo.py +1 -1
  165. ccxt/probit.py +21 -21
  166. ccxt/test/base/test_shared_methods.py +1 -1
  167. ccxt/tokocrypto.py +22 -22
  168. ccxt/upbit.py +21 -21
  169. ccxt/wavesexchange.py +2 -2
  170. ccxt/wazirx.py +14 -14
  171. ccxt/whitebit.py +6 -6
  172. ccxt/woo.py +21 -21
  173. ccxt/yobit.py +16 -16
  174. ccxt/zaif.py +10 -10
  175. ccxt/zonda.py +15 -15
  176. {ccxt-4.1.19.dist-info → ccxt-4.1.22.dist-info}/METADATA +5 -9
  177. {ccxt-4.1.19.dist-info → ccxt-4.1.22.dist-info}/RECORD +179 -179
  178. {ccxt-4.1.19.dist-info → ccxt-4.1.22.dist-info}/WHEEL +0 -0
  179. {ccxt-4.1.19.dist-info → ccxt-4.1.22.dist-info}/top_level.txt +0 -0
ccxt/bitget.py CHANGED
@@ -1087,7 +1087,7 @@ class bitget(Exchange, ImplicitAPI):
1087
1087
  def fetch_time(self, params={}):
1088
1088
  """
1089
1089
  fetches the current integer timestamp in milliseconds from the exchange server
1090
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-server-time
1090
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-server-time
1091
1091
  :param dict [params]: extra parameters specific to the bitget api endpoint
1092
1092
  :returns int: the current integer timestamp in milliseconds from the exchange server
1093
1093
  """
@@ -1105,8 +1105,8 @@ class bitget(Exchange, ImplicitAPI):
1105
1105
  def fetch_markets(self, params={}):
1106
1106
  """
1107
1107
  retrieves data on all markets for bitget
1108
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
1109
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbols
1108
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
1109
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbols
1110
1110
  :param dict [params]: extra parameters specific to the exchange api endpoint
1111
1111
  :returns dict[]: an array of objects representing market data
1112
1112
  """
@@ -1364,7 +1364,7 @@ class bitget(Exchange, ImplicitAPI):
1364
1364
  def fetch_currencies(self, params={}):
1365
1365
  """
1366
1366
  fetches all available currencies on an exchange
1367
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
1367
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
1368
1368
  :param dict [params]: extra parameters specific to the bitget api endpoint
1369
1369
  :returns dict: an associative dictionary of currencies
1370
1370
  """
@@ -1482,7 +1482,7 @@ class bitget(Exchange, ImplicitAPI):
1482
1482
  def fetch_market_leverage_tiers(self, symbol: str, params={}):
1483
1483
  """
1484
1484
  retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
1485
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-position-tier
1485
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-position-tier
1486
1486
  :param str symbol: unified market symbol
1487
1487
  :param dict [params]: extra parameters specific to the bitget api endpoint
1488
1488
  :returns dict: a `leverage tiers structure <https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure>`
@@ -1546,7 +1546,7 @@ class bitget(Exchange, ImplicitAPI):
1546
1546
  def fetch_deposits(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
1547
1547
  """
1548
1548
  fetch all deposits made to an account
1549
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-deposit-list
1549
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-deposit-list
1550
1550
  :param str code: unified currency code
1551
1551
  :param int [since]: the earliest time in ms to fetch deposits for
1552
1552
  :param int [limit]: the maximum number of deposits structures to retrieve
@@ -1603,7 +1603,7 @@ class bitget(Exchange, ImplicitAPI):
1603
1603
  def withdraw(self, code: str, amount, address, tag=None, params={}):
1604
1604
  """
1605
1605
  make a withdrawal
1606
- see https://bitgetlimited.github.io/apidoc/en/spot/#withdraw-v2
1606
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#withdraw-v2
1607
1607
  :param str code: unified currency code
1608
1608
  :param float amount: the amount to withdraw
1609
1609
  :param str address: the address to withdraw to
@@ -1689,7 +1689,7 @@ class bitget(Exchange, ImplicitAPI):
1689
1689
  def fetch_withdrawals(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
1690
1690
  """
1691
1691
  fetch all withdrawals made from an account
1692
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-withdraw-list
1692
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-withdraw-list
1693
1693
  :param str code: unified currency code
1694
1694
  :param int [since]: the earliest time in ms to fetch withdrawals for
1695
1695
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -1809,7 +1809,7 @@ class bitget(Exchange, ImplicitAPI):
1809
1809
  def fetch_deposit_address(self, code: str, params={}):
1810
1810
  """
1811
1811
  fetch the deposit address for a currency associated with self account
1812
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-address
1812
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-address
1813
1813
  :param str code: unified currency code
1814
1814
  :param dict [params]: extra parameters specific to the bitget api endpoint
1815
1815
  :returns dict: an `address structure <https://github.com/ccxt/ccxt/wiki/Manual#address-structure>`
@@ -1864,8 +1864,8 @@ class bitget(Exchange, ImplicitAPI):
1864
1864
  def fetch_order_book(self, symbol: str, limit: Optional[int] = None, params={}):
1865
1865
  """
1866
1866
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
1867
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-depth
1868
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-depth
1867
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-depth
1868
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-depth
1869
1869
  :param str symbol: unified symbol of the market to fetch the order book for
1870
1870
  :param int [limit]: the maximum amount of order book entries to return
1871
1871
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -2018,8 +2018,8 @@ class bitget(Exchange, ImplicitAPI):
2018
2018
  def fetch_ticker(self, symbol: str, params={}):
2019
2019
  """
2020
2020
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
2021
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-ticker
2022
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-symbol-ticker
2021
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-single-ticker
2022
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-single-symbol-ticker
2023
2023
  :param str symbol: unified symbol of the market to fetch the ticker for
2024
2024
  :param dict [params]: extra parameters specific to the bitget api endpoint
2025
2025
  :returns dict: a `ticker structure <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
@@ -2060,8 +2060,8 @@ class bitget(Exchange, ImplicitAPI):
2060
2060
  def fetch_tickers(self, symbols: Optional[List[str]] = None, params={}):
2061
2061
  """
2062
2062
  fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
2063
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-all-tickers
2064
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbol-ticker
2063
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-all-tickers
2064
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbol-ticker
2065
2065
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2066
2066
  :param dict [params]: extra parameters specific to the bitget api endpoint
2067
2067
  :returns dict: a dictionary of `ticker structures <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
@@ -2161,42 +2161,61 @@ class bitget(Exchange, ImplicitAPI):
2161
2161
  # "symbol": "BTCUSDT_UMCBL"
2162
2162
  # }
2163
2163
  #
2164
- # private
2164
+ # spot: fetchMyTrades
2165
2165
  #
2166
2166
  # {
2167
- # accountId: '4383649766',
2168
- # symbol: 'ETHBTC_SPBL',
2169
- # orderId: '1009402341131468800',
2170
- # fillId: '1009402351489581068',
2171
- # orderType: 'limit',
2172
- # side: 'sell',
2173
- # fillPrice: '0.06997800',
2174
- # fillQuantity: '0.04120000',
2175
- # fillTotalAmount: '0.00288309',
2176
- # feeCcy: 'BTC',
2177
- # fees: '-0.00000288',
2178
- # cTime: '1676386195060'
2167
+ # "accountId": "7264631750",
2168
+ # "symbol": "BTCUSDT_SPBL",
2169
+ # "orderId": "1098394344925597696",
2170
+ # "fillId": "1098394344974925824",
2171
+ # "orderType": "market",
2172
+ # "side": "sell",
2173
+ # "fillPrice": "28467.68",
2174
+ # "fillQuantity": "0.0002",
2175
+ # "fillTotalAmount": "5.693536",
2176
+ # "feeCcy": "USDT",
2177
+ # "fees": "-0.005693536",
2178
+ # "takerMakerFlag": "taker",
2179
+ # "cTime": "1697603539699"
2179
2180
  # }
2180
2181
  #
2182
+ # swap and future: fetchMyTrades
2183
+ #
2181
2184
  # {
2182
- # tradeId: '881640729552281602',
2183
- # symbol: 'BTCUSDT_UMCBL',
2184
- # orderId: '881640729145409536',
2185
- # price: '38429.50',
2186
- # sizeQty: '0.001',
2187
- # fee: '0',
2188
- # side: 'open_long',
2189
- # fillAmount: '38.4295',
2190
- # profit: '0',
2191
- # cTime: '1645925450694'
2185
+ # "tradeId": "1099351653724958721",
2186
+ # "symbol": "BTCUSDT_UMCBL",
2187
+ # "orderId": "1099351653682413569",
2188
+ # "price": "29531.3",
2189
+ # "sizeQty": "0.001",
2190
+ # "fee": "-0.01771878",
2191
+ # "side": "close_long",
2192
+ # "fillAmount": "29.5313",
2193
+ # "profit": "0.001",
2194
+ # "enterPointSource": "WEB",
2195
+ # "tradeSide": "close_long",
2196
+ # "holdMode": "double_hold",
2197
+ # "takerMakerFlag": "taker",
2198
+ # "cTime": "1697831779891"
2199
+ # }
2200
+ #
2201
+ # isolated and cross margin: fetchMyTrades
2202
+ #
2203
+ # {
2204
+ # "orderId": "1099353730455318528",
2205
+ # "fillId": "1099353730627092481",
2206
+ # "orderType": "market",
2207
+ # "side": "sell",
2208
+ # "fillPrice": "29543.7",
2209
+ # "fillQuantity": "0.0001",
2210
+ # "fillTotalAmount": "2.95437",
2211
+ # "feeCcy": "USDT",
2212
+ # "fees": "-0.00295437",
2213
+ # "ctime": "1697832275063"
2192
2214
  # }
2193
2215
  #
2194
2216
  marketId = self.safe_string(trade, 'symbol')
2195
2217
  symbol = self.safe_symbol(marketId, market)
2196
- amount = self.safe_string_2(trade, 'fillQuantity', 'size')
2197
- amount = self.safe_string(trade, 'sizeQty', amount)
2198
- timestamp = self.safe_integer_2(trade, 'fillTime', 'timestamp')
2199
- timestamp = self.safe_integer(trade, 'cTime', timestamp)
2218
+ timestamp = self.safe_integer_n(trade, ['fillTime', 'timestamp', 'ctime', 'cTime'])
2200
2219
  fee = None
2201
2220
  feeAmount = self.safe_string(trade, 'fees')
2202
2221
  if feeAmount is not None:
@@ -2206,7 +2225,6 @@ class bitget(Exchange, ImplicitAPI):
2206
2225
  'currency': currencyCode,
2207
2226
  'cost': Precise.string_neg(feeAmount),
2208
2227
  }
2209
- datetime = self.iso8601(timestamp)
2210
2228
  return self.safe_trade({
2211
2229
  'info': trade,
2212
2230
  'id': self.safe_string_2(trade, 'tradeId', 'fillId'),
@@ -2214,22 +2232,22 @@ class bitget(Exchange, ImplicitAPI):
2214
2232
  'symbol': symbol,
2215
2233
  'side': self.safe_string_lower(trade, 'side'),
2216
2234
  'type': self.safe_string(trade, 'orderType'),
2217
- 'takerOrMaker': None,
2235
+ 'takerOrMaker': self.safe_string(trade, 'takerMakerFlag'),
2218
2236
  'price': self.safe_string_2(trade, 'fillPrice', 'price'),
2219
- 'amount': amount,
2237
+ 'amount': self.safe_string_n(trade, ['fillQuantity', 'size', 'sizeQty']),
2220
2238
  'cost': None,
2221
- 'fee': fee,
2222
2239
  'timestamp': timestamp,
2223
- 'datetime': datetime,
2240
+ 'datetime': self.iso8601(timestamp),
2241
+ 'fee': fee,
2224
2242
  }, market)
2225
2243
 
2226
2244
  def fetch_trades(self, symbol: str, since: Optional[int] = None, limit: Optional[int] = None, params={}):
2227
2245
  """
2228
2246
  get the list of most recent trades for a particular symbol
2229
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-market-trades
2230
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-fills
2231
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-recent-trades
2232
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-recent-fills
2247
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-market-trades
2248
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-fills
2249
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-recent-trades
2250
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-recent-fills
2233
2251
  :param str symbol: unified symbol of the market to fetch trades for
2234
2252
  :param int [since]: timestamp in ms of the earliest trade to fetch
2235
2253
  :param int [limit]: the maximum amount of trades to fetch
@@ -2331,7 +2349,7 @@ class bitget(Exchange, ImplicitAPI):
2331
2349
  def fetch_trading_fee(self, symbol: str, params={}):
2332
2350
  """
2333
2351
  fetch the trading fees for a market
2334
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-symbol
2352
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-single-symbol
2335
2353
  :param str symbol: unified market symbol
2336
2354
  :param dict [params]: extra parameters specific to the bitget api endpoint
2337
2355
  :returns dict: a `fee structure <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -2368,7 +2386,7 @@ class bitget(Exchange, ImplicitAPI):
2368
2386
  def fetch_trading_fees(self, params={}):
2369
2387
  """
2370
2388
  fetch the trading fees for multiple markets
2371
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
2389
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
2372
2390
  :param dict [params]: extra parameters specific to the bitget api endpoint
2373
2391
  :returns dict: a dictionary of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>` indexed by market symbols
2374
2392
  """
@@ -2454,12 +2472,12 @@ class bitget(Exchange, ImplicitAPI):
2454
2472
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
2455
2473
  """
2456
2474
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
2457
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-candle-data
2458
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-history-candle-data
2459
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-candle-data
2460
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-candle-data
2461
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-index-candle-data
2462
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-mark-candle-data
2475
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-candle-data
2476
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-history-candle-data
2477
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-candle-data
2478
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-candle-data
2479
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-index-candle-data
2480
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-mark-candle-data
2463
2481
  :param str symbol: unified symbol of the market to fetch OHLCV data for
2464
2482
  :param str timeframe: the length of time each candle represents
2465
2483
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -2547,10 +2565,10 @@ class bitget(Exchange, ImplicitAPI):
2547
2565
  def fetch_balance(self, params={}):
2548
2566
  """
2549
2567
  query for balance and get the amount of funds available for trading or funds locked in orders
2550
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
2551
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
2552
- see https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-assets
2553
- see https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-assets
2568
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
2569
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
2570
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-assets
2571
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-assets
2554
2572
  :param dict [params]: extra parameters specific to the bitget api endpoint
2555
2573
  :returns dict: a `balance structure <https://github.com/ccxt/ccxt/wiki/Manual#balance-structure>`
2556
2574
  """
@@ -2843,24 +2861,36 @@ class bitget(Exchange, ImplicitAPI):
2843
2861
  # "data": "1098753830701928448"
2844
2862
  # }
2845
2863
  #
2864
+ # isolated and cross margin: fetchOpenOrders, fetchCanceledOrders, fetchClosedOrders
2865
+ #
2866
+ # {
2867
+ # "symbol": "BTCUSDT",
2868
+ # "orderType": "limit",
2869
+ # "source": "WEB",
2870
+ # "orderId": "1099108898629627904",
2871
+ # "clientOid": "f9b55416029e4cc2bbbe2f40ac368c38",
2872
+ # "loanType": "autoLoan",
2873
+ # "price": "25000",
2874
+ # "side": "buy",
2875
+ # "status": "new",
2876
+ # "baseQuantity": "0.0002",
2877
+ # "quoteAmount": "5",
2878
+ # "fillPrice": "0",
2879
+ # "fillQuantity": "0",
2880
+ # "fillTotalAmount": "0",
2881
+ # "ctime": "1697773902588"
2882
+ # }
2883
+ #
2846
2884
  marketId = self.safe_string(order, 'symbol')
2847
2885
  market = self.safe_market(marketId, market)
2848
- symbol = market['symbol']
2849
- id = self.safe_string_2(order, 'orderId', 'data')
2850
- price = self.safe_string_2(order, 'price', 'executePrice')
2851
- amount = self.safe_string_2(order, 'quantity', 'size')
2852
- filled = self.safe_string_2(order, 'fillQuantity', 'filledQty')
2853
- cost = self.safe_string_2(order, 'fillTotalAmount', 'filledAmount')
2854
- average = self.safe_string_2(order, 'fillPrice', 'priceAvg')
2855
- type = self.safe_string(order, 'orderType')
2856
- timestamp = self.safe_integer(order, 'cTime')
2857
- lastUpdatetimestamp = self.safe_integer(order, 'uTime')
2886
+ timestamp = self.safe_integer_2(order, 'cTime', 'ctime')
2887
+ updateTimestamp = self.safe_integer(order, 'uTime')
2888
+ rawStatus = self.safe_string_2(order, 'status', 'state')
2858
2889
  side = self.safe_string_2(order, 'side', 'posSide')
2859
2890
  if (side == 'open_long') or (side == 'close_short'):
2860
2891
  side = 'buy'
2861
2892
  elif (side == 'close_long') or (side == 'open_short'):
2862
2893
  side = 'sell'
2863
- clientOrderId = self.safe_string_2(order, 'clientOrderId', 'clientOid')
2864
2894
  fee = None
2865
2895
  feeCostString = self.safe_string(order, 'fee')
2866
2896
  if feeCostString is not None:
@@ -2878,31 +2908,28 @@ class bitget(Exchange, ImplicitAPI):
2878
2908
  'cost': self.safe_string(first, 'totalFee'),
2879
2909
  'currency': self.safe_currency_code(self.safe_string(first, 'feeCoinCode')),
2880
2910
  }
2881
- rawStatus = self.safe_string_2(order, 'status', 'state')
2882
- status = self.parse_order_status(rawStatus)
2883
- lastTradeTimestamp = self.safe_integer(order, 'uTime')
2884
2911
  return self.safe_order({
2885
2912
  'info': order,
2886
- 'id': id,
2887
- 'clientOrderId': clientOrderId,
2913
+ 'id': self.safe_string_2(order, 'orderId', 'data'),
2914
+ 'clientOrderId': self.safe_string_2(order, 'clientOrderId', 'clientOid'),
2888
2915
  'timestamp': timestamp,
2889
2916
  'datetime': self.iso8601(timestamp),
2890
- 'lastTradeTimestamp': lastTradeTimestamp,
2891
- 'lastUpdateTimestamp': lastUpdatetimestamp,
2892
- 'symbol': symbol,
2893
- 'type': type,
2917
+ 'lastTradeTimestamp': updateTimestamp,
2918
+ 'lastUpdateTimestamp': updateTimestamp,
2919
+ 'symbol': market['symbol'],
2920
+ 'type': self.safe_string(order, 'orderType'),
2894
2921
  'timeInForce': None,
2895
2922
  'postOnly': None,
2896
2923
  'side': side,
2897
- 'price': price,
2924
+ 'price': self.safe_string_2(order, 'price', 'executePrice'),
2898
2925
  'stopPrice': self.safe_number(order, 'triggerPrice'),
2899
2926
  'triggerPrice': self.safe_number(order, 'triggerPrice'),
2900
- 'average': average,
2901
- 'cost': cost,
2902
- 'amount': amount,
2903
- 'filled': filled,
2927
+ 'average': self.safe_string_2(order, 'fillPrice', 'priceAvg'),
2928
+ 'cost': self.safe_string_2(order, 'fillTotalAmount', 'filledAmount'),
2929
+ 'amount': self.safe_string_n(order, ['quantity', 'size', 'baseQuantity']),
2930
+ 'filled': self.safe_string_2(order, 'fillQuantity', 'filledQty'),
2904
2931
  'remaining': None,
2905
- 'status': status,
2932
+ 'status': self.parse_order_status(rawStatus),
2906
2933
  'fee': fee,
2907
2934
  'trades': None,
2908
2935
  }, market)
@@ -2910,14 +2937,14 @@ class bitget(Exchange, ImplicitAPI):
2910
2937
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
2911
2938
  """
2912
2939
  create a trade order
2913
- see https://bitgetlimited.github.io/apidoc/en/spot/#place-order
2914
- see https://bitgetlimited.github.io/apidoc/en/spot/#place-plan-order
2915
- see https://bitgetlimited.github.io/apidoc/en/mix/#place-order
2916
- see https://bitgetlimited.github.io/apidoc/en/mix/#place-stop-order
2917
- see https://bitgetlimited.github.io/apidoc/en/mix/#place-position-tpsl
2918
- see https://bitgetlimited.github.io/apidoc/en/mix/#place-plan-order
2919
- see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-place-order
2920
- see https://bitgetlimited.github.io/apidoc/en/margin/#cross-place-order
2940
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#place-order
2941
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#place-plan-order
2942
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#place-order
2943
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#place-stop-order
2944
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#place-position-tpsl
2945
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#place-plan-order
2946
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-place-order
2947
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-place-order
2921
2948
  :param str symbol: unified symbol of the market to create an order in
2922
2949
  :param str type: 'market' or 'limit'
2923
2950
  :param str side: 'buy' or 'sell' or 'open_long' or 'open_short' or 'close_long' or 'close_short'
@@ -3098,10 +3125,10 @@ class bitget(Exchange, ImplicitAPI):
3098
3125
  def edit_order(self, id: str, symbol, type, side, amount=None, price=None, params={}):
3099
3126
  """
3100
3127
  edit a trade order
3101
- see https://bitgetlimited.github.io/apidoc/en/spot/#modify-plan-order
3102
- see https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order
3103
- see https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order-tpsl
3104
- see https://bitgetlimited.github.io/apidoc/en/mix/#modify-stop-order
3128
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#modify-plan-order
3129
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order
3130
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order-tpsl
3131
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#modify-stop-order
3105
3132
  :param str id: cancel order id
3106
3133
  :param str symbol: unified symbol of the market to create an order in
3107
3134
  :param str type: 'market' or 'limit'
@@ -3189,12 +3216,12 @@ class bitget(Exchange, ImplicitAPI):
3189
3216
  def cancel_order(self, id: str, symbol: Optional[str] = None, params={}):
3190
3217
  """
3191
3218
  cancels an open order
3192
- see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order
3193
- see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-plan-order
3194
- see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-order
3195
- see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-plan-order-tpsl
3196
- see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-cancel-order
3197
- see https://bitgetlimited.github.io/apidoc/en/margin/#cross-cancel-order
3219
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order
3220
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#cancel-plan-order
3221
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#cancel-order
3222
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#cancel-plan-order-tpsl
3223
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-cancel-order
3224
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-cancel-order
3198
3225
  :param str id: order id
3199
3226
  :param str symbol: unified symbol of the market the order was made in
3200
3227
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -3307,10 +3334,10 @@ class bitget(Exchange, ImplicitAPI):
3307
3334
  def cancel_orders(self, ids, symbol: Optional[str] = None, params={}):
3308
3335
  """
3309
3336
  cancel multiple orders
3310
- see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order-in-batch-v2-single-instruments
3311
- see https://bitgetlimited.github.io/apidoc/en/mix/#batch-cancel-order
3312
- see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
3313
- see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
3337
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order-in-batch-v2-single-instruments
3338
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#batch-cancel-order
3339
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
3340
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
3314
3341
  :param str[] ids: order ids
3315
3342
  :param str symbol: unified market symbol, default is None
3316
3343
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -3382,10 +3409,10 @@ class bitget(Exchange, ImplicitAPI):
3382
3409
  def cancel_all_orders(self, symbol: Optional[str] = None, params={}):
3383
3410
  """
3384
3411
  cancel all open orders
3385
- see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-all-order
3386
- see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-all-trigger-order-tpsl
3387
- see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
3388
- see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
3412
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#cancel-all-order
3413
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#cancel-all-trigger-order-tpsl
3414
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
3415
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
3389
3416
  :param str symbol: unified market symbol
3390
3417
  :param dict [params]: extra parameters specific to the bitget api endpoint
3391
3418
  :param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
@@ -3418,7 +3445,7 @@ class bitget(Exchange, ImplicitAPI):
3418
3445
  return self.privateMarginPostIsolatedOrderBatchCancelOrder(self.extend(spotMarginRequest, params))
3419
3446
  request = {
3420
3447
  'productType': productType,
3421
- 'marginCoin': market['settleId'],
3448
+ 'marginCoin': self.safe_string(market, 'settleId', 'USDT'),
3422
3449
  }
3423
3450
  stop = self.safe_value_2(params, 'stop', 'trigger')
3424
3451
  planType = self.safe_string(params, 'planType')
@@ -3453,8 +3480,8 @@ class bitget(Exchange, ImplicitAPI):
3453
3480
  def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
3454
3481
  """
3455
3482
  fetches information on an order made by the user
3456
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-details
3457
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-details
3483
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-order-details
3484
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-order-details
3458
3485
  :param str symbol: unified symbol of the market the order was made in
3459
3486
  :param dict [params]: extra parameters specific to the bitget api endpoint
3460
3487
  :returns dict: An `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
@@ -3534,10 +3561,13 @@ class bitget(Exchange, ImplicitAPI):
3534
3561
  def fetch_open_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3535
3562
  """
3536
3563
  fetch all unfilled currently open orders
3537
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-list
3538
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-open-order
3539
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-plan-order-tpsl-list
3540
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-open-order
3564
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-order-list
3565
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-current-plan-orders
3566
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-all-open-order
3567
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-plan-order-tpsl-list
3568
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-open-order
3569
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-open-orders
3570
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-open-orders
3541
3571
  :param str symbol: unified market symbol
3542
3572
  :param int [since]: the earliest time in ms to fetch open orders for
3543
3573
  :param int [limit]: the maximum number of open order structures to retrieve
@@ -3546,27 +3576,46 @@ class bitget(Exchange, ImplicitAPI):
3546
3576
  """
3547
3577
  self.load_markets()
3548
3578
  request = {}
3549
- marketType = None
3550
- query = None
3551
3579
  market = None
3580
+ marketType = None
3581
+ marginMode = None
3582
+ response = None
3552
3583
  if symbol is not None:
3553
3584
  market = self.market(symbol)
3554
- request['symbol'] = market['id']
3555
- marketType, query = self.handle_market_type_and_params('fetchOpenOrders', market, params)
3556
- response = None
3557
- stop = self.safe_value(query, 'stop')
3585
+ symbolRequest = (market['info']['symbolName']) if (marginMode is not None) else (market['id'])
3586
+ request['symbol'] = symbolRequest
3587
+ marketType, params = self.handle_market_type_and_params('fetchOpenOrders', market, params)
3588
+ marginMode, params = self.handle_margin_mode_and_params('fetchOpenOrders', params)
3589
+ stop = self.safe_value_2(params, 'stop', 'trigger')
3590
+ params = self.omit(params, ['stop', 'trigger'])
3558
3591
  if stop:
3559
3592
  self.check_required_symbol('fetchOpenOrders', symbol)
3560
- query = self.omit(query, 'stop')
3561
3593
  if marketType == 'spot':
3562
3594
  if limit is not None:
3563
3595
  request['pageSize'] = limit
3564
- response = self.privateSpotPostPlanCurrentPlan(self.extend(request, query))
3596
+ response = self.privateSpotPostPlanCurrentPlan(self.extend(request, params))
3565
3597
  else:
3566
- response = self.privateMixGetPlanCurrentPlan(self.extend(request, query))
3598
+ response = self.privateMixGetPlanCurrentPlan(self.extend(request, params))
3567
3599
  else:
3568
3600
  if marketType == 'spot':
3569
- response = self.privateSpotPostTradeOpenOrders(self.extend(request, query))
3601
+ if marginMode is not None:
3602
+ clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
3603
+ endTime = self.safe_integer_n(params, ['endTime', 'until', 'till'])
3604
+ params = self.omit(params, ['until', 'till', 'clientOrderId'])
3605
+ if clientOrderId is not None:
3606
+ request['clientOid'] = clientOrderId
3607
+ if endTime is not None:
3608
+ request['endTime'] = endTime
3609
+ if since is not None:
3610
+ request['startTime'] = since
3611
+ if limit is not None:
3612
+ request['pageSize'] = limit
3613
+ if marginMode == 'isolated':
3614
+ response = self.privateMarginGetIsolatedOrderOpenOrders(self.extend(request, params))
3615
+ elif marginMode == 'cross':
3616
+ response = self.privateMarginGetCrossOrderOpenOrders(self.extend(request, params))
3617
+ else:
3618
+ response = self.privateSpotPostTradeOpenOrders(self.extend(request, params))
3570
3619
  else:
3571
3620
  if market is None:
3572
3621
  subType = None
@@ -3576,9 +3625,10 @@ class bitget(Exchange, ImplicitAPI):
3576
3625
  if sandboxMode:
3577
3626
  productType = 'S' + productType
3578
3627
  request['productType'] = productType
3579
- response = self.privateMixGetOrderMarginCoinCurrent(self.extend(request, query))
3628
+ response = self.privateMixGetOrderMarginCoinCurrent(self.extend(request, params))
3580
3629
  else:
3581
- response = self.privateMixGetOrderCurrent(self.extend(request, query))
3630
+ self.check_required_symbol('fetchOpenOrders', symbol)
3631
+ response = self.privateMixGetOrderCurrent(self.extend(request, params))
3582
3632
  #
3583
3633
  # spot
3584
3634
  # {
@@ -3682,9 +3732,43 @@ class bitget(Exchange, ImplicitAPI):
3682
3732
  # }
3683
3733
  # }
3684
3734
  #
3735
+ # isolated and cross margin
3736
+ #
3737
+ # {
3738
+ # "code": "00000",
3739
+ # "msg": "success",
3740
+ # "requestTime": 1697773997250,
3741
+ # "data": {
3742
+ # "orderList": [
3743
+ # {
3744
+ # "symbol": "BTCUSDT",
3745
+ # "orderType": "limit",
3746
+ # "source": "WEB",
3747
+ # "orderId": "1099108898629627904",
3748
+ # "clientOid": "f9b55416029e4cc2bbbe2f40ac368c38",
3749
+ # "loanType": "autoLoan",
3750
+ # "price": "25000",
3751
+ # "side": "buy",
3752
+ # "status": "new",
3753
+ # "baseQuantity": "0.0002",
3754
+ # "quoteAmount": "5",
3755
+ # "fillPrice": "0",
3756
+ # "fillQuantity": "0",
3757
+ # "fillTotalAmount": "0",
3758
+ # "ctime": "1697773902588"
3759
+ # }
3760
+ # ],
3761
+ # "maxId": "1099108898629627904",
3762
+ # "minId": "1099108898629627904"
3763
+ # }
3764
+ # }
3765
+ #
3685
3766
  if isinstance(response, str):
3686
3767
  response = json.loads(response)
3687
3768
  data = self.safe_value(response, 'data', [])
3769
+ if marginMode is not None:
3770
+ resultList = self.safe_value(data, 'orderList', [])
3771
+ return self.parse_orders(resultList, market, since, limit)
3688
3772
  if not isinstance(data, list):
3689
3773
  result = self.safe_value(data, 'orderList', [])
3690
3774
  return self.add_pagination_cursor_to_result(data, result)
@@ -3693,10 +3777,12 @@ class bitget(Exchange, ImplicitAPI):
3693
3777
  def fetch_closed_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3694
3778
  """
3695
3779
  fetches information on multiple closed orders made by the user
3696
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-history
3697
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-orders
3698
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-plan-orders-tpsl
3699
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-history-plan-orders
3780
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-order-history
3781
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-history-plan-orders
3782
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-orders
3783
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-plan-orders-tpsl
3784
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-order-history
3785
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-order-history
3700
3786
  :param str symbol: unified market symbol of the closed orders
3701
3787
  :param int [since]: timestamp in ms of the earliest order
3702
3788
  :param int [limit]: the max number of closed orders to return
@@ -3726,10 +3812,12 @@ class bitget(Exchange, ImplicitAPI):
3726
3812
  def fetch_canceled_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3727
3813
  """
3728
3814
  fetches information on multiple canceled orders made by the user
3729
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-history
3730
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-orders
3731
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-plan-orders-tpsl
3732
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-history-plan-orders
3815
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-order-history
3816
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-history-plan-orders
3817
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-orders
3818
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-plan-orders-tpsl
3819
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-order-history
3820
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-order-history
3733
3821
  :param str symbol: unified market symbol of the canceled orders
3734
3822
  :param int [since]: timestamp in ms of the earliest order
3735
3823
  :param int [limit]: the max number of canceled orders to return
@@ -3760,43 +3848,62 @@ class bitget(Exchange, ImplicitAPI):
3760
3848
  self.load_markets()
3761
3849
  market = self.market(symbol)
3762
3850
  marketType = None
3851
+ marginMode = None
3852
+ response = None
3763
3853
  marketType, params = self.handle_market_type_and_params('fetchCanceledAndClosedOrders', market, params)
3764
- endTime = self.safe_integer_n(params, ['endTime', 'until', 'till'])
3765
- params = self.omit(params, ['until', 'till'])
3854
+ marginMode, params = self.handle_margin_mode_and_params('fetchCanceledAndClosedOrders', params)
3855
+ symbolRequest = (market['info']['symbolName']) if (marginMode is not None) else (market['id'])
3766
3856
  request = {
3767
- 'symbol': market['id'],
3857
+ 'symbol': symbolRequest,
3768
3858
  }
3769
- if since is not None:
3770
- request['startTime'] = since
3771
- method = self.get_supported_mapping(marketType, {
3772
- 'spot': 'privateSpotPostTradeHistory',
3773
- 'swap': 'privateMixGetOrderHistory',
3774
- 'future': 'privateMixGetOrderHistory',
3775
- })
3859
+ now = self.milliseconds()
3860
+ endTime = self.safe_integer_n(params, ['endTime', 'until', 'till'])
3776
3861
  stop = self.safe_value(params, 'stop')
3777
- if stop:
3778
- if marketType == 'spot':
3779
- method = 'privateSpotPostPlanHistoryPlan'
3780
- else:
3781
- method = 'privateMixGetPlanHistoryPlan'
3782
- params = self.omit(params, 'stop')
3783
- if marketType == 'swap' or stop:
3862
+ params = self.omit(params, ['until', 'till', 'stop'])
3863
+ if stop or (marketType == 'swap') or (marketType == 'future'):
3784
3864
  if limit is None:
3785
3865
  limit = 100
3786
3866
  request['pageSize'] = limit
3787
3867
  if since is None:
3788
- since = 0
3868
+ if marketType == 'spot':
3869
+ since = now - 7776000000
3870
+ else:
3871
+ since = 0
3789
3872
  request['startTime'] = since
3790
3873
  if endTime is None:
3791
3874
  request['endTime'] = self.milliseconds()
3792
3875
  else:
3793
3876
  request['endTime'] = endTime
3877
+ if stop:
3878
+ if marketType == 'spot':
3879
+ response = self.privateSpotPostPlanHistoryPlan(self.extend(request, params))
3880
+ else:
3881
+ response = self.privateMixGetPlanHistoryPlan(self.extend(request, params))
3794
3882
  else:
3795
- if limit is not None:
3796
- request['pageSize'] = limit
3797
- if endTime is not None:
3798
- request['endTime'] = endTime
3799
- response = getattr(self, method)(self.extend(request, params))
3883
+ if (marketType == 'swap') or (marketType == 'future'):
3884
+ response = self.privateMixGetOrderHistory(self.extend(request, params))
3885
+ else:
3886
+ if marginMode is not None:
3887
+ if since is None:
3888
+ since = now - 7776000000
3889
+ request['startTime'] = since
3890
+ if endTime is not None:
3891
+ request['endTime'] = endTime
3892
+ if limit is not None:
3893
+ request['pageSize'] = limit
3894
+ if marginMode == 'isolated':
3895
+ response = self.privateMarginGetIsolatedOrderHistory(self.extend(request, params))
3896
+ elif marginMode == 'cross':
3897
+ response = self.privateMarginGetCrossOrderHistory(self.extend(request, params))
3898
+ else:
3899
+ if limit is not None:
3900
+ request['limit'] = limit
3901
+ if since is not None:
3902
+ request['after'] = since
3903
+ if endTime is not None:
3904
+ params = self.omit(params, 'endTime')
3905
+ request['before'] = endTime
3906
+ response = self.privateSpotPostTradeHistory(self.extend(request, params))
3800
3907
  #
3801
3908
  # spot
3802
3909
  #
@@ -3913,6 +4020,37 @@ class bitget(Exchange, ImplicitAPI):
3913
4020
  # "requestTime":1627354109502
3914
4021
  # }
3915
4022
  #
4023
+ # isolated and cross margin
4024
+ #
4025
+ # {
4026
+ # "code": "00000",
4027
+ # "msg": "success",
4028
+ # "requestTime": 1697779608818,
4029
+ # "data": {
4030
+ # "orderList": [
4031
+ # {
4032
+ # "symbol": "BTCUSDT",
4033
+ # "orderType": "limit",
4034
+ # "source": "API",
4035
+ # "orderId": "1098761451063619584",
4036
+ # "clientOid": "8d8ac3454ed345fca914c9cd55682121",
4037
+ # "loanType": "normal",
4038
+ # "price": "25000",
4039
+ # "side": "buy",
4040
+ # "status": "cancelled",
4041
+ # "baseQuantity": "0.0002",
4042
+ # "quoteAmount": "0",
4043
+ # "fillPrice": "0",
4044
+ # "fillQuantity": "0",
4045
+ # "fillTotalAmount": "0",
4046
+ # "ctime": "1697691064614"
4047
+ # },
4048
+ # ],
4049
+ # "maxId": "1098761451063619584",
4050
+ # "minId": "1098394690472521728"
4051
+ # }
4052
+ # }
4053
+ #
3916
4054
  data = self.safe_value(response, 'data')
3917
4055
  if data is not None:
3918
4056
  if 'orderList' in data:
@@ -3940,7 +4078,7 @@ class bitget(Exchange, ImplicitAPI):
3940
4078
 
3941
4079
  def fetch_ledger(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3942
4080
  """
3943
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-bills
4081
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-bills
3944
4082
  fetch the history of changes, actions done by the user or operations that altered balance of the user
3945
4083
  :param str code: unified currency code, default is None
3946
4084
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
@@ -4035,14 +4173,16 @@ class bitget(Exchange, ImplicitAPI):
4035
4173
  def fetch_my_trades(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4036
4174
  """
4037
4175
  fetch all trades made by the user
4038
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
4039
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
4176
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
4177
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
4178
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-transaction-details
4179
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-order-fills
4040
4180
  :param str symbol: unified market symbol
4041
4181
  :param int [since]: the earliest time in ms to fetch trades for
4042
4182
  :param int [limit]: the maximum number of trades structures to retrieve
4043
4183
  :param dict [params]: extra parameters specific to the bitget api endpoint
4044
- :param int [params.until]: *swap only* the latest time in ms to fetch entries for
4045
- :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4184
+ :param int [params.until]: the latest time in ms to fetch entries for
4185
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4046
4186
  :returns Trade[]: a list of `trade structures <https://github.com/ccxt/ccxt/wiki/Manual#trade-structure>`
4047
4187
  """
4048
4188
  self.check_required_symbol('fetchMyTrades', symbol)
@@ -4055,14 +4195,34 @@ class bitget(Exchange, ImplicitAPI):
4055
4195
  return self.fetch_paginated_call_cursor('fetchMyTrades', symbol, since, limit, params, 'orderId', 'after', None, 50)
4056
4196
  else:
4057
4197
  return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params, 500)
4198
+ response = None
4199
+ marginMode = None
4200
+ marginMode, params = self.handle_margin_mode_and_params('fetchMyTrades', params)
4201
+ symbolRequest = (market['info']['symbolName']) if (marginMode is not None) else (market['id'])
4058
4202
  request = {
4059
- 'symbol': market['id'],
4203
+ 'symbol': symbolRequest,
4060
4204
  }
4061
- if limit is not None:
4062
- request['limit'] = limit
4063
- response = None
4064
4205
  if market['spot']:
4065
- response = self.privateSpotPostTradeFills(self.extend(request, params))
4206
+ if marginMode is not None:
4207
+ request, params = self.handle_until_option('endTime', request, params)
4208
+ if since is not None:
4209
+ request['startTime'] = since
4210
+ else:
4211
+ now = self.milliseconds()
4212
+ request['startTime'] = now - 7776000000
4213
+ if limit is not None:
4214
+ request['pageSize'] = limit
4215
+ if marginMode == 'isolated':
4216
+ response = self.privateMarginGetIsolatedOrderFills(self.extend(request, params))
4217
+ elif marginMode == 'cross':
4218
+ response = self.privateMarginGetCrossOrderFills(self.extend(request, params))
4219
+ else:
4220
+ request, params = self.handle_until_option('before', request, params)
4221
+ if since is not None:
4222
+ request['after'] = since
4223
+ if limit is not None:
4224
+ request['limit'] = limit
4225
+ response = self.privateSpotPostTradeFills(self.extend(request, params))
4066
4226
  else:
4067
4227
  orderId = self.safe_string(params, 'orderId') # when order id is not defined, startTime and endTime are required
4068
4228
  if since is not None:
@@ -4074,36 +4234,94 @@ class bitget(Exchange, ImplicitAPI):
4074
4234
  request['endTime'] = self.milliseconds()
4075
4235
  response = self.privateMixGetOrderFills(self.extend(request, params))
4076
4236
  #
4237
+ # spot
4238
+ #
4077
4239
  # {
4078
- # code: '00000',
4079
- # msg: 'success',
4080
- # requestTime: '1645918954082',
4081
- # data: [
4082
- # {
4083
- # accountId: '6394957606',
4084
- # symbol: 'LTCUSDT_SPBL',
4085
- # orderId: '864752115272552448',
4086
- # fillId: '864752115685969921',
4087
- # orderType: 'limit',
4088
- # side: 'buy',
4089
- # fillPrice: '127.92000000',
4090
- # fillQuantity: '0.10000000',
4091
- # fillTotalAmount: '12.79200000',
4092
- # feeCcy: 'LTC',
4093
- # fees: '0.00000000',
4094
- # cTime: '1641898891373'
4240
+ # "code": "00000",
4241
+ # "msg": "success",
4242
+ # "requestTime": 1697831543676,
4243
+ # "data": [
4244
+ # {
4245
+ # "accountId": "7264631750",
4246
+ # "symbol": "BTCUSDT_SPBL",
4247
+ # "orderId": "1098394344925597696",
4248
+ # "fillId": "1098394344974925824",
4249
+ # "orderType": "market",
4250
+ # "side": "sell",
4251
+ # "fillPrice": "28467.68",
4252
+ # "fillQuantity": "0.0002",
4253
+ # "fillTotalAmount": "5.693536",
4254
+ # "feeCcy": "USDT",
4255
+ # "fees": "-0.005693536",
4256
+ # "takerMakerFlag": "taker",
4257
+ # "cTime": "1697603539699"
4258
+ # },
4259
+ # ]
4260
+ # }
4261
+ #
4262
+ # swap and future
4263
+ #
4264
+ # {
4265
+ # "code": "00000",
4266
+ # "msg": "success",
4267
+ # "requestTime": 1697831790948,
4268
+ # "data": [
4269
+ # {
4270
+ # "tradeId": "1099351653724958721",
4271
+ # "symbol": "BTCUSDT_UMCBL",
4272
+ # "orderId": "1099351653682413569",
4273
+ # "price": "29531.3",
4274
+ # "sizeQty": "0.001",
4275
+ # "fee": "-0.01771878",
4276
+ # "side": "close_long",
4277
+ # "fillAmount": "29.5313",
4278
+ # "profit": "0.001",
4279
+ # "enterPointSource": "WEB",
4280
+ # "tradeSide": "close_long",
4281
+ # "holdMode": "double_hold",
4282
+ # "takerMakerFlag": "taker",
4283
+ # "cTime": "1697831779891"
4284
+ # },
4285
+ # ]
4286
+ # }
4287
+ #
4288
+ # isolated and cross margin
4289
+ #
4290
+ # {
4291
+ # "code": "00000",
4292
+ # "msg": "success",
4293
+ # "requestTime": 1697832285469,
4294
+ # "data": {
4295
+ # "fills": [
4296
+ # {
4297
+ # "orderId": "1099353730455318528",
4298
+ # "fillId": "1099353730627092481",
4299
+ # "orderType": "market",
4300
+ # "side": "sell",
4301
+ # "fillPrice": "29543.7",
4302
+ # "fillQuantity": "0.0001",
4303
+ # "fillTotalAmount": "2.95437",
4304
+ # "feeCcy": "USDT",
4305
+ # "fees": "-0.00295437",
4306
+ # "ctime": "1697832275063"
4307
+ # },
4308
+ # ],
4309
+ # "minId": "1099353591699161118",
4310
+ # "maxId": "1099353730627092481"
4095
4311
  # }
4096
- # ]
4097
4312
  # }
4098
4313
  #
4099
4314
  data = self.safe_value(response, 'data')
4315
+ if marginMode is not None:
4316
+ fills = self.safe_value(data, 'fills', [])
4317
+ return self.parse_trades(fills, market, since, limit)
4100
4318
  return self.parse_trades(data, market, since, limit)
4101
4319
 
4102
4320
  def fetch_order_trades(self, id: str, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4103
4321
  """
4104
4322
  fetch all the trades made from a single order
4105
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
4106
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
4323
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
4324
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
4107
4325
  :param str id: order id
4108
4326
  :param str symbol: unified market symbol
4109
4327
  :param int [since]: the earliest time in ms to fetch trades for
@@ -4154,7 +4372,7 @@ class bitget(Exchange, ImplicitAPI):
4154
4372
  def fetch_position(self, symbol: str, params={}):
4155
4373
  """
4156
4374
  fetch data on a single open contract trade position
4157
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-symbol-position-v2
4375
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-symbol-position-v2
4158
4376
  :param str symbol: unified market symbol of the market the position is held in, default is None
4159
4377
  :param dict [params]: extra parameters specific to the bitget api endpoint
4160
4378
  :returns dict: a `position structure <https://github.com/ccxt/ccxt/wiki/Manual#position-structure>`
@@ -4202,8 +4420,8 @@ class bitget(Exchange, ImplicitAPI):
4202
4420
  def fetch_positions(self, symbols: Optional[List[str]] = None, params={}):
4203
4421
  """
4204
4422
  fetch all open positions
4205
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-position-v2
4206
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-position
4423
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-all-position-v2
4424
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-position
4207
4425
  :param str[]|None symbols: list of unified market symbols
4208
4426
  :param dict [params]: extra parameters specific to the bitget api endpoint
4209
4427
  :returns dict[]: a list of `position structure <https://github.com/ccxt/ccxt/wiki/Manual#position-structure>`
@@ -4440,7 +4658,7 @@ class bitget(Exchange, ImplicitAPI):
4440
4658
 
4441
4659
  def fetch_funding_rate_history(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4442
4660
  """
4443
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
4661
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
4444
4662
  fetches historical funding rate prices
4445
4663
  :param str symbol: unified symbol of the market to fetch the funding rate history for
4446
4664
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
@@ -4500,7 +4718,7 @@ class bitget(Exchange, ImplicitAPI):
4500
4718
  def fetch_funding_rate(self, symbol: str, params={}):
4501
4719
  """
4502
4720
  fetch the current funding rate
4503
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-current-funding-rate
4721
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-current-funding-rate
4504
4722
  :param str symbol: unified market symbol
4505
4723
  :param dict [params]: extra parameters specific to the bitget api endpoint
4506
4724
  :returns dict: a `funding rate structure <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure>`
@@ -4559,7 +4777,7 @@ class bitget(Exchange, ImplicitAPI):
4559
4777
  def fetch_funding_history(self, symbol: str, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4560
4778
  """
4561
4779
  fetch the funding history
4562
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-bill
4780
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-account-bill
4563
4781
  :param str symbol: unified market symbol
4564
4782
  :param int [since]: the starting timestamp in milliseconds
4565
4783
  :param int [limit]: the number of entries to return
@@ -4694,7 +4912,7 @@ class bitget(Exchange, ImplicitAPI):
4694
4912
  def reduce_margin(self, symbol: str, amount, params={}):
4695
4913
  """
4696
4914
  remove margin from a position
4697
- see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
4915
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
4698
4916
  :param str symbol: unified market symbol
4699
4917
  :param float amount: the amount of margin to remove
4700
4918
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4710,7 +4928,7 @@ class bitget(Exchange, ImplicitAPI):
4710
4928
  def add_margin(self, symbol: str, amount, params={}):
4711
4929
  """
4712
4930
  add margin
4713
- see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
4931
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
4714
4932
  :param str symbol: unified market symbol
4715
4933
  :param float amount: amount of margin to add
4716
4934
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4724,7 +4942,7 @@ class bitget(Exchange, ImplicitAPI):
4724
4942
  def fetch_leverage(self, symbol: str, params={}):
4725
4943
  """
4726
4944
  fetch the set leverage for a market
4727
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-account
4945
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-single-account
4728
4946
  :param str symbol: unified market symbol
4729
4947
  :param dict [params]: extra parameters specific to the bitget api endpoint
4730
4948
  :returns dict: a `leverage structure <https://github.com/ccxt/ccxt/wiki/Manual#leverage-structure>`
@@ -4767,7 +4985,7 @@ class bitget(Exchange, ImplicitAPI):
4767
4985
  def set_leverage(self, leverage, symbol: Optional[str] = None, params={}):
4768
4986
  """
4769
4987
  set the level of leverage for a market
4770
- see https://bitgetlimited.github.io/apidoc/en/mix/#change-leverage
4988
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#change-leverage
4771
4989
  :param float leverage: the rate of leverage
4772
4990
  :param str symbol: unified market symbol
4773
4991
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4787,7 +5005,7 @@ class bitget(Exchange, ImplicitAPI):
4787
5005
  def set_margin_mode(self, marginMode, symbol: Optional[str] = None, params={}):
4788
5006
  """
4789
5007
  set margin mode to 'cross' or 'isolated'
4790
- see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin-mode
5008
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#change-margin-mode
4791
5009
  :param str marginMode: 'cross' or 'isolated'
4792
5010
  :param str symbol: unified market symbol
4793
5011
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4813,7 +5031,7 @@ class bitget(Exchange, ImplicitAPI):
4813
5031
  def set_position_mode(self, hedged, symbol: Optional[str] = None, params={}):
4814
5032
  """
4815
5033
  set hedged to True or False for a market
4816
- see https://bitgetlimited.github.io/apidoc/en/mix/#change-hold-mode
5034
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#change-hold-mode
4817
5035
  :param bool hedged: set to True to use dualSidePosition
4818
5036
  :param str symbol: not used by bitget setPositionMode()
4819
5037
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4849,7 +5067,7 @@ class bitget(Exchange, ImplicitAPI):
4849
5067
  def fetch_open_interest(self, symbol: str, params={}):
4850
5068
  """
4851
5069
  Retrieves the open interest of a currency
4852
- see https://bitgetlimited.github.io/apidoc/en/mix/#get-open-interest
5070
+ :see: https://bitgetlimited.github.io/apidoc/en/mix/#get-open-interest
4853
5071
  :param str symbol: Unified CCXT market symbol
4854
5072
  :param dict [params]: exchange specific parameters
4855
5073
  :returns dict} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#interest-history-structure:
@@ -4880,7 +5098,7 @@ class bitget(Exchange, ImplicitAPI):
4880
5098
  def fetch_transfers(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4881
5099
  """
4882
5100
  fetch a history of internal transfers made on an account
4883
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-transfer-list
5101
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-transfer-list
4884
5102
  :param str code: unified currency code of the currency transferred
4885
5103
  :param int [since]: the earliest time in ms to fetch transfers for
4886
5104
  :param int [limit]: the maximum number of transfers structures to retrieve
@@ -4935,7 +5153,7 @@ class bitget(Exchange, ImplicitAPI):
4935
5153
 
4936
5154
  def transfer(self, code: str, amount, fromAccount, toAccount, params={}):
4937
5155
  """
4938
- see https://bitgetlimited.github.io/apidoc/en/spot/#transfer-v2
5156
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#transfer-v2
4939
5157
  transfer currency internally between wallets on the same account
4940
5158
  :param str code: unified currency code
4941
5159
  :param float amount: amount to transfer
@@ -5089,7 +5307,7 @@ class bitget(Exchange, ImplicitAPI):
5089
5307
  def fetch_deposit_withdraw_fees(self, codes: Optional[List[str]] = None, params={}):
5090
5308
  """
5091
5309
  fetch deposit and withdraw fees
5092
- see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
5310
+ :see: https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
5093
5311
  :param str[]|None codes: list of unified currency codes
5094
5312
  :param dict [params]: extra parameters specific to the bitget api endpoint
5095
5313
  :returns dict: a list of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -5130,8 +5348,8 @@ class bitget(Exchange, ImplicitAPI):
5130
5348
  def borrow_margin(self, code: str, amount, symbol: Optional[str] = None, params={}):
5131
5349
  """
5132
5350
  create a loan to borrow margin
5133
- see https://bitgetlimited.github.io/apidoc/en/margin/#cross-borrow
5134
- see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-borrow
5351
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-borrow
5352
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-borrow
5135
5353
  :param str code: unified currency code of the currency to borrow
5136
5354
  :param str amount: the amount to borrow
5137
5355
  :param str [symbol]: unified market symbol
@@ -5192,8 +5410,8 @@ class bitget(Exchange, ImplicitAPI):
5192
5410
  def repay_margin(self, code: str, amount, symbol: Optional[str] = None, params={}):
5193
5411
  """
5194
5412
  repay borrowed margin and interest
5195
- see https://bitgetlimited.github.io/apidoc/en/margin/#cross-repay
5196
- see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-repay
5413
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#cross-repay
5414
+ :see: https://bitgetlimited.github.io/apidoc/en/margin/#isolated-repay
5197
5415
  :param str code: unified currency code of the currency to repay
5198
5416
  :param str amount: the amount to repay
5199
5417
  :param str [symbol]: unified market symbol