ccxt 4.5.1__py2.py3-none-any.whl → 4.5.2__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -5
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -5
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +17 -12
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/indodax.py +11 -12
- ccxt/async_support/okx.py +2 -2
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/zonda.py +12 -0
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +17 -12
- ccxt/bitget.py +1 -1
- ccxt/indodax.py +11 -12
- ccxt/okx.py +2 -2
- ccxt/poloniex.py +1 -1
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/bitget.py +151 -26
- ccxt/pro/bitmart.py +1 -1
- ccxt/pro/gemini.py +6 -2
- ccxt/pro/hyperliquid.py +4 -0
- ccxt/pro/kraken.py +3 -6
- ccxt/test/tests_async.py +2 -25
- ccxt/test/tests_sync.py +2 -25
- ccxt/zonda.py +12 -0
- {ccxt-4.5.1.dist-info → ccxt-4.5.2.dist-info}/METADATA +111 -113
- {ccxt-4.5.1.dist-info → ccxt-4.5.2.dist-info}/RECORD +31 -38
- ccxt/abstract/ellipx.py +0 -25
- ccxt/abstract/vertex.py +0 -19
- ccxt/async_support/ellipx.py +0 -2029
- ccxt/async_support/vertex.py +0 -3050
- ccxt/ellipx.py +0 -2029
- ccxt/pro/vertex.py +0 -948
- ccxt/vertex.py +0 -3050
- {ccxt-4.5.1.dist-info → ccxt-4.5.2.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.5.1.dist-info → ccxt-4.5.2.dist-info}/WHEEL +0 -0
- {ccxt-4.5.1.dist-info → ccxt-4.5.2.dist-info}/top_level.txt +0 -0
ccxt/pro/bitget.py
CHANGED
@@ -68,6 +68,7 @@ class bitget(ccxt.async_support.bitget):
|
|
68
68
|
# WS timeframes differ from REST timeframes
|
69
69
|
'timeframes': {
|
70
70
|
'1m': '1m',
|
71
|
+
'3m': '3m',
|
71
72
|
'5m': '5m',
|
72
73
|
'15m': '15m',
|
73
74
|
'30m': '30m',
|
@@ -481,12 +482,14 @@ class bitget(ccxt.async_support.bitget):
|
|
481
482
|
|
482
483
|
https://www.bitget.com/api-doc/spot/websocket/public/Candlesticks-Channel
|
483
484
|
https://www.bitget.com/api-doc/contract/websocket/public/Candlesticks-Channel
|
485
|
+
https://www.bitget.com/api-doc/uta/websocket/public/Candlesticks-Channel
|
484
486
|
|
485
487
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
486
488
|
:param str timeframe: the length of time each candle represents
|
487
489
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
488
490
|
:param int [limit]: the maximum amount of candles to fetch
|
489
491
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
492
|
+
:param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
|
490
493
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
491
494
|
"""
|
492
495
|
await self.load_markets()
|
@@ -494,14 +497,24 @@ class bitget(ccxt.async_support.bitget):
|
|
494
497
|
symbol = market['symbol']
|
495
498
|
timeframes = self.safe_value(self.options, 'timeframes')
|
496
499
|
interval = self.safe_string(timeframes, timeframe)
|
497
|
-
messageHash =
|
500
|
+
messageHash = None
|
498
501
|
instType = None
|
499
|
-
|
502
|
+
uta = None
|
503
|
+
uta, params = self.handle_option_and_params(params, 'watchOHLCV', 'uta', False)
|
504
|
+
instType, params = self.get_inst_type(market, uta, params)
|
500
505
|
args: dict = {
|
501
506
|
'instType': instType,
|
502
|
-
'channel': 'candle' + interval,
|
503
|
-
'instId': market['id'],
|
504
507
|
}
|
508
|
+
if uta:
|
509
|
+
args['topic'] = 'kline'
|
510
|
+
args['symbol'] = market['id']
|
511
|
+
args['interval'] = interval
|
512
|
+
params['uta'] = True
|
513
|
+
messageHash = 'kline:' + symbol
|
514
|
+
else:
|
515
|
+
args['channel'] = 'candle' + interval
|
516
|
+
args['instId'] = market['id']
|
517
|
+
messageHash = 'candles:' + timeframe + ':' + symbol
|
505
518
|
ohlcv = await self.watch_public(messageHash, args, params)
|
506
519
|
if self.newUpdates:
|
507
520
|
limit = ohlcv.getLimit(symbol, limit)
|
@@ -513,17 +526,43 @@ class bitget(ccxt.async_support.bitget):
|
|
513
526
|
|
514
527
|
https://www.bitget.com/api-doc/spot/websocket/public/Candlesticks-Channel
|
515
528
|
https://www.bitget.com/api-doc/contract/websocket/public/Candlesticks-Channel
|
529
|
+
https://www.bitget.com/api-doc/uta/websocket/public/Candlesticks-Channel
|
516
530
|
|
517
531
|
:param str symbol: unified symbol of the market to unwatch the ohlcv for
|
518
532
|
:param str [timeframe]: the period for the ratio, default is 1 minute
|
519
533
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
534
|
+
:param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
|
520
535
|
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
|
521
536
|
"""
|
522
537
|
await self.load_markets()
|
523
538
|
timeframes = self.safe_dict(self.options, 'timeframes')
|
524
539
|
interval = self.safe_string(timeframes, timeframe)
|
525
|
-
channel =
|
526
|
-
|
540
|
+
channel = None
|
541
|
+
market = None
|
542
|
+
if symbol is not None:
|
543
|
+
market = self.market(symbol)
|
544
|
+
instType = None
|
545
|
+
messageHash = None
|
546
|
+
uta = None
|
547
|
+
uta, params = self.handle_option_and_params(params, 'unWatchOHLCV', 'uta', False)
|
548
|
+
instType, params = self.get_inst_type(market, uta, params)
|
549
|
+
args: dict = {
|
550
|
+
'instType': instType,
|
551
|
+
}
|
552
|
+
if uta:
|
553
|
+
channel = 'kline'
|
554
|
+
args['topic'] = channel
|
555
|
+
args['symbol'] = market['id']
|
556
|
+
args['interval'] = interval
|
557
|
+
params['uta'] = True
|
558
|
+
params['interval'] = interval
|
559
|
+
messageHash = channel + symbol
|
560
|
+
else:
|
561
|
+
channel = 'candle' + interval
|
562
|
+
args['channel'] = channel
|
563
|
+
args['instId'] = market['id']
|
564
|
+
messageHash = 'candles:' + interval
|
565
|
+
return await self.un_watch_channel(symbol, channel, messageHash, params)
|
527
566
|
|
528
567
|
def handle_ohlcv(self, client: Client, message):
|
529
568
|
#
|
@@ -559,15 +598,45 @@ class bitget(ccxt.async_support.bitget):
|
|
559
598
|
# "ts": 1701901610417
|
560
599
|
# }
|
561
600
|
#
|
601
|
+
# uta
|
602
|
+
#
|
603
|
+
# {
|
604
|
+
# "action": "snapshot",
|
605
|
+
# "arg": {
|
606
|
+
# "instType": "usdt-futures",
|
607
|
+
# "topic": "kline",
|
608
|
+
# "symbol": "BTCUSDT",
|
609
|
+
# "interval": "1m"
|
610
|
+
# },
|
611
|
+
# "data": [
|
612
|
+
# {
|
613
|
+
# "start": "1755564480000",
|
614
|
+
# "open": "116286",
|
615
|
+
# "close": "116256.2",
|
616
|
+
# "high": "116310.2",
|
617
|
+
# "low": "116232.8",
|
618
|
+
# "volume": "39.7062",
|
619
|
+
# "turnover": "4616746.46654"
|
620
|
+
# },
|
621
|
+
# ],
|
622
|
+
# "ts": 1755594421877
|
623
|
+
# }
|
624
|
+
#
|
562
625
|
arg = self.safe_value(message, 'arg', {})
|
563
|
-
instType = self.
|
564
|
-
marketType = 'spot' if (instType == '
|
565
|
-
marketId = self.
|
626
|
+
instType = self.safe_string_lower(arg, 'instType')
|
627
|
+
marketType = 'spot' if (instType == 'spot') else 'contract'
|
628
|
+
marketId = self.safe_string_2(arg, 'instId', 'symbol')
|
566
629
|
market = self.safe_market(marketId, None, None, marketType)
|
567
630
|
symbol = market['symbol']
|
568
631
|
self.ohlcvs[symbol] = self.safe_value(self.ohlcvs, symbol, {})
|
569
|
-
channel = self.
|
570
|
-
interval =
|
632
|
+
channel = self.safe_string_2(arg, 'channel', 'topic')
|
633
|
+
interval = self.safe_string(arg, 'interval')
|
634
|
+
isUta = None
|
635
|
+
if interval is None:
|
636
|
+
isUta = False
|
637
|
+
interval = channel.replace('candle', '')
|
638
|
+
else:
|
639
|
+
isUta = True
|
571
640
|
timeframes = self.safe_value(self.options, 'timeframes')
|
572
641
|
timeframe = self.find_timeframe(interval, timeframes)
|
573
642
|
stored = self.safe_value(self.ohlcvs[symbol], timeframe)
|
@@ -579,7 +648,11 @@ class bitget(ccxt.async_support.bitget):
|
|
579
648
|
for i in range(0, len(data)):
|
580
649
|
parsed = self.parse_ws_ohlcv(data[i], market)
|
581
650
|
stored.append(parsed)
|
582
|
-
messageHash =
|
651
|
+
messageHash = None
|
652
|
+
if isUta:
|
653
|
+
messageHash = 'kline:' + symbol
|
654
|
+
else:
|
655
|
+
messageHash = 'candles:' + timeframe + ':' + symbol
|
583
656
|
client.resolve(stored, messageHash)
|
584
657
|
|
585
658
|
def parse_ws_ohlcv(self, ohlcv, market=None) -> list:
|
@@ -595,14 +668,26 @@ class bitget(ccxt.async_support.bitget):
|
|
595
668
|
# "437404.105512" # USDT volume
|
596
669
|
# ]
|
597
670
|
#
|
671
|
+
# uta
|
672
|
+
#
|
673
|
+
# {
|
674
|
+
# "start": "1755564480000",
|
675
|
+
# "open": "116286",
|
676
|
+
# "close": "116256.2",
|
677
|
+
# "high": "116310.2",
|
678
|
+
# "low": "116232.8",
|
679
|
+
# "volume": "39.7062",
|
680
|
+
# "turnover": "4616746.46654"
|
681
|
+
# }
|
682
|
+
#
|
598
683
|
volumeIndex = 6 if (market['inverse']) else 5
|
599
684
|
return [
|
600
|
-
self.
|
601
|
-
self.
|
602
|
-
self.
|
603
|
-
self.
|
604
|
-
self.
|
605
|
-
self.
|
685
|
+
self.safe_integer_2(ohlcv, 'start', 0),
|
686
|
+
self.safe_number_2(ohlcv, 'open', 1),
|
687
|
+
self.safe_number_2(ohlcv, 'high', 2),
|
688
|
+
self.safe_number_2(ohlcv, 'low', 3),
|
689
|
+
self.safe_number_2(ohlcv, 'close', 4),
|
690
|
+
self.safe_number_2(ohlcv, 'volume', volumeIndex),
|
606
691
|
]
|
607
692
|
|
608
693
|
async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
@@ -644,12 +729,21 @@ class bitget(ccxt.async_support.bitget):
|
|
644
729
|
market = self.market(symbol)
|
645
730
|
messageHash = 'unsubscribe:' + messageHashTopic + ':' + market['symbol']
|
646
731
|
instType = None
|
647
|
-
|
732
|
+
uta = None
|
733
|
+
uta, params = self.handle_option_and_params(params, 'unWatchChannel', 'uta', False)
|
734
|
+
instType, params = self.get_inst_type(market, uta, params)
|
648
735
|
args: dict = {
|
649
736
|
'instType': instType,
|
650
|
-
'channel': channel,
|
651
|
-
'instId': market['id'],
|
652
737
|
}
|
738
|
+
if uta:
|
739
|
+
args['topic'] = channel
|
740
|
+
args['symbol'] = market['id']
|
741
|
+
args['interval'] = self.safe_string(params, 'interval', '1m')
|
742
|
+
params['uta'] = True
|
743
|
+
params = self.omit(params, 'interval')
|
744
|
+
else:
|
745
|
+
args['channel'] = channel
|
746
|
+
args['instId'] = market['id']
|
653
747
|
return await self.un_watch_public(messageHash, args, params)
|
654
748
|
|
655
749
|
async def watch_order_book_for_symbols(self, symbols: List[str], limit: Int = None, params={}) -> OrderBook:
|
@@ -1999,6 +2093,18 @@ class bitget(ccxt.async_support.bitget):
|
|
1999
2093
|
# "ts": 1753230479687
|
2000
2094
|
# }
|
2001
2095
|
#
|
2096
|
+
# unsubscribe
|
2097
|
+
#
|
2098
|
+
# {
|
2099
|
+
# "event": "unsubscribe",
|
2100
|
+
# "arg": {
|
2101
|
+
# "instType": "spot",
|
2102
|
+
# "topic": "kline",
|
2103
|
+
# "symbol": "BTCUSDT",
|
2104
|
+
# "interval": "1m"
|
2105
|
+
# }
|
2106
|
+
# }
|
2107
|
+
#
|
2002
2108
|
if self.handle_error_message(client, message):
|
2003
2109
|
return
|
2004
2110
|
content = self.safe_string(message, 'message')
|
@@ -2031,6 +2137,7 @@ class bitget(ccxt.async_support.bitget):
|
|
2031
2137
|
'positions': self.handle_positions,
|
2032
2138
|
'account-isolated': self.handle_balance,
|
2033
2139
|
'account-crossed': self.handle_balance,
|
2140
|
+
'kline': self.handle_ohlcv,
|
2034
2141
|
}
|
2035
2142
|
arg = self.safe_value(message, 'arg', {})
|
2036
2143
|
topic = self.safe_value_2(arg, 'channel', 'topic', '')
|
@@ -2128,18 +2235,34 @@ class bitget(ccxt.async_support.bitget):
|
|
2128
2235
|
#
|
2129
2236
|
# {"event":"unsubscribe","arg":{"instType":"SPOT","channel":"candle1m","instId":"BTCUSDT"}}
|
2130
2237
|
#
|
2238
|
+
# UTA
|
2239
|
+
#
|
2240
|
+
# {"event":"unsubscribe","arg":{"instType":"spot","topic":"kline","symbol":"BTCUSDT","interval":"1m"}}
|
2241
|
+
#
|
2131
2242
|
arg = self.safe_dict(message, 'arg', {})
|
2132
2243
|
instType = self.safe_string_lower(arg, 'instType')
|
2133
2244
|
type = 'spot' if (instType == 'spot') else 'contract'
|
2134
|
-
instId = self.
|
2135
|
-
channel = self.
|
2136
|
-
interval =
|
2245
|
+
instId = self.safe_string_2(arg, 'instId', 'symbol')
|
2246
|
+
channel = self.safe_string_2(arg, 'channel', 'topic')
|
2247
|
+
interval = self.safe_string(arg, 'interval')
|
2248
|
+
isUta = None
|
2249
|
+
if interval is None:
|
2250
|
+
isUta = False
|
2251
|
+
interval = channel.replace('candle', '')
|
2252
|
+
else:
|
2253
|
+
isUta = True
|
2137
2254
|
timeframes = self.safe_value(self.options, 'timeframes')
|
2138
2255
|
timeframe = self.find_timeframe(interval, timeframes)
|
2139
2256
|
market = self.safe_market(instId, None, None, type)
|
2140
2257
|
symbol = market['symbol']
|
2141
|
-
messageHash =
|
2142
|
-
subMessageHash =
|
2258
|
+
messageHash = None
|
2259
|
+
subMessageHash = None
|
2260
|
+
if isUta:
|
2261
|
+
messageHash = 'unsubscribe:kline:' + symbol
|
2262
|
+
subMessageHash = 'kline:' + symbol
|
2263
|
+
else:
|
2264
|
+
messageHash = 'unsubscribe:candles:' + timeframe + ':' + symbol
|
2265
|
+
subMessageHash = 'candles:' + timeframe + ':' + symbol
|
2143
2266
|
if symbol in self.ohlcvs:
|
2144
2267
|
if timeframe in self.ohlcvs[symbol]:
|
2145
2268
|
del self.ohlcvs[symbol][timeframe]
|
@@ -2180,4 +2303,6 @@ class bitget(ccxt.async_support.bitget):
|
|
2180
2303
|
self.handle_ticker_un_subscription(client, message)
|
2181
2304
|
elif channel.startswith('candle'):
|
2182
2305
|
self.handle_ohlcv_un_subscription(client, message)
|
2306
|
+
elif channel.startswith('kline'):
|
2307
|
+
self.handle_ohlcv_un_subscription(client, message)
|
2183
2308
|
return message
|
ccxt/pro/bitmart.py
CHANGED
ccxt/pro/gemini.py
CHANGED
@@ -471,11 +471,15 @@ class gemini(ccxt.async_support.gemini):
|
|
471
471
|
currentBidAsk['timestamp'] = timestamp
|
472
472
|
currentBidAsk['datetime'] = self.iso8601(timestamp)
|
473
473
|
currentBidAsk['info'] = rawBidAskChanges
|
474
|
+
bidsAsksDict = {}
|
475
|
+
bidsAsksDict[symbol] = currentBidAsk
|
474
476
|
self.bidsasks[symbol] = currentBidAsk
|
475
|
-
client.resolve(
|
477
|
+
client.resolve(bidsAsksDict, messageHash)
|
476
478
|
|
477
|
-
async def helper_for_watch_multiple_construct(self, itemHashName: str, symbols: List[str], params={}):
|
479
|
+
async def helper_for_watch_multiple_construct(self, itemHashName: str, symbols: List[str] = None, params={}):
|
478
480
|
await self.load_markets()
|
481
|
+
if symbols is None:
|
482
|
+
raise NotSupported(self.id + ' watchMultiple requires at least one symbol')
|
479
483
|
symbols = self.market_symbols(symbols, None, False, True, True)
|
480
484
|
firstMarket = self.market(symbols[0])
|
481
485
|
if not firstMarket['spot'] and not firstMarket['linear']:
|
ccxt/pro/hyperliquid.py
CHANGED
@@ -104,6 +104,10 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
104
104
|
await self.load_markets()
|
105
105
|
order, globalParams = self.parseCreateEditOrderArgs(None, symbol, type, side, amount, price, params)
|
106
106
|
orders = await self.create_orders_ws([order], globalParams)
|
107
|
+
ordersLength = len(orders)
|
108
|
+
if ordersLength == 0:
|
109
|
+
# not sure why but it is happening sometimes
|
110
|
+
return self.safe_order({})
|
107
111
|
parsedOrder = orders[0]
|
108
112
|
return parsedOrder
|
109
113
|
|
ccxt/pro/kraken.py
CHANGED
@@ -1613,7 +1613,7 @@ class kraken(ccxt.async_support.kraken):
|
|
1613
1613
|
#
|
1614
1614
|
errorMessage = self.safe_string_2(message, 'errorMessage', 'error')
|
1615
1615
|
if errorMessage is not None:
|
1616
|
-
|
1616
|
+
requestId = self.safe_string_2(message, 'reqid', 'req_id')
|
1617
1617
|
broad = self.exceptions['ws']['broad']
|
1618
1618
|
broadKey = self.find_broadly_matched_key(broad, errorMessage)
|
1619
1619
|
exception = None
|
@@ -1621,11 +1621,8 @@ class kraken(ccxt.async_support.kraken):
|
|
1621
1621
|
exception = ExchangeError(errorMessage) # c# requirement to convert the errorMessage to string
|
1622
1622
|
else:
|
1623
1623
|
exception = broad[broadKey](errorMessage)
|
1624
|
-
|
1625
|
-
|
1626
|
-
# else:
|
1627
|
-
client.reject(exception)
|
1628
|
-
# }
|
1624
|
+
if requestId is not None:
|
1625
|
+
client.reject(exception, requestId)
|
1629
1626
|
return False
|
1630
1627
|
return True
|
1631
1628
|
|
ccxt/test/tests_async.py
CHANGED
@@ -1188,7 +1188,7 @@ class testMainClass:
|
|
1188
1188
|
# -----------------------------------------------------------------------------
|
1189
1189
|
# --- Init of brokerId tests functions-----------------------------------------
|
1190
1190
|
# -----------------------------------------------------------------------------
|
1191
|
-
promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.
|
1191
|
+
promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.test_paradex(), self.test_hashkey(), self.test_coincatch(), self.test_defx(), self.test_cryptomus(), self.test_derive(), self.test_mode_trade()]
|
1192
1192
|
await asyncio.gather(*promises)
|
1193
1193
|
success_message = '[' + self.lang + '][TEST_SUCCESS] brokerId tests passed.'
|
1194
1194
|
dump('[INFO]' + success_message)
|
@@ -1253,7 +1253,7 @@ class testMainClass:
|
|
1253
1253
|
|
1254
1254
|
async def test_okx(self):
|
1255
1255
|
exchange = self.init_offline_exchange('okx')
|
1256
|
-
id = '
|
1256
|
+
id = '6b9ad766b55dBCDE'
|
1257
1257
|
spot_order_request = None
|
1258
1258
|
try:
|
1259
1259
|
await exchange.create_order('BTC/USDT', 'limit', 'buy', 1, 20000)
|
@@ -1604,29 +1604,6 @@ class testMainClass:
|
|
1604
1604
|
await close(exchange)
|
1605
1605
|
return True
|
1606
1606
|
|
1607
|
-
async def test_vertex(self):
|
1608
|
-
exchange = self.init_offline_exchange('vertex')
|
1609
|
-
exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
|
1610
|
-
exchange.privateKey = 'c33b1eb4b53108bf52e10f636d8c1236c04c33a712357ba3543ab45f48a5cb0b'
|
1611
|
-
exchange.options['v1contracts'] = {
|
1612
|
-
'chain_id': '42161',
|
1613
|
-
'endpoint_addr': '0xbbee07b3e8121227afcfe1e2b82772246226128e',
|
1614
|
-
'book_addrs': ['0x0000000000000000000000000000000000000000', '0x70e5911371472e406f1291c621d1c8f207764d73', '0xf03f457a30e598d5020164a339727ef40f2b8fbc', '0x1c6281a78aa0ed88949c319cba5f0f0de2ce8353', '0xfe653438a1a4a7f56e727509c341d60a7b54fa91', '0xb6304e9a6ca241376a5fc9294daa8fca65ddcdcd', '0x01ec802ae0ab1b2cc4f028b9fe6eb954aef06ed1', '0x0000000000000000000000000000000000000000', '0x9c52d5c4df5a68955ad088a781b4ab364a861e9e', '0x0000000000000000000000000000000000000000', '0x2a3bcda1bb3ef649f3571c96c597c3d2b25edc79', '0x0000000000000000000000000000000000000000', '0x0492ff9807f82856781488015ef7aa5526c0edd6', '0x0000000000000000000000000000000000000000', '0xea884c82418ebc21cd080b8f40ecc4d06a6a6883', '0x0000000000000000000000000000000000000000', '0x5ecf68f983253a818ca8c17a56a4f2fb48d6ec6b', '0x0000000000000000000000000000000000000000', '0xba3f57a977f099905531f7c2f294aad7b56ed254', '0x0000000000000000000000000000000000000000', '0x0ac8c26d207d0c6aabb3644fea18f530c4d6fc8e', '0x0000000000000000000000000000000000000000', '0x8bd80ad7630b3864bed66cf28f548143ea43dc3b', '0x0000000000000000000000000000000000000000', '0x045391227fc4b2cdd27b95f066864225afc9314e', '0x0000000000000000000000000000000000000000', '0x7d512bef2e6cfd7e7f5f6b2f8027e3728eb7b6c3', '0x0000000000000000000000000000000000000000', '0x678a6c5003b56b5e9a81559e9a0df880407c796f', '0x0000000000000000000000000000000000000000', '0x14b5a17208fa98843cc602b3f74e31c95ded3567', '0xe442a89a07b3888ab10579fbb2824aeceff3a282', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xac28ac205275d7c2d6877bea8657cebe04fd9ae9', '0x0000000000000000000000000000000000000000', '0xed811409bfea901e75cb19ba347c08a154e860c9', '0x0000000000000000000000000000000000000000', '0x0f7afcb1612b305626cff84f84e4169ba2d0f12c', '0x0000000000000000000000000000000000000000', '0xe4b8d903db2ce2d3891ef04cfc3ac56330c1b0c3', '0x5f44362bad629846b7455ad9d36bbc3759a3ef62', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xa64e04ed4b223a71e524dc7ebb7f28e422ccfdde', '0x0000000000000000000000000000000000000000', '0x2ee573caab73c1d8cf0ca6bd3589b67de79628a4', '0x0000000000000000000000000000000000000000', '0x01bb96883a8a478d4410387d4aaf11067edc2c74', '0x0000000000000000000000000000000000000000', '0xe7ed0c559d905436a867cddf07e06921d572363c', '0x0000000000000000000000000000000000000000', '0xa94f9e3433c92a5cd1925494811a67b1943557d9', '0x0000000000000000000000000000000000000000', '0xa63de7f89ba1270b85f3dcc193ff1a1390a7c7c7', '0x0000000000000000000000000000000000000000', '0xc8b0b37dffe3a711a076dc86dd617cc203f36121', '0x0000000000000000000000000000000000000000', '0x646df48947ff785fe609969ff634e7be9d1c34cd', '0x0000000000000000000000000000000000000000', '0x42582b404b0bec4a266631a0e178840b107a0c69', '0x0000000000000000000000000000000000000000', '0x36a94bc3edb1b629d1413091e22dc65fa050f17f', '0x0000000000000000000000000000000000000000', '0xb398d00b5a336f0ad33cfb352fd7646171cec442', '0x0000000000000000000000000000000000000000', '0xb4bc3b00de98e1c0498699379f6607b1f00bd5a1', '0x0000000000000000000000000000000000000000', '0xfe8b7baf68952bac2c04f386223d2013c1b4c601', '0x0000000000000000000000000000000000000000', '0x9c8764ec71f175c97c6c2fd558eb6546fcdbea32', '0x0000000000000000000000000000000000000000', '0x94d31188982c8eccf243e555b22dc57de1dba4e1', '0x0000000000000000000000000000000000000000', '0x407c5e2fadd7555be927c028bc358daa907c797a', '0x0000000000000000000000000000000000000000', '0x7e97da2dbbbdd7fb313cf9dc0581ac7cec999c70', '0x0000000000000000000000000000000000000000', '0x7f8d2662f64dd468c423805f98a6579ad59b28fa', '0x0000000000000000000000000000000000000000', '0x3398adf63fed17cbadd6080a1fb771e6a2a55958', '0x0000000000000000000000000000000000000000', '0xba8910a1d7ab62129729047d453091a1e6356170', '0x0000000000000000000000000000000000000000', '0xdc054bce222fe725da0f17abcef38253bd8bb745', '0x0000000000000000000000000000000000000000', '0xca21693467d0a5ea9e10a5a7c5044b9b3837e694', '0x0000000000000000000000000000000000000000', '0xe0b02de2139256dbae55cf350094b882fbe629ea', '0x0000000000000000000000000000000000000000', '0x02c38368a6f53858aab5a3a8d91d73eb59edf9b9', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xfe8c4778843c3cb047ffe7c0c0154a724c05cab9', '0x0000000000000000000000000000000000000000', '0xe2e88862d9b7379e21c82fc4aec8d71bddbcdb4b', '0x0000000000000000000000000000000000000000', '0xbbaff9e73b30f9cea5c01481f12de75050947fd6', '0x0000000000000000000000000000000000000000', '0xa20f6f381fe0fec5a1035d37ebf8890726377ab9', '0x0000000000000000000000000000000000000000', '0xbad68032d012bf35d3a2a177b242e86684027ed0', '0x0000000000000000000000000000000000000000', '0x0e61ca37f0c67e8a8794e45e264970a2a23a513c', '0x0000000000000000000000000000000000000000', '0xa77b7048e378c5270b15918449ededf87c3a3db3', '0x0000000000000000000000000000000000000000', '0x15afca1e6f02b556fa6551021b3493a1e4a7f44f'],
|
1615
|
-
}
|
1616
|
-
id = 5930043274845996
|
1617
|
-
await exchange.load_markets()
|
1618
|
-
request = None
|
1619
|
-
try:
|
1620
|
-
await exchange.create_order('BTC/USDC:USDC', 'limit', 'buy', 1, 20000)
|
1621
|
-
except Exception as e:
|
1622
|
-
request = json_parse(exchange.last_request_body)
|
1623
|
-
order = request['place_order']
|
1624
|
-
broker_id = order['id']
|
1625
|
-
assert broker_id == id, 'vertex - id: ' + str(id) + ' different from broker_id: ' + str(broker_id)
|
1626
|
-
if not is_sync():
|
1627
|
-
await close(exchange)
|
1628
|
-
return True
|
1629
|
-
|
1630
1607
|
async def test_paradex(self):
|
1631
1608
|
exchange = self.init_offline_exchange('paradex')
|
1632
1609
|
exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
|
ccxt/test/tests_sync.py
CHANGED
@@ -1185,7 +1185,7 @@ class testMainClass:
|
|
1185
1185
|
# -----------------------------------------------------------------------------
|
1186
1186
|
# --- Init of brokerId tests functions-----------------------------------------
|
1187
1187
|
# -----------------------------------------------------------------------------
|
1188
|
-
promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.
|
1188
|
+
promises = [self.test_binance(), self.test_okx(), self.test_cryptocom(), self.test_bybit(), self.test_kucoin(), self.test_kucoinfutures(), self.test_bitget(), self.test_mexc(), self.test_htx(), self.test_woo(), self.test_bitmart(), self.test_coinex(), self.test_bingx(), self.test_phemex(), self.test_blofin(), self.test_coinbaseinternational(), self.test_coinbase_advanced(), self.test_woofi_pro(), self.test_oxfun(), self.test_xt(), self.test_paradex(), self.test_hashkey(), self.test_coincatch(), self.test_defx(), self.test_cryptomus(), self.test_derive(), self.test_mode_trade()]
|
1189
1189
|
(promises)
|
1190
1190
|
success_message = '[' + self.lang + '][TEST_SUCCESS] brokerId tests passed.'
|
1191
1191
|
dump('[INFO]' + success_message)
|
@@ -1250,7 +1250,7 @@ class testMainClass:
|
|
1250
1250
|
|
1251
1251
|
def test_okx(self):
|
1252
1252
|
exchange = self.init_offline_exchange('okx')
|
1253
|
-
id = '
|
1253
|
+
id = '6b9ad766b55dBCDE'
|
1254
1254
|
spot_order_request = None
|
1255
1255
|
try:
|
1256
1256
|
exchange.create_order('BTC/USDT', 'limit', 'buy', 1, 20000)
|
@@ -1601,29 +1601,6 @@ class testMainClass:
|
|
1601
1601
|
close(exchange)
|
1602
1602
|
return True
|
1603
1603
|
|
1604
|
-
def test_vertex(self):
|
1605
|
-
exchange = self.init_offline_exchange('vertex')
|
1606
|
-
exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
|
1607
|
-
exchange.privateKey = 'c33b1eb4b53108bf52e10f636d8c1236c04c33a712357ba3543ab45f48a5cb0b'
|
1608
|
-
exchange.options['v1contracts'] = {
|
1609
|
-
'chain_id': '42161',
|
1610
|
-
'endpoint_addr': '0xbbee07b3e8121227afcfe1e2b82772246226128e',
|
1611
|
-
'book_addrs': ['0x0000000000000000000000000000000000000000', '0x70e5911371472e406f1291c621d1c8f207764d73', '0xf03f457a30e598d5020164a339727ef40f2b8fbc', '0x1c6281a78aa0ed88949c319cba5f0f0de2ce8353', '0xfe653438a1a4a7f56e727509c341d60a7b54fa91', '0xb6304e9a6ca241376a5fc9294daa8fca65ddcdcd', '0x01ec802ae0ab1b2cc4f028b9fe6eb954aef06ed1', '0x0000000000000000000000000000000000000000', '0x9c52d5c4df5a68955ad088a781b4ab364a861e9e', '0x0000000000000000000000000000000000000000', '0x2a3bcda1bb3ef649f3571c96c597c3d2b25edc79', '0x0000000000000000000000000000000000000000', '0x0492ff9807f82856781488015ef7aa5526c0edd6', '0x0000000000000000000000000000000000000000', '0xea884c82418ebc21cd080b8f40ecc4d06a6a6883', '0x0000000000000000000000000000000000000000', '0x5ecf68f983253a818ca8c17a56a4f2fb48d6ec6b', '0x0000000000000000000000000000000000000000', '0xba3f57a977f099905531f7c2f294aad7b56ed254', '0x0000000000000000000000000000000000000000', '0x0ac8c26d207d0c6aabb3644fea18f530c4d6fc8e', '0x0000000000000000000000000000000000000000', '0x8bd80ad7630b3864bed66cf28f548143ea43dc3b', '0x0000000000000000000000000000000000000000', '0x045391227fc4b2cdd27b95f066864225afc9314e', '0x0000000000000000000000000000000000000000', '0x7d512bef2e6cfd7e7f5f6b2f8027e3728eb7b6c3', '0x0000000000000000000000000000000000000000', '0x678a6c5003b56b5e9a81559e9a0df880407c796f', '0x0000000000000000000000000000000000000000', '0x14b5a17208fa98843cc602b3f74e31c95ded3567', '0xe442a89a07b3888ab10579fbb2824aeceff3a282', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xac28ac205275d7c2d6877bea8657cebe04fd9ae9', '0x0000000000000000000000000000000000000000', '0xed811409bfea901e75cb19ba347c08a154e860c9', '0x0000000000000000000000000000000000000000', '0x0f7afcb1612b305626cff84f84e4169ba2d0f12c', '0x0000000000000000000000000000000000000000', '0xe4b8d903db2ce2d3891ef04cfc3ac56330c1b0c3', '0x5f44362bad629846b7455ad9d36bbc3759a3ef62', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xa64e04ed4b223a71e524dc7ebb7f28e422ccfdde', '0x0000000000000000000000000000000000000000', '0x2ee573caab73c1d8cf0ca6bd3589b67de79628a4', '0x0000000000000000000000000000000000000000', '0x01bb96883a8a478d4410387d4aaf11067edc2c74', '0x0000000000000000000000000000000000000000', '0xe7ed0c559d905436a867cddf07e06921d572363c', '0x0000000000000000000000000000000000000000', '0xa94f9e3433c92a5cd1925494811a67b1943557d9', '0x0000000000000000000000000000000000000000', '0xa63de7f89ba1270b85f3dcc193ff1a1390a7c7c7', '0x0000000000000000000000000000000000000000', '0xc8b0b37dffe3a711a076dc86dd617cc203f36121', '0x0000000000000000000000000000000000000000', '0x646df48947ff785fe609969ff634e7be9d1c34cd', '0x0000000000000000000000000000000000000000', '0x42582b404b0bec4a266631a0e178840b107a0c69', '0x0000000000000000000000000000000000000000', '0x36a94bc3edb1b629d1413091e22dc65fa050f17f', '0x0000000000000000000000000000000000000000', '0xb398d00b5a336f0ad33cfb352fd7646171cec442', '0x0000000000000000000000000000000000000000', '0xb4bc3b00de98e1c0498699379f6607b1f00bd5a1', '0x0000000000000000000000000000000000000000', '0xfe8b7baf68952bac2c04f386223d2013c1b4c601', '0x0000000000000000000000000000000000000000', '0x9c8764ec71f175c97c6c2fd558eb6546fcdbea32', '0x0000000000000000000000000000000000000000', '0x94d31188982c8eccf243e555b22dc57de1dba4e1', '0x0000000000000000000000000000000000000000', '0x407c5e2fadd7555be927c028bc358daa907c797a', '0x0000000000000000000000000000000000000000', '0x7e97da2dbbbdd7fb313cf9dc0581ac7cec999c70', '0x0000000000000000000000000000000000000000', '0x7f8d2662f64dd468c423805f98a6579ad59b28fa', '0x0000000000000000000000000000000000000000', '0x3398adf63fed17cbadd6080a1fb771e6a2a55958', '0x0000000000000000000000000000000000000000', '0xba8910a1d7ab62129729047d453091a1e6356170', '0x0000000000000000000000000000000000000000', '0xdc054bce222fe725da0f17abcef38253bd8bb745', '0x0000000000000000000000000000000000000000', '0xca21693467d0a5ea9e10a5a7c5044b9b3837e694', '0x0000000000000000000000000000000000000000', '0xe0b02de2139256dbae55cf350094b882fbe629ea', '0x0000000000000000000000000000000000000000', '0x02c38368a6f53858aab5a3a8d91d73eb59edf9b9', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000', '0xfe8c4778843c3cb047ffe7c0c0154a724c05cab9', '0x0000000000000000000000000000000000000000', '0xe2e88862d9b7379e21c82fc4aec8d71bddbcdb4b', '0x0000000000000000000000000000000000000000', '0xbbaff9e73b30f9cea5c01481f12de75050947fd6', '0x0000000000000000000000000000000000000000', '0xa20f6f381fe0fec5a1035d37ebf8890726377ab9', '0x0000000000000000000000000000000000000000', '0xbad68032d012bf35d3a2a177b242e86684027ed0', '0x0000000000000000000000000000000000000000', '0x0e61ca37f0c67e8a8794e45e264970a2a23a513c', '0x0000000000000000000000000000000000000000', '0xa77b7048e378c5270b15918449ededf87c3a3db3', '0x0000000000000000000000000000000000000000', '0x15afca1e6f02b556fa6551021b3493a1e4a7f44f'],
|
1612
|
-
}
|
1613
|
-
id = 5930043274845996
|
1614
|
-
exchange.load_markets()
|
1615
|
-
request = None
|
1616
|
-
try:
|
1617
|
-
exchange.create_order('BTC/USDC:USDC', 'limit', 'buy', 1, 20000)
|
1618
|
-
except Exception as e:
|
1619
|
-
request = json_parse(exchange.last_request_body)
|
1620
|
-
order = request['place_order']
|
1621
|
-
broker_id = order['id']
|
1622
|
-
assert broker_id == id, 'vertex - id: ' + str(id) + ' different from broker_id: ' + str(broker_id)
|
1623
|
-
if not is_sync():
|
1624
|
-
close(exchange)
|
1625
|
-
return True
|
1626
|
-
|
1627
1604
|
def test_paradex(self):
|
1628
1605
|
exchange = self.init_offline_exchange('paradex')
|
1629
1606
|
exchange.walletAddress = '0xc751489d24a33172541ea451bc253d7a9e98c781'
|
ccxt/zonda.py
CHANGED
@@ -41,6 +41,9 @@ class zonda(Exchange, ImplicitAPI):
|
|
41
41
|
'future': False,
|
42
42
|
'option': False,
|
43
43
|
'addMargin': False,
|
44
|
+
'borrowCrossMargin': False,
|
45
|
+
'borrowIsolatedMargin': False,
|
46
|
+
'borrowMargin': False,
|
44
47
|
'cancelAllOrders': False,
|
45
48
|
'cancelOrder': True,
|
46
49
|
'cancelOrders': False,
|
@@ -49,6 +52,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
49
52
|
'createDepositAddress': False,
|
50
53
|
'createOrder': True,
|
51
54
|
'createReduceOnlyOrder': False,
|
55
|
+
'fetchAllGreeks': False,
|
52
56
|
'fetchBalance': True,
|
53
57
|
'fetchBorrowInterest': False,
|
54
58
|
'fetchBorrowRate': False,
|
@@ -79,12 +83,15 @@ class zonda(Exchange, ImplicitAPI):
|
|
79
83
|
'fetchLeverages': False,
|
80
84
|
'fetchLeverageTiers': False,
|
81
85
|
'fetchLiquidations': False,
|
86
|
+
'fetchLongShortRatio': False,
|
87
|
+
'fetchLongShortRatioHistory': False,
|
82
88
|
'fetchMarginAdjustmentHistory': False,
|
83
89
|
'fetchMarginMode': False,
|
84
90
|
'fetchMarginModes': False,
|
85
91
|
'fetchMarketLeverageTiers': False,
|
86
92
|
'fetchMarkets': True,
|
87
93
|
'fetchMarkOHLCV': False,
|
94
|
+
'fetchMarkPrice': False,
|
88
95
|
'fetchMarkPrices': False,
|
89
96
|
'fetchMyLiquidations': False,
|
90
97
|
'fetchMySettlementHistory': False,
|
@@ -92,6 +99,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
92
99
|
'fetchOHLCV': True,
|
93
100
|
'fetchOpenInterest': False,
|
94
101
|
'fetchOpenInterestHistory': False,
|
102
|
+
'fetchOpenInterests': False,
|
95
103
|
'fetchOpenOrder': False,
|
96
104
|
'fetchOpenOrders': True,
|
97
105
|
'fetchOption': False,
|
@@ -99,8 +107,11 @@ class zonda(Exchange, ImplicitAPI):
|
|
99
107
|
'fetchOrderBook': True,
|
100
108
|
'fetchOrderBooks': False,
|
101
109
|
'fetchPosition': False,
|
110
|
+
'fetchPositionHistory': False,
|
102
111
|
'fetchPositionMode': False,
|
103
112
|
'fetchPositions': False,
|
113
|
+
'fetchPositionsForSymbol': False,
|
114
|
+
'fetchPositionsHistory': False,
|
104
115
|
'fetchPositionsRisk': False,
|
105
116
|
'fetchPremiumIndexOHLCV': False,
|
106
117
|
'fetchSettlementHistory': False,
|
@@ -121,6 +132,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
121
132
|
'reduceMargin': False,
|
122
133
|
'repayCrossMargin': False,
|
123
134
|
'repayIsolatedMargin': False,
|
135
|
+
'repayMargin': False,
|
124
136
|
'setLeverage': False,
|
125
137
|
'setMargin': False,
|
126
138
|
'setMarginMode': False,
|