ccxt 4.2.30__py2.py3-none-any.whl → 4.2.34__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/abstract/coinbase.py +10 -0
- ccxt/abstract/okx.py +12 -1
- ccxt/ace.py +4 -3
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +6 -6
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +4 -3
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +6 -6
- ccxt/async_support/base/exchange.py +62 -39
- ccxt/async_support/bigone.py +25 -5
- ccxt/async_support/binance.py +17 -16
- ccxt/async_support/bingx.py +10 -9
- ccxt/async_support/bit2c.py +13 -1
- ccxt/async_support/bitbank.py +2 -2
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +5 -5
- ccxt/async_support/bitfinex2.py +386 -40
- ccxt/async_support/bitflyer.py +5 -5
- ccxt/async_support/bitforex.py +4 -1
- ccxt/async_support/bitget.py +11 -11
- ccxt/async_support/bithumb.py +2 -2
- ccxt/async_support/bitmart.py +9 -9
- ccxt/async_support/bitmex.py +3 -3
- ccxt/async_support/bitopro.py +2 -2
- ccxt/async_support/bitrue.py +8 -8
- ccxt/async_support/bitso.py +4 -4
- ccxt/async_support/bitstamp.py +2 -2
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +3 -3
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +3 -3
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +2 -2
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +9 -9
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +16 -6
- ccxt/async_support/coinbasepro.py +2 -2
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +4 -4
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +2 -2
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +14 -14
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +5 -4
- ccxt/async_support/digifinex.py +6 -6
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +41 -37
- ccxt/async_support/gemini.py +2 -2
- ccxt/async_support/hitbtc.py +5 -5
- ccxt/async_support/hollaex.py +2 -2
- ccxt/async_support/htx.py +11 -11
- ccxt/async_support/huobijp.py +4 -4
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +45 -5
- ccxt/async_support/krakenfutures.py +8 -5
- ccxt/async_support/kucoin.py +8 -8
- ccxt/async_support/kucoinfutures.py +4 -4
- ccxt/async_support/kuna.py +2 -2
- ccxt/async_support/latoken.py +3 -3
- ccxt/async_support/lbank.py +5 -4
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +2 -2
- ccxt/async_support/mercado.py +2 -2
- ccxt/async_support/mexc.py +7 -6
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +4 -4
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +5 -5
- ccxt/async_support/okx.py +26 -12
- ccxt/async_support/onetrading.py +2 -2
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paymium.py +3 -3
- ccxt/async_support/phemex.py +13 -13
- ccxt/async_support/poloniex.py +4 -4
- ccxt/async_support/poloniexfutures.py +4 -1
- ccxt/async_support/probit.py +5 -5
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/tokocrypto.py +4 -4
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/wavesexchange.py +4 -3
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +6 -6
- ccxt/async_support/woo.py +6 -6
- ccxt/async_support/yobit.py +41 -2
- ccxt/async_support/zaif.py +2 -2
- ccxt/async_support/zonda.py +4 -4
- ccxt/base/exchange.py +77 -44
- ccxt/base/types.py +10 -0
- ccxt/bigone.py +25 -5
- ccxt/binance.py +17 -16
- ccxt/bingx.py +10 -9
- ccxt/bit2c.py +13 -1
- ccxt/bitbank.py +2 -2
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +5 -5
- ccxt/bitfinex2.py +386 -40
- ccxt/bitflyer.py +5 -5
- ccxt/bitforex.py +4 -1
- ccxt/bitget.py +11 -11
- ccxt/bithumb.py +2 -2
- ccxt/bitmart.py +9 -9
- ccxt/bitmex.py +3 -3
- ccxt/bitopro.py +2 -2
- ccxt/bitrue.py +8 -8
- ccxt/bitso.py +4 -4
- ccxt/bitstamp.py +2 -2
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +3 -3
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +3 -3
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +2 -2
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +9 -9
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +16 -6
- ccxt/coinbasepro.py +2 -2
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +4 -4
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +2 -2
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +14 -14
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +5 -4
- ccxt/digifinex.py +6 -6
- ccxt/exmo.py +2 -2
- ccxt/gate.py +41 -37
- ccxt/gemini.py +2 -2
- ccxt/hitbtc.py +5 -5
- ccxt/hollaex.py +2 -2
- ccxt/htx.py +11 -11
- ccxt/huobijp.py +4 -4
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +45 -5
- ccxt/krakenfutures.py +8 -5
- ccxt/kucoin.py +8 -8
- ccxt/kucoinfutures.py +4 -4
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +3 -3
- ccxt/lbank.py +5 -4
- ccxt/luno.py +1 -1
- ccxt/lykke.py +2 -2
- ccxt/mercado.py +2 -2
- ccxt/mexc.py +7 -6
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +4 -4
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +5 -5
- ccxt/okx.py +26 -12
- ccxt/onetrading.py +2 -2
- ccxt/p2b.py +1 -1
- ccxt/paymium.py +3 -3
- ccxt/phemex.py +13 -13
- ccxt/poloniex.py +4 -4
- ccxt/poloniexfutures.py +4 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -4
- ccxt/pro/ascendex.py +1 -2
- ccxt/pro/binance.py +14 -10
- ccxt/pro/bingx.py +1 -1
- ccxt/pro/bitfinex.py +21 -22
- ccxt/pro/bitfinex2.py +13 -15
- ccxt/pro/bitget.py +3 -1
- ccxt/pro/bitmart.py +3 -7
- ccxt/pro/bitmex.py +4 -6
- ccxt/pro/bitopro.py +2 -4
- ccxt/pro/bitrue.py +1 -1
- ccxt/pro/bitstamp.py +2 -3
- ccxt/pro/bitvavo.py +10 -5
- ccxt/pro/blockchaincom.py +22 -22
- ccxt/pro/bybit.py +5 -5
- ccxt/pro/cex.py +7 -7
- ccxt/pro/coinbase.py +3 -2
- ccxt/pro/coinbasepro.py +1 -1
- ccxt/pro/coinex.py +15 -13
- ccxt/pro/currencycom.py +5 -6
- ccxt/pro/deribit.py +4 -4
- ccxt/pro/exmo.py +15 -13
- ccxt/pro/gate.py +1 -1
- ccxt/pro/gemini.py +4 -2
- ccxt/pro/hitbtc.py +10 -9
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +6 -6
- ccxt/pro/huobijp.py +3 -4
- ccxt/pro/idex.py +1 -1
- ccxt/pro/independentreserve.py +14 -13
- ccxt/pro/kraken.py +10 -14
- ccxt/pro/krakenfutures.py +10 -6
- ccxt/pro/kucoin.py +10 -10
- ccxt/pro/kucoinfutures.py +11 -10
- ccxt/pro/lbank.py +10 -10
- ccxt/pro/luno.py +12 -14
- ccxt/pro/mexc.py +3 -2
- ccxt/pro/ndax.py +7 -11
- ccxt/pro/okcoin.py +7 -10
- ccxt/pro/okx.py +6 -9
- ccxt/pro/onetrading.py +16 -15
- ccxt/pro/p2b.py +5 -3
- ccxt/pro/phemex.py +16 -11
- ccxt/pro/poloniex.py +6 -4
- ccxt/pro/poloniexfutures.py +13 -9
- ccxt/pro/probit.py +15 -12
- ccxt/pro/upbit.py +8 -8
- ccxt/pro/wazirx.py +6 -3
- ccxt/pro/woo.py +9 -7
- ccxt/probit.py +5 -5
- ccxt/test/base/test_order_book.py +7 -7
- ccxt/test/base/test_shared_methods.py +1 -1
- ccxt/test/test_async.py +86 -36
- ccxt/test/test_sync.py +86 -36
- ccxt/timex.py +2 -2
- ccxt/tokocrypto.py +4 -4
- ccxt/upbit.py +2 -2
- ccxt/wavesexchange.py +4 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +6 -6
- ccxt/woo.py +6 -6
- ccxt/yobit.py +41 -2
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +4 -4
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/METADATA +10 -10
- ccxt-4.2.34.dist-info/RECORD +438 -0
- ccxt-4.2.30.dist-info/RECORD +0 -438
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/WHEEL +0 -0
- {ccxt-4.2.30.dist-info → ccxt-4.2.34.dist-info}/top_level.txt +0 -0
ccxt/pro/poloniex.py
CHANGED
@@ -974,13 +974,15 @@ class poloniex(ccxt.async_support.poloniex):
|
|
974
974
|
bid = self.safe_value(bids, j)
|
975
975
|
price = self.safe_number(bid, 0)
|
976
976
|
amount = self.safe_number(bid, 1)
|
977
|
-
orderbook['bids']
|
977
|
+
bidsSide = orderbook['bids']
|
978
|
+
bidsSide.store(price, amount)
|
978
979
|
if asks is not None:
|
979
980
|
for j in range(0, len(asks)):
|
980
981
|
ask = self.safe_value(asks, j)
|
981
982
|
price = self.safe_number(ask, 0)
|
982
983
|
amount = self.safe_number(ask, 1)
|
983
|
-
orderbook['asks']
|
984
|
+
asksSide = orderbook['asks']
|
985
|
+
asksSide.store(price, amount)
|
984
986
|
orderbook['symbol'] = symbol
|
985
987
|
orderbook['timestamp'] = timestamp
|
986
988
|
orderbook['datetime'] = self.iso8601(timestamp)
|
@@ -1104,12 +1106,12 @@ class poloniex(ccxt.async_support.poloniex):
|
|
1104
1106
|
if orderId == '0':
|
1105
1107
|
self.handle_error_message(client, item)
|
1106
1108
|
else:
|
1107
|
-
|
1109
|
+
self.handle_order_request(client, message)
|
1108
1110
|
else:
|
1109
1111
|
data = self.safe_value(message, 'data', [])
|
1110
1112
|
dataLength = len(data)
|
1111
1113
|
if dataLength > 0:
|
1112
|
-
|
1114
|
+
method(client, message)
|
1113
1115
|
|
1114
1116
|
def handle_error_message(self, client: Client, message):
|
1115
1117
|
#
|
ccxt/pro/poloniexfutures.py
CHANGED
@@ -68,17 +68,20 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
68
68
|
},
|
69
69
|
})
|
70
70
|
|
71
|
-
def negotiate(self, privateChannel, params={}):
|
71
|
+
async def negotiate(self, privateChannel, params={}):
|
72
72
|
connectId = 'private' if privateChannel else 'public'
|
73
73
|
urls = self.safe_value(self.options, 'urls', {})
|
74
74
|
if connectId in urls:
|
75
|
-
return urls[connectId]
|
75
|
+
# return urls[connectId]
|
76
|
+
storedFuture = urls[connectId]
|
77
|
+
return await storedFuture
|
76
78
|
# we store an awaitable to the url
|
77
79
|
# so that multiple calls don't asynchronously
|
78
80
|
# fetch different urls and overwrite each other
|
79
81
|
urls[connectId] = self.spawn(self.negotiate_helper, privateChannel, params)
|
80
82
|
self.options['urls'] = urls
|
81
|
-
|
83
|
+
future = urls[connectId]
|
84
|
+
return await future
|
82
85
|
|
83
86
|
async def negotiate_helper(self, privateChannel, params={}):
|
84
87
|
response = None
|
@@ -685,7 +688,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
685
688
|
messageHash = self.safe_string(message, 'topic')
|
686
689
|
subject = self.safe_string(message, 'subject')
|
687
690
|
if subject == 'received':
|
688
|
-
return
|
691
|
+
return
|
689
692
|
# At the time of writting self, there is no implementation to easily convert each order into the orderbook so raw messages are returned
|
690
693
|
client.resolve(message, messageHash)
|
691
694
|
|
@@ -703,8 +706,9 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
703
706
|
topic = self.safe_string(message, 'topic')
|
704
707
|
isSnapshot = topic.find('Depth') >= 0
|
705
708
|
if isSnapshot:
|
706
|
-
|
707
|
-
|
709
|
+
self.hande_l2_snapshot(client, message)
|
710
|
+
return
|
711
|
+
self.handle_l2_order_book(client, message)
|
708
712
|
|
709
713
|
def handle_l2_order_book(self, client: Client, message):
|
710
714
|
#
|
@@ -740,7 +744,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
740
744
|
snapshotDelay = self.handle_option('watchOrderBook', 'snapshotDelay', 5)
|
741
745
|
if cacheLength == snapshotDelay:
|
742
746
|
limit = 0
|
743
|
-
self.spawn(self.load_order_book, client, messageHash, symbol, limit)
|
747
|
+
self.spawn(self.load_order_book, client, messageHash, symbol, limit, {})
|
744
748
|
orderBook.cache.append(data)
|
745
749
|
return
|
746
750
|
try:
|
@@ -920,7 +924,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
920
924
|
}
|
921
925
|
method = self.safe_value(methods, subject)
|
922
926
|
if method is not None:
|
923
|
-
|
927
|
+
method(client, message)
|
924
928
|
|
925
929
|
def ping(self, client: Client):
|
926
930
|
id = str(self.request_id())
|
@@ -955,7 +959,7 @@ class poloniexfutures(ccxt.async_support.poloniexfutures):
|
|
955
959
|
}
|
956
960
|
method = self.safe_value(methods, type)
|
957
961
|
if method is not None:
|
958
|
-
|
962
|
+
method(client, message)
|
959
963
|
|
960
964
|
def handle_authenticate(self, client, message):
|
961
965
|
#
|
ccxt/pro/probit.py
CHANGED
@@ -428,17 +428,17 @@ class probit(ccxt.async_support.probit):
|
|
428
428
|
symbol = self.safe_symbol(marketId)
|
429
429
|
dataBySide = self.group_by(orderBook, 'side')
|
430
430
|
messageHash = 'orderbook:' + symbol
|
431
|
-
|
432
|
-
if
|
433
|
-
|
434
|
-
self.orderbooks[symbol] =
|
431
|
+
orderbook = self.safe_value(self.orderbooks, symbol)
|
432
|
+
if orderbook is None:
|
433
|
+
orderbook = self.order_book({})
|
434
|
+
self.orderbooks[symbol] = orderbook
|
435
435
|
reset = self.safe_bool(message, 'reset', False)
|
436
436
|
if reset:
|
437
437
|
snapshot = self.parse_order_book(dataBySide, symbol, None, 'buy', 'sell', 'price', 'quantity')
|
438
|
-
|
438
|
+
orderbook.reset(snapshot)
|
439
439
|
else:
|
440
|
-
self.handle_delta(
|
441
|
-
client.resolve(
|
440
|
+
self.handle_delta(orderbook, dataBySide)
|
441
|
+
client.resolve(orderbook, messageHash)
|
442
442
|
|
443
443
|
def handle_bid_asks(self, bookSide, bidAsks):
|
444
444
|
for i in range(0, len(bidAsks)):
|
@@ -505,10 +505,12 @@ class probit(ccxt.async_support.probit):
|
|
505
505
|
#
|
506
506
|
errorCode = self.safe_string(message, 'errorCode')
|
507
507
|
if errorCode is not None:
|
508
|
-
|
508
|
+
self.handle_error_message(client, message)
|
509
|
+
return
|
509
510
|
type = self.safe_string(message, 'type')
|
510
511
|
if type == 'authorization':
|
511
|
-
|
512
|
+
self.handle_authenticate(client, message)
|
513
|
+
return
|
512
514
|
handlers = {
|
513
515
|
'marketdata': self.handle_market_data,
|
514
516
|
'balance': self.handle_balance,
|
@@ -519,7 +521,8 @@ class probit(ccxt.async_support.probit):
|
|
519
521
|
channel = self.safe_string(message, 'channel')
|
520
522
|
handler = self.safe_value(handlers, channel)
|
521
523
|
if handler is not None:
|
522
|
-
|
524
|
+
handler(client, message)
|
525
|
+
return
|
523
526
|
error = NotSupported(self.id + ' handleMessage: unknown message: ' + self.json(message))
|
524
527
|
client.reject(error)
|
525
528
|
|
@@ -530,7 +533,7 @@ class probit(ccxt.async_support.probit):
|
|
530
533
|
expires = self.safe_integer(self.options, 'expires', 0)
|
531
534
|
future = self.safe_value(client.subscriptions, messageHash)
|
532
535
|
if (future is None) or (self.milliseconds() > expires):
|
533
|
-
response = await self.
|
536
|
+
response = await self.sign_in()
|
534
537
|
#
|
535
538
|
# {
|
536
539
|
# "access_token": "0ttDv/2hTTn3bLi8GP1gKaneiEQ6+0hOBenPrxNQt2s=",
|
@@ -545,4 +548,4 @@ class probit(ccxt.async_support.probit):
|
|
545
548
|
}
|
546
549
|
future = self.watch(url, messageHash, self.extend(request, params))
|
547
550
|
client.subscriptions[messageHash] = future
|
548
|
-
return
|
551
|
+
return future
|
ccxt/pro/upbit.py
CHANGED
@@ -161,15 +161,15 @@ class upbit(ccxt.async_support.upbit):
|
|
161
161
|
limit = self.safe_integer(options, 'limit', 15)
|
162
162
|
if type == 'SNAPSHOT':
|
163
163
|
self.orderbooks[symbol] = self.order_book({}, limit)
|
164
|
-
|
164
|
+
orderbook = self.orderbooks[symbol]
|
165
165
|
# upbit always returns a snapshot of 15 topmost entries
|
166
166
|
# the "REALTIME" deltas are not incremental
|
167
167
|
# therefore we reset the orderbook on each update
|
168
168
|
# and reinitialize it again with new bidasks
|
169
|
-
|
170
|
-
|
171
|
-
bids =
|
172
|
-
asks =
|
169
|
+
orderbook.reset({})
|
170
|
+
orderbook['symbol'] = symbol
|
171
|
+
bids = orderbook['bids']
|
172
|
+
asks = orderbook['asks']
|
173
173
|
data = self.safe_value(message, 'orderbook_units', [])
|
174
174
|
for i in range(0, len(data)):
|
175
175
|
entry = data[i]
|
@@ -181,10 +181,10 @@ class upbit(ccxt.async_support.upbit):
|
|
181
181
|
bids.store(bid_price, bid_size)
|
182
182
|
timestamp = self.safe_integer(message, 'timestamp')
|
183
183
|
datetime = self.iso8601(timestamp)
|
184
|
-
|
185
|
-
|
184
|
+
orderbook['timestamp'] = timestamp
|
185
|
+
orderbook['datetime'] = datetime
|
186
186
|
messageHash = 'orderbook:' + marketId
|
187
|
-
client.resolve(
|
187
|
+
client.resolve(orderbook, messageHash)
|
188
188
|
|
189
189
|
def handle_trades(self, client: Client, message):
|
190
190
|
# {type: "trade",
|
ccxt/pro/wazirx.py
CHANGED
@@ -698,7 +698,8 @@ class wazirx(ccxt.async_support.wazirx):
|
|
698
698
|
def handle_message(self, client: Client, message):
|
699
699
|
status = self.safe_string(message, 'status')
|
700
700
|
if status == 'error':
|
701
|
-
|
701
|
+
self.handle_error(client, message)
|
702
|
+
return
|
702
703
|
event = self.safe_string(message, 'event')
|
703
704
|
eventHandlers = {
|
704
705
|
'error': self.handle_error,
|
@@ -707,7 +708,8 @@ class wazirx(ccxt.async_support.wazirx):
|
|
707
708
|
}
|
708
709
|
eventHandler = self.safe_value(eventHandlers, event)
|
709
710
|
if eventHandler is not None:
|
710
|
-
|
711
|
+
eventHandler(client, message)
|
712
|
+
return
|
711
713
|
stream = self.safe_string(message, 'stream', '')
|
712
714
|
streamHandlers = {
|
713
715
|
'ticker@arr': self.handle_ticker,
|
@@ -722,7 +724,8 @@ class wazirx(ccxt.async_support.wazirx):
|
|
722
724
|
for i in range(0, len(streams)):
|
723
725
|
if self.in_array(streams[i], stream):
|
724
726
|
handler = streamHandlers[streams[i]]
|
725
|
-
|
727
|
+
handler(client, message)
|
728
|
+
return
|
726
729
|
raise NotSupported(self.id + ' self message type is not supported yet. Message: ' + self.json(message))
|
727
730
|
|
728
731
|
async def authenticate(self, params={}):
|
ccxt/pro/woo.py
CHANGED
@@ -407,7 +407,7 @@ class woo(ccxt.async_support.woo):
|
|
407
407
|
return False
|
408
408
|
return True
|
409
409
|
|
410
|
-
def authenticate(self, params={}):
|
410
|
+
async def authenticate(self, params={}):
|
411
411
|
self.check_required_credentials()
|
412
412
|
url = self.urls['api']['ws']['private'] + '/' + self.uid
|
413
413
|
client = self.client(url)
|
@@ -786,28 +786,30 @@ class woo(ccxt.async_support.woo):
|
|
786
786
|
event = self.safe_string(message, 'event')
|
787
787
|
method = self.safe_value(methods, event)
|
788
788
|
if method is not None:
|
789
|
-
|
789
|
+
method(client, message)
|
790
|
+
return
|
790
791
|
topic = self.safe_string(message, 'topic')
|
791
792
|
if topic is not None:
|
792
793
|
method = self.safe_value(methods, topic)
|
793
794
|
if method is not None:
|
794
|
-
|
795
|
+
method(client, message)
|
796
|
+
return
|
795
797
|
splitTopic = topic.split('@')
|
796
798
|
splitLength = len(splitTopic)
|
797
799
|
if splitLength == 2:
|
798
800
|
name = self.safe_string(splitTopic, 1)
|
799
801
|
method = self.safe_value(methods, name)
|
800
802
|
if method is not None:
|
801
|
-
|
803
|
+
method(client, message)
|
804
|
+
return
|
802
805
|
splitName = name.split('_')
|
803
806
|
splitNameLength = len(splitTopic)
|
804
807
|
if splitNameLength == 2:
|
805
808
|
method = self.safe_value(methods, self.safe_string(splitName, 0))
|
806
809
|
if method is not None:
|
807
|
-
|
808
|
-
return message
|
810
|
+
method(client, message)
|
809
811
|
|
810
|
-
def ping(self, client):
|
812
|
+
def ping(self, client: Client):
|
811
813
|
return {'event': 'ping'}
|
812
814
|
|
813
815
|
def handle_ping(self, client: Client, message):
|
ccxt/probit.py
CHANGED
@@ -433,8 +433,8 @@ class probit(Exchange, ImplicitAPI):
|
|
433
433
|
networkList = {}
|
434
434
|
for j in range(0, len(platformsByPriority)):
|
435
435
|
network = platformsByPriority[j]
|
436
|
-
|
437
|
-
networkCode = self.network_id_to_code(
|
436
|
+
idInner = self.safe_string(network, 'id')
|
437
|
+
networkCode = self.network_id_to_code(idInner)
|
438
438
|
currentDepositSuspended = self.safe_value(network, 'deposit_suspended')
|
439
439
|
currentWithdrawalSuspended = self.safe_value(network, 'withdrawal_suspended')
|
440
440
|
currentDeposit = not currentDepositSuspended
|
@@ -452,7 +452,7 @@ class probit(Exchange, ImplicitAPI):
|
|
452
452
|
networkFee = withdrawPlatform
|
453
453
|
break
|
454
454
|
networkList[networkCode] = {
|
455
|
-
'id':
|
455
|
+
'id': idInner,
|
456
456
|
'network': networkCode,
|
457
457
|
'active': currentActive,
|
458
458
|
'deposit': currentDeposit,
|
@@ -1138,7 +1138,7 @@ class probit(Exchange, ImplicitAPI):
|
|
1138
1138
|
def cost_to_precision(self, symbol, cost):
|
1139
1139
|
return self.decimal_to_precision(cost, TRUNCATE, self.markets[symbol]['precision']['cost'], self.precisionMode)
|
1140
1140
|
|
1141
|
-
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
|
1141
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1142
1142
|
"""
|
1143
1143
|
create a trade order
|
1144
1144
|
:see: https://docs-en.probit.com/reference/order-1
|
@@ -1331,7 +1331,7 @@ class probit(Exchange, ImplicitAPI):
|
|
1331
1331
|
data = self.safe_value(response, 'data', [])
|
1332
1332
|
return self.parse_deposit_addresses(data, codes)
|
1333
1333
|
|
1334
|
-
def withdraw(self, code: str, amount, address, tag=None, params={}):
|
1334
|
+
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1335
1335
|
"""
|
1336
1336
|
:see: https://docs-en.probit.com/reference/withdrawal
|
1337
1337
|
make a withdrawal
|
@@ -15,7 +15,7 @@ sys.path.append(root)
|
|
15
15
|
from ccxt.base.precise import Precise # noqa E402
|
16
16
|
from ccxt.test.base import test_shared_methods # noqa E402
|
17
17
|
|
18
|
-
def test_order_book(exchange, skipped_properties, method,
|
18
|
+
def test_order_book(exchange, skipped_properties, method, orderbook, symbol):
|
19
19
|
format = {
|
20
20
|
'symbol': 'ETH/BTC',
|
21
21
|
'asks': [[exchange.parse_number('1.24'), exchange.parse_number('0.453')], [exchange.parse_number('1.25'), exchange.parse_number('0.157')]],
|
@@ -25,14 +25,14 @@ def test_order_book(exchange, skipped_properties, method, entry, symbol):
|
|
25
25
|
'nonce': 134234234,
|
26
26
|
}
|
27
27
|
empty_allowed_for = ['symbol', 'nonce', 'datetime', 'timestamp'] # todo: make timestamp required
|
28
|
-
test_shared_methods.assert_structure(exchange, skipped_properties, method,
|
29
|
-
test_shared_methods.assert_timestamp_and_datetime(exchange, skipped_properties, method,
|
30
|
-
test_shared_methods.assert_symbol(exchange, skipped_properties, method,
|
31
|
-
log_text = test_shared_methods.log_template(exchange, method,
|
28
|
+
test_shared_methods.assert_structure(exchange, skipped_properties, method, orderbook, format, empty_allowed_for)
|
29
|
+
test_shared_methods.assert_timestamp_and_datetime(exchange, skipped_properties, method, orderbook)
|
30
|
+
test_shared_methods.assert_symbol(exchange, skipped_properties, method, orderbook, 'symbol', symbol)
|
31
|
+
log_text = test_shared_methods.log_template(exchange, method, orderbook)
|
32
32
|
#
|
33
33
|
if ('bid' in skipped_properties) or ('ask' in skipped_properties):
|
34
34
|
return
|
35
|
-
bids =
|
35
|
+
bids = orderbook['bids']
|
36
36
|
bids_length = len(bids)
|
37
37
|
for i in range(0, bids_length):
|
38
38
|
current_bid_string = exchange.safe_string(bids[i], 0)
|
@@ -43,7 +43,7 @@ def test_order_book(exchange, skipped_properties, method, entry, symbol):
|
|
43
43
|
assert has_correct_order, 'current bid should be > than the next one: ' + current_bid_string + '>' + next_bid_string + log_text
|
44
44
|
test_shared_methods.assert_greater(exchange, skipped_properties, method, bids[i], 0, '0')
|
45
45
|
test_shared_methods.assert_greater(exchange, skipped_properties, method, bids[i], 1, '0')
|
46
|
-
asks =
|
46
|
+
asks = orderbook['asks']
|
47
47
|
asks_length = len(asks)
|
48
48
|
for i in range(0, asks_length):
|
49
49
|
current_ask_string = exchange.safe_string(asks[i], 0)
|
@@ -40,7 +40,7 @@ def string_value(value):
|
|
40
40
|
|
41
41
|
def assert_type(exchange, skipped_properties, entry, key, format):
|
42
42
|
if key in skipped_properties:
|
43
|
-
return
|
43
|
+
return None
|
44
44
|
# because "typeof" string is not transpilable without === 'name', we list them manually at this moment
|
45
45
|
entry_key_val = exchange.safe_value(entry, key)
|
46
46
|
format_key_val = exchange.safe_value(format, key)
|