ccxt 4.3.1__py2.py3-none-any.whl → 4.3.3__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/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +5 -2
- ccxt/async_support/binance.py +295 -20
- ccxt/async_support/bingx.py +5 -4
- ccxt/async_support/bitget.py +74 -4
- ccxt/async_support/coinbase.py +10 -2
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coinex.py +109 -145
- ccxt/async_support/cryptocom.py +5 -5
- ccxt/async_support/hyperliquid.py +154 -14
- ccxt/async_support/kraken.py +6 -3
- ccxt/async_support/kucoin.py +13 -11
- ccxt/async_support/okx.py +108 -0
- ccxt/async_support/poloniexfutures.py +9 -2
- ccxt/async_support/woo.py +102 -6
- ccxt/base/exchange.py +24 -2
- ccxt/base/types.py +4 -0
- ccxt/binance.py +295 -20
- ccxt/bingx.py +5 -4
- ccxt/bitget.py +74 -4
- ccxt/coinbase.py +10 -2
- ccxt/coinbasepro.py +1 -1
- ccxt/coinex.py +109 -145
- ccxt/cryptocom.py +5 -5
- ccxt/hyperliquid.py +154 -14
- ccxt/kraken.py +6 -3
- ccxt/kucoin.py +13 -11
- ccxt/okx.py +108 -0
- ccxt/poloniexfutures.py +9 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/hyperliquid.py +8 -7
- ccxt/pro/kraken.py +1 -1
- ccxt/pro/wazirx.py +2 -1
- ccxt/woo.py +102 -6
- {ccxt-4.3.1.dist-info → ccxt-4.3.3.dist-info}/METADATA +7 -6
- {ccxt-4.3.1.dist-info → ccxt-4.3.3.dist-info}/RECORD +39 -39
- {ccxt-4.3.1.dist-info → ccxt-4.3.3.dist-info}/WHEEL +0 -0
- {ccxt-4.3.1.dist-info → ccxt-4.3.3.dist-info}/top_level.txt +0 -0
ccxt/kraken.py
CHANGED
@@ -1333,7 +1333,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1333
1333
|
'ordertype': type,
|
1334
1334
|
'volume': self.amount_to_precision(symbol, amount),
|
1335
1335
|
}
|
1336
|
-
orderRequest = self.order_request('createOrder
|
1336
|
+
orderRequest = self.order_request('createOrder', symbol, type, request, price, params)
|
1337
1337
|
response = self.privatePostAddOrder(self.extend(orderRequest[0], orderRequest[1]))
|
1338
1338
|
#
|
1339
1339
|
# {
|
@@ -1659,7 +1659,10 @@ class kraken(Exchange, ImplicitAPI):
|
|
1659
1659
|
request['price'] = trailingAmountString
|
1660
1660
|
request['ordertype'] = 'trailing-stop'
|
1661
1661
|
if reduceOnly:
|
1662
|
-
|
1662
|
+
if method == 'createOrderWs':
|
1663
|
+
request['reduce_only'] = True # ws request can't have stringified bool
|
1664
|
+
else:
|
1665
|
+
request['reduce_only'] = 'true' # not using hasattr(self, boolean) case, because the urlencodedNested transforms it into 'True' string
|
1663
1666
|
close = self.safe_value(params, 'close')
|
1664
1667
|
if close is not None:
|
1665
1668
|
close = self.extend({}, close)
|
@@ -1710,7 +1713,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1710
1713
|
}
|
1711
1714
|
if amount is not None:
|
1712
1715
|
request['volume'] = self.amount_to_precision(symbol, amount)
|
1713
|
-
orderRequest = self.order_request('editOrder
|
1716
|
+
orderRequest = self.order_request('editOrder', symbol, type, request, price, params)
|
1714
1717
|
response = self.privatePostEditOrder(self.extend(orderRequest[0], orderRequest[1]))
|
1715
1718
|
#
|
1716
1719
|
# {
|
ccxt/kucoin.py
CHANGED
@@ -606,6 +606,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
606
606
|
'BIFI': 'BIFIF',
|
607
607
|
'VAI': 'VAIOT',
|
608
608
|
'WAX': 'WAXP',
|
609
|
+
'ALT': 'APTOSLAUNCHTOKEN',
|
610
|
+
'KALT': 'ALT', # ALTLAYER
|
609
611
|
},
|
610
612
|
'options': {
|
611
613
|
'version': 'v1',
|
@@ -1776,7 +1778,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1776
1778
|
address = address.replace('bitcoincash:', '')
|
1777
1779
|
code = None
|
1778
1780
|
if currency is not None:
|
1779
|
-
code = currency['id']
|
1781
|
+
code = self.safe_currency_code(currency['id'])
|
1780
1782
|
if code != 'NIM':
|
1781
1783
|
# contains spaces
|
1782
1784
|
self.check_address(address)
|
@@ -1822,7 +1824,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1822
1824
|
self.options['versions']['private']['GET']['deposit-addresses'] = version
|
1823
1825
|
chains = self.safe_list(response, 'data', [])
|
1824
1826
|
parsed = self.parse_deposit_addresses(chains, [currency['code']], False, {
|
1825
|
-
'currency': currency['
|
1827
|
+
'currency': currency['code'],
|
1826
1828
|
})
|
1827
1829
|
return self.index_by(parsed, 'network')
|
1828
1830
|
|
@@ -2799,7 +2801,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2799
2801
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
2800
2802
|
"""
|
2801
2803
|
get the list of most recent trades for a particular symbol
|
2802
|
-
:see: https://
|
2804
|
+
:see: https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
|
2803
2805
|
:param str symbol: unified symbol of the market to fetch trades for
|
2804
2806
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
2805
2807
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -2964,7 +2966,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2964
2966
|
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
2965
2967
|
"""
|
2966
2968
|
fetch the trading fees for a market
|
2967
|
-
:see: https://
|
2969
|
+
:see: https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
|
2968
2970
|
:param str symbol: unified market symbol
|
2969
2971
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2970
2972
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -3002,7 +3004,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3002
3004
|
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
3003
3005
|
"""
|
3004
3006
|
make a withdrawal
|
3005
|
-
:see: https://
|
3007
|
+
:see: https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw
|
3006
3008
|
:param str code: unified currency code
|
3007
3009
|
:param float amount: the amount to withdraw
|
3008
3010
|
:param str address: the address to withdraw to
|
@@ -3163,8 +3165,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3163
3165
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3164
3166
|
"""
|
3165
3167
|
fetch all deposits made to an account
|
3166
|
-
:see: https://
|
3167
|
-
:see: https://
|
3168
|
+
:see: https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
|
3169
|
+
:see: https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
|
3168
3170
|
:param str code: unified currency code
|
3169
3171
|
:param int [since]: the earliest time in ms to fetch deposits for
|
3170
3172
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -3239,8 +3241,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3239
3241
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3240
3242
|
"""
|
3241
3243
|
fetch all withdrawals made from an account
|
3242
|
-
:see: https://
|
3243
|
-
:see: https://
|
3244
|
+
:see: https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
|
3245
|
+
:see: https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
|
3244
3246
|
:param str code: unified currency code
|
3245
3247
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
3246
3248
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -3490,7 +3492,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3490
3492
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
3491
3493
|
"""
|
3492
3494
|
transfer currency internally between wallets on the same account
|
3493
|
-
:see: https://
|
3495
|
+
:see: https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
|
3494
3496
|
:see: https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
|
3495
3497
|
:see: https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
|
3496
3498
|
:param str code: unified currency code
|
@@ -3757,7 +3759,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3757
3759
|
|
3758
3760
|
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3759
3761
|
"""
|
3760
|
-
:see: https://
|
3762
|
+
:see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
|
3761
3763
|
:see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
|
3762
3764
|
:see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
|
3763
3765
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
ccxt/okx.py
CHANGED
@@ -86,6 +86,8 @@ class okx(Exchange, ImplicitAPI):
|
|
86
86
|
'fetchClosedOrders': True,
|
87
87
|
'fetchConvertCurrencies': True,
|
88
88
|
'fetchConvertQuote': True,
|
89
|
+
'fetchConvertTrade': True,
|
90
|
+
'fetchConvertTradeHistory': True,
|
89
91
|
'fetchCrossBorrowRate': True,
|
90
92
|
'fetchCrossBorrowRates': True,
|
91
93
|
'fetchCurrencies': True,
|
@@ -7202,6 +7204,96 @@ class okx(Exchange, ImplicitAPI):
|
|
7202
7204
|
toCurrency = self.currency(toCurrencyId)
|
7203
7205
|
return self.parse_conversion(result, fromCurrency, toCurrency)
|
7204
7206
|
|
7207
|
+
def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
|
7208
|
+
"""
|
7209
|
+
fetch the data for a conversion trade
|
7210
|
+
:see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-history
|
7211
|
+
:param str id: the id of the trade that you want to fetch
|
7212
|
+
:param str [code]: the unified currency code of the conversion trade
|
7213
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7214
|
+
:returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
|
7215
|
+
"""
|
7216
|
+
self.load_markets()
|
7217
|
+
request = {
|
7218
|
+
'clTReqId': id,
|
7219
|
+
}
|
7220
|
+
response = self.privateGetAssetConvertHistory(self.extend(request, params))
|
7221
|
+
#
|
7222
|
+
# {
|
7223
|
+
# "code": "0",
|
7224
|
+
# "data": [
|
7225
|
+
# {
|
7226
|
+
# "clTReqId": "",
|
7227
|
+
# "instId": "ETH-USDT",
|
7228
|
+
# "side": "buy",
|
7229
|
+
# "fillPx": "2932.401044",
|
7230
|
+
# "baseCcy": "ETH",
|
7231
|
+
# "quoteCcy": "USDT",
|
7232
|
+
# "fillBaseSz": "0.01023052",
|
7233
|
+
# "state": "fullyFilled",
|
7234
|
+
# "tradeId": "trader16461885203381437",
|
7235
|
+
# "fillQuoteSz": "30",
|
7236
|
+
# "ts": "1646188520000"
|
7237
|
+
# }
|
7238
|
+
# ],
|
7239
|
+
# "msg": ""
|
7240
|
+
# }
|
7241
|
+
#
|
7242
|
+
data = self.safe_list(response, 'data', [])
|
7243
|
+
result = self.safe_dict(data, 0, {})
|
7244
|
+
fromCurrencyId = self.safe_string(result, 'baseCcy')
|
7245
|
+
toCurrencyId = self.safe_string(result, 'quoteCcy')
|
7246
|
+
fromCurrency = None
|
7247
|
+
toCurrency = None
|
7248
|
+
if fromCurrencyId is not None:
|
7249
|
+
fromCurrency = self.currency(fromCurrencyId)
|
7250
|
+
if toCurrencyId is not None:
|
7251
|
+
toCurrency = self.currency(toCurrencyId)
|
7252
|
+
return self.parse_conversion(result, fromCurrency, toCurrency)
|
7253
|
+
|
7254
|
+
def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
|
7255
|
+
"""
|
7256
|
+
fetch the users history of conversion trades
|
7257
|
+
:see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-history
|
7258
|
+
:param str [code]: the unified currency code
|
7259
|
+
:param int [since]: the earliest time in ms to fetch conversions for
|
7260
|
+
:param int [limit]: the maximum number of conversion structures to retrieve
|
7261
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7262
|
+
:param int [params.until]: timestamp in ms of the latest conversion to fetch
|
7263
|
+
:returns dict[]: a list of `conversion structures <https://docs.ccxt.com/#/?id=conversion-structure>`
|
7264
|
+
"""
|
7265
|
+
self.load_markets()
|
7266
|
+
request = {}
|
7267
|
+
request, params = self.handle_until_option('after', request, params)
|
7268
|
+
if since is not None:
|
7269
|
+
request['before'] = since
|
7270
|
+
if limit is not None:
|
7271
|
+
request['limit'] = limit
|
7272
|
+
response = self.privateGetAssetConvertHistory(self.extend(request, params))
|
7273
|
+
#
|
7274
|
+
# {
|
7275
|
+
# "code": "0",
|
7276
|
+
# "data": [
|
7277
|
+
# {
|
7278
|
+
# "clTReqId": "",
|
7279
|
+
# "instId": "ETH-USDT",
|
7280
|
+
# "side": "buy",
|
7281
|
+
# "fillPx": "2932.401044",
|
7282
|
+
# "baseCcy": "ETH",
|
7283
|
+
# "quoteCcy": "USDT",
|
7284
|
+
# "fillBaseSz": "0.01023052",
|
7285
|
+
# "state": "fullyFilled",
|
7286
|
+
# "tradeId": "trader16461885203381437",
|
7287
|
+
# "fillQuoteSz": "30",
|
7288
|
+
# "ts": "1646188520000"
|
7289
|
+
# }
|
7290
|
+
# ],
|
7291
|
+
# "msg": ""
|
7292
|
+
# }
|
7293
|
+
#
|
7294
|
+
rows = self.safe_list(response, 'data', [])
|
7295
|
+
return self.parse_conversions(rows, 'baseCcy', 'quoteCcy', since, limit)
|
7296
|
+
|
7205
7297
|
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
7206
7298
|
#
|
7207
7299
|
# fetchConvertQuote
|
@@ -7239,6 +7331,22 @@ class okx(Exchange, ImplicitAPI):
|
|
7239
7331
|
# "ts": "1646188520338"
|
7240
7332
|
# }
|
7241
7333
|
#
|
7334
|
+
# fetchConvertTrade, fetchConvertTradeHistory
|
7335
|
+
#
|
7336
|
+
# {
|
7337
|
+
# "clTReqId": "",
|
7338
|
+
# "instId": "ETH-USDT",
|
7339
|
+
# "side": "buy",
|
7340
|
+
# "fillPx": "2932.401044",
|
7341
|
+
# "baseCcy": "ETH",
|
7342
|
+
# "quoteCcy": "USDT",
|
7343
|
+
# "fillBaseSz": "0.01023052",
|
7344
|
+
# "state": "fullyFilled",
|
7345
|
+
# "tradeId": "trader16461885203381437",
|
7346
|
+
# "fillQuoteSz": "30",
|
7347
|
+
# "ts": "1646188520000"
|
7348
|
+
# }
|
7349
|
+
#
|
7242
7350
|
timestamp = self.safe_integer_2(conversion, 'quoteTime', 'ts')
|
7243
7351
|
fromCoin = self.safe_string(conversion, 'baseCcy')
|
7244
7352
|
fromCode = self.safe_currency_code(fromCoin, fromCurrency)
|
ccxt/poloniexfutures.py
CHANGED
@@ -383,8 +383,15 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
383
383
|
marketId = self.safe_string(ticker, 'symbol')
|
384
384
|
symbol = self.safe_symbol(marketId, market)
|
385
385
|
timestampString = self.safe_string(ticker, 'ts')
|
386
|
-
# check timestamp bcz bug: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011
|
387
|
-
multiplier =
|
386
|
+
# check timestamp bcz bug: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011 and also 17 digits occured
|
387
|
+
multiplier = None
|
388
|
+
if len(timestampString) == 17:
|
389
|
+
multiplier = 0.0001
|
390
|
+
elif len(timestampString) == 18:
|
391
|
+
multiplier = 0.00001
|
392
|
+
else:
|
393
|
+
# 19 length default
|
394
|
+
multiplier = 0.000001
|
388
395
|
timestamp = self.safe_integer_product(ticker, 'ts', multiplier)
|
389
396
|
last = self.safe_string_2(ticker, 'price', 'lastPrice')
|
390
397
|
percentage = Precise.string_mul(self.safe_string(ticker, 'priceChgPct'), '100')
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/hyperliquid.py
CHANGED
@@ -70,7 +70,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
70
70
|
'method': 'subscribe',
|
71
71
|
'subscription': {
|
72
72
|
'type': 'l2Book',
|
73
|
-
'coin': market['base'],
|
73
|
+
'coin': market['base'] if market['swap'] else market['id'],
|
74
74
|
},
|
75
75
|
}
|
76
76
|
message = self.extend(request, params)
|
@@ -105,7 +105,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
105
105
|
#
|
106
106
|
entry = self.safe_dict(message, 'data', {})
|
107
107
|
coin = self.safe_string(entry, 'coin')
|
108
|
-
marketId = coin
|
108
|
+
marketId = self.coinToMarketId(coin)
|
109
109
|
market = self.market(marketId)
|
110
110
|
symbol = market['symbol']
|
111
111
|
rawData = self.safe_list(entry, 'levels', [])
|
@@ -225,7 +225,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
225
225
|
'method': 'subscribe',
|
226
226
|
'subscription': {
|
227
227
|
'type': 'trades',
|
228
|
-
'coin': market['base'],
|
228
|
+
'coin': market['base'] if market['swap'] else market['id'],
|
229
229
|
},
|
230
230
|
}
|
231
231
|
message = self.extend(request, params)
|
@@ -254,7 +254,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
254
254
|
entry = self.safe_list(message, 'data', [])
|
255
255
|
first = self.safe_dict(entry, 0, {})
|
256
256
|
coin = self.safe_string(first, 'coin')
|
257
|
-
marketId = coin
|
257
|
+
marketId = self.coinToMarketId(coin)
|
258
258
|
market = self.market(marketId)
|
259
259
|
symbol = market['symbol']
|
260
260
|
if not (symbol in self.trades):
|
@@ -307,7 +307,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
307
307
|
price = self.safe_string(trade, 'px')
|
308
308
|
amount = self.safe_string(trade, 'sz')
|
309
309
|
coin = self.safe_string(trade, 'coin')
|
310
|
-
marketId = coin
|
310
|
+
marketId = self.coinToMarketId(coin)
|
311
311
|
market = self.safe_market(marketId, None)
|
312
312
|
symbol = market['symbol']
|
313
313
|
id = self.safe_string(trade, 'tid')
|
@@ -349,7 +349,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
349
349
|
'method': 'subscribe',
|
350
350
|
'subscription': {
|
351
351
|
'type': 'candle',
|
352
|
-
'coin': market['base'],
|
352
|
+
'coin': market['base'] if market['swap'] else market['id'],
|
353
353
|
'interval': timeframe,
|
354
354
|
},
|
355
355
|
}
|
@@ -380,7 +380,8 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
380
380
|
#
|
381
381
|
data = self.safe_dict(message, 'data', {})
|
382
382
|
base = self.safe_string(data, 's')
|
383
|
-
|
383
|
+
marketId = self.coinToMarketId(base)
|
384
|
+
symbol = self.safe_symbol(marketId)
|
384
385
|
timeframe = self.safe_string(data, 'i')
|
385
386
|
if not (symbol in self.ohlcvs):
|
386
387
|
self.ohlcvs[symbol] = {}
|
ccxt/pro/kraken.py
CHANGED
@@ -1242,7 +1242,7 @@ class kraken(ccxt.async_support.kraken):
|
|
1242
1242
|
},
|
1243
1243
|
}
|
1244
1244
|
url = self.urls['api']['ws']['public']
|
1245
|
-
return await self.watch_multiple(url, messageHashes, self.
|
1245
|
+
return await self.watch_multiple(url, messageHashes, self.deep_extend(request, params), messageHashes, subscriptionArgs)
|
1246
1246
|
|
1247
1247
|
def get_message_hash(self, unifiedElementName: str, subChannelName: Str = None, symbol: Str = None):
|
1248
1248
|
# unifiedElementName can be : orderbook, trade, ticker, bidask ...
|
ccxt/pro/wazirx.py
CHANGED
@@ -722,7 +722,8 @@ class wazirx(ccxt.async_support.wazirx):
|
|
722
722
|
}
|
723
723
|
streams = list(streamHandlers.keys())
|
724
724
|
for i in range(0, len(streams)):
|
725
|
-
|
725
|
+
streamContains = stream.find(streams[i]) > -1
|
726
|
+
if streamContains:
|
726
727
|
handler = streamHandlers[streams[i]]
|
727
728
|
handler(client, message)
|
728
729
|
return
|
ccxt/woo.py
CHANGED
@@ -69,6 +69,8 @@ class woo(Exchange, ImplicitAPI):
|
|
69
69
|
'fetchClosedOrders': True,
|
70
70
|
'fetchConvertCurrencies': True,
|
71
71
|
'fetchConvertQuote': True,
|
72
|
+
'fetchConvertTrade': True,
|
73
|
+
'fetchConvertTradeHistory': True,
|
72
74
|
'fetchCurrencies': True,
|
73
75
|
'fetchDepositAddress': True,
|
74
76
|
'fetchDeposits': True,
|
@@ -2853,6 +2855,88 @@ class woo(Exchange, ImplicitAPI):
|
|
2853
2855
|
data = self.safe_dict(response, 'data', {})
|
2854
2856
|
return self.parse_conversion(data)
|
2855
2857
|
|
2858
|
+
def fetch_convert_trade(self, id: str, code: Str = None, params={}) -> Conversion:
|
2859
|
+
"""
|
2860
|
+
fetch the data for a conversion trade
|
2861
|
+
:see: https://docs.woo.org/#get-quote-trade
|
2862
|
+
:param str id: the id of the trade that you want to fetch
|
2863
|
+
:param str [code]: the unified currency code of the conversion trade
|
2864
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2865
|
+
:returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
|
2866
|
+
"""
|
2867
|
+
self.load_markets()
|
2868
|
+
request = {
|
2869
|
+
'quoteId': id,
|
2870
|
+
}
|
2871
|
+
response = self.v3PrivateGetConvertTrade(self.extend(request, params))
|
2872
|
+
#
|
2873
|
+
# {
|
2874
|
+
# "success": True,
|
2875
|
+
# "data": {
|
2876
|
+
# "quoteId": 12,
|
2877
|
+
# "buyAsset": "",
|
2878
|
+
# "sellAsset": "",
|
2879
|
+
# "buyAmount": 12.11,
|
2880
|
+
# "sellAmount": 12.11,
|
2881
|
+
# "tradeStatus": 12,
|
2882
|
+
# "createdTime": ""
|
2883
|
+
# }
|
2884
|
+
# }
|
2885
|
+
#
|
2886
|
+
data = self.safe_dict(response, 'data', {})
|
2887
|
+
fromCurrencyId = self.safe_string(data, 'sellAsset')
|
2888
|
+
toCurrencyId = self.safe_string(data, 'buyAsset')
|
2889
|
+
fromCurrency = None
|
2890
|
+
toCurrency = None
|
2891
|
+
if fromCurrencyId is not None:
|
2892
|
+
fromCurrency = self.currency(fromCurrencyId)
|
2893
|
+
if toCurrencyId is not None:
|
2894
|
+
toCurrency = self.currency(toCurrencyId)
|
2895
|
+
return self.parse_conversion(data, fromCurrency, toCurrency)
|
2896
|
+
|
2897
|
+
def fetch_convert_trade_history(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Conversion]:
|
2898
|
+
"""
|
2899
|
+
fetch the users history of conversion trades
|
2900
|
+
:see: https://docs.woo.org/#get-quote-trades
|
2901
|
+
:param str [code]: the unified currency code
|
2902
|
+
:param int [since]: the earliest time in ms to fetch conversions for
|
2903
|
+
:param int [limit]: the maximum number of conversion structures to retrieve
|
2904
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2905
|
+
:param int [params.until]: timestamp in ms of the latest conversion to fetch
|
2906
|
+
:returns dict[]: a list of `conversion structures <https://docs.ccxt.com/#/?id=conversion-structure>`
|
2907
|
+
"""
|
2908
|
+
self.load_markets()
|
2909
|
+
request = {}
|
2910
|
+
request, params = self.handle_until_option('endTime', request, params)
|
2911
|
+
if since is not None:
|
2912
|
+
request['startTime'] = since
|
2913
|
+
if limit is not None:
|
2914
|
+
request['size'] = limit
|
2915
|
+
response = self.v3PrivateGetConvertTrades(self.extend(request, params))
|
2916
|
+
#
|
2917
|
+
# {
|
2918
|
+
# "success": True,
|
2919
|
+
# "data": {
|
2920
|
+
# "count": 12,
|
2921
|
+
# "tradeVos":[
|
2922
|
+
# {
|
2923
|
+
# "quoteId": 12,
|
2924
|
+
# "buyAsset": "",
|
2925
|
+
# "sellAsset": "",
|
2926
|
+
# "buyAmount": 12.11,
|
2927
|
+
# "sellAmount": 12.11,
|
2928
|
+
# "tradeStatus": 12,
|
2929
|
+
# "createdTime": ""
|
2930
|
+
# }
|
2931
|
+
# ...
|
2932
|
+
# ]
|
2933
|
+
# }
|
2934
|
+
# }
|
2935
|
+
#
|
2936
|
+
data = self.safe_dict(response, 'data', {})
|
2937
|
+
rows = self.safe_list(data, 'tradeVos', [])
|
2938
|
+
return self.parse_conversions(rows, 'sellAsset', 'buyAsset', since, limit)
|
2939
|
+
|
2856
2940
|
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
2857
2941
|
#
|
2858
2942
|
# fetchConvertQuote
|
@@ -2877,10 +2961,22 @@ class woo(Exchange, ImplicitAPI):
|
|
2877
2961
|
# "rftAccepted": 1 # 1 -> success; 2 -> processing; 3 -> fail
|
2878
2962
|
# }
|
2879
2963
|
#
|
2880
|
-
|
2881
|
-
|
2882
|
-
|
2883
|
-
|
2964
|
+
# fetchConvertTrade, fetchConvertTradeHistory
|
2965
|
+
#
|
2966
|
+
# {
|
2967
|
+
# "quoteId": 12,
|
2968
|
+
# "buyAsset": "",
|
2969
|
+
# "sellAsset": "",
|
2970
|
+
# "buyAmount": 12.11,
|
2971
|
+
# "sellAmount": 12.11,
|
2972
|
+
# "tradeStatus": 12,
|
2973
|
+
# "createdTime": ""
|
2974
|
+
# }
|
2975
|
+
#
|
2976
|
+
timestamp = self.safe_integer_2(conversion, 'expireTimestamp', 'createdTime')
|
2977
|
+
fromCurr = self.safe_string_2(conversion, 'sellToken', 'buyAsset')
|
2978
|
+
fromCode = self.safe_currency_code(fromCurr, fromCurrency)
|
2979
|
+
to = self.safe_string_2(conversion, 'buyToken', 'sellAsset')
|
2884
2980
|
toCode = self.safe_currency_code(to, toCurrency)
|
2885
2981
|
return {
|
2886
2982
|
'info': conversion,
|
@@ -2888,9 +2984,9 @@ class woo(Exchange, ImplicitAPI):
|
|
2888
2984
|
'datetime': self.iso8601(timestamp),
|
2889
2985
|
'id': self.safe_string(conversion, 'quoteId'),
|
2890
2986
|
'fromCurrency': fromCode,
|
2891
|
-
'fromAmount': self.
|
2987
|
+
'fromAmount': self.safe_number_2(conversion, 'sellQuantity', 'sellAmount'),
|
2892
2988
|
'toCurrency': toCode,
|
2893
|
-
'toAmount': self.
|
2989
|
+
'toAmount': self.safe_number_2(conversion, 'buyQuantity', 'buyAmount'),
|
2894
2990
|
'price': self.safe_number(conversion, 'buyPrice'),
|
2895
2991
|
'fee': None,
|
2896
2992
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.3.
|
3
|
+
Version: 4.3.3
|
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
|
@@ -90,6 +90,7 @@ Current feature list:
|
|
90
90
|
| [](http://www.bitmart.com/?r=rQCFLh) | bitmart | [BitMart](http://www.bitmart.com/?r=rQCFLh) | [](https://developer-pro.bitmart.com/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](http://www.bitmart.com/?r=rQCFLh) |
|
91
91
|
| [](https://www.bitmex.com/app/register/NZTR1q) | bitmex | [BitMEX](https://www.bitmex.com/app/register/NZTR1q) | [](https://www.bitmex.com/app/apiOverview) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://www.bitmex.com/app/register/NZTR1q) |
|
92
92
|
| [](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [](https://bybit-exchange.github.io/docs/inverse/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
93
|
+
| [](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase Advanced](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [](https://developers.coinbase.com/api/v2) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
93
94
|
| [](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbase.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
94
95
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://docs.coinex.com/api/v2) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | |
|
95
96
|
| [](https://crypto.com/exch/kdacthrnxt) | cryptocom | [Crypto.com](https://crypto.com/exch/kdacthrnxt) | [](https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) | [](https://crypto.com/exch/kdacthrnxt) |
|
@@ -142,9 +143,9 @@ The CCXT library currently supports the following 97 cryptocurrency exchange mar
|
|
142
143
|
| [](https://www.btcturk.com) | btcturk | [BTCTurk](https://www.btcturk.com) | [](https://github.com/BTCTrader/broker-api-docs) | | |
|
143
144
|
| [](https://www.bybit.com/register?affiliate_id=35953) | bybit | [Bybit](https://www.bybit.com/register?affiliate_id=35953) | [](https://bybit-exchange.github.io/docs/inverse/) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
144
145
|
| [](https://cex.io/r/0/up105393824/0/) | cex | [CEX.IO](https://cex.io/r/0/up105393824/0/) | [](https://cex.io/cex-api) | | [](https://ccxt.pro) |
|
145
|
-
| [](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase](https://www.coinbase.com/join/58cbe25a355148797479dbd2)
|
146
|
+
| [](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | coinbase | [Coinbase Advanced](https://www.coinbase.com/join/58cbe25a355148797479dbd2) | [](https://developers.coinbase.com/api/v2) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
146
147
|
| [](https://international.coinbase.com) | coinbaseinternational | [Coinbase International](https://international.coinbase.com) | [](https://docs.cloud.coinbase.com/intx/docs) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
147
|
-
| [](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro](https://pro.coinbase.com/)
|
148
|
+
| [](https://pro.coinbase.com/) | coinbasepro | [Coinbase Pro(Deprecated)](https://pro.coinbase.com/) | [](https://docs.pro.coinbase.com) | | [](https://ccxt.pro) |
|
148
149
|
| [](https://coincheck.com) | coincheck | [coincheck](https://coincheck.com) | [](https://coincheck.com/documents/exchange/api) | | |
|
149
150
|
| [](https://www.coinex.com/register?refer_code=yw5fz) | coinex | [CoinEx](https://www.coinex.com/register?refer_code=yw5fz) | [](https://docs.coinex.com/api/v2) | [](https://github.com/ccxt/ccxt/wiki/Certification) | [](https://ccxt.pro) |
|
150
151
|
| [](https://coinlist.co) | coinlist | [Coinlist](https://coinlist.co) | [](https://trade-docs.coinlist.co) | | |
|
@@ -261,13 +262,13 @@ console.log(version, Object.keys(exchanges));
|
|
261
262
|
|
262
263
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
263
264
|
|
264
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
265
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
265
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.3/dist/ccxt.browser.js
|
266
|
+
* unpkg: https://unpkg.com/ccxt@4.3.3/dist/ccxt.browser.js
|
266
267
|
|
267
268
|
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
269
|
|
269
270
|
```HTML
|
270
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
271
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.3/dist/ccxt.browser.js"></script>
|
271
272
|
```
|
272
273
|
|
273
274
|
Creates a global `ccxt` object:
|