ccxt 4.4.42__py2.py3-none-any.whl → 4.4.44__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 +3 -1
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bingx.py +4 -0
- ccxt/abstract/bitstamp.py +1 -0
- ccxt/abstract/myokx.py +340 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +57 -45
- ccxt/async_support/bingx.py +30 -7
- ccxt/async_support/bitfinex.py +6 -2
- ccxt/async_support/bitget.py +3 -1
- ccxt/async_support/bitmart.py +4 -7
- ccxt/async_support/bitmex.py +3 -5
- ccxt/async_support/bitstamp.py +59 -0
- ccxt/async_support/bybit.py +8 -23
- ccxt/async_support/coinbase.py +13 -9
- ccxt/async_support/coinbaseinternational.py +13 -9
- ccxt/async_support/coincatch.py +2 -2
- ccxt/async_support/coinex.py +5 -5
- ccxt/async_support/cryptocom.py +4 -2
- ccxt/async_support/defx.py +2 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/gate.py +9 -4
- ccxt/async_support/gemini.py +65 -2
- ccxt/async_support/hashkey.py +9 -9
- ccxt/async_support/htx.py +101 -3
- ccxt/async_support/hyperliquid.py +6 -1
- ccxt/async_support/kraken.py +9 -2
- ccxt/async_support/krakenfutures.py +5 -0
- ccxt/async_support/kucoin.py +9 -7
- ccxt/async_support/kucoinfutures.py +5 -5
- ccxt/async_support/mexc.py +18 -12
- ccxt/async_support/myokx.py +35 -0
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okx.py +5 -6
- ccxt/async_support/phemex.py +6 -4
- ccxt/async_support/vertex.py +63 -4
- ccxt/async_support/whitebit.py +4 -2
- ccxt/async_support/woo.py +8 -6
- ccxt/async_support/woofipro.py +5 -2
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +57 -45
- ccxt/bingx.py +30 -7
- ccxt/bitfinex.py +6 -2
- ccxt/bitget.py +3 -1
- ccxt/bitmart.py +4 -7
- ccxt/bitmex.py +3 -5
- ccxt/bitstamp.py +59 -0
- ccxt/bybit.py +8 -23
- ccxt/coinbase.py +13 -9
- ccxt/coinbaseinternational.py +13 -9
- ccxt/coincatch.py +2 -2
- ccxt/coinex.py +5 -5
- ccxt/cryptocom.py +4 -2
- ccxt/defx.py +2 -2
- ccxt/delta.py +1 -1
- ccxt/gate.py +9 -4
- ccxt/gemini.py +65 -2
- ccxt/hashkey.py +9 -9
- ccxt/htx.py +101 -3
- ccxt/hyperliquid.py +6 -1
- ccxt/kraken.py +9 -2
- ccxt/krakenfutures.py +5 -0
- ccxt/kucoin.py +9 -7
- ccxt/kucoinfutures.py +5 -5
- ccxt/mexc.py +18 -12
- ccxt/myokx.py +35 -0
- ccxt/ndax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okx.py +5 -6
- ccxt/phemex.py +6 -4
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bitcoincom.py +4 -1
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/myokx.py +23 -0
- ccxt/vertex.py +63 -4
- ccxt/whitebit.py +4 -2
- ccxt/woo.py +8 -6
- ccxt/woofipro.py +5 -2
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/METADATA +36 -34
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/RECORD +88 -87
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3625
- ccxt/async_support/hitbtc3.py +0 -16
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/WHEEL +0 -0
- {ccxt-4.4.42.dist-info → ccxt-4.4.44.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
4
|
+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
5
|
+
|
6
|
+
from ccxt.async_support.okx import okx
|
7
|
+
from ccxt.abstract.myokx import ImplicitAPI
|
8
|
+
|
9
|
+
|
10
|
+
class myokx(okx, ImplicitAPI):
|
11
|
+
|
12
|
+
def describe(self):
|
13
|
+
return self.deep_extend(super(myokx, self).describe(), {
|
14
|
+
'id': 'myokx',
|
15
|
+
'name': 'MyOKX(EEA)',
|
16
|
+
'certified': False,
|
17
|
+
'pro': True,
|
18
|
+
'hostname': 'eea.okx.com',
|
19
|
+
'urls': {
|
20
|
+
'logo': 'https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg',
|
21
|
+
'api': {
|
22
|
+
'rest': 'https://{hostname}',
|
23
|
+
},
|
24
|
+
'www': 'https://my.okx.com',
|
25
|
+
'doc': 'https://my.okx.com/docs-v5/en/#overview',
|
26
|
+
'fees': 'https://my.okx.com/pages/products/fees.html',
|
27
|
+
'referral': {
|
28
|
+
'url': 'https://www.my.okx.com/join/CCXT2023',
|
29
|
+
'discount': 0.2,
|
30
|
+
},
|
31
|
+
'test': {
|
32
|
+
'rest': 'https://{hostname}',
|
33
|
+
},
|
34
|
+
},
|
35
|
+
})
|
ccxt/async_support/ndax.py
CHANGED
ccxt/async_support/oceanex.py
CHANGED
ccxt/async_support/okx.py
CHANGED
@@ -1207,7 +1207,6 @@ class okx(Exchange, ImplicitAPI):
|
|
1207
1207
|
'brokerId': 'e847386590ce4dBC',
|
1208
1208
|
},
|
1209
1209
|
'features': {
|
1210
|
-
# https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
|
1211
1210
|
'default': {
|
1212
1211
|
'sandbox': True,
|
1213
1212
|
'createOrder': {
|
@@ -1236,12 +1235,12 @@ class okx(Exchange, ImplicitAPI):
|
|
1236
1235
|
'GTD': False,
|
1237
1236
|
},
|
1238
1237
|
'hedged': True,
|
1239
|
-
# even though the below params not unified yet, it's useful metadata for users to know that exchange supports them
|
1240
|
-
'selfTradePrevention': True,
|
1241
1238
|
'trailing': True,
|
1242
|
-
'
|
1243
|
-
'
|
1244
|
-
'
|
1239
|
+
'iceberg': True, # todo implement
|
1240
|
+
'leverage': False,
|
1241
|
+
'selfTradePrevention': True, # todo implement
|
1242
|
+
'marketBuyByCost': True,
|
1243
|
+
'marketBuyRequiresPrice': False,
|
1245
1244
|
},
|
1246
1245
|
'createOrders': {
|
1247
1246
|
'max': 20,
|
ccxt/async_support/phemex.py
CHANGED
@@ -3462,13 +3462,15 @@ class phemex(Exchange, ImplicitAPI):
|
|
3462
3462
|
|
3463
3463
|
:param str[] [symbols]: list of unified market symbols
|
3464
3464
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3465
|
+
:param str [params.code]: the currency code to fetch positions for, USD, BTC or USDT, USD is the default
|
3465
3466
|
:param str [params.method]: *USDT contracts only* 'privateGetGAccountsAccountPositions' or 'privateGetAccountsPositions' default is 'privateGetGAccountsAccountPositions'
|
3466
3467
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
3467
3468
|
"""
|
3468
3469
|
await self.load_markets()
|
3469
3470
|
symbols = self.market_symbols(symbols)
|
3470
3471
|
subType = None
|
3471
|
-
code = self.
|
3472
|
+
code = self.safe_string_2(params, 'currency', 'code', 'USD')
|
3473
|
+
params = self.omit(params, ['currency', 'code'])
|
3472
3474
|
settle = None
|
3473
3475
|
market = None
|
3474
3476
|
firstSymbol = self.safe_string(symbols, 0)
|
@@ -3477,15 +3479,15 @@ class phemex(Exchange, ImplicitAPI):
|
|
3477
3479
|
settle = market['settle']
|
3478
3480
|
code = market['settle']
|
3479
3481
|
else:
|
3480
|
-
settle, params = self.handle_option_and_params(params, 'fetchPositions', 'settle',
|
3482
|
+
settle, params = self.handle_option_and_params(params, 'fetchPositions', 'settle', code)
|
3481
3483
|
subType, params = self.handle_sub_type_and_params('fetchPositions', market, params)
|
3482
3484
|
isUSDTSettled = settle == 'USDT'
|
3483
3485
|
if isUSDTSettled:
|
3484
3486
|
code = 'USDT'
|
3487
|
+
elif settle == 'BTC':
|
3488
|
+
code = 'BTC'
|
3485
3489
|
elif code is None:
|
3486
3490
|
code = 'USD' if (subType == 'linear') else 'BTC'
|
3487
|
-
else:
|
3488
|
-
params = self.omit(params, 'code')
|
3489
3491
|
currency = self.currency(code)
|
3490
3492
|
request: dict = {
|
3491
3493
|
'currency': currency['id'],
|
ccxt/async_support/vertex.py
CHANGED
@@ -93,6 +93,7 @@ class vertex(Exchange, ImplicitAPI):
|
|
93
93
|
'fetchOHLCV': True,
|
94
94
|
'fetchOpenInterest': True,
|
95
95
|
'fetchOpenInterestHistory': False,
|
96
|
+
'fetchOpenInterests': True,
|
96
97
|
'fetchOpenOrders': True,
|
97
98
|
'fetchOrder': True,
|
98
99
|
'fetchOrderBook': True,
|
@@ -1329,16 +1330,74 @@ class vertex(Exchange, ImplicitAPI):
|
|
1329
1330
|
# }
|
1330
1331
|
# }
|
1331
1332
|
#
|
1332
|
-
|
1333
|
+
marketId = self.safe_string(interest, 'ticker_id')
|
1333
1334
|
return self.safe_open_interest({
|
1334
|
-
'symbol': market
|
1335
|
-
'openInterestAmount':
|
1336
|
-
'openInterestValue':
|
1335
|
+
'symbol': self.safe_symbol(marketId, market),
|
1336
|
+
'openInterestAmount': self.safe_number(interest, 'open_interest'),
|
1337
|
+
'openInterestValue': self.safe_number(interest, 'open_interest_usd'),
|
1337
1338
|
'timestamp': None,
|
1338
1339
|
'datetime': None,
|
1339
1340
|
'info': interest,
|
1340
1341
|
}, market)
|
1341
1342
|
|
1343
|
+
async def fetch_open_interests(self, symbols: Strings = None, params={}):
|
1344
|
+
"""
|
1345
|
+
Retrieves the open interest for a list of symbols
|
1346
|
+
|
1347
|
+
https://docs.vertexprotocol.com/developer-resources/api/v2/contracts
|
1348
|
+
|
1349
|
+
:param str[] [symbols]: a list of unified CCXT market symbols
|
1350
|
+
:param dict [params]: exchange specific parameters
|
1351
|
+
:returns dict[]: a list of `open interest structures <https://docs.ccxt.com/#/?id=open-interest-structure>`
|
1352
|
+
"""
|
1353
|
+
await self.load_markets()
|
1354
|
+
symbols = self.market_symbols(symbols)
|
1355
|
+
response = await self.v2ArchiveGetContracts(params)
|
1356
|
+
#
|
1357
|
+
# {
|
1358
|
+
# "ADA-PERP_USDC": {
|
1359
|
+
# "ticker_id": "ADA-PERP_USDC",
|
1360
|
+
# "base_currency": "ADA-PERP",
|
1361
|
+
# "quote_currency": "USDC",
|
1362
|
+
# "last_price": 0.85506,
|
1363
|
+
# "base_volume": 1241320.0,
|
1364
|
+
# "quote_volume": 1122670.9080057142,
|
1365
|
+
# "product_type": "perpetual",
|
1366
|
+
# "contract_price": 0.8558601432685385,
|
1367
|
+
# "contract_price_currency": "USD",
|
1368
|
+
# "open_interest": 104040.0,
|
1369
|
+
# "open_interest_usd": 89043.68930565874,
|
1370
|
+
# "index_price": 0.8561952606869176,
|
1371
|
+
# "mark_price": 0.856293781088936,
|
1372
|
+
# "funding_rate": 0.000116153806226841,
|
1373
|
+
# "next_funding_rate_timestamp": 1734685200,
|
1374
|
+
# "price_change_percent_24h": -12.274325340321374
|
1375
|
+
# },
|
1376
|
+
# }
|
1377
|
+
#
|
1378
|
+
parsedSymbols = []
|
1379
|
+
results = []
|
1380
|
+
markets = list(response.keys())
|
1381
|
+
if symbols is None:
|
1382
|
+
symbols = []
|
1383
|
+
for y in range(0, len(markets)):
|
1384
|
+
tickerId = markets[y]
|
1385
|
+
parsedTickerId = tickerId.split('-')
|
1386
|
+
currentSymbol = parsedTickerId[0] + '/USDC:USDC'
|
1387
|
+
if not self.in_array(currentSymbol, symbols):
|
1388
|
+
symbols.append(currentSymbol)
|
1389
|
+
for i in range(0, len(markets)):
|
1390
|
+
marketId = markets[i]
|
1391
|
+
marketInner = self.safe_market(marketId)
|
1392
|
+
openInterest = self.safe_dict(response, marketId, {})
|
1393
|
+
for j in range(0, len(symbols)):
|
1394
|
+
market = self.market(symbols[j])
|
1395
|
+
tickerId = market['base'] + '_USDC'
|
1396
|
+
if marketInner['marketId'] == tickerId:
|
1397
|
+
parsedSymbols.append(market['symbol'])
|
1398
|
+
results.append(self.parse_open_interest(openInterest, market))
|
1399
|
+
return self.filter_by_array(results, 'symbol', parsedSymbols)
|
1400
|
+
|
1342
1401
|
async def fetch_open_interest(self, symbol: str, params={}):
|
1343
1402
|
"""
|
1344
1403
|
Retrieves the open interest of a derivative trading pair
|
ccxt/async_support/whitebit.py
CHANGED
@@ -1217,9 +1217,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1217
1217
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1218
1218
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1219
1219
|
"""
|
1220
|
-
|
1220
|
+
req = {
|
1221
|
+
'cost': cost,
|
1222
|
+
}
|
1221
1223
|
# only buy side is supported
|
1222
|
-
return await self.create_order(symbol, 'market', side, 0, None, params)
|
1224
|
+
return await self.create_order(symbol, 'market', side, 0, None, self.extend(req, params))
|
1223
1225
|
|
1224
1226
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
1225
1227
|
"""
|
ccxt/async_support/woo.py
CHANGED
@@ -344,9 +344,11 @@ class woo(Exchange, ImplicitAPI):
|
|
344
344
|
},
|
345
345
|
'hedged': False,
|
346
346
|
'trailing': True,
|
347
|
-
|
348
|
-
|
349
|
-
|
347
|
+
'leverage': False,
|
348
|
+
'marketBuyByCost': True,
|
349
|
+
'marketBuyRequiresPrice': False,
|
350
|
+
'selfTradePrevention': False,
|
351
|
+
'iceberg': True, # todo implement
|
350
352
|
},
|
351
353
|
'createOrders': None,
|
352
354
|
'fetchMyTrades': {
|
@@ -1051,7 +1053,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1051
1053
|
marginMode, params = self.handle_margin_mode_and_params('createOrder', params)
|
1052
1054
|
if marginMode is not None:
|
1053
1055
|
request['margin_mode'] = self.encode_margin_mode(marginMode)
|
1054
|
-
triggerPrice = self.
|
1056
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
1055
1057
|
stopLoss = self.safe_value(params, 'stopLoss')
|
1056
1058
|
takeProfit = self.safe_value(params, 'takeProfit')
|
1057
1059
|
algoType = self.safe_string(params, 'algoType')
|
@@ -1128,7 +1130,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1128
1130
|
}
|
1129
1131
|
closeSide = 'SELL' if (orderSide == 'BUY') else 'BUY'
|
1130
1132
|
if stopLoss is not None:
|
1131
|
-
stopLossPrice = self.
|
1133
|
+
stopLossPrice = self.safe_string(stopLoss, 'triggerPrice', stopLoss)
|
1132
1134
|
stopLossOrder: dict = {
|
1133
1135
|
'side': closeSide,
|
1134
1136
|
'algoType': 'STOP_LOSS',
|
@@ -1138,7 +1140,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1138
1140
|
}
|
1139
1141
|
outterOrder['childOrders'].append(stopLossOrder)
|
1140
1142
|
if takeProfit is not None:
|
1141
|
-
takeProfitPrice = self.
|
1143
|
+
takeProfitPrice = self.safe_string(takeProfit, 'triggerPrice', takeProfit)
|
1142
1144
|
takeProfitOrder: dict = {
|
1143
1145
|
'side': closeSide,
|
1144
1146
|
'algoType': 'TAKE_PROFIT',
|
ccxt/async_support/woofipro.py
CHANGED
@@ -327,8 +327,11 @@ class woofipro(Exchange, ImplicitAPI):
|
|
327
327
|
},
|
328
328
|
'hedged': False,
|
329
329
|
'trailing': True,
|
330
|
-
#
|
331
|
-
|
330
|
+
'leverage': True, # todo implement
|
331
|
+
'marketBuyByCost': False,
|
332
|
+
'marketBuyRequiresPrice': False,
|
333
|
+
'selfTradePrevention': False,
|
334
|
+
'iceberg': True, # todo implement
|
332
335
|
},
|
333
336
|
'createOrders': {
|
334
337
|
'max': 10,
|