ccxt 4.2.98__py2.py3-none-any.whl → 4.2.100__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/ascendex.py +2 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +2 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/coinbase.py +47 -20
- ccxt/async_support/kraken.py +5 -4
- ccxt/async_support/kucoin.py +6 -6
- ccxt/base/exchange.py +1 -1
- ccxt/coinbase.py +47 -20
- ccxt/kraken.py +5 -4
- ccxt/kucoin.py +6 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/coinbase.py +21 -3
- {ccxt-4.2.98.dist-info → ccxt-4.2.100.dist-info}/METADATA +4 -4
- {ccxt-4.2.98.dist-info → ccxt-4.2.100.dist-info}/RECORD +18 -18
- {ccxt-4.2.98.dist-info → ccxt-4.2.100.dist-info}/WHEEL +0 -0
- {ccxt-4.2.98.dist-info → ccxt-4.2.100.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/ascendex.py
CHANGED
@@ -11,6 +11,7 @@ from typing import List
|
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
14
|
+
from ccxt.base.errors import AccountSuspended
|
14
15
|
from ccxt.base.errors import ArgumentsRequired
|
15
16
|
from ccxt.base.errors import BadRequest
|
16
17
|
from ccxt.base.errors import BadSymbol
|
@@ -368,7 +369,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
368
369
|
'300013': InvalidOrder, # INVALID_BATCH_ORDER Some or all orders are invalid in batch order request
|
369
370
|
'300014': InvalidOrder, # {"code":300014,"message":"Order price doesn't conform to the required tick size: 0.1","reason":"TICK_SIZE_VIOLATION"}
|
370
371
|
'300020': InvalidOrder, # TRADING_RESTRICTED There is some trading restriction on account or asset
|
371
|
-
'300021':
|
372
|
+
'300021': AccountSuspended, # {"code":300021,"message":"Trading disabled for self account.","reason":"TRADING_DISABLED"}
|
372
373
|
'300031': InvalidOrder, # NO_MARKET_PRICE No market price for market type order trading
|
373
374
|
'310001': InsufficientFunds, # INVALID_MARGIN_BALANCE No enough margin balance
|
374
375
|
'310002': InvalidOrder, # INVALID_MARGIN_ACCOUNT Not a valid account for margin trading
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/ascendex.py
CHANGED
@@ -11,6 +11,7 @@ from typing import List
|
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
14
|
+
from ccxt.base.errors import AccountSuspended
|
14
15
|
from ccxt.base.errors import ArgumentsRequired
|
15
16
|
from ccxt.base.errors import BadRequest
|
16
17
|
from ccxt.base.errors import BadSymbol
|
@@ -368,7 +369,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
368
369
|
'300013': InvalidOrder, # INVALID_BATCH_ORDER Some or all orders are invalid in batch order request
|
369
370
|
'300014': InvalidOrder, # {"code":300014,"message":"Order price doesn't conform to the required tick size: 0.1","reason":"TICK_SIZE_VIOLATION"}
|
370
371
|
'300020': InvalidOrder, # TRADING_RESTRICTED There is some trading restriction on account or asset
|
371
|
-
'300021':
|
372
|
+
'300021': AccountSuspended, # {"code":300021,"message":"Trading disabled for self account.","reason":"TRADING_DISABLED"}
|
372
373
|
'300031': InvalidOrder, # NO_MARKET_PRICE No market price for market type order trading
|
373
374
|
'310001': InsufficientFunds, # INVALID_MARGIN_BALANCE No enough margin balance
|
374
375
|
'310002': InvalidOrder, # INVALID_MARGIN_ACCOUNT Not a valid account for margin trading
|
ccxt/async_support/coinbase.py
CHANGED
@@ -1416,6 +1416,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1416
1416
|
contractExpiryType = self.safe_string(futureProductDetails, 'contract_expiry_type')
|
1417
1417
|
contractSize = self.safe_number(futureProductDetails, 'contract_size')
|
1418
1418
|
contractExpire = self.safe_string(futureProductDetails, 'contract_expiry')
|
1419
|
+
expireTimestamp = self.parse8601(contractExpire)
|
1419
1420
|
isSwap = (contractExpiryType == 'PERPETUAL')
|
1420
1421
|
baseId = self.safe_string(futureProductDetails, 'contract_root_unit')
|
1421
1422
|
quoteId = self.safe_string(market, 'quote_currency_id')
|
@@ -1429,7 +1430,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1429
1430
|
symbol = symbol + ':' + quote
|
1430
1431
|
else:
|
1431
1432
|
type = 'future'
|
1432
|
-
symbol = symbol + ':' + quote + '-' + self.yymmdd(
|
1433
|
+
symbol = symbol + ':' + quote + '-' + self.yymmdd(expireTimestamp)
|
1433
1434
|
takerFeeRate = self.safe_number(feeTier, 'taker_fee_rate')
|
1434
1435
|
makerFeeRate = self.safe_number(feeTier, 'maker_fee_rate')
|
1435
1436
|
taker = takerFeeRate if takerFeeRate else self.parse_number('0.06')
|
@@ -1456,7 +1457,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1456
1457
|
'taker': taker,
|
1457
1458
|
'maker': maker,
|
1458
1459
|
'contractSize': contractSize,
|
1459
|
-
'expiry':
|
1460
|
+
'expiry': expireTimestamp,
|
1460
1461
|
'expiryDatetime': contractExpire,
|
1461
1462
|
'strike': None,
|
1462
1463
|
'optionType': None,
|
@@ -4048,6 +4049,30 @@ class coinbase(Exchange, ImplicitAPI):
|
|
4048
4049
|
'takeProfitPrice': None,
|
4049
4050
|
})
|
4050
4051
|
|
4052
|
+
def create_auth_token(self, seconds: Int, method: Str = None, url: Str = None):
|
4053
|
+
# it may not work for v2
|
4054
|
+
uri = None
|
4055
|
+
if url is not None:
|
4056
|
+
uri = method + ' ' + url.replace('https://', '')
|
4057
|
+
quesPos = uri.find('?')
|
4058
|
+
# Due to we use mb_strpos, quesPos could be False in php. In that case, the quesPos >= 0 is True
|
4059
|
+
# Also it's not possible that the question mark is first character, only check > 0 here.
|
4060
|
+
if quesPos > 0:
|
4061
|
+
uri = uri[0:quesPos]
|
4062
|
+
nonce = self.random_bytes(16)
|
4063
|
+
request = {
|
4064
|
+
'aud': ['retail_rest_api_proxy'],
|
4065
|
+
'iss': 'coinbase-cloud',
|
4066
|
+
'nbf': seconds,
|
4067
|
+
'exp': seconds + 120,
|
4068
|
+
'sub': self.apiKey,
|
4069
|
+
'iat': seconds,
|
4070
|
+
}
|
4071
|
+
if uri is not None:
|
4072
|
+
request['uri'] = uri
|
4073
|
+
token = self.jwt(request, self.encode(self.secret), 'sha256', False, {'kid': self.apiKey, 'nonce': nonce, 'alg': 'ES256'})
|
4074
|
+
return token
|
4075
|
+
|
4051
4076
|
def sign(self, path, api=[], method='GET', params={}, headers=None, body=None):
|
4052
4077
|
version = api[0]
|
4053
4078
|
signed = api[1] == 'private'
|
@@ -4087,24 +4112,26 @@ class coinbase(Exchange, ImplicitAPI):
|
|
4087
4112
|
if isCloudAPiKey:
|
4088
4113
|
if self.apiKey.startswith('-----BEGIN'):
|
4089
4114
|
raise ArgumentsRequired(self.id + ' apiKey should contain the name(eg: organizations/3b910e93....) and not the public key')
|
4090
|
-
# it may not work for v2
|
4091
|
-
uri = method + ' ' + url.replace('https://', '')
|
4092
|
-
quesPos = uri.find('?')
|
4093
|
-
# Due to we use mb_strpos, quesPos could be False in php. In that case, the quesPos >= 0 is True
|
4094
|
-
# Also it's not possible that the question mark is first character, only check > 0 here.
|
4095
|
-
if quesPos > 0:
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4099
|
-
|
4100
|
-
|
4101
|
-
|
4102
|
-
|
4103
|
-
|
4104
|
-
|
4105
|
-
|
4106
|
-
|
4107
|
-
|
4115
|
+
# # it may not work for v2
|
4116
|
+
# uri = method + ' ' + url.replace('https://', '')
|
4117
|
+
# quesPos = uri.find('?')
|
4118
|
+
# # Due to we use mb_strpos, quesPos could be False in php. In that case, the quesPos >= 0 is True
|
4119
|
+
# # Also it's not possible that the question mark is first character, only check > 0 here.
|
4120
|
+
# if quesPos > 0:
|
4121
|
+
# uri = uri[0:quesPos]
|
4122
|
+
# }
|
4123
|
+
# nonce = self.random_bytes(16)
|
4124
|
+
# request = {
|
4125
|
+
# 'aud': ['retail_rest_api_proxy'],
|
4126
|
+
# 'iss': 'coinbase-cloud',
|
4127
|
+
# 'nbf': seconds,
|
4128
|
+
# 'exp': seconds + 120,
|
4129
|
+
# 'sub': self.apiKey,
|
4130
|
+
# 'uri': uri,
|
4131
|
+
# 'iat': seconds,
|
4132
|
+
# }
|
4133
|
+
token = self.create_auth_token(seconds, method, url)
|
4134
|
+
# token = self.jwt(request, self.encode(self.secret), 'sha256', False, {'kid': self.apiKey, 'nonce': nonce, 'alg': 'ES256'})
|
4108
4135
|
authorizationString = 'Bearer ' + token
|
4109
4136
|
else:
|
4110
4137
|
timestampString = str(self.seconds())
|
ccxt/async_support/kraken.py
CHANGED
@@ -1501,9 +1501,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1501
1501
|
# }
|
1502
1502
|
#
|
1503
1503
|
description = self.safe_dict(order, 'descr', {})
|
1504
|
+
orderDescriptionObj = self.safe_dict(order, 'descr') # can be null
|
1504
1505
|
orderDescription = None
|
1505
|
-
if
|
1506
|
-
orderDescription = self.safe_string(
|
1506
|
+
if orderDescriptionObj is not None:
|
1507
|
+
orderDescription = self.safe_string(orderDescriptionObj, 'order')
|
1507
1508
|
else:
|
1508
1509
|
orderDescription = self.safe_string(order, 'descr')
|
1509
1510
|
side = None
|
@@ -1564,8 +1565,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
1564
1565
|
fee['currency'] = market['base']
|
1565
1566
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
1566
1567
|
id = self.safe_string_2(order, 'id', 'txid')
|
1567
|
-
if (id is None) or (id
|
1568
|
-
txid = self.
|
1568
|
+
if (id is None) or (id.startswith('[')):
|
1569
|
+
txid = self.safe_list(order, 'txid')
|
1569
1570
|
id = self.safe_string(txid, 0)
|
1570
1571
|
clientOrderId = self.safe_string(order, 'userref')
|
1571
1572
|
rawTrades = self.safe_value(order, 'trades', [])
|
ccxt/async_support/kucoin.py
CHANGED
@@ -1207,10 +1207,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1207
1207
|
# }
|
1208
1208
|
#
|
1209
1209
|
responses = await asyncio.gather(*promises)
|
1210
|
-
currenciesResponse = self.
|
1211
|
-
currenciesData = self.
|
1212
|
-
additionalResponse = self.
|
1213
|
-
additionalData = self.
|
1210
|
+
currenciesResponse = self.safe_dict(responses, 0, {})
|
1211
|
+
currenciesData = self.safe_list(currenciesResponse, 'data', [])
|
1212
|
+
additionalResponse = self.safe_dict(responses, 1, {})
|
1213
|
+
additionalData = self.safe_list(additionalResponse, 'data', [])
|
1214
1214
|
additionalDataGrouped = self.group_by(additionalData, 'currency')
|
1215
1215
|
result = {}
|
1216
1216
|
for i in range(0, len(currenciesData)):
|
@@ -1222,7 +1222,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1222
1222
|
isDepositEnabled = None
|
1223
1223
|
networks = {}
|
1224
1224
|
chains = self.safe_list(entry, 'chains', [])
|
1225
|
-
extraChainsData = self.index_by(self.
|
1225
|
+
extraChainsData = self.index_by(self.safe_list(additionalDataGrouped, id, []), 'chain')
|
1226
1226
|
rawPrecision = self.safe_string(entry, 'precision')
|
1227
1227
|
precision = self.parse_number(self.parse_precision(rawPrecision))
|
1228
1228
|
chainsLength = len(chains)
|
@@ -1350,7 +1350,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1350
1350
|
if networkCode is not None:
|
1351
1351
|
request['chain'] = self.network_code_to_id(networkCode).lower()
|
1352
1352
|
response = await self.privateGetWithdrawalsQuotas(self.extend(request, params))
|
1353
|
-
data = self.
|
1353
|
+
data = self.safe_dict(response, 'data', {})
|
1354
1354
|
withdrawFees = {}
|
1355
1355
|
withdrawFees[code] = self.safe_number(data, 'withdrawMinFee')
|
1356
1356
|
return {
|
ccxt/base/exchange.py
CHANGED
ccxt/coinbase.py
CHANGED
@@ -1415,6 +1415,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1415
1415
|
contractExpiryType = self.safe_string(futureProductDetails, 'contract_expiry_type')
|
1416
1416
|
contractSize = self.safe_number(futureProductDetails, 'contract_size')
|
1417
1417
|
contractExpire = self.safe_string(futureProductDetails, 'contract_expiry')
|
1418
|
+
expireTimestamp = self.parse8601(contractExpire)
|
1418
1419
|
isSwap = (contractExpiryType == 'PERPETUAL')
|
1419
1420
|
baseId = self.safe_string(futureProductDetails, 'contract_root_unit')
|
1420
1421
|
quoteId = self.safe_string(market, 'quote_currency_id')
|
@@ -1428,7 +1429,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1428
1429
|
symbol = symbol + ':' + quote
|
1429
1430
|
else:
|
1430
1431
|
type = 'future'
|
1431
|
-
symbol = symbol + ':' + quote + '-' + self.yymmdd(
|
1432
|
+
symbol = symbol + ':' + quote + '-' + self.yymmdd(expireTimestamp)
|
1432
1433
|
takerFeeRate = self.safe_number(feeTier, 'taker_fee_rate')
|
1433
1434
|
makerFeeRate = self.safe_number(feeTier, 'maker_fee_rate')
|
1434
1435
|
taker = takerFeeRate if takerFeeRate else self.parse_number('0.06')
|
@@ -1455,7 +1456,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
1455
1456
|
'taker': taker,
|
1456
1457
|
'maker': maker,
|
1457
1458
|
'contractSize': contractSize,
|
1458
|
-
'expiry':
|
1459
|
+
'expiry': expireTimestamp,
|
1459
1460
|
'expiryDatetime': contractExpire,
|
1460
1461
|
'strike': None,
|
1461
1462
|
'optionType': None,
|
@@ -4047,6 +4048,30 @@ class coinbase(Exchange, ImplicitAPI):
|
|
4047
4048
|
'takeProfitPrice': None,
|
4048
4049
|
})
|
4049
4050
|
|
4051
|
+
def create_auth_token(self, seconds: Int, method: Str = None, url: Str = None):
|
4052
|
+
# it may not work for v2
|
4053
|
+
uri = None
|
4054
|
+
if url is not None:
|
4055
|
+
uri = method + ' ' + url.replace('https://', '')
|
4056
|
+
quesPos = uri.find('?')
|
4057
|
+
# Due to we use mb_strpos, quesPos could be False in php. In that case, the quesPos >= 0 is True
|
4058
|
+
# Also it's not possible that the question mark is first character, only check > 0 here.
|
4059
|
+
if quesPos > 0:
|
4060
|
+
uri = uri[0:quesPos]
|
4061
|
+
nonce = self.random_bytes(16)
|
4062
|
+
request = {
|
4063
|
+
'aud': ['retail_rest_api_proxy'],
|
4064
|
+
'iss': 'coinbase-cloud',
|
4065
|
+
'nbf': seconds,
|
4066
|
+
'exp': seconds + 120,
|
4067
|
+
'sub': self.apiKey,
|
4068
|
+
'iat': seconds,
|
4069
|
+
}
|
4070
|
+
if uri is not None:
|
4071
|
+
request['uri'] = uri
|
4072
|
+
token = self.jwt(request, self.encode(self.secret), 'sha256', False, {'kid': self.apiKey, 'nonce': nonce, 'alg': 'ES256'})
|
4073
|
+
return token
|
4074
|
+
|
4050
4075
|
def sign(self, path, api=[], method='GET', params={}, headers=None, body=None):
|
4051
4076
|
version = api[0]
|
4052
4077
|
signed = api[1] == 'private'
|
@@ -4086,24 +4111,26 @@ class coinbase(Exchange, ImplicitAPI):
|
|
4086
4111
|
if isCloudAPiKey:
|
4087
4112
|
if self.apiKey.startswith('-----BEGIN'):
|
4088
4113
|
raise ArgumentsRequired(self.id + ' apiKey should contain the name(eg: organizations/3b910e93....) and not the public key')
|
4089
|
-
# it may not work for v2
|
4090
|
-
uri = method + ' ' + url.replace('https://', '')
|
4091
|
-
quesPos = uri.find('?')
|
4092
|
-
# Due to we use mb_strpos, quesPos could be False in php. In that case, the quesPos >= 0 is True
|
4093
|
-
# Also it's not possible that the question mark is first character, only check > 0 here.
|
4094
|
-
if quesPos > 0:
|
4095
|
-
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4099
|
-
|
4100
|
-
|
4101
|
-
|
4102
|
-
|
4103
|
-
|
4104
|
-
|
4105
|
-
|
4106
|
-
|
4114
|
+
# # it may not work for v2
|
4115
|
+
# uri = method + ' ' + url.replace('https://', '')
|
4116
|
+
# quesPos = uri.find('?')
|
4117
|
+
# # Due to we use mb_strpos, quesPos could be False in php. In that case, the quesPos >= 0 is True
|
4118
|
+
# # Also it's not possible that the question mark is first character, only check > 0 here.
|
4119
|
+
# if quesPos > 0:
|
4120
|
+
# uri = uri[0:quesPos]
|
4121
|
+
# }
|
4122
|
+
# nonce = self.random_bytes(16)
|
4123
|
+
# request = {
|
4124
|
+
# 'aud': ['retail_rest_api_proxy'],
|
4125
|
+
# 'iss': 'coinbase-cloud',
|
4126
|
+
# 'nbf': seconds,
|
4127
|
+
# 'exp': seconds + 120,
|
4128
|
+
# 'sub': self.apiKey,
|
4129
|
+
# 'uri': uri,
|
4130
|
+
# 'iat': seconds,
|
4131
|
+
# }
|
4132
|
+
token = self.create_auth_token(seconds, method, url)
|
4133
|
+
# token = self.jwt(request, self.encode(self.secret), 'sha256', False, {'kid': self.apiKey, 'nonce': nonce, 'alg': 'ES256'})
|
4107
4134
|
authorizationString = 'Bearer ' + token
|
4108
4135
|
else:
|
4109
4136
|
timestampString = str(self.seconds())
|
ccxt/kraken.py
CHANGED
@@ -1501,9 +1501,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1501
1501
|
# }
|
1502
1502
|
#
|
1503
1503
|
description = self.safe_dict(order, 'descr', {})
|
1504
|
+
orderDescriptionObj = self.safe_dict(order, 'descr') # can be null
|
1504
1505
|
orderDescription = None
|
1505
|
-
if
|
1506
|
-
orderDescription = self.safe_string(
|
1506
|
+
if orderDescriptionObj is not None:
|
1507
|
+
orderDescription = self.safe_string(orderDescriptionObj, 'order')
|
1507
1508
|
else:
|
1508
1509
|
orderDescription = self.safe_string(order, 'descr')
|
1509
1510
|
side = None
|
@@ -1564,8 +1565,8 @@ class kraken(Exchange, ImplicitAPI):
|
|
1564
1565
|
fee['currency'] = market['base']
|
1565
1566
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
1566
1567
|
id = self.safe_string_2(order, 'id', 'txid')
|
1567
|
-
if (id is None) or (id
|
1568
|
-
txid = self.
|
1568
|
+
if (id is None) or (id.startswith('[')):
|
1569
|
+
txid = self.safe_list(order, 'txid')
|
1569
1570
|
id = self.safe_string(txid, 0)
|
1570
1571
|
clientOrderId = self.safe_string(order, 'userref')
|
1571
1572
|
rawTrades = self.safe_value(order, 'trades', [])
|
ccxt/kucoin.py
CHANGED
@@ -1206,10 +1206,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1206
1206
|
# }
|
1207
1207
|
#
|
1208
1208
|
responses = promises
|
1209
|
-
currenciesResponse = self.
|
1210
|
-
currenciesData = self.
|
1211
|
-
additionalResponse = self.
|
1212
|
-
additionalData = self.
|
1209
|
+
currenciesResponse = self.safe_dict(responses, 0, {})
|
1210
|
+
currenciesData = self.safe_list(currenciesResponse, 'data', [])
|
1211
|
+
additionalResponse = self.safe_dict(responses, 1, {})
|
1212
|
+
additionalData = self.safe_list(additionalResponse, 'data', [])
|
1213
1213
|
additionalDataGrouped = self.group_by(additionalData, 'currency')
|
1214
1214
|
result = {}
|
1215
1215
|
for i in range(0, len(currenciesData)):
|
@@ -1221,7 +1221,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1221
1221
|
isDepositEnabled = None
|
1222
1222
|
networks = {}
|
1223
1223
|
chains = self.safe_list(entry, 'chains', [])
|
1224
|
-
extraChainsData = self.index_by(self.
|
1224
|
+
extraChainsData = self.index_by(self.safe_list(additionalDataGrouped, id, []), 'chain')
|
1225
1225
|
rawPrecision = self.safe_string(entry, 'precision')
|
1226
1226
|
precision = self.parse_number(self.parse_precision(rawPrecision))
|
1227
1227
|
chainsLength = len(chains)
|
@@ -1349,7 +1349,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1349
1349
|
if networkCode is not None:
|
1350
1350
|
request['chain'] = self.network_code_to_id(networkCode).lower()
|
1351
1351
|
response = self.privateGetWithdrawalsQuotas(self.extend(request, params))
|
1352
|
-
data = self.
|
1352
|
+
data = self.safe_dict(response, 'data', {})
|
1353
1353
|
withdrawFees = {}
|
1354
1354
|
withdrawFees[code] = self.safe_number(data, 'withdrawMinFee')
|
1355
1355
|
return {
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/coinbase.py
CHANGED
@@ -9,6 +9,7 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import ArgumentsRequired
|
12
13
|
|
13
14
|
|
14
15
|
class coinbase(ccxt.async_support.coinbase):
|
@@ -77,15 +78,32 @@ class coinbase(ccxt.async_support.coinbase):
|
|
77
78
|
productIds = [market['id']]
|
78
79
|
url = self.urls['api']['ws']
|
79
80
|
timestamp = self.number_to_string(self.seconds())
|
81
|
+
isCloudAPiKey = (self.apiKey.find('organizations/') >= 0) or (self.secret.startswith('-----BEGIN'))
|
80
82
|
auth = timestamp + name + ','.join(productIds)
|
81
83
|
subscribe = {
|
82
84
|
'type': 'subscribe',
|
83
85
|
'product_ids': productIds,
|
84
86
|
'channel': name,
|
85
|
-
'api_key': self.apiKey,
|
86
|
-
'timestamp': timestamp,
|
87
|
-
'signature': self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256),
|
87
|
+
# 'api_key': self.apiKey,
|
88
|
+
# 'timestamp': timestamp,
|
89
|
+
# 'signature': self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256),
|
88
90
|
}
|
91
|
+
if not isCloudAPiKey:
|
92
|
+
subscribe['api_key'] = self.apiKey
|
93
|
+
subscribe['timestamp'] = timestamp
|
94
|
+
subscribe['signature'] = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
|
95
|
+
else:
|
96
|
+
if self.apiKey.startswith('-----BEGIN'):
|
97
|
+
raise ArgumentsRequired(self.id + ' apiKey should contain the name(eg: organizations/3b910e93....) and not the public key')
|
98
|
+
currentToken = self.safe_string(self.options, 'wsToken')
|
99
|
+
tokenTimestamp = self.safe_integer(self.options, 'wsTokenTimestamp', 0)
|
100
|
+
seconds = self.seconds()
|
101
|
+
if currentToken is None or tokenTimestamp + 120 < seconds:
|
102
|
+
# we should generate new token
|
103
|
+
token = self.create_auth_token(seconds)
|
104
|
+
self.options['wsToken'] = token
|
105
|
+
self.options['wsTokenTimestamp'] = seconds
|
106
|
+
subscribe['jwt'] = self.safe_string(self.options, 'wsToken')
|
89
107
|
return await self.watch(url, messageHash, subscribe, messageHash)
|
90
108
|
|
91
109
|
async def watch_ticker(self, symbol: str, params={}) -> Ticker:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.2.
|
3
|
+
Version: 4.2.100
|
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
|
@@ -261,13 +261,13 @@ console.log(version, Object.keys(exchanges));
|
|
261
261
|
|
262
262
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
263
263
|
|
264
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.
|
265
|
-
* unpkg: https://unpkg.com/ccxt@4.2.
|
264
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.2.100/dist/ccxt.browser.js
|
265
|
+
* unpkg: https://unpkg.com/ccxt@4.2.100/dist/ccxt.browser.js
|
266
266
|
|
267
267
|
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.
|
268
268
|
|
269
269
|
```HTML
|
270
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.
|
270
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.2.100/dist/ccxt.browser.js"></script>
|
271
271
|
```
|
272
272
|
|
273
273
|
Creates a global `ccxt` object:
|
@@ -1,7 +1,7 @@
|
|
1
|
-
ccxt/__init__.py,sha256=
|
1
|
+
ccxt/__init__.py,sha256=BQp-m1xoMgS5-jWWrCbk8CN6MCRQt0VoqHDbN_kIYH8,15657
|
2
2
|
ccxt/ace.py,sha256=yGGKYViya2zCyr1DjWhEu9mknkDAEVsobHmrvJxHfX0,41420
|
3
3
|
ccxt/alpaca.py,sha256=6P2wAEGJQOjjoKQbzv1KvSuZvEZmOX987a1NqB7z9mk,46908
|
4
|
-
ccxt/ascendex.py,sha256=
|
4
|
+
ccxt/ascendex.py,sha256=T5dbI_93gq24rPswAnm1rrncTMatz7XdcRQMYVbT8WQ,151384
|
5
5
|
ccxt/bequant.py,sha256=RBiAmaTbL35DgiV3Hl6uchLUd78V0z1T9riTlNsrpdc,1174
|
6
6
|
ccxt/bigone.py,sha256=rgg8BdMqBPa0jJjDh9xP7Y7Y6lMKAIJXzmE-g6EEm4I,92185
|
7
7
|
ccxt/binance.py,sha256=9asBcH4nAt_DKfg1IViC7TXFbaARjAJSwAdxfOz127w,596976
|
@@ -37,7 +37,7 @@ ccxt/btcmarkets.py,sha256=XOoDrXKNLvqMbNTUmTNMkQzsyy7oOh_Dw1USiJ8WjEs,51328
|
|
37
37
|
ccxt/btcturk.py,sha256=p-_zpUEu0aIK5kR4PXQKnAqr9P0ajFsaszyFylUOHeE,36506
|
38
38
|
ccxt/bybit.py,sha256=PgvPYqeTrs9z-qzhjlr6Tqy7heLOQDc1ENH_5FSlcbU,401635
|
39
39
|
ccxt/cex.py,sha256=CfQ_1t-Em16bYl-5DmzqJzC8rxrdk9CCxq7Q0ON7vOM,69653
|
40
|
-
ccxt/coinbase.py,sha256=
|
40
|
+
ccxt/coinbase.py,sha256=6c4fSP4KlR9zsQAxKronfMYtL2ahC4z6LWHiwGSkWnc,202878
|
41
41
|
ccxt/coinbaseinternational.py,sha256=RnTdgTmkia2wpMBW2pZR_yvUzWIC-7hfXFun8v6pW0k,87123
|
42
42
|
ccxt/coinbasepro.py,sha256=JdHrR6nr9sBmxsPfiql_pRGM5y8mP4NRUV1viSCeKwU,78377
|
43
43
|
ccxt/coincheck.py,sha256=16rD9tUt0Ww8pjSTDD1CQ28wusKil0FnFRiUvzj9FwQ,35513
|
@@ -69,9 +69,9 @@ ccxt/hyperliquid.py,sha256=DWU4nZGKPxZmwhPMBsXWqIJAG6b_M2ly44sa2OelhSc,92412
|
|
69
69
|
ccxt/idex.py,sha256=CUitIG8A6wXceGhyJyb42SdJ7lIIK3UWHzeyrBg9v9Y,72809
|
70
70
|
ccxt/independentreserve.py,sha256=nRprUlIbJ2ipFavUim5Ad46oYSEz8cpqFL1gg1hN-Mg,32024
|
71
71
|
ccxt/indodax.py,sha256=0Uv6cHkrvmLHOV5YaMMfs3Le5qwbNtAmLP2eZl_m8wo,51779
|
72
|
-
ccxt/kraken.py,sha256=
|
72
|
+
ccxt/kraken.py,sha256=hrbxDpIH8_oJGG4gTe2HEb3zp-vUP9jXg8I-I1h0fKg,124030
|
73
73
|
ccxt/krakenfutures.py,sha256=2QLNQ5Jw1vc2VELeVOtGNY029lKRAovFoV2iBzb_rCw,115673
|
74
|
-
ccxt/kucoin.py,sha256=
|
74
|
+
ccxt/kucoin.py,sha256=kAhBzQpsEhH_AixxPmhGdz6bVlq2HBff4h7H07zEK44,214703
|
75
75
|
ccxt/kucoinfutures.py,sha256=Mkzn3sg13r-qW_gEgt8RsrW4MezlZtX96DXJerCVw6k,118519
|
76
76
|
ccxt/kuna.py,sha256=vBWvg6-OPQvpEWwfCiZ8qkKaoTjiQ728l-Y5ThlcuVc,95980
|
77
77
|
ccxt/latoken.py,sha256=gVAVH_Yp68SzObhjtYXpMBn8g__tHAnHYL-4skplYgA,78780
|
@@ -207,10 +207,10 @@ ccxt/abstract/woo.py,sha256=E-QXVJKVI4EOW72NX6wv99px9EyitWtd9KWvXUc9Tyo,10216
|
|
207
207
|
ccxt/abstract/yobit.py,sha256=8ycfCO8ORFly9hc0Aa47sZyX4_ZKPXS9h9yJzI-uQ7Q,1339
|
208
208
|
ccxt/abstract/zaif.py,sha256=m15WHdl3gYy0GOXNZ8NEH8eE7sVh8c0T_ITNuU8vXeU,3935
|
209
209
|
ccxt/abstract/zonda.py,sha256=aSfewvRojzmuymX6QbOnDR8v9VFqWTULMHX9Y7kKD1M,5820
|
210
|
-
ccxt/async_support/__init__.py,sha256=
|
210
|
+
ccxt/async_support/__init__.py,sha256=TA-VoBEUgXFhFXWnMRUYXBco6YCsx-Ae_czZ8QFd0RA,15410
|
211
211
|
ccxt/async_support/ace.py,sha256=kbkibefA6HaHJSNoL_MPmbPUn7n2wyruxBOR7BXmUmQ,41644
|
212
212
|
ccxt/async_support/alpaca.py,sha256=Nsaff9RczBhiNF19RlqI6wggvEibV_2ICgB8H5Qiuck,47120
|
213
|
-
ccxt/async_support/ascendex.py,sha256=
|
213
|
+
ccxt/async_support/ascendex.py,sha256=wlR3Mc8Mg7dIuzWZ59AWxAVPh0sVKddH-SFvdbq3ECc,152172
|
214
214
|
ccxt/async_support/bequant.py,sha256=1hTwHovo1bW1XTIc8ZKjvJ-Xg6LfmpGdzT7TepykaVM,1188
|
215
215
|
ccxt/async_support/bigone.py,sha256=_B8qO9qQWVMSd5c-CeBmYtm_IsrkweAZPTLUf7hiQaI,92639
|
216
216
|
ccxt/async_support/binance.py,sha256=eQbd5uw_bRqM_wbwyVUeQHQk2ZIZd9j1YThtuppflHw,599554
|
@@ -246,7 +246,7 @@ ccxt/async_support/btcmarkets.py,sha256=b6izd3cD8P3swetbESyX1N0qD3K0sZI7PX4qMjWm
|
|
246
246
|
ccxt/async_support/btcturk.py,sha256=nz0nAY_whtiOupBWqdKjrYvpe6Ynu82b_SsB8kd5DC0,36724
|
247
247
|
ccxt/async_support/bybit.py,sha256=DMTulzeqpQj-jFsY7qH2dyQbnvoXKa41awkEqWhdAFs,403379
|
248
248
|
ccxt/async_support/cex.py,sha256=_zLkiZaE0dT7yTuJtgkFQlmuzj6M5dQQvI_VXkKsBCc,70003
|
249
|
-
ccxt/async_support/coinbase.py,sha256=
|
249
|
+
ccxt/async_support/coinbase.py,sha256=K5AYf8H7ctSqOogv9_yIcX_ve6VS6W-mSXzbTz0-s0A,203930
|
250
250
|
ccxt/async_support/coinbaseinternational.py,sha256=d_6C7iQFn1giEh1Sr7Wm2fhG9QtGYx1pMkeJXpwjZvM,87677
|
251
251
|
ccxt/async_support/coinbasepro.py,sha256=H32l_mejuo2ATe4_Hac3vFgRTIxSPuDDFHz2pdQOLnw,78883
|
252
252
|
ccxt/async_support/coincheck.py,sha256=LbgeqG4WkPMXZid_LZstU6Vzv6C4-xRkt_mLb4wudGc,35719
|
@@ -278,9 +278,9 @@ ccxt/async_support/hyperliquid.py,sha256=XVu7E1x3MgU6LM5WUWXCQs0i1eJD7PdBJi_7hDv
|
|
278
278
|
ccxt/async_support/idex.py,sha256=UVFjkPyNlRN92W4zWt7R_og3g0a3SNfzWHKnSyZLKw0,73285
|
279
279
|
ccxt/async_support/independentreserve.py,sha256=02gCggRgFSmIdJyG5vO-R2JXNbB3u6U1TH2cfdckhdU,32284
|
280
280
|
ccxt/async_support/indodax.py,sha256=4ebi88kkmmJdLH1nvwds5EXNVNJV78U4CMFRSQ26ie0,52087
|
281
|
-
ccxt/async_support/kraken.py,sha256=
|
281
|
+
ccxt/async_support/kraken.py,sha256=flntvB2c5KlnAq6YGSTvvBrIRFnV0PUj9sEtTV2kAdA,124614
|
282
282
|
ccxt/async_support/krakenfutures.py,sha256=7kXGYak9jf74JvgjE5WxNYiN3_-LdSR7MRBE14VtAHw,116143
|
283
|
-
ccxt/async_support/kucoin.py,sha256=
|
283
|
+
ccxt/async_support/kucoin.py,sha256=_Z0XF69rgA49L1BoUGtQW15TFMM6O3VbPTYET-XvQ4o,215757
|
284
284
|
ccxt/async_support/kucoinfutures.py,sha256=wMiqQhM6OAYsekbG2srW5VD4cCo2GekQxaX3PCc1Htk,119121
|
285
285
|
ccxt/async_support/kuna.py,sha256=6X17wtrcGt6NZL9ttZBfw1PWqaIvRv2r_SRmcfBVB_k,96396
|
286
286
|
ccxt/async_support/latoken.py,sha256=GqTk_f1xJJHXnAfSOA0J7rS2hDrIJzajTQZe1gRvtCU,79256
|
@@ -313,7 +313,7 @@ ccxt/async_support/yobit.py,sha256=EgBPquMnD4GU32jnWp1FXUxlMyC1nYPtRzJCZUG_HMY,5
|
|
313
313
|
ccxt/async_support/zaif.py,sha256=PaHcaNijKkhocrw6DZoSBNUjBOLNlkUYtsJvPAqkx68,28134
|
314
314
|
ccxt/async_support/zonda.py,sha256=89EXub_DW_p4Rpza9iiW-hAaj3ucKbNdZyV2ETQ3ESY,80866
|
315
315
|
ccxt/async_support/base/__init__.py,sha256=aVYSsFi--b4InRs9zDN_wtCpj8odosAB726JdUHavrk,67
|
316
|
-
ccxt/async_support/base/exchange.py,sha256=
|
316
|
+
ccxt/async_support/base/exchange.py,sha256=OfzybCHeJgY9baAqvt2k9RqtzUClnOt5AKJe1rQFBCU,91522
|
317
317
|
ccxt/async_support/base/throttler.py,sha256=tvDVcdRUVYi8fZRlEcnqtgzcgB_KMUMRs5Pu8tuU-tU,1847
|
318
318
|
ccxt/async_support/base/ws/__init__.py,sha256=uockzpLuwntKGZbs5EOWFe-Zg-k6Cj7GhNJLc_RX0so,1791
|
319
319
|
ccxt/async_support/base/ws/aiohttp_client.py,sha256=Ed1765emEde2Hj8Ys6f5EjS54ZI1wQ0qIhd04eB7yhU,5751
|
@@ -327,10 +327,10 @@ ccxt/async_support/base/ws/order_book_side.py,sha256=Pxrq22nCODckJ6G1OXkYEmUunIu
|
|
327
327
|
ccxt/base/__init__.py,sha256=eTx1OE3HJjspFUQjGm6LBhaQiMKJnXjkdP-JUXknyQ0,1320
|
328
328
|
ccxt/base/decimal_to_precision.py,sha256=fgWRBzRTtsf3r2INyS4f7WHlzgjB5YM1ekiwqD21aac,6634
|
329
329
|
ccxt/base/errors.py,sha256=u_zxABGVPU_K5oLEEZQWOI0_F5Q-SAUq1g1q6AFh7IM,4107
|
330
|
-
ccxt/base/exchange.py,sha256=
|
330
|
+
ccxt/base/exchange.py,sha256=Ozub1PC_MNs_AclLCqBC5i5CVG8b6LPcPS3FTcPIhZw,256007
|
331
331
|
ccxt/base/precise.py,sha256=_xfu54sV0vWNnOfGTKRFykeuWP8mn4K1m9lk1tcllX4,8565
|
332
332
|
ccxt/base/types.py,sha256=x9KoAaFdEPJD2l8ottMk4xKr-tEdby77jKaAK8XcIgo,7903
|
333
|
-
ccxt/pro/__init__.py,sha256=
|
333
|
+
ccxt/pro/__init__.py,sha256=ZPi-tUKXnss4tlQYsYIMdLq4-ATjzrGR-Cx10CGh8rs,7000
|
334
334
|
ccxt/pro/alpaca.py,sha256=7ePyWli0949ti5UheIn553xmnFpedrNc2W5CKauSZio,27167
|
335
335
|
ccxt/pro/ascendex.py,sha256=fCM3EujSfJvtvffqI56UAstTtwjXFIocwukm15cF8rE,35432
|
336
336
|
ccxt/pro/bequant.py,sha256=5zbsP8BHQTUZ8ZNL6uaACxDbUClgkOV4SYfXT_LfQVg,1351
|
@@ -354,7 +354,7 @@ ccxt/pro/bitvavo.py,sha256=5xzpVRMcI2z0r41eoN-NORr5-qQYBao_bMsH8all9Q0,56143
|
|
354
354
|
ccxt/pro/blockchaincom.py,sha256=Uv1ijvxvFGrqFPH6iifCk5AgQYTDsXUa5n0ktpusVjM,29560
|
355
355
|
ccxt/pro/bybit.py,sha256=INf7Qfo1CRR5m6yv9w6YNirE0hFOED6J1ztV9kkQ53M,75022
|
356
356
|
ccxt/pro/cex.py,sha256=sxpyOCappmjLVOGa4CxYh1tcswHU23xz4FrTlJsjirk,58370
|
357
|
-
ccxt/pro/coinbase.py,sha256=
|
357
|
+
ccxt/pro/coinbase.py,sha256=icUrGgWl5IJ7C4-XRnaIXbSRs1dgIdktiDEmSG4-iUs,25652
|
358
358
|
ccxt/pro/coinbaseinternational.py,sha256=9Pbe6je_6nqA7SviyzmcR_4CscKdQzBYNLECOYJ4BoU,25428
|
359
359
|
ccxt/pro/coinbasepro.py,sha256=94ZXmg-Ez5tSiUYP98nu-gWvuXb-Dk4WHMVsXOR8AK0,38945
|
360
360
|
ccxt/pro/coincheck.py,sha256=MKAPHJeVifQaCKPla-7RY86TIWyDGe4nvjRhNmi617w,7789
|
@@ -529,7 +529,7 @@ ccxt/test/base/test_ticker.py,sha256=cMTIMb1oySNORUCmqI5ZzMswlEyCF6gJMah3vfvo8wQ
|
|
529
529
|
ccxt/test/base/test_trade.py,sha256=PMtmB8V38dpaP-eb8h488xYMlR6D69yCOhsA1RuWrUA,2336
|
530
530
|
ccxt/test/base/test_trading_fee.py,sha256=2aDCNJtqBkTC_AieO0l1HYGq5hz5qkWlkWb9Nv_fcwk,1066
|
531
531
|
ccxt/test/base/test_transaction.py,sha256=BTbB4UHHXkrvYgwbrhh867nVRlevmIkIrz1W_odlQJI,1434
|
532
|
-
ccxt-4.2.
|
533
|
-
ccxt-4.2.
|
534
|
-
ccxt-4.2.
|
535
|
-
ccxt-4.2.
|
532
|
+
ccxt-4.2.100.dist-info/METADATA,sha256=2dI8l3buFe3NYl2S4Y0APkplN8vdu5DKBMhtl-Ns5vk,110285
|
533
|
+
ccxt-4.2.100.dist-info/WHEEL,sha256=P2T-6epvtXQ2cBOE_U1K4_noqlJFN3tj15djMgEu4NM,110
|
534
|
+
ccxt-4.2.100.dist-info/top_level.txt,sha256=CkQDuCTDKNcImPV60t36G6MdYfxsAPNiSaEwifVoVMo,5
|
535
|
+
ccxt-4.2.100.dist-info/RECORD,,
|
File without changes
|
File without changes
|