ccxt 4.2.100__py2.py3-none-any.whl → 4.3.2__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +55 -1
- ccxt/async_support/bingx.py +3 -2
- ccxt/async_support/bitget.py +65 -5
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/coinbase.py +2 -1
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coinex.py +163 -203
- ccxt/async_support/cryptocom.py +5 -5
- ccxt/async_support/hyperliquid.py +69 -1
- ccxt/async_support/kraken.py +6 -3
- ccxt/async_support/kucoin.py +13 -11
- ccxt/async_support/okx.py +74 -5
- ccxt/async_support/woo.py +38 -0
- ccxt/base/exchange.py +5 -2
- ccxt/base/types.py +4 -0
- ccxt/binance.py +55 -1
- ccxt/bingx.py +3 -2
- ccxt/bitget.py +65 -5
- ccxt/bybit.py +1 -1
- ccxt/coinbase.py +2 -1
- ccxt/coinbasepro.py +1 -1
- ccxt/coinex.py +163 -203
- ccxt/cryptocom.py +5 -5
- ccxt/hyperliquid.py +69 -1
- ccxt/kraken.py +6 -3
- ccxt/kucoin.py +13 -11
- ccxt/okx.py +74 -5
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/kraken.py +2 -2
- ccxt/woo.py +38 -0
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/METADATA +7 -6
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/RECORD +37 -37
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/WHEEL +0 -0
- {ccxt-4.2.100.dist-info → ccxt-4.3.2.dist-info}/top_level.txt +0 -0
ccxt/hyperliquid.py
CHANGED
@@ -5,10 +5,11 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hyperliquid import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
12
|
+
from ccxt.base.errors import BadRequest
|
12
13
|
from ccxt.base.errors import InvalidOrder
|
13
14
|
from ccxt.base.errors import OrderNotFound
|
14
15
|
from ccxt.base.errors import NotSupported
|
@@ -43,6 +44,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
43
44
|
'cancelAllOrders': False,
|
44
45
|
'cancelOrder': True,
|
45
46
|
'cancelOrders': True,
|
47
|
+
'cancelOrdersForSymbols': True,
|
46
48
|
'closeAllPositions': False,
|
47
49
|
'closePosition': False,
|
48
50
|
'createMarketBuyOrderWithCost': False,
|
@@ -1167,6 +1169,72 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1167
1169
|
#
|
1168
1170
|
return response
|
1169
1171
|
|
1172
|
+
def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
|
1173
|
+
"""
|
1174
|
+
cancel multiple orders for multiple symbols
|
1175
|
+
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
1176
|
+
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
1177
|
+
:param CancellationRequest[] orders: each order should contain the parameters required by cancelOrder namely id and symbol
|
1178
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1179
|
+
:param str [params.vaultAddress]: the vault address
|
1180
|
+
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1181
|
+
"""
|
1182
|
+
self.check_required_credentials()
|
1183
|
+
self.load_markets()
|
1184
|
+
nonce = self.milliseconds()
|
1185
|
+
request = {
|
1186
|
+
'nonce': nonce,
|
1187
|
+
# 'vaultAddress': vaultAddress,
|
1188
|
+
}
|
1189
|
+
cancelReq = []
|
1190
|
+
cancelAction = {
|
1191
|
+
'type': '',
|
1192
|
+
'cancels': [],
|
1193
|
+
}
|
1194
|
+
cancelByCloid = False
|
1195
|
+
for i in range(0, len(orders)):
|
1196
|
+
order = orders[i]
|
1197
|
+
clientOrderId = self.safe_string(order, 'clientOrderId')
|
1198
|
+
if clientOrderId is not None:
|
1199
|
+
cancelByCloid = True
|
1200
|
+
id = self.safe_string(order, 'id')
|
1201
|
+
symbol = self.safe_string(order, 'symbol')
|
1202
|
+
if symbol is None:
|
1203
|
+
raise ArgumentsRequired(self.id + ' cancelOrdersForSymbols() requires a symbol argument in each order')
|
1204
|
+
if id is not None and cancelByCloid:
|
1205
|
+
raise BadRequest(self.id + ' cancelOrdersForSymbols() all orders must have either id or clientOrderId')
|
1206
|
+
assetKey = 'asset' if cancelByCloid else 'a'
|
1207
|
+
idKey = 'cloid' if cancelByCloid else 'o'
|
1208
|
+
market = self.market(symbol)
|
1209
|
+
cancelObj = {}
|
1210
|
+
cancelObj[assetKey] = self.parse_to_numeric(market['baseId'])
|
1211
|
+
cancelObj[idKey] = clientOrderId if cancelByCloid else self.parse_to_numeric(id)
|
1212
|
+
cancelReq.append(cancelObj)
|
1213
|
+
cancelAction['type'] = 'cancelByCloid' if cancelByCloid else 'cancel'
|
1214
|
+
cancelAction['cancels'] = cancelReq
|
1215
|
+
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
1216
|
+
signature = self.sign_l1_action(cancelAction, nonce, vaultAddress)
|
1217
|
+
request['action'] = cancelAction
|
1218
|
+
request['signature'] = signature
|
1219
|
+
if vaultAddress is not None:
|
1220
|
+
params = self.omit(params, 'vaultAddress')
|
1221
|
+
request['vaultAddress'] = vaultAddress
|
1222
|
+
response = self.privatePostExchange(self.extend(request, params))
|
1223
|
+
#
|
1224
|
+
# {
|
1225
|
+
# "status":"ok",
|
1226
|
+
# "response":{
|
1227
|
+
# "type":"cancel",
|
1228
|
+
# "data":{
|
1229
|
+
# "statuses":[
|
1230
|
+
# "success"
|
1231
|
+
# ]
|
1232
|
+
# }
|
1233
|
+
# }
|
1234
|
+
# }
|
1235
|
+
#
|
1236
|
+
return response
|
1237
|
+
|
1170
1238
|
def edit_order(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={}):
|
1171
1239
|
"""
|
1172
1240
|
edit a trade order
|
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
@@ -58,6 +58,7 @@ class okx(Exchange, ImplicitAPI):
|
|
58
58
|
'cancelOrders': True,
|
59
59
|
'closeAllPositions': False,
|
60
60
|
'closePosition': True,
|
61
|
+
'createConvertTrade': True,
|
61
62
|
'createDepositAddress': False,
|
62
63
|
'createMarketBuyOrderWithCost': True,
|
63
64
|
'createMarketSellOrderWithCost': True,
|
@@ -7150,6 +7151,57 @@ class okx(Exchange, ImplicitAPI):
|
|
7150
7151
|
toCurrency = self.currency(toCurrencyId)
|
7151
7152
|
return self.parse_conversion(result, fromCurrency, toCurrency)
|
7152
7153
|
|
7154
|
+
def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
7155
|
+
"""
|
7156
|
+
convert from one currency to another
|
7157
|
+
:see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-convert-trade
|
7158
|
+
:param str id: the id of the trade that you want to make
|
7159
|
+
:param str fromCode: the currency that you want to sell and convert from
|
7160
|
+
:param str toCode: the currency that you want to buy and convert into
|
7161
|
+
:param float [amount]: how much you want to trade in units of the from currency
|
7162
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7163
|
+
:returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
|
7164
|
+
"""
|
7165
|
+
self.load_markets()
|
7166
|
+
request = {
|
7167
|
+
'quoteId': id,
|
7168
|
+
'baseCcy': fromCode,
|
7169
|
+
'quoteCcy': toCode,
|
7170
|
+
'szCcy': fromCode,
|
7171
|
+
'sz': self.number_to_string(amount),
|
7172
|
+
'side': 'sell',
|
7173
|
+
}
|
7174
|
+
response = self.privatePostAssetConvertTrade(self.extend(request, params))
|
7175
|
+
#
|
7176
|
+
# {
|
7177
|
+
# "code": "0",
|
7178
|
+
# "data": [
|
7179
|
+
# {
|
7180
|
+
# "baseCcy": "ETH",
|
7181
|
+
# "clTReqId": "",
|
7182
|
+
# "fillBaseSz": "0.01023052",
|
7183
|
+
# "fillPx": "2932.40104429",
|
7184
|
+
# "fillQuoteSz": "30",
|
7185
|
+
# "instId": "ETH-USDT",
|
7186
|
+
# "quoteCcy": "USDT",
|
7187
|
+
# "quoteId": "quoterETH-USDT16461885104612381",
|
7188
|
+
# "side": "buy",
|
7189
|
+
# "state": "fullyFilled",
|
7190
|
+
# "tradeId": "trader16461885203381437",
|
7191
|
+
# "ts": "1646188520338"
|
7192
|
+
# }
|
7193
|
+
# ],
|
7194
|
+
# "msg": ""
|
7195
|
+
# }
|
7196
|
+
#
|
7197
|
+
data = self.safe_list(response, 'data', [])
|
7198
|
+
result = self.safe_dict(data, 0, {})
|
7199
|
+
fromCurrencyId = self.safe_string(result, 'baseCcy', fromCode)
|
7200
|
+
fromCurrency = self.currency(fromCurrencyId)
|
7201
|
+
toCurrencyId = self.safe_string(result, 'quoteCcy', toCode)
|
7202
|
+
toCurrency = self.currency(toCurrencyId)
|
7203
|
+
return self.parse_conversion(result, fromCurrency, toCurrency)
|
7204
|
+
|
7153
7205
|
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
7154
7206
|
#
|
7155
7207
|
# fetchConvertQuote
|
@@ -7170,7 +7222,24 @@ class okx(Exchange, ImplicitAPI):
|
|
7170
7222
|
# "ttlMs": "10000"
|
7171
7223
|
# }
|
7172
7224
|
#
|
7173
|
-
|
7225
|
+
# createConvertTrade
|
7226
|
+
#
|
7227
|
+
# {
|
7228
|
+
# "baseCcy": "ETH",
|
7229
|
+
# "clTReqId": "",
|
7230
|
+
# "fillBaseSz": "0.01023052",
|
7231
|
+
# "fillPx": "2932.40104429",
|
7232
|
+
# "fillQuoteSz": "30",
|
7233
|
+
# "instId": "ETH-USDT",
|
7234
|
+
# "quoteCcy": "USDT",
|
7235
|
+
# "quoteId": "quoterETH-USDT16461885104612381",
|
7236
|
+
# "side": "buy",
|
7237
|
+
# "state": "fullyFilled",
|
7238
|
+
# "tradeId": "trader16461885203381437",
|
7239
|
+
# "ts": "1646188520338"
|
7240
|
+
# }
|
7241
|
+
#
|
7242
|
+
timestamp = self.safe_integer_2(conversion, 'quoteTime', 'ts')
|
7174
7243
|
fromCoin = self.safe_string(conversion, 'baseCcy')
|
7175
7244
|
fromCode = self.safe_currency_code(fromCoin, fromCurrency)
|
7176
7245
|
to = self.safe_string(conversion, 'quoteCcy')
|
@@ -7179,12 +7248,12 @@ class okx(Exchange, ImplicitAPI):
|
|
7179
7248
|
'info': conversion,
|
7180
7249
|
'timestamp': timestamp,
|
7181
7250
|
'datetime': self.iso8601(timestamp),
|
7182
|
-
'id': self.
|
7251
|
+
'id': self.safe_string_n(conversion, ['clQReqId', 'tradeId', 'quoteId']),
|
7183
7252
|
'fromCurrency': fromCode,
|
7184
|
-
'fromAmount': self.
|
7253
|
+
'fromAmount': self.safe_number_2(conversion, 'baseSz', 'fillBaseSz'),
|
7185
7254
|
'toCurrency': toCode,
|
7186
|
-
'toAmount': self.
|
7187
|
-
'price': self.
|
7255
|
+
'toAmount': self.safe_number_2(conversion, 'quoteSz', 'fillQuoteSz'),
|
7256
|
+
'price': self.safe_number_2(conversion, 'cnvtPx', 'fillPx'),
|
7188
7257
|
'fee': None,
|
7189
7258
|
}
|
7190
7259
|
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/kraken.py
CHANGED
@@ -150,7 +150,7 @@ class kraken(ccxt.async_support.kraken):
|
|
150
150
|
'pair': market['wsId'],
|
151
151
|
'volume': self.amount_to_precision(symbol, amount),
|
152
152
|
}
|
153
|
-
request, params = self.orderRequest('createOrderWs
|
153
|
+
request, params = self.orderRequest('createOrderWs', symbol, type, request, price, params)
|
154
154
|
return await self.watch(url, messageHash, self.extend(request, params), messageHash)
|
155
155
|
|
156
156
|
def handle_create_edit_order(self, client, message):
|
@@ -204,7 +204,7 @@ class kraken(ccxt.async_support.kraken):
|
|
204
204
|
'pair': market['wsId'],
|
205
205
|
'volume': self.amount_to_precision(symbol, amount),
|
206
206
|
}
|
207
|
-
request, params = self.orderRequest('editOrderWs
|
207
|
+
request, params = self.orderRequest('editOrderWs', symbol, type, request, price, params)
|
208
208
|
return await self.watch(url, messageHash, self.extend(request, params), messageHash)
|
209
209
|
|
210
210
|
async def cancel_orders_ws(self, ids: List[str], symbol: Str = None, params={}):
|
ccxt/woo.py
CHANGED
@@ -45,6 +45,7 @@ class woo(Exchange, ImplicitAPI):
|
|
45
45
|
'cancelWithdraw': False, # exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://kronosresearch.github.io/wootrade-documents/#cancel-withdraw-request
|
46
46
|
'closeAllPositions': False,
|
47
47
|
'closePosition': False,
|
48
|
+
'createConvertTrade': True,
|
48
49
|
'createDepositAddress': False,
|
49
50
|
'createMarketBuyOrderWithCost': True,
|
50
51
|
'createMarketOrder': False,
|
@@ -2823,6 +2824,35 @@ class woo(Exchange, ImplicitAPI):
|
|
2823
2824
|
toCurrency = self.currency(toCurrencyId)
|
2824
2825
|
return self.parse_conversion(data, fromCurrency, toCurrency)
|
2825
2826
|
|
2827
|
+
def create_convert_trade(self, id: str, fromCode: str, toCode: str, amount: Num = None, params={}) -> Conversion:
|
2828
|
+
"""
|
2829
|
+
convert from one currency to another
|
2830
|
+
:see: https://docs.woo.org/#send-quote-rft
|
2831
|
+
:param str id: the id of the trade that you want to make
|
2832
|
+
:param str fromCode: the currency that you want to sell and convert from
|
2833
|
+
:param str toCode: the currency that you want to buy and convert into
|
2834
|
+
:param float [amount]: how much you want to trade in units of the from currency
|
2835
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2836
|
+
:returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
|
2837
|
+
"""
|
2838
|
+
self.load_markets()
|
2839
|
+
request = {
|
2840
|
+
'quoteId': id,
|
2841
|
+
}
|
2842
|
+
response = self.v3PrivatePostConvertRft(self.extend(request, params))
|
2843
|
+
#
|
2844
|
+
# {
|
2845
|
+
# "success": True,
|
2846
|
+
# "data": {
|
2847
|
+
# "quoteId": 123123123,
|
2848
|
+
# "counterPartyId": "",
|
2849
|
+
# "rftAccepted": 1 # 1 -> success; 2 -> processing; 3 -> fail
|
2850
|
+
# }
|
2851
|
+
# }
|
2852
|
+
#
|
2853
|
+
data = self.safe_dict(response, 'data', {})
|
2854
|
+
return self.parse_conversion(data)
|
2855
|
+
|
2826
2856
|
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
2827
2857
|
#
|
2828
2858
|
# fetchConvertQuote
|
@@ -2839,6 +2869,14 @@ class woo(Exchange, ImplicitAPI):
|
|
2839
2869
|
# "message": 1659084466000
|
2840
2870
|
# }
|
2841
2871
|
#
|
2872
|
+
# createConvertTrade
|
2873
|
+
#
|
2874
|
+
# {
|
2875
|
+
# "quoteId": 123123123,
|
2876
|
+
# "counterPartyId": "",
|
2877
|
+
# "rftAccepted": 1 # 1 -> success; 2 -> processing; 3 -> fail
|
2878
|
+
# }
|
2879
|
+
#
|
2842
2880
|
timestamp = self.safe_integer(conversion, 'expireTimestamp')
|
2843
2881
|
fromCoin = self.safe_string(conversion, 'sellToken')
|
2844
2882
|
fromCode = self.safe_currency_code(fromCoin, fromCurrency)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.2
|
3
|
+
Version: 4.3.2
|
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.2
|
265
|
-
* unpkg: https://unpkg.com/ccxt@4.2
|
265
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.2/dist/ccxt.browser.js
|
266
|
+
* unpkg: https://unpkg.com/ccxt@4.3.2/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.2
|
271
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.2/dist/ccxt.browser.js"></script>
|
271
272
|
```
|
272
273
|
|
273
274
|
Creates a global `ccxt` object:
|