ccxt 4.1.85__py2.py3-none-any.whl → 4.1.86__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +4 -2
- ccxt/async_support/binance.py +1 -1
- ccxt/async_support/bingx.py +1 -1
- ccxt/async_support/bitget.py +1 -2
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/bybit.py +2 -4
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/cryptocom.py +2 -2
- ccxt/async_support/digifinex.py +119 -103
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +2 -2
- ccxt/async_support/kucoin.py +1 -5
- ccxt/async_support/latoken.py +1 -1
- ccxt/async_support/mexc.py +76 -49
- ccxt/async_support/okx.py +3 -3
- ccxt/async_support/p2b.py +0 -2
- ccxt/async_support/poloniex.py +42 -42
- ccxt/async_support/probit.py +25 -17
- ccxt/async_support/tokocrypto.py +6 -3
- ccxt/base/exchange.py +18 -8
- ccxt/binance.py +1 -1
- ccxt/bingx.py +1 -1
- ccxt/bitget.py +1 -2
- ccxt/bitmex.py +1 -1
- ccxt/bybit.py +2 -4
- ccxt/coinex.py +1 -1
- ccxt/cryptocom.py +2 -2
- ccxt/digifinex.py +119 -103
- ccxt/hitbtc.py +1 -1
- ccxt/htx.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +2 -2
- ccxt/kucoin.py +1 -5
- ccxt/latoken.py +1 -1
- ccxt/mexc.py +76 -49
- ccxt/okx.py +3 -3
- ccxt/p2b.py +0 -2
- ccxt/poloniex.py +42 -42
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitmex.py +200 -2
- ccxt/pro/krakenfutures.py +4 -4
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/poloniex.py +1 -1
- ccxt/pro/poloniexfutures.py +3 -3
- ccxt/probit.py +25 -17
- ccxt/tokocrypto.py +6 -3
- {ccxt-4.1.85.dist-info → ccxt-4.1.86.dist-info}/METADATA +4 -4
- {ccxt-4.1.85.dist-info → ccxt-4.1.86.dist-info}/RECORD +58 -58
- {ccxt-4.1.85.dist-info → ccxt-4.1.86.dist-info}/WHEEL +0 -0
- {ccxt-4.1.85.dist-info → ccxt-4.1.86.dist-info}/top_level.txt +0 -0
ccxt/pro/bitmex.py
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
5
|
|
6
6
|
import ccxt.async_support
|
7
|
-
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
|
7
|
+
from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Int, Str
|
9
|
+
from ccxt.base.types import Int, Str, Strings
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -26,6 +26,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
26
26
|
'watchOrderBook': True,
|
27
27
|
'watchOrderBookForSymbols': True,
|
28
28
|
'watchOrders': True,
|
29
|
+
'watchPostions': True,
|
29
30
|
'watchTicker': True,
|
30
31
|
'watchTickers': False,
|
31
32
|
'watchTrades': True,
|
@@ -585,6 +586,202 @@ class bitmex(ccxt.async_support.bitmex):
|
|
585
586
|
if messageHash in client.subscriptions:
|
586
587
|
del client.subscriptions[messageHash]
|
587
588
|
|
589
|
+
async def watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}):
|
590
|
+
"""
|
591
|
+
:see: https://www.bitmex.com/app/wsAPI
|
592
|
+
watch all open positions
|
593
|
+
:param str[]|None symbols: list of unified market symbols
|
594
|
+
:param dict params: extra parameters specific to the exchange API endpoint
|
595
|
+
:returns dict[]: a list of `position structure <https://docs.ccxt.com/en/latest/manual.html#position-structure>`
|
596
|
+
"""
|
597
|
+
await self.load_markets()
|
598
|
+
await self.authenticate()
|
599
|
+
subscriptionHash = 'position'
|
600
|
+
messageHash = 'positions'
|
601
|
+
if not self.is_empty(symbols):
|
602
|
+
messageHash = '::' + ','.join(symbols)
|
603
|
+
url = self.urls['api']['ws']
|
604
|
+
request = {
|
605
|
+
'op': 'subscribe',
|
606
|
+
'args': [
|
607
|
+
subscriptionHash,
|
608
|
+
],
|
609
|
+
}
|
610
|
+
newPositions = await self.watch(url, messageHash, request, subscriptionHash)
|
611
|
+
if self.newUpdates:
|
612
|
+
return newPositions
|
613
|
+
return self.filter_by_symbols_since_limit(self.positions, symbols, since, limit, True)
|
614
|
+
|
615
|
+
def handle_positions(self, client, message):
|
616
|
+
#
|
617
|
+
# partial
|
618
|
+
# {
|
619
|
+
# table: 'position',
|
620
|
+
# action: 'partial',
|
621
|
+
# keys: ['account', 'symbol'],
|
622
|
+
# types: {
|
623
|
+
# account: 'long',
|
624
|
+
# symbol: 'symbol',
|
625
|
+
# currency: 'symbol',
|
626
|
+
# underlying: 'symbol',
|
627
|
+
# quoteCurrency: 'symbol',
|
628
|
+
# commission: 'float',
|
629
|
+
# initMarginReq: 'float',
|
630
|
+
# maintMarginReq: 'float',
|
631
|
+
# riskLimit: 'long',
|
632
|
+
# leverage: 'float',
|
633
|
+
# crossMargin: 'boolean',
|
634
|
+
# deleveragePercentile: 'float',
|
635
|
+
# rebalancedPnl: 'long',
|
636
|
+
# prevRealisedPnl: 'long',
|
637
|
+
# prevUnrealisedPnl: 'long',
|
638
|
+
# openingQty: 'long',
|
639
|
+
# openOrderBuyQty: 'long',
|
640
|
+
# openOrderBuyCost: 'long',
|
641
|
+
# openOrderBuyPremium: 'long',
|
642
|
+
# openOrderSellQty: 'long',
|
643
|
+
# openOrderSellCost: 'long',
|
644
|
+
# openOrderSellPremium: 'long',
|
645
|
+
# currentQty: 'long',
|
646
|
+
# currentCost: 'long',
|
647
|
+
# currentComm: 'long',
|
648
|
+
# realisedCost: 'long',
|
649
|
+
# unrealisedCost: 'long',
|
650
|
+
# grossOpenPremium: 'long',
|
651
|
+
# isOpen: 'boolean',
|
652
|
+
# markPrice: 'float',
|
653
|
+
# markValue: 'long',
|
654
|
+
# riskValue: 'long',
|
655
|
+
# homeNotional: 'float',
|
656
|
+
# foreignNotional: 'float',
|
657
|
+
# posState: 'symbol',
|
658
|
+
# posCost: 'long',
|
659
|
+
# posCross: 'long',
|
660
|
+
# posComm: 'long',
|
661
|
+
# posLoss: 'long',
|
662
|
+
# posMargin: 'long',
|
663
|
+
# posMaint: 'long',
|
664
|
+
# initMargin: 'long',
|
665
|
+
# maintMargin: 'long',
|
666
|
+
# realisedPnl: 'long',
|
667
|
+
# unrealisedPnl: 'long',
|
668
|
+
# unrealisedPnlPcnt: 'float',
|
669
|
+
# unrealisedRoePcnt: 'float',
|
670
|
+
# avgCostPrice: 'float',
|
671
|
+
# avgEntryPrice: 'float',
|
672
|
+
# breakEvenPrice: 'float',
|
673
|
+
# marginCallPrice: 'float',
|
674
|
+
# liquidationPrice: 'float',
|
675
|
+
# bankruptPrice: 'float',
|
676
|
+
# timestamp: 'timestamp'
|
677
|
+
# },
|
678
|
+
# filter: {account: 412475},
|
679
|
+
# data: [
|
680
|
+
# {
|
681
|
+
# account: 412475,
|
682
|
+
# symbol: 'XBTUSD',
|
683
|
+
# currency: 'XBt',
|
684
|
+
# underlying: 'XBT',
|
685
|
+
# quoteCurrency: 'USD',
|
686
|
+
# commission: 0.00075,
|
687
|
+
# initMarginReq: 0.01,
|
688
|
+
# maintMarginReq: 0.0035,
|
689
|
+
# riskLimit: 20000000000,
|
690
|
+
# leverage: 100,
|
691
|
+
# crossMargin: True,
|
692
|
+
# deleveragePercentile: 1,
|
693
|
+
# rebalancedPnl: 0,
|
694
|
+
# prevRealisedPnl: 0,
|
695
|
+
# prevUnrealisedPnl: 0,
|
696
|
+
# openingQty: 400,
|
697
|
+
# openOrderBuyQty: 0,
|
698
|
+
# openOrderBuyCost: 0,
|
699
|
+
# openOrderBuyPremium: 0,
|
700
|
+
# openOrderSellQty: 0,
|
701
|
+
# openOrderSellCost: 0,
|
702
|
+
# openOrderSellPremium: 0,
|
703
|
+
# currentQty: 400,
|
704
|
+
# currentCost: -912269,
|
705
|
+
# currentComm: 684,
|
706
|
+
# realisedCost: 0,
|
707
|
+
# unrealisedCost: -912269,
|
708
|
+
# grossOpenPremium: 0,
|
709
|
+
# isOpen: True,
|
710
|
+
# markPrice: 43772,
|
711
|
+
# markValue: -913828,
|
712
|
+
# riskValue: 913828,
|
713
|
+
# homeNotional: 0.00913828,
|
714
|
+
# foreignNotional: -400,
|
715
|
+
# posCost: -912269,
|
716
|
+
# posCross: 1559,
|
717
|
+
# posComm: 694,
|
718
|
+
# posLoss: 0,
|
719
|
+
# posMargin: 11376,
|
720
|
+
# posMaint: 3887,
|
721
|
+
# initMargin: 0,
|
722
|
+
# maintMargin: 9817,
|
723
|
+
# realisedPnl: -684,
|
724
|
+
# unrealisedPnl: -1559,
|
725
|
+
# unrealisedPnlPcnt: -0.0017,
|
726
|
+
# unrealisedRoePcnt: -0.1709,
|
727
|
+
# avgCostPrice: 43846.7643,
|
728
|
+
# avgEntryPrice: 43846.7643,
|
729
|
+
# breakEvenPrice: 43880,
|
730
|
+
# marginCallPrice: 20976,
|
731
|
+
# liquidationPrice: 20976,
|
732
|
+
# bankruptPrice: 20941,
|
733
|
+
# timestamp: '2023-12-07T00:09:00.709Z'
|
734
|
+
# }
|
735
|
+
# ]
|
736
|
+
# }
|
737
|
+
# update
|
738
|
+
# {
|
739
|
+
# table: 'position',
|
740
|
+
# action: 'update',
|
741
|
+
# data: [
|
742
|
+
# {
|
743
|
+
# account: 412475,
|
744
|
+
# symbol: 'XBTUSD',
|
745
|
+
# currency: 'XBt',
|
746
|
+
# currentQty: 400,
|
747
|
+
# markPrice: 43772.75,
|
748
|
+
# markValue: -913812,
|
749
|
+
# riskValue: 913812,
|
750
|
+
# homeNotional: 0.00913812,
|
751
|
+
# posCross: 1543,
|
752
|
+
# posComm: 693,
|
753
|
+
# posMargin: 11359,
|
754
|
+
# posMaint: 3886,
|
755
|
+
# maintMargin: 9816,
|
756
|
+
# unrealisedPnl: -1543,
|
757
|
+
# unrealisedRoePcnt: -0.1691,
|
758
|
+
# liquidationPrice: 20976,
|
759
|
+
# timestamp: '2023-12-07T00:09:10.760Z'
|
760
|
+
# }
|
761
|
+
# ]
|
762
|
+
# }
|
763
|
+
#
|
764
|
+
if self.positions is None:
|
765
|
+
self.positions = ArrayCacheBySymbolBySide()
|
766
|
+
cache = self.positions
|
767
|
+
rawPositions = self.safe_value(message, 'data', [])
|
768
|
+
newPositions = []
|
769
|
+
for i in range(0, len(rawPositions)):
|
770
|
+
rawPosition = rawPositions[i]
|
771
|
+
position = self.parse_position(rawPosition)
|
772
|
+
newPositions.append(position)
|
773
|
+
cache.append(position)
|
774
|
+
messageHashes = self.find_message_hashes(client, 'positions::')
|
775
|
+
for i in range(0, len(messageHashes)):
|
776
|
+
messageHash = messageHashes[i]
|
777
|
+
parts = messageHash.split('::')
|
778
|
+
symbolsString = parts[1]
|
779
|
+
symbols = symbolsString.split(',')
|
780
|
+
positions = self.filter_by_array(newPositions, 'symbol', symbols, False)
|
781
|
+
if not self.is_empty(positions):
|
782
|
+
client.resolve(positions, messageHash)
|
783
|
+
client.resolve(newPositions, 'positions')
|
784
|
+
|
588
785
|
async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
589
786
|
"""
|
590
787
|
watches information on multiple orders made by the user
|
@@ -1318,6 +1515,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1318
1515
|
'order': self.handle_orders,
|
1319
1516
|
'execution': self.handle_my_trades,
|
1320
1517
|
'margin': self.handle_balance,
|
1518
|
+
'position': self.handle_positions,
|
1321
1519
|
}
|
1322
1520
|
method = self.safe_value(methods, table)
|
1323
1521
|
if method is None:
|
ccxt/pro/krakenfutures.py
CHANGED
@@ -102,8 +102,8 @@ class krakenfutures(ccxt.async_support.krakenfutures):
|
|
102
102
|
Connects to a websocket channel
|
103
103
|
:param str name: name of the channel
|
104
104
|
:param str[] symbols: CCXT market symbols
|
105
|
-
:param
|
106
|
-
:returns
|
105
|
+
:param dict [params]: extra parameters specific to the krakenfutures api
|
106
|
+
:returns dict: data from the websocket stream
|
107
107
|
"""
|
108
108
|
await self.load_markets()
|
109
109
|
url = self.urls['api']['ws']
|
@@ -132,8 +132,8 @@ class krakenfutures(ccxt.async_support.krakenfutures):
|
|
132
132
|
Connects to a websocket channel
|
133
133
|
:param str name: name of the channel
|
134
134
|
:param str[] symbols: CCXT market symbols
|
135
|
-
:param
|
136
|
-
:returns
|
135
|
+
:param dict [params]: extra parameters specific to the krakenfutures api
|
136
|
+
:returns dict: data from the websocket stream
|
137
137
|
"""
|
138
138
|
await self.load_markets()
|
139
139
|
await self.authenticate()
|
ccxt/pro/mexc.py
CHANGED
@@ -697,7 +697,7 @@ class mexc(ccxt.async_support.mexc):
|
|
697
697
|
:param int [since]: the earliest time in ms to fetch orders for
|
698
698
|
:param int [limit]: the maximum number of orde structures to retrieve
|
699
699
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
700
|
-
:
|
700
|
+
:param str|None params['type']: the type of orders to retrieve, can be 'spot' or 'margin'
|
701
701
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
702
702
|
"""
|
703
703
|
await self.load_markets()
|
ccxt/pro/poloniex.py
CHANGED
@@ -201,7 +201,7 @@ class poloniex(ccxt.async_support.poloniex):
|
|
201
201
|
:param str [params.stpMode]: self-trade prevention, defaults to expire_taker, none: enable self-trade; expire_taker: taker order will be canceled when self-trade happens
|
202
202
|
:param str [params.slippageTolerance]: used to control the maximum slippage ratio, the value range is greater than 0 and less than 1
|
203
203
|
:returns dict: an `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
|
204
|
-
|
204
|
+
"""
|
205
205
|
await self.load_markets()
|
206
206
|
await self.authenticate()
|
207
207
|
market = self.market(symbol)
|
ccxt/pro/poloniexfutures.py
CHANGED
@@ -130,9 +130,9 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
130
130
|
:param str name: name of the channel and suscriptionHash
|
131
131
|
:param bool isPrivate: True for the authenticated url, False for the public url
|
132
132
|
:param str symbol: is required for all public channels, not required for private channels(except position)
|
133
|
-
:param
|
134
|
-
:param
|
135
|
-
:returns
|
133
|
+
:param dict subscription: subscription parameters
|
134
|
+
:param dict [params]: extra parameters specific to the poloniex api
|
135
|
+
:returns dict: data from the websocket stream
|
136
136
|
"""
|
137
137
|
url = await self.negotiate(isPrivate)
|
138
138
|
if symbol is not None:
|
ccxt/probit.py
CHANGED
@@ -43,7 +43,10 @@ class probit(Exchange, ImplicitAPI):
|
|
43
43
|
'option': False,
|
44
44
|
'addMargin': False,
|
45
45
|
'cancelOrder': True,
|
46
|
+
'createMarketBuyOrderWithCost': True,
|
46
47
|
'createMarketOrder': True,
|
48
|
+
'createMarketOrderWithCost': False,
|
49
|
+
'createMarketSellOrderWithCost': False,
|
47
50
|
'createOrder': True,
|
48
51
|
'createReduceOnlyOrder': False,
|
49
52
|
'createStopLimitOrder': False,
|
@@ -328,6 +331,7 @@ class probit(Exchange, ImplicitAPI):
|
|
328
331
|
'precision': {
|
329
332
|
'amount': self.parse_number(self.parse_precision(self.safe_string(market, 'quantity_precision'))),
|
330
333
|
'price': self.safe_number(market, 'price_increment'),
|
334
|
+
'cost': self.parse_number(self.parse_precision(self.safe_string(market, 'cost_precision'))),
|
331
335
|
},
|
332
336
|
'limits': {
|
333
337
|
'leverage': {
|
@@ -1135,14 +1139,15 @@ class probit(Exchange, ImplicitAPI):
|
|
1135
1139
|
|
1136
1140
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1137
1141
|
"""
|
1138
|
-
:see: https://docs-en.probit.com/reference/order-1
|
1139
1142
|
create a trade order
|
1143
|
+
:see: https://docs-en.probit.com/reference/order-1
|
1140
1144
|
:param str symbol: unified symbol of the market to create an order in
|
1141
1145
|
:param str type: 'market' or 'limit'
|
1142
1146
|
:param str side: 'buy' or 'sell'
|
1143
|
-
:param float amount: how much
|
1147
|
+
:param float amount: how much you want to trade in units of the base currency
|
1144
1148
|
:param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
1145
1149
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1150
|
+
:param float [params.cost]: the quote quantity that can be used alternative for the amount for market buy orders
|
1146
1151
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1147
1152
|
"""
|
1148
1153
|
self.load_markets()
|
@@ -1159,27 +1164,30 @@ class probit(Exchange, ImplicitAPI):
|
|
1159
1164
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'client_order_id')
|
1160
1165
|
if clientOrderId is not None:
|
1161
1166
|
request['client_order_id'] = clientOrderId
|
1162
|
-
|
1167
|
+
quoteAmount = None
|
1163
1168
|
if type == 'limit':
|
1164
1169
|
request['limit_price'] = self.price_to_precision(symbol, price)
|
1165
1170
|
request['quantity'] = self.amount_to_precision(symbol, amount)
|
1166
1171
|
elif type == 'market':
|
1167
1172
|
# for market buy it requires the amount of quote currency to spend
|
1168
1173
|
if side == 'buy':
|
1169
|
-
|
1170
|
-
createMarketBuyOrderRequiresPrice = self.
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1174
|
+
createMarketBuyOrderRequiresPrice = True
|
1175
|
+
createMarketBuyOrderRequiresPrice, params = self.handle_option_and_params(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', True)
|
1176
|
+
cost = self.safe_string(params, 'cost')
|
1177
|
+
params = self.omit(params, 'cost')
|
1178
|
+
if cost is not None:
|
1179
|
+
quoteAmount = self.cost_to_precision(symbol, cost)
|
1180
|
+
elif createMarketBuyOrderRequiresPrice:
|
1181
|
+
if price is None:
|
1182
|
+
raise InvalidOrder(self.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument')
|
1183
|
+
else:
|
1184
|
+
amountString = self.number_to_string(amount)
|
1185
|
+
priceString = self.number_to_string(price)
|
1186
|
+
costRequest = Precise.string_mul(amountString, priceString)
|
1187
|
+
quoteAmount = self.cost_to_precision(symbol, costRequest)
|
1179
1188
|
else:
|
1180
|
-
|
1181
|
-
|
1182
|
-
request['cost'] = costToPrecision
|
1189
|
+
quoteAmount = self.cost_to_precision(symbol, amount)
|
1190
|
+
request['cost'] = quoteAmount
|
1183
1191
|
else:
|
1184
1192
|
request['quantity'] = self.amount_to_precision(symbol, amount)
|
1185
1193
|
query = self.omit(params, ['timeInForce', 'time_in_force', 'clientOrderId', 'client_order_id'])
|
@@ -1211,7 +1219,7 @@ class probit(Exchange, ImplicitAPI):
|
|
1211
1219
|
# returned by the exchange on market buys
|
1212
1220
|
if (type == 'market') and (side == 'buy'):
|
1213
1221
|
order['amount'] = None
|
1214
|
-
order['cost'] = self.parse_number(
|
1222
|
+
order['cost'] = self.parse_number(quoteAmount)
|
1215
1223
|
order['remaining'] = None
|
1216
1224
|
return order
|
1217
1225
|
|
ccxt/tokocrypto.py
CHANGED
@@ -1011,15 +1011,19 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1011
1011
|
responseInner = self.publicGetOpenV1MarketTrades(self.extend(request, params))
|
1012
1012
|
data = self.safe_value(responseInner, 'data', {})
|
1013
1013
|
return self.parse_trades(data, market, since, limit)
|
1014
|
+
if limit is not None:
|
1015
|
+
request['limit'] = limit # default = 500, maximum = 1000
|
1014
1016
|
defaultMethod = 'binanceGetTrades'
|
1015
1017
|
method = self.safe_string(self.options, 'fetchTradesMethod', defaultMethod)
|
1018
|
+
response = None
|
1016
1019
|
if (method == 'binanceGetAggTrades') and (since is not None):
|
1017
1020
|
request['startTime'] = since
|
1018
1021
|
# https://github.com/ccxt/ccxt/issues/6400
|
1019
1022
|
# https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#compressedaggregate-trades-list
|
1020
1023
|
request['endTime'] = self.sum(since, 3600000)
|
1021
|
-
|
1022
|
-
|
1024
|
+
response = self.binanceGetAggTrades(self.extend(request, params))
|
1025
|
+
else:
|
1026
|
+
response = self.binanceGetTrades(self.extend(request, params))
|
1023
1027
|
#
|
1024
1028
|
# Caveats:
|
1025
1029
|
# - default limit(500) applies only if no other parameters set, trades up
|
@@ -1029,7 +1033,6 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1029
1033
|
# - 'tradeId' accepted and returned by self method is "aggregate" trade id
|
1030
1034
|
# which is different from actual trade id
|
1031
1035
|
# - setting both fromId and time window results in error
|
1032
|
-
response = getattr(self, method)(self.extend(request, params))
|
1033
1036
|
#
|
1034
1037
|
# aggregate trades
|
1035
1038
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.1.
|
3
|
+
Version: 4.1.86
|
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
|
@@ -259,13 +259,13 @@ console.log(version, Object.keys(exchanges));
|
|
259
259
|
|
260
260
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
261
261
|
|
262
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
263
|
-
* unpkg: https://unpkg.com/ccxt@4.1.
|
262
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.86/dist/ccxt.browser.js
|
263
|
+
* unpkg: https://unpkg.com/ccxt@4.1.86/dist/ccxt.browser.js
|
264
264
|
|
265
265
|
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.
|
266
266
|
|
267
267
|
```HTML
|
268
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
268
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.86/dist/ccxt.browser.js"></script>
|
269
269
|
```
|
270
270
|
|
271
271
|
Creates a global `ccxt` object:
|