ccxt 4.3.56__py2.py3-none-any.whl → 4.3.58__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/kucoin.py +1 -0
- ccxt/abstract/kucoinfutures.py +1 -0
- ccxt/alpaca.py +5 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +5 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/client.py +26 -5
- ccxt/async_support/bigone.py +19 -1
- ccxt/async_support/bingx.py +114 -26
- ccxt/async_support/bitget.py +56 -47
- ccxt/async_support/coinmate.py +28 -32
- ccxt/async_support/coinone.py +15 -19
- ccxt/async_support/gate.py +102 -4
- ccxt/async_support/htx.py +87 -26
- ccxt/async_support/huobijp.py +61 -2
- ccxt/async_support/kucoin.py +3 -0
- ccxt/async_support/latoken.py +5 -1
- ccxt/async_support/okx.py +2 -0
- ccxt/async_support/woo.py +2 -1
- ccxt/base/exchange.py +1 -1
- ccxt/bigone.py +19 -1
- ccxt/bingx.py +114 -26
- ccxt/bitget.py +56 -47
- ccxt/coinmate.py +28 -32
- ccxt/coinone.py +15 -19
- ccxt/gate.py +102 -4
- ccxt/htx.py +87 -26
- ccxt/huobijp.py +61 -2
- ccxt/kucoin.py +3 -0
- ccxt/latoken.py +5 -1
- ccxt/okx.py +2 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/htx.py +1 -1
- ccxt/pro/okx.py +3 -3
- ccxt/woo.py +2 -1
- {ccxt-4.3.56.dist-info → ccxt-4.3.58.dist-info}/METADATA +4 -4
- {ccxt-4.3.56.dist-info → ccxt-4.3.58.dist-info}/RECORD +41 -41
- {ccxt-4.3.56.dist-info → ccxt-4.3.58.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.56.dist-info → ccxt-4.3.58.dist-info}/WHEEL +0 -0
- {ccxt-4.3.56.dist-info → ccxt-4.3.58.dist-info}/top_level.txt +0 -0
ccxt/gate.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.gate import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -99,6 +99,8 @@ class gate(Exchange, ImplicitAPI):
|
|
99
99
|
'borrowIsolatedMargin': True,
|
100
100
|
'cancelAllOrders': True,
|
101
101
|
'cancelOrder': True,
|
102
|
+
'cancelOrders': True,
|
103
|
+
'cancelOrdersForSymbols': True,
|
102
104
|
'createMarketBuyOrderWithCost': True,
|
103
105
|
'createMarketOrder': True,
|
104
106
|
'createMarketOrderWithCost': False,
|
@@ -3784,7 +3786,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3784
3786
|
if isMarketOrder:
|
3785
3787
|
request['price'] = price # set to 0 for market orders
|
3786
3788
|
else:
|
3787
|
-
request['price'] = self.price_to_precision(symbol, price)
|
3789
|
+
request['price'] = '0' if (price == 0) else self.price_to_precision(symbol, price)
|
3788
3790
|
if reduceOnly is not None:
|
3789
3791
|
request['reduce_only'] = reduceOnly
|
3790
3792
|
if timeInForce is not None:
|
@@ -3855,7 +3857,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3855
3857
|
'initial': {
|
3856
3858
|
'contract': market['id'],
|
3857
3859
|
'size': amount, # positive = buy, negative = sell, set to 0 to close the position
|
3858
|
-
'price': self.price_to_precision(symbol, price), # set to 0 to use market price
|
3860
|
+
# 'price': '0' if (price == 0) else self.price_to_precision(symbol, price), # set to 0 to use market price
|
3859
3861
|
# 'close': False, # set to True if trying to close the position
|
3860
3862
|
# 'tif': 'gtc', # gtc, ioc, if using market price, only ioc is supported
|
3861
3863
|
# 'text': clientOrderId, # web, api, app
|
@@ -3863,6 +3865,10 @@ class gate(Exchange, ImplicitAPI):
|
|
3863
3865
|
},
|
3864
3866
|
'settle': market['settleId'],
|
3865
3867
|
}
|
3868
|
+
if type == 'market':
|
3869
|
+
request['initial']['price'] = '0'
|
3870
|
+
else:
|
3871
|
+
request['initial']['price'] = '0' if (price == 0) else self.price_to_precision(symbol, price)
|
3866
3872
|
if trigger is None:
|
3867
3873
|
rule = None
|
3868
3874
|
triggerOrderPrice = None
|
@@ -4184,6 +4190,8 @@ class gate(Exchange, ImplicitAPI):
|
|
4184
4190
|
# "message": "Not enough balance"
|
4185
4191
|
# }
|
4186
4192
|
#
|
4193
|
+
# {"user_id":10406147,"id":"id","succeeded":false,"message":"INVALID_PROTOCOL","label":"INVALID_PROTOCOL"}
|
4194
|
+
#
|
4187
4195
|
succeeded = self.safe_bool(order, 'succeeded', True)
|
4188
4196
|
if not succeeded:
|
4189
4197
|
# cancelOrders response
|
@@ -4191,6 +4199,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4191
4199
|
'clientOrderId': self.safe_string(order, 'text'),
|
4192
4200
|
'info': order,
|
4193
4201
|
'status': 'rejected',
|
4202
|
+
'id': self.safe_string(order, 'id'),
|
4194
4203
|
})
|
4195
4204
|
put = self.safe_value_2(order, 'put', 'initial', {})
|
4196
4205
|
trigger = self.safe_value(order, 'trigger', {})
|
@@ -4726,6 +4735,81 @@ class gate(Exchange, ImplicitAPI):
|
|
4726
4735
|
#
|
4727
4736
|
return self.parse_order(response, market)
|
4728
4737
|
|
4738
|
+
def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
4739
|
+
"""
|
4740
|
+
cancel multiple orders
|
4741
|
+
:see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
4742
|
+
:see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
|
4743
|
+
:param str[] ids: order ids
|
4744
|
+
:param str symbol: unified symbol of the market the order was made in
|
4745
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4746
|
+
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4747
|
+
"""
|
4748
|
+
self.load_markets()
|
4749
|
+
market = None
|
4750
|
+
if symbol is not None:
|
4751
|
+
market = self.market(symbol)
|
4752
|
+
type = None
|
4753
|
+
defaultSettle = 'usdt' if (market is None) else market['settle']
|
4754
|
+
settle = self.safe_string_lower(params, 'settle', defaultSettle)
|
4755
|
+
type, params = self.handle_market_type_and_params('cancelOrders', market, params)
|
4756
|
+
isSpot = (type == 'spot')
|
4757
|
+
if isSpot and (symbol is None):
|
4758
|
+
raise ArgumentsRequired(self.id + ' cancelOrders requires a symbol argument for spot markets')
|
4759
|
+
if isSpot:
|
4760
|
+
ordersRequests = []
|
4761
|
+
for i in range(0, len(ids)):
|
4762
|
+
id = ids[i]
|
4763
|
+
orderItem: dict = {
|
4764
|
+
'id': id,
|
4765
|
+
'symbol': symbol,
|
4766
|
+
}
|
4767
|
+
ordersRequests.append(orderItem)
|
4768
|
+
return self.cancel_orders_for_symbols(ordersRequests, params)
|
4769
|
+
request = {
|
4770
|
+
'settle': settle,
|
4771
|
+
}
|
4772
|
+
finalList = [request] # hacky but needs to be done here
|
4773
|
+
for i in range(0, len(ids)):
|
4774
|
+
finalList.append(ids[i])
|
4775
|
+
response = self.privateFuturesPostSettleBatchCancelOrders(finalList)
|
4776
|
+
return self.parse_orders(response)
|
4777
|
+
|
4778
|
+
def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
|
4779
|
+
"""
|
4780
|
+
cancel multiple orders for multiple symbols
|
4781
|
+
:see: https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
4782
|
+
:param str[] ids: order ids
|
4783
|
+
:param str symbol: unified symbol of the market the order was made in
|
4784
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4785
|
+
:param str[] [params.clientOrderIds]: client order ids
|
4786
|
+
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4787
|
+
"""
|
4788
|
+
self.load_markets()
|
4789
|
+
ordersRequests = []
|
4790
|
+
for i in range(0, len(orders)):
|
4791
|
+
order = orders[i]
|
4792
|
+
symbol = self.safe_string(order, 'symbol')
|
4793
|
+
market = self.market(symbol)
|
4794
|
+
if not market['spot']:
|
4795
|
+
raise NotSupported(self.id + ' cancelOrdersForSymbols() supports only spot markets')
|
4796
|
+
id = self.safe_string(order, 'id')
|
4797
|
+
orderItem: dict = {
|
4798
|
+
'id': id,
|
4799
|
+
'currency_pair': market['id'],
|
4800
|
+
}
|
4801
|
+
ordersRequests.append(orderItem)
|
4802
|
+
response = self.privateSpotPostCancelBatchOrders(ordersRequests)
|
4803
|
+
#
|
4804
|
+
# [
|
4805
|
+
# {
|
4806
|
+
# "currency_pair": "BTC_USDT",
|
4807
|
+
# "id": "123456"
|
4808
|
+
# }
|
4809
|
+
# ]
|
4810
|
+
#
|
4811
|
+
return self.parse_orders(response)
|
4812
|
+
|
4729
4813
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
4730
4814
|
"""
|
4731
4815
|
cancel all open orders
|
@@ -5652,7 +5736,20 @@ class gate(Exchange, ImplicitAPI):
|
|
5652
5736
|
authentication = api[0] # public, private
|
5653
5737
|
type = api[1] # spot, margin, future, delivery
|
5654
5738
|
query = self.omit(params, self.extract_params(path))
|
5655
|
-
|
5739
|
+
containsSettle = path.find('settle') > -1
|
5740
|
+
if containsSettle and path.endswith('batch_cancel_orders'): # weird check to prevent $settle in php and converting {settle} to array(settle)
|
5741
|
+
# special case where we need to extract the settle from the path
|
5742
|
+
# but the body is an array of strings
|
5743
|
+
settle = self.safe_dict(params, 0)
|
5744
|
+
path = self.implode_params(path, settle)
|
5745
|
+
# remove the first element from params
|
5746
|
+
newParams = []
|
5747
|
+
anyParams = params
|
5748
|
+
for i in range(1, len(anyParams)):
|
5749
|
+
newParams.append(params[i])
|
5750
|
+
params = newParams
|
5751
|
+
query = newParams
|
5752
|
+
elif isinstance(params, list):
|
5656
5753
|
# endpoints like createOrders use an array instead of an object
|
5657
5754
|
# so we infer the settle from one of the elements
|
5658
5755
|
# they have to be all the same so relying on the first one is fine
|
@@ -7011,6 +7108,7 @@ class gate(Exchange, ImplicitAPI):
|
|
7011
7108
|
# {"label": "INVALID_PARAM_VALUE", "message": "invalid argument: Trigger.rule"}
|
7012
7109
|
# {"label": "INVALID_PARAM_VALUE", "message": "invalid argument: trigger.expiration invalid range"}
|
7013
7110
|
# {"label": "INVALID_ARGUMENT", "detail": "invalid size"}
|
7111
|
+
# {"user_id":10406147,"id":"id","succeeded":false,"message":"INVALID_PROTOCOL","label":"INVALID_PROTOCOL"}
|
7014
7112
|
#
|
7015
7113
|
label = self.safe_string(response, 'label')
|
7016
7114
|
if label is not None:
|
ccxt/htx.py
CHANGED
@@ -3053,6 +3053,7 @@ class htx(Exchange, ImplicitAPI):
|
|
3053
3053
|
instStatus = self.safe_string(entry, 'instStatus')
|
3054
3054
|
currencyActive = instStatus == 'normal'
|
3055
3055
|
minPrecision = None
|
3056
|
+
minDeposit = None
|
3056
3057
|
minWithdraw = None
|
3057
3058
|
maxWithdraw = None
|
3058
3059
|
deposit = False
|
@@ -3064,6 +3065,7 @@ class htx(Exchange, ImplicitAPI):
|
|
3064
3065
|
self.options['networkChainIdsByNames'][code][title] = uniqueChainId
|
3065
3066
|
self.options['networkNamesByChainIds'][uniqueChainId] = title
|
3066
3067
|
networkCode = self.network_id_to_code(uniqueChainId)
|
3068
|
+
minDeposit = self.safe_number(chainEntry, 'minDepositAmt')
|
3067
3069
|
minWithdraw = self.safe_number(chainEntry, 'minWithdrawAmt')
|
3068
3070
|
maxWithdraw = self.safe_number(chainEntry, 'maxWithdrawAmt')
|
3069
3071
|
withdrawStatus = self.safe_string(chainEntry, 'withdrawStatus')
|
@@ -3083,7 +3085,7 @@ class htx(Exchange, ImplicitAPI):
|
|
3083
3085
|
'network': networkCode,
|
3084
3086
|
'limits': {
|
3085
3087
|
'deposit': {
|
3086
|
-
'min':
|
3088
|
+
'min': minDeposit,
|
3087
3089
|
'max': None,
|
3088
3090
|
},
|
3089
3091
|
'withdraw': {
|
@@ -5521,7 +5523,62 @@ class htx(Exchange, ImplicitAPI):
|
|
5521
5523
|
# "ts": 1604367997451
|
5522
5524
|
# }
|
5523
5525
|
#
|
5524
|
-
|
5526
|
+
data = self.safe_dict(response, 'data')
|
5527
|
+
return self.parse_cancel_orders(data)
|
5528
|
+
|
5529
|
+
def parse_cancel_orders(self, orders):
|
5530
|
+
#
|
5531
|
+
# {
|
5532
|
+
# "success": [
|
5533
|
+
# "5983466"
|
5534
|
+
# ],
|
5535
|
+
# "failed": [
|
5536
|
+
# {
|
5537
|
+
# "err-msg": "Incorrect order state",
|
5538
|
+
# "order-state": 7,
|
5539
|
+
# "order-id": "",
|
5540
|
+
# "err-code": "order-orderstate-error",
|
5541
|
+
# "client-order-id": "first"
|
5542
|
+
# },
|
5543
|
+
# ...
|
5544
|
+
# ]
|
5545
|
+
# }
|
5546
|
+
#
|
5547
|
+
# {
|
5548
|
+
# "errors": [
|
5549
|
+
# {
|
5550
|
+
# "order_id": "769206471845261312",
|
5551
|
+
# "err_code": 1061,
|
5552
|
+
# "err_msg": "This order doesnt exist."
|
5553
|
+
# }
|
5554
|
+
# ],
|
5555
|
+
# "successes": "1258075374411399168,1258075393254871040"
|
5556
|
+
# }
|
5557
|
+
#
|
5558
|
+
successes = self.safe_string(orders, 'successes')
|
5559
|
+
success = None
|
5560
|
+
if successes is not None:
|
5561
|
+
success = successes.split(',')
|
5562
|
+
else:
|
5563
|
+
success = self.safe_list(orders, 'success', [])
|
5564
|
+
failed = self.safe_list_2(orders, 'errors', 'failed', [])
|
5565
|
+
result = []
|
5566
|
+
for i in range(0, len(success)):
|
5567
|
+
order = success[i]
|
5568
|
+
result.append(self.safe_order({
|
5569
|
+
'info': order,
|
5570
|
+
'id': order,
|
5571
|
+
'status': 'canceled',
|
5572
|
+
}))
|
5573
|
+
for i in range(0, len(failed)):
|
5574
|
+
order = failed[i]
|
5575
|
+
result.append(self.safe_order({
|
5576
|
+
'info': order,
|
5577
|
+
'id': self.safe_string_2(order, 'order-id', 'order_id'),
|
5578
|
+
'status': 'failed',
|
5579
|
+
'clientOrderId': self.safe_string(order, 'client-order-id'),
|
5580
|
+
}))
|
5581
|
+
return result
|
5525
5582
|
|
5526
5583
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
5527
5584
|
"""
|
@@ -5558,6 +5615,22 @@ class htx(Exchange, ImplicitAPI):
|
|
5558
5615
|
if symbol is not None:
|
5559
5616
|
request['symbol'] = market['id']
|
5560
5617
|
response = self.spotPrivatePostV1OrderOrdersBatchCancelOpenOrders(self.extend(request, params))
|
5618
|
+
#
|
5619
|
+
# {
|
5620
|
+
# "code": 200,
|
5621
|
+
# "data": {
|
5622
|
+
# "success-count": 2,
|
5623
|
+
# "failed-count": 0,
|
5624
|
+
# "next-id": 5454600
|
5625
|
+
# }
|
5626
|
+
# }
|
5627
|
+
#
|
5628
|
+
data = self.safe_dict(response, 'data')
|
5629
|
+
return [
|
5630
|
+
self.safe_order({
|
5631
|
+
'info': data,
|
5632
|
+
}),
|
5633
|
+
]
|
5561
5634
|
else:
|
5562
5635
|
if symbol is None:
|
5563
5636
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
@@ -5611,30 +5684,18 @@ class htx(Exchange, ImplicitAPI):
|
|
5611
5684
|
response = self.contractPrivatePostApiV1ContractCancelall(self.extend(request, params))
|
5612
5685
|
else:
|
5613
5686
|
raise NotSupported(self.id + ' cancelAllOrders() does not support ' + marketType + ' markets')
|
5614
|
-
|
5615
|
-
|
5616
|
-
|
5617
|
-
|
5618
|
-
|
5619
|
-
|
5620
|
-
|
5621
|
-
|
5622
|
-
|
5623
|
-
|
5624
|
-
|
5625
|
-
|
5626
|
-
# future and swap
|
5627
|
-
#
|
5628
|
-
# {
|
5629
|
-
# "status": "ok",
|
5630
|
-
# "data": {
|
5631
|
-
# "errors": [],
|
5632
|
-
# "successes": "1104754904426696704"
|
5633
|
-
# },
|
5634
|
-
# "ts": "1683435723755"
|
5635
|
-
# }
|
5636
|
-
#
|
5637
|
-
return response
|
5687
|
+
#
|
5688
|
+
# {
|
5689
|
+
# "status": "ok",
|
5690
|
+
# "data": {
|
5691
|
+
# "errors": [],
|
5692
|
+
# "successes": "1104754904426696704"
|
5693
|
+
# },
|
5694
|
+
# "ts": "1683435723755"
|
5695
|
+
# }
|
5696
|
+
#
|
5697
|
+
data = self.safe_dict(response, 'data')
|
5698
|
+
return self.parse_cancel_orders(data)
|
5638
5699
|
|
5639
5700
|
def cancel_all_orders_after(self, timeout: Int, params={}):
|
5640
5701
|
"""
|
ccxt/huobijp.py
CHANGED
@@ -1468,7 +1468,61 @@ class huobijp(Exchange, ImplicitAPI):
|
|
1468
1468
|
# }
|
1469
1469
|
# }
|
1470
1470
|
#
|
1471
|
-
return response
|
1471
|
+
return self.parse_cancel_orders(response)
|
1472
|
+
|
1473
|
+
def parse_cancel_orders(self, orders):
|
1474
|
+
#
|
1475
|
+
# {
|
1476
|
+
# "success": [
|
1477
|
+
# "5983466"
|
1478
|
+
# ],
|
1479
|
+
# "failed": [
|
1480
|
+
# {
|
1481
|
+
# "err-msg": "Incorrect order state",
|
1482
|
+
# "order-state": 7,
|
1483
|
+
# "order-id": "",
|
1484
|
+
# "err-code": "order-orderstate-error",
|
1485
|
+
# "client-order-id": "first"
|
1486
|
+
# },
|
1487
|
+
# ...
|
1488
|
+
# ]
|
1489
|
+
# }
|
1490
|
+
#
|
1491
|
+
# {
|
1492
|
+
# "errors": [
|
1493
|
+
# {
|
1494
|
+
# "order_id": "769206471845261312",
|
1495
|
+
# "err_code": 1061,
|
1496
|
+
# "err_msg": "This order doesnt exist."
|
1497
|
+
# }
|
1498
|
+
# ],
|
1499
|
+
# "successes": "1258075374411399168,1258075393254871040"
|
1500
|
+
# }
|
1501
|
+
#
|
1502
|
+
successes = self.safe_string(orders, 'successes')
|
1503
|
+
success = None
|
1504
|
+
if successes is not None:
|
1505
|
+
success = successes.split(',')
|
1506
|
+
else:
|
1507
|
+
success = self.safe_list(orders, 'success', [])
|
1508
|
+
failed = self.safe_list_2(orders, 'errors', 'failed', [])
|
1509
|
+
result = []
|
1510
|
+
for i in range(0, len(success)):
|
1511
|
+
order = success[i]
|
1512
|
+
result.append(self.safe_order({
|
1513
|
+
'info': order,
|
1514
|
+
'id': order,
|
1515
|
+
'status': 'canceled',
|
1516
|
+
}))
|
1517
|
+
for i in range(0, len(failed)):
|
1518
|
+
order = failed[i]
|
1519
|
+
result.append(self.safe_order({
|
1520
|
+
'info': order,
|
1521
|
+
'id': self.safe_string_2(order, 'order-id', 'order_id'),
|
1522
|
+
'status': 'failed',
|
1523
|
+
'clientOrderId': self.safe_string(order, 'client-order-id'),
|
1524
|
+
}))
|
1525
|
+
return result
|
1472
1526
|
|
1473
1527
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1474
1528
|
"""
|
@@ -1500,7 +1554,12 @@ class huobijp(Exchange, ImplicitAPI):
|
|
1500
1554
|
# }
|
1501
1555
|
# }
|
1502
1556
|
#
|
1503
|
-
|
1557
|
+
data = self.safe_dict(response, 'data', {})
|
1558
|
+
return [
|
1559
|
+
self.safe_order({
|
1560
|
+
'info': data,
|
1561
|
+
}),
|
1562
|
+
]
|
1504
1563
|
|
1505
1564
|
def currency_to_precision(self, code, fee, networkCode=None):
|
1506
1565
|
return self.decimal_to_precision(fee, 0, self.currencies[code]['precision'], self.precisionMode)
|
ccxt/kucoin.py
CHANGED
@@ -259,6 +259,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
259
259
|
'purchase/orders': 10, # 10SW
|
260
260
|
# broker
|
261
261
|
'broker/api/rebase/download': 3,
|
262
|
+
# affiliate
|
263
|
+
'affiliate/inviter/statistics': 30,
|
262
264
|
},
|
263
265
|
'post': {
|
264
266
|
# account
|
@@ -700,6 +702,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
700
702
|
'redeem/orders': 'v3',
|
701
703
|
'purchase/orders': 'v3',
|
702
704
|
'margin/symbols': 'v3',
|
705
|
+
'affiliate/inviter/statistics': 'v2',
|
703
706
|
},
|
704
707
|
'POST': {
|
705
708
|
# account
|
ccxt/latoken.py
CHANGED
@@ -1344,7 +1344,11 @@ class latoken(Exchange, ImplicitAPI):
|
|
1344
1344
|
# "status":"SUCCESS"
|
1345
1345
|
# }
|
1346
1346
|
#
|
1347
|
-
return
|
1347
|
+
return [
|
1348
|
+
self.safe_order({
|
1349
|
+
'info': response,
|
1350
|
+
}),
|
1351
|
+
]
|
1348
1352
|
|
1349
1353
|
def fetch_transactions(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1350
1354
|
"""
|
ccxt/okx.py
CHANGED
@@ -6858,6 +6858,8 @@ class okx(Exchange, ImplicitAPI):
|
|
6858
6858
|
depositWithdrawFees[code] = self.deposit_withdraw_fee({})
|
6859
6859
|
depositWithdrawFees[code]['info'][currencyId] = feeInfo
|
6860
6860
|
chain = self.safe_string(feeInfo, 'chain')
|
6861
|
+
if chain is None:
|
6862
|
+
continue
|
6861
6863
|
chainSplit = chain.split('-')
|
6862
6864
|
networkId = self.safe_value(chainSplit, 1)
|
6863
6865
|
withdrawFee = self.safe_number(feeInfo, 'minFee')
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/htx.py
CHANGED
@@ -124,7 +124,7 @@ class htx(ccxt.async_support.htx):
|
|
124
124
|
'2002': AuthenticationError, # {action: 'sub', code: 2002, ch: 'accounts.update#2', message: 'invalid.auth.state'}
|
125
125
|
'2021': BadRequest,
|
126
126
|
'2001': BadSymbol, # {action: 'sub', code: 2001, ch: 'orders#2ltcusdt', message: 'invalid.symbol'}
|
127
|
-
'2011': BadSymbol, # {op: 'sub', cid: '1649149285', topic: 'orders_cross.
|
127
|
+
'2011': BadSymbol, # {op: 'sub', cid: '1649149285', topic: 'orders_cross.ltc-usdt', 'err-code': 2011, 'err-msg': "Contract doesn't exist.", ts: 1649149287637}
|
128
128
|
'2040': BadRequest, # {op: 'sub', cid: '1649152947', 'err-code': 2040, 'err-msg': 'Missing required parameter.', ts: 1649152948684}
|
129
129
|
'4007': BadRequest, # {op: 'sub', cid: '1', topic: 'accounts_unify.USDT', 'err-code': 4007, 'err-msg': 'Non - single account user is not available, please check through the cross and isolated account asset interface', ts: 1698419318540}
|
130
130
|
},
|
ccxt/pro/okx.py
CHANGED
@@ -1571,7 +1571,7 @@ class okx(ccxt.async_support.okx):
|
|
1571
1571
|
if self.is_empty(args):
|
1572
1572
|
method = self.safe_string(message, 'op')
|
1573
1573
|
stringMsg = self.json(message)
|
1574
|
-
self.handle_errors(None, None, client.url, method, None, stringMsg,
|
1574
|
+
self.handle_errors(None, None, client.url, method, None, stringMsg, message, None, None)
|
1575
1575
|
orders = self.parse_orders(args, None, None, None)
|
1576
1576
|
first = self.safe_dict(orders, 0, {})
|
1577
1577
|
client.resolve(first, messageHash)
|
@@ -1729,8 +1729,8 @@ class okx(ccxt.async_support.okx):
|
|
1729
1729
|
future.resolve(True)
|
1730
1730
|
|
1731
1731
|
def ping(self, client):
|
1732
|
-
#
|
1733
|
-
#
|
1732
|
+
# OKX does not support the built-in WebSocket protocol-level ping-pong.
|
1733
|
+
# Instead, it requires a custom text-based ping-pong mechanism.
|
1734
1734
|
return 'ping'
|
1735
1735
|
|
1736
1736
|
def handle_pong(self, client: Client, message):
|
ccxt/woo.py
CHANGED
@@ -15,6 +15,7 @@ from ccxt.base.errors import ArgumentsRequired
|
|
15
15
|
from ccxt.base.errors import BadRequest
|
16
16
|
from ccxt.base.errors import InvalidOrder
|
17
17
|
from ccxt.base.errors import NotSupported
|
18
|
+
from ccxt.base.errors import OperationFailed
|
18
19
|
from ccxt.base.errors import RateLimitExceeded
|
19
20
|
from ccxt.base.errors import OnMaintenance
|
20
21
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
@@ -316,7 +317,7 @@ class woo(Exchange, ImplicitAPI):
|
|
316
317
|
'commonCurrencies': {},
|
317
318
|
'exceptions': {
|
318
319
|
'exact': {
|
319
|
-
'-1000':
|
320
|
+
'-1000': OperationFailed, # {"code": -1000, "message": "An unknown error occurred while processing the request"} or {"success":false,"code":"-1000","message":"An internal error has occurred. We are unable to process your request. Please try again later."}
|
320
321
|
'-1001': AuthenticationError, # {"code": -1001, "message": "The api key or secret is in wrong format"}
|
321
322
|
'-1002': AuthenticationError, # {"code": -1002, "message": "API key or secret is invalid, it may because key have insufficient permission or the key is expired/revoked."}
|
322
323
|
'-1003': RateLimitExceeded, # {"code": -1003, "message": "Rate limit exceed."}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.3.
|
3
|
+
Version: 4.3.58
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
|
5
5
|
Home-page: https://ccxt.com
|
6
6
|
Author: Igor Kroitor
|
@@ -268,13 +268,13 @@ console.log(version, Object.keys(exchanges));
|
|
268
268
|
|
269
269
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
270
270
|
|
271
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
272
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
271
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.58/dist/ccxt.browser.min.js
|
272
|
+
* unpkg: https://unpkg.com/ccxt@4.3.58/dist/ccxt.browser.min.js
|
273
273
|
|
274
274
|
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.
|
275
275
|
|
276
276
|
```HTML
|
277
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
277
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.58/dist/ccxt.browser.min.js"></script>
|
278
278
|
```
|
279
279
|
|
280
280
|
Creates a global `ccxt` object:
|