ccxt 4.0.107__py2.py3-none-any.whl → 4.0.109__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ccxt/bitforex.py CHANGED
@@ -165,6 +165,7 @@ class bitforex(Exchange, ImplicitAPI):
165
165
  def fetch_markets(self, params={}):
166
166
  """
167
167
  retrieves data on all markets for bitforex
168
+ see https://apidoc.bitforex.com/#exchange-information
168
169
  :param dict [params]: extra parameters specific to the exchange api endpoint
169
170
  :returns dict[]: an array of objects representing market data
170
171
  """
@@ -314,6 +315,7 @@ class bitforex(Exchange, ImplicitAPI):
314
315
  def fetch_trades(self, symbol: str, since: Optional[int] = None, limit: Optional[int] = None, params={}):
315
316
  """
316
317
  get the list of most recent trades for a particular symbol
318
+ see https://apidoc.bitforex.com/#recent-trades-list
317
319
  :param str symbol: unified symbol of the market to fetch trades for
318
320
  :param int [since]: timestamp in ms of the earliest trade to fetch
319
321
  :param int [limit]: the maximum amount of trades to fetch
@@ -417,6 +419,7 @@ class bitforex(Exchange, ImplicitAPI):
417
419
  def fetch_balance(self, params={}):
418
420
  """
419
421
  query for balance and get the amount of funds available for trading or funds locked in orders
422
+ see https://apidoc.bitforex.com/#user-all-asset-information-user_data
420
423
  :param dict [params]: extra parameters specific to the bitforex api endpoint
421
424
  :returns dict: a `balance structure <https://github.com/ccxt/ccxt/wiki/Manual#balance-structure>`
422
425
  """
@@ -464,6 +467,7 @@ class bitforex(Exchange, ImplicitAPI):
464
467
  def fetch_ticker(self, symbol: str, params={}):
465
468
  """
466
469
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
470
+ see https://apidoc.bitforex.com/#exchange-information
467
471
  :param str symbol: unified symbol of the market to fetch the ticker for
468
472
  :param dict [params]: extra parameters specific to the bitforex api endpoint
469
473
  :returns dict: a `ticker structure <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
@@ -516,6 +520,7 @@ class bitforex(Exchange, ImplicitAPI):
516
520
  def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
517
521
  """
518
522
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
523
+ see https://apidoc.bitforex.com/#kline
519
524
  :param str symbol: unified symbol of the market to fetch OHLCV data for
520
525
  :param str timeframe: the length of time each candle represents
521
526
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -549,6 +554,7 @@ class bitforex(Exchange, ImplicitAPI):
549
554
  def fetch_order_book(self, symbol: str, limit: Optional[int] = None, params={}):
550
555
  """
551
556
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
557
+ see https://apidoc.bitforex.com/#order-book
552
558
  :param str symbol: unified symbol of the market to fetch the order book for
553
559
  :param int [limit]: the maximum amount of order book entries to return
554
560
  :param dict [params]: extra parameters specific to the bitforex api endpoint
@@ -631,6 +637,7 @@ class bitforex(Exchange, ImplicitAPI):
631
637
  def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
632
638
  """
633
639
  fetches information on an order made by the user
640
+ * @see
634
641
  :param str symbol: unified symbol of the market the order was made in
635
642
  :param dict [params]: extra parameters specific to the bitforex api endpoint
636
643
  :returns dict: An `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
@@ -688,6 +695,7 @@ class bitforex(Exchange, ImplicitAPI):
688
695
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
689
696
  """
690
697
  create a trade order
698
+ see https://apidoc.bitforex.com/#new-order-trade
691
699
  :param str symbol: unified symbol of the market to create an order in
692
700
  :param str type: 'market' or 'limit'
693
701
  :param str side: 'buy' or 'sell'
@@ -719,6 +727,7 @@ class bitforex(Exchange, ImplicitAPI):
719
727
  def cancel_order(self, id: str, symbol: Optional[str] = None, params={}):
720
728
  """
721
729
  cancels an open order
730
+ see https://apidoc.bitforex.com/#cancel-order-trade
722
731
  :param str id: order id
723
732
  :param str symbol: unified symbol of the market the order was made in
724
733
  :param dict [params]: extra parameters specific to the bitforex api endpoint
ccxt/bitget.py CHANGED
@@ -1084,6 +1084,7 @@ class bitget(Exchange, ImplicitAPI):
1084
1084
  def fetch_time(self, params={}):
1085
1085
  """
1086
1086
  fetches the current integer timestamp in milliseconds from the exchange server
1087
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-server-time
1087
1088
  :param dict [params]: extra parameters specific to the bitget api endpoint
1088
1089
  :returns int: the current integer timestamp in milliseconds from the exchange server
1089
1090
  """
@@ -1101,6 +1102,8 @@ class bitget(Exchange, ImplicitAPI):
1101
1102
  def fetch_markets(self, params={}):
1102
1103
  """
1103
1104
  retrieves data on all markets for bitget
1105
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
1106
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbols
1104
1107
  :param dict [params]: extra parameters specific to the exchange api endpoint
1105
1108
  :returns dict[]: an array of objects representing market data
1106
1109
  """
@@ -1357,6 +1360,7 @@ class bitget(Exchange, ImplicitAPI):
1357
1360
  def fetch_currencies(self, params={}):
1358
1361
  """
1359
1362
  fetches all available currencies on an exchange
1363
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
1360
1364
  :param dict [params]: extra parameters specific to the bitget api endpoint
1361
1365
  :returns dict: an associative dictionary of currencies
1362
1366
  """
@@ -1770,6 +1774,7 @@ class bitget(Exchange, ImplicitAPI):
1770
1774
  def fetch_deposit_address(self, code: str, params={}):
1771
1775
  """
1772
1776
  fetch the deposit address for a currency associated with self account
1777
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-address
1773
1778
  :param str code: unified currency code
1774
1779
  :param dict [params]: extra parameters specific to the bitget api endpoint
1775
1780
  :returns dict: an `address structure <https://github.com/ccxt/ccxt/wiki/Manual#address-structure>`
@@ -1824,6 +1829,8 @@ class bitget(Exchange, ImplicitAPI):
1824
1829
  def fetch_order_book(self, symbol: str, limit: Optional[int] = None, params={}):
1825
1830
  """
1826
1831
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
1832
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-depth
1833
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-depth
1827
1834
  :param str symbol: unified symbol of the market to fetch the order book for
1828
1835
  :param int [limit]: the maximum amount of order book entries to return
1829
1836
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -1976,6 +1983,8 @@ class bitget(Exchange, ImplicitAPI):
1976
1983
  def fetch_ticker(self, symbol: str, params={}):
1977
1984
  """
1978
1985
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1986
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-ticker
1987
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-symbol-ticker
1979
1988
  :param str symbol: unified symbol of the market to fetch the ticker for
1980
1989
  :param dict [params]: extra parameters specific to the bitget api endpoint
1981
1990
  :returns dict: a `ticker structure <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
@@ -2283,6 +2292,7 @@ class bitget(Exchange, ImplicitAPI):
2283
2292
  def fetch_trading_fee(self, symbol: str, params={}):
2284
2293
  """
2285
2294
  fetch the trading fees for a market
2295
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-symbol
2286
2296
  :param str symbol: unified market symbol
2287
2297
  :param dict [params]: extra parameters specific to the bitget api endpoint
2288
2298
  :returns dict: a `fee structure <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>`
@@ -2319,6 +2329,7 @@ class bitget(Exchange, ImplicitAPI):
2319
2329
  def fetch_trading_fees(self, params={}):
2320
2330
  """
2321
2331
  fetch the trading fees for multiple markets
2332
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
2322
2333
  :param dict [params]: extra parameters specific to the bitget api endpoint
2323
2334
  :returns dict: a dictionary of `fee structures <https://github.com/ccxt/ccxt/wiki/Manual#fee-structure>` indexed by market symbols
2324
2335
  """
@@ -2491,9 +2502,9 @@ class bitget(Exchange, ImplicitAPI):
2491
2502
 
2492
2503
  def fetch_balance(self, params={}):
2493
2504
  """
2505
+ query for balance and get the amount of funds available for trading or funds locked in orders
2494
2506
  see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
2495
2507
  see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
2496
- query for balance and get the amount of funds available for trading or funds locked in orders
2497
2508
  :param dict [params]: extra parameters specific to the bitget api endpoint
2498
2509
  :returns dict: a `balance structure <https://github.com/ccxt/ccxt/wiki/Manual#balance-structure>`
2499
2510
  """
@@ -2742,13 +2753,13 @@ class bitget(Exchange, ImplicitAPI):
2742
2753
 
2743
2754
  def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
2744
2755
  """
2756
+ create a trade order
2745
2757
  see https://bitgetlimited.github.io/apidoc/en/spot/#place-order
2746
2758
  see https://bitgetlimited.github.io/apidoc/en/spot/#place-plan-order
2747
2759
  see https://bitgetlimited.github.io/apidoc/en/mix/#place-order
2748
2760
  see https://bitgetlimited.github.io/apidoc/en/mix/#place-stop-order
2749
2761
  see https://bitgetlimited.github.io/apidoc/en/mix/#place-position-tpsl
2750
2762
  see https://bitgetlimited.github.io/apidoc/en/mix/#place-plan-order
2751
- create a trade order
2752
2763
  :param str symbol: unified symbol of the market to create an order in
2753
2764
  :param str type: 'market' or 'limit'
2754
2765
  :param str side: 'buy' or 'sell' or 'open_long' or 'open_short' or 'close_long' or 'close_short'
@@ -2904,6 +2915,10 @@ class bitget(Exchange, ImplicitAPI):
2904
2915
  def edit_order(self, id: str, symbol, type, side, amount=None, price=None, params={}):
2905
2916
  """
2906
2917
  edit a trade order
2918
+ see https://bitgetlimited.github.io/apidoc/en/spot/#modify-plan-order
2919
+ see https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order
2920
+ see https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order-tpsl
2921
+ see https://bitgetlimited.github.io/apidoc/en/mix/#modify-stop-order
2907
2922
  :param str id: cancel order id
2908
2923
  :param str symbol: unified symbol of the market to create an order in
2909
2924
  :param str type: 'market' or 'limit'
@@ -2991,6 +3006,10 @@ class bitget(Exchange, ImplicitAPI):
2991
3006
  def cancel_order(self, id: str, symbol: Optional[str] = None, params={}):
2992
3007
  """
2993
3008
  cancels an open order
3009
+ see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order
3010
+ see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-plan-order
3011
+ see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-order
3012
+ see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-plan-order-tpsl
2994
3013
  :param str id: order id
2995
3014
  :param str symbol: unified symbol of the market the order was made in
2996
3015
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -3028,6 +3047,8 @@ class bitget(Exchange, ImplicitAPI):
3028
3047
  def cancel_orders(self, ids, symbol: Optional[str] = None, params={}):
3029
3048
  """
3030
3049
  cancel multiple orders
3050
+ see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order-in-batch-v2-single-instruments
3051
+ see https://bitgetlimited.github.io/apidoc/en/mix/#batch-cancel-order
3031
3052
  :param str[] ids: order ids
3032
3053
  :param str symbol: unified market symbol, default is None
3033
3054
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -3153,6 +3174,8 @@ class bitget(Exchange, ImplicitAPI):
3153
3174
  def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
3154
3175
  """
3155
3176
  fetches information on an order made by the user
3177
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-details
3178
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-details
3156
3179
  :param str symbol: unified symbol of the market the order was made in
3157
3180
  :param dict [params]: extra parameters specific to the bitget api endpoint
3158
3181
  :returns dict: An `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
@@ -3231,11 +3254,11 @@ class bitget(Exchange, ImplicitAPI):
3231
3254
 
3232
3255
  def fetch_open_orders(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3233
3256
  """
3257
+ fetch all unfilled currently open orders
3234
3258
  see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-list
3235
3259
  see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-open-order
3236
3260
  see https://bitgetlimited.github.io/apidoc/en/mix/#get-plan-order-tpsl-list
3237
3261
  see https://bitgetlimited.github.io/apidoc/en/mix/#get-open-order
3238
- fetch all unfilled currently open orders
3239
3262
  :param str symbol: unified market symbol
3240
3263
  :param int [since]: the earliest time in ms to fetch open orders for
3241
3264
  :param int [limit]: the maximum number of open order structures to retrieve
@@ -3587,6 +3610,7 @@ class bitget(Exchange, ImplicitAPI):
3587
3610
  def fetch_ledger(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3588
3611
  """
3589
3612
  fetch the history of changes, actions done by the user or operations that altered balance of the user
3613
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-bills
3590
3614
  :param str code: unified currency code, default is None
3591
3615
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
3592
3616
  :param int [limit]: max number of ledger entrys to return, default is None
@@ -3721,6 +3745,8 @@ class bitget(Exchange, ImplicitAPI):
3721
3745
  def fetch_order_trades(self, id: str, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
3722
3746
  """
3723
3747
  fetch all the trades made from a single order
3748
+ see https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
3749
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
3724
3750
  :param str id: order id
3725
3751
  :param str symbol: unified market symbol
3726
3752
  :param int [since]: the earliest time in ms to fetch trades for
@@ -3771,6 +3797,7 @@ class bitget(Exchange, ImplicitAPI):
3771
3797
  def fetch_position(self, symbol: str, params={}):
3772
3798
  """
3773
3799
  fetch data on a single open contract trade position
3800
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-symbol-position-v2
3774
3801
  :param str symbol: unified market symbol of the market the position is held in, default is None
3775
3802
  :param dict [params]: extra parameters specific to the bitget api endpoint
3776
3803
  :returns dict: a `position structure <https://github.com/ccxt/ccxt/wiki/Manual#position-structure>`
@@ -3818,6 +3845,8 @@ class bitget(Exchange, ImplicitAPI):
3818
3845
  def fetch_positions(self, symbols: Optional[List[str]] = None, params={}):
3819
3846
  """
3820
3847
  fetch all open positions
3848
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-position-v2
3849
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-position
3821
3850
  :param str[]|None symbols: list of unified market symbols
3822
3851
  :param dict [params]: extra parameters specific to the bitget api endpoint
3823
3852
  :returns dict[]: a list of `position structure <https://github.com/ccxt/ccxt/wiki/Manual#position-structure>`
@@ -4055,6 +4084,7 @@ class bitget(Exchange, ImplicitAPI):
4055
4084
  def fetch_funding_rate_history(self, symbol: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
4056
4085
  """
4057
4086
  fetches historical funding rate prices
4087
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
4058
4088
  :param str symbol: unified symbol of the market to fetch the funding rate history for
4059
4089
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
4060
4090
  :param int [limit]: the maximum amount of `funding rate structures <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure>` to fetch
@@ -4107,6 +4137,7 @@ class bitget(Exchange, ImplicitAPI):
4107
4137
  def fetch_funding_rate(self, symbol: str, params={}):
4108
4138
  """
4109
4139
  fetch the current funding rate
4140
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-current-funding-rate
4110
4141
  :param str symbol: unified market symbol
4111
4142
  :param dict [params]: extra parameters specific to the bitget api endpoint
4112
4143
  :returns dict: a `funding rate structure <https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure>`
@@ -4300,6 +4331,7 @@ class bitget(Exchange, ImplicitAPI):
4300
4331
  def reduce_margin(self, symbol: str, amount, params={}):
4301
4332
  """
4302
4333
  remove margin from a position
4334
+ see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
4303
4335
  :param str symbol: unified market symbol
4304
4336
  :param float amount: the amount of margin to remove
4305
4337
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4315,6 +4347,7 @@ class bitget(Exchange, ImplicitAPI):
4315
4347
  def add_margin(self, symbol: str, amount, params={}):
4316
4348
  """
4317
4349
  add margin
4350
+ see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
4318
4351
  :param str symbol: unified market symbol
4319
4352
  :param float amount: amount of margin to add
4320
4353
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4328,6 +4361,7 @@ class bitget(Exchange, ImplicitAPI):
4328
4361
  def fetch_leverage(self, symbol: str, params={}):
4329
4362
  """
4330
4363
  fetch the set leverage for a market
4364
+ see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-account
4331
4365
  :param str symbol: unified market symbol
4332
4366
  :param dict [params]: extra parameters specific to the bitget api endpoint
4333
4367
  :returns dict: a `leverage structure <https://github.com/ccxt/ccxt/wiki/Manual#leverage-structure>`
@@ -4370,6 +4404,7 @@ class bitget(Exchange, ImplicitAPI):
4370
4404
  def set_leverage(self, leverage, symbol: Optional[str] = None, params={}):
4371
4405
  """
4372
4406
  set the level of leverage for a market
4407
+ see https://bitgetlimited.github.io/apidoc/en/mix/#change-leverage
4373
4408
  :param float leverage: the rate of leverage
4374
4409
  :param str symbol: unified market symbol
4375
4410
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4389,6 +4424,7 @@ class bitget(Exchange, ImplicitAPI):
4389
4424
  def set_margin_mode(self, marginMode, symbol: Optional[str] = None, params={}):
4390
4425
  """
4391
4426
  set margin mode to 'cross' or 'isolated'
4427
+ see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin-mode
4392
4428
  :param str marginMode: 'cross' or 'isolated'
4393
4429
  :param str symbol: unified market symbol
4394
4430
  :param dict [params]: extra parameters specific to the bitget api endpoint
@@ -4414,6 +4450,7 @@ class bitget(Exchange, ImplicitAPI):
4414
4450
  def set_position_mode(self, hedged, symbol: Optional[str] = None, params={}):
4415
4451
  """
4416
4452
  set hedged to True or False for a market
4453
+ see https://bitgetlimited.github.io/apidoc/en/mix/#change-hold-mode
4417
4454
  :param bool hedged: set to True to use dualSidePosition
4418
4455
  :param str symbol: not used by bitget setPositionMode()
4419
4456
  :param dict [params]: extra parameters specific to the bitget api endpoint
ccxt/bitmart.py CHANGED
@@ -1887,7 +1887,7 @@ class bitmart(Exchange, ImplicitAPI):
1887
1887
  # "updateTime" : 1681701559408
1888
1888
  # }
1889
1889
  #
1890
- # swap: fetchOpenOrders
1890
+ # swap: fetchOrder, fetchOpenOrders
1891
1891
  #
1892
1892
  # {
1893
1893
  # "order_id": "230935812485489",
@@ -2369,26 +2369,89 @@ class bitmart(Exchange, ImplicitAPI):
2369
2369
 
2370
2370
  def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
2371
2371
  """
2372
+ fetches information on an order made by the user
2372
2373
  see https://developer-pro.bitmart.com/en/spot/#query-order-by-id-v4-signed
2373
2374
  see https://developer-pro.bitmart.com/en/spot/#query-order-by-clientorderid-v4-signed
2374
- fetches information on an order made by the user
2375
+ see https://developer-pro.bitmart.com/en/futures/#get-order-detail-keyed
2376
+ :param str id: the id of the order
2375
2377
  :param str symbol: unified symbol of the market the order was made in
2376
2378
  :param dict [params]: extra parameters specific to the bitmart api endpoint
2377
- :param str [params.clientOrderId]: fetch the order by client order id instead of order id
2379
+ :param str [params.clientOrderId]: *spot* fetch the order by client order id instead of order id
2378
2380
  :returns dict: An `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
2379
2381
  """
2380
2382
  self.load_markets()
2381
2383
  request = {}
2382
- clientOrderId = self.safe_string(params, 'clientOrderId')
2383
- if not clientOrderId:
2384
- request['orderId'] = id
2384
+ type = None
2385
+ market = None
2385
2386
  response = None
2386
- if clientOrderId is not None:
2387
- response = self.privatePostSpotV4QueryClientOrder(self.extend(request, params))
2388
- else:
2389
- response = self.privatePostSpotV4QueryOrder(self.extend(request, params))
2387
+ if symbol is not None:
2388
+ market = self.market(symbol)
2389
+ type, params = self.handle_market_type_and_params('fetchOrder', market, params)
2390
+ if type == 'spot':
2391
+ clientOrderId = self.safe_string(params, 'clientOrderId')
2392
+ if not clientOrderId:
2393
+ request['orderId'] = id
2394
+ if clientOrderId is not None:
2395
+ response = self.privatePostSpotV4QueryClientOrder(self.extend(request, params))
2396
+ else:
2397
+ response = self.privatePostSpotV4QueryOrder(self.extend(request, params))
2398
+ elif type == 'swap':
2399
+ self.check_required_symbol('fetchOrder', symbol)
2400
+ request['symbol'] = market['id']
2401
+ request['order_id'] = id
2402
+ response = self.privateGetContractPrivateOrder(self.extend(request, params))
2403
+ #
2404
+ # spot
2405
+ #
2406
+ # {
2407
+ # "code": 1000,
2408
+ # "message": "success",
2409
+ # "data": {
2410
+ # "orderId": "183347420821295423",
2411
+ # "clientOrderId": "183347420821295423",
2412
+ # "symbol": "BTC_USDT",
2413
+ # "side": "buy",
2414
+ # "orderMode": "spot",
2415
+ # "type": "limit",
2416
+ # "state": "new",
2417
+ # "price": "24000.00",
2418
+ # "priceAvg": "0.00",
2419
+ # "size": "0.00022",
2420
+ # "filledSize": "0.00000",
2421
+ # "notional": "5.28000000",
2422
+ # "filledNotional": "0.00000000",
2423
+ # "createTime": 1695783014734,
2424
+ # "updateTime": 1695783014762
2425
+ # },
2426
+ # "trace": "ce3e6422c8b44d5fag855348a68693ed.63.14957831547451715"
2427
+ # }
2428
+ #
2429
+ # swap
2430
+ #
2431
+ # {
2432
+ # "code": 1000,
2433
+ # "message": "Ok",
2434
+ # "data": {
2435
+ # "order_id": "230927283405028",
2436
+ # "client_order_id": "",
2437
+ # "price": "23000",
2438
+ # "size": "1",
2439
+ # "symbol": "BTCUSDT",
2440
+ # "state": 2,
2441
+ # "side": 1,
2442
+ # "type": "limit",
2443
+ # "leverage": "10",
2444
+ # "open_type": "isolated",
2445
+ # "deal_avg_price": "0",
2446
+ # "deal_size": "0",
2447
+ # "create_time": 1695783433600,
2448
+ # "update_time": 1695783433613
2449
+ # },
2450
+ # "trace": "4cad855075664097af6ba5257c47605d.63.14957831547451715"
2451
+ # }
2452
+ #
2390
2453
  data = self.safe_value(response, 'data', {})
2391
- return self.parse_order(data, None)
2454
+ return self.parse_order(data, market)
2392
2455
 
2393
2456
  def fetch_deposit_address(self, code: str, params={}):
2394
2457
  """
ccxt/exmo.py CHANGED
@@ -1623,11 +1623,11 @@ class exmo(Exchange, ImplicitAPI):
1623
1623
  marketIds = list(response.keys())
1624
1624
  for i in range(0, len(marketIds)):
1625
1625
  marketId = marketIds[i]
1626
- market = self.safe_market(marketId)
1626
+ marketInner = self.safe_market(marketId)
1627
1627
  params = self.extend(params, {
1628
1628
  'status': 'open',
1629
1629
  })
1630
- parsedOrders = self.parse_orders(response[marketId], market, since, limit, params)
1630
+ parsedOrders = self.parse_orders(response[marketId], marketInner, since, limit, params)
1631
1631
  orders = self.array_concat(orders, parsedOrders)
1632
1632
  return orders
1633
1633
 
@@ -1815,8 +1815,8 @@ class exmo(Exchange, ImplicitAPI):
1815
1815
  limit = 100
1816
1816
  isSpot = (marginMode != 'isolated')
1817
1817
  if symbol is not None:
1818
- market = self.market(symbol)
1819
- symbol = market['symbol']
1818
+ marketInner = self.market(symbol)
1819
+ symbol = marketInner['symbol']
1820
1820
  request = {
1821
1821
  'limit': limit,
1822
1822
  }
@@ -1847,7 +1847,7 @@ class exmo(Exchange, ImplicitAPI):
1847
1847
  })
1848
1848
  return self.parse_orders(response, market, since, limit, params)
1849
1849
  else:
1850
- response = self.privatePostMarginUserOrderHistory(self.extend(request, params))
1850
+ responseSwap = self.privatePostMarginUserOrderHistory(self.extend(request, params))
1851
1851
  #
1852
1852
  # {
1853
1853
  # "items": [
@@ -1872,7 +1872,7 @@ class exmo(Exchange, ImplicitAPI):
1872
1872
  # ]
1873
1873
  # }
1874
1874
  #
1875
- items = self.safe_value(response, 'items')
1875
+ items = self.safe_value(responseSwap, 'items')
1876
1876
  orders = self.parse_orders(items, market, since, limit, params)
1877
1877
  result = []
1878
1878
  for i in range(0, len(orders)):
ccxt/pro/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.0.107'
7
+ __version__ = '4.0.109'
8
8
 
9
9
  # ----------------------------------------------------------------------------
10
10
 
ccxt/pro/bitget.py CHANGED
@@ -146,11 +146,11 @@ class bitget(ccxt.async_support.bitget):
146
146
  topics = []
147
147
  for i in range(0, len(marketIds)):
148
148
  marketId = marketIds[i]
149
- market = self.market(marketId)
149
+ marketInner = self.market(marketId)
150
150
  args = {
151
151
  'instType': instType,
152
152
  'channel': 'ticker',
153
- 'instId': self.get_ws_market_id(market),
153
+ 'instId': self.get_ws_market_id(marketInner),
154
154
  }
155
155
  topics.append(args)
156
156
  tickers = await self.watch_public_multiple(messageHash, topics, params)
@@ -188,12 +188,12 @@ class bitget(ccxt.async_support.bitget):
188
188
  # watchTickers part
189
189
  messageHashes = self.find_message_hashes(client, 'tickers::')
190
190
  for i in range(0, len(messageHashes)):
191
- messageHash = messageHashes[i]
192
- parts = messageHash.split('::')
191
+ messageHashTicker = messageHashes[i]
192
+ parts = messageHashTicker.split('::')
193
193
  symbolsString = parts[1]
194
194
  symbols = symbolsString.split(',')
195
195
  if self.in_array(symbol, symbols):
196
- client.resolve(ticker, messageHash)
196
+ client.resolve(ticker, messageHashTicker)
197
197
  return message
198
198
 
199
199
  def parse_ws_ticker(self, message, market=None):
ccxt/pro/bybit.py CHANGED
@@ -338,12 +338,12 @@ class bybit(ccxt.async_support.bybit):
338
338
  # watchTickers part
339
339
  messageHashes = self.find_message_hashes(client, 'tickers::')
340
340
  for i in range(0, len(messageHashes)):
341
- messageHash = messageHashes[i]
342
- parts = messageHash.split('::')
341
+ messageHashTicker = messageHashes[i]
342
+ parts = messageHashTicker.split('::')
343
343
  symbolsString = parts[1]
344
344
  symbols = symbolsString.split(',')
345
345
  if self.in_array(parsed['symbol'], symbols):
346
- client.resolve(parsed, messageHash)
346
+ client.resolve(parsed, messageHashTicker)
347
347
 
348
348
  async def watch_ohlcv(self, symbol: str, timeframe='1m', since: Optional[int] = None, limit: Optional[int] = None, params={}):
349
349
  """
ccxt/pro/woo.py CHANGED
@@ -20,7 +20,7 @@ class woo(ccxt.async_support.woo):
20
20
  return self.deep_extend(super(woo, self).describe(), {
21
21
  'has': {
22
22
  'ws': True,
23
- 'watchBalance': False,
23
+ 'watchBalance': True,
24
24
  'watchMyTrades': False,
25
25
  'watchOHLCV': True,
26
26
  'watchOrderBook': True,
@@ -591,6 +591,70 @@ class woo(ccxt.async_support.woo):
591
591
  messageHashSymbol = topic + ':' + symbol
592
592
  client.resolve(self.orders, messageHashSymbol)
593
593
 
594
+ async def watch_balance(self, params={}):
595
+ """
596
+ see https://docs.woo.org/#balance
597
+ watch balance and get the amount of funds available for trading or funds locked in orders
598
+ :param dict [params]: extra parameters specific to the woo api endpoint
599
+ :returns dict: a `balance structure <https://github.com/ccxt/ccxt/wiki/Manual#balance-structure>`
600
+ """
601
+ await self.load_markets()
602
+ topic = 'balance'
603
+ messageHash = topic
604
+ request = {
605
+ 'event': 'subscribe',
606
+ 'topic': topic,
607
+ }
608
+ message = self.extend(request, params)
609
+ return await self.watch_private(messageHash, message)
610
+
611
+ def handle_balance(self, client, message):
612
+ #
613
+ # {
614
+ # "topic": "balance",
615
+ # "ts": 1695716888789,
616
+ # "data": {
617
+ # "balances": {
618
+ # "USDT": {
619
+ # "holding": 266.56059176,
620
+ # "frozen": 0,
621
+ # "interest": 0,
622
+ # "pendingShortQty": 0,
623
+ # "pendingExposure": 0,
624
+ # "pendingLongQty": 0,
625
+ # "pendingLongExposure": 0,
626
+ # "version": 37,
627
+ # "staked": 0,
628
+ # "unbonding": 0,
629
+ # "vault": 0,
630
+ # "averageOpenPrice": 0,
631
+ # "pnl24H": 0,
632
+ # "fee24H": 0,
633
+ # "markPrice": 1,
634
+ # "pnl24HPercentage": 0
635
+ # }
636
+ # }
637
+ #
638
+ # }
639
+ #
640
+ data = self.safe_value(message, 'data')
641
+ balances = self.safe_value(data, 'balances')
642
+ keys = list(balances.keys())
643
+ ts = self.safe_integer(message, 'ts')
644
+ self.balance['info'] = data
645
+ self.balance['timestamp'] = ts
646
+ self.balance['datetime'] = self.iso8601(ts)
647
+ for i in range(0, len(keys)):
648
+ key = keys[i]
649
+ value = balances[key]
650
+ code = self.safe_currency_code(key)
651
+ account = self.balance[code] if (code in self.balance) else self.account()
652
+ account['total'] = self.safe_string(value, 'holding')
653
+ account['used'] = self.safe_string(value, 'frozen')
654
+ self.balance[code] = account
655
+ self.balance = self.safe_balance(self.balance)
656
+ client.resolve(self.balance, 'balance')
657
+
594
658
  def handle_message(self, client: Client, message):
595
659
  methods = {
596
660
  'ping': self.handle_ping,
@@ -603,6 +667,7 @@ class woo(ccxt.async_support.woo):
603
667
  'auth': self.handle_auth,
604
668
  'executionreport': self.handle_order_update,
605
669
  'trade': self.handle_trade,
670
+ 'balance': self.handle_balance,
606
671
  }
607
672
  event = self.safe_string(message, 'event')
608
673
  method = self.safe_value(methods, event)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ccxt
3
- Version: 4.0.107
3
+ Version: 4.0.109
4
4
  Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges
5
5
  Home-page: https://ccxt.com
6
6
  Author: Igor Kroitor
@@ -258,13 +258,13 @@ console.log(version, Object.keys(exchanges));
258
258
 
259
259
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
260
260
 
261
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.107/dist/ccxt.browser.js
262
- * unpkg: https://unpkg.com/ccxt@4.0.107/dist/ccxt.browser.js
261
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.0.109/dist/ccxt.browser.js
262
+ * unpkg: https://unpkg.com/ccxt@4.0.109/dist/ccxt.browser.js
263
263
 
264
264
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
265
265
 
266
266
  ```HTML
267
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.107/dist/ccxt.browser.js"></script>
267
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.0.109/dist/ccxt.browser.js"></script>
268
268
  ```
269
269
 
270
270
  Creates a global `ccxt` object: