ccxt 4.1.91__py2.py3-none-any.whl → 4.1.95__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bybit.py +1 -0
- ccxt/abstract/coinbase.py +6 -0
- ccxt/abstract/coinone.py +63 -21
- ccxt/abstract/kucoinfutures.py +2 -0
- ccxt/abstract/okx.py +2 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +8 -4
- ccxt/async_support/binance.py +10 -9
- ccxt/async_support/bingx.py +8 -5
- ccxt/async_support/bitget.py +138 -92
- ccxt/async_support/bitrue.py +2 -9
- ccxt/async_support/bybit.py +1 -0
- ccxt/async_support/coinbase.py +42 -1
- ccxt/async_support/coinone.py +385 -137
- ccxt/async_support/hitbtc.py +38 -0
- ccxt/async_support/kucoinfutures.py +17 -4
- ccxt/async_support/okx.py +2 -0
- ccxt/base/exchange.py +2 -1
- ccxt/binance.py +10 -9
- ccxt/bingx.py +8 -5
- ccxt/bitget.py +138 -92
- ccxt/bitrue.py +2 -9
- ccxt/bybit.py +1 -0
- ccxt/coinbase.py +42 -1
- ccxt/coinone.py +385 -137
- ccxt/hitbtc.py +38 -0
- ccxt/kucoinfutures.py +17 -4
- ccxt/okx.py +2 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bingx.py +38 -4
- {ccxt-4.1.91.dist-info → ccxt-4.1.95.dist-info}/METADATA +4 -4
- {ccxt-4.1.91.dist-info → ccxt-4.1.95.dist-info}/RECORD +35 -35
- {ccxt-4.1.91.dist-info → ccxt-4.1.95.dist-info}/WHEEL +0 -0
- {ccxt-4.1.91.dist-info → ccxt-4.1.95.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/bybit.py
CHANGED
@@ -128,6 +128,7 @@ class ImplicitAPI:
|
|
128
128
|
private_get_v5_account_fee_rate = privateGetV5AccountFeeRate = Entry('v5/account/fee-rate', 'private', 'GET', {'cost': 10})
|
129
129
|
private_get_v5_account_info = privateGetV5AccountInfo = Entry('v5/account/info', 'private', 'GET', {'cost': 5})
|
130
130
|
private_get_v5_account_transaction_log = privateGetV5AccountTransactionLog = Entry('v5/account/transaction-log', 'private', 'GET', {'cost': 1})
|
131
|
+
private_get_v5_account_smp_group = privateGetV5AccountSmpGroup = Entry('v5/account/smp-group', 'private', 'GET', {'cost': 1})
|
131
132
|
private_get_v5_account_mmp_state = privateGetV5AccountMmpState = Entry('v5/account/mmp-state', 'private', 'GET', {'cost': 5})
|
132
133
|
private_get_v5_asset_exchange_order_record = privateGetV5AssetExchangeOrderRecord = Entry('v5/asset/exchange/order-record', 'private', 'GET', {'cost': 5})
|
133
134
|
private_get_v5_asset_delivery_record = privateGetV5AssetDeliveryRecord = Entry('v5/asset/delivery-record', 'private', 'GET', {'cost': 5})
|
ccxt/abstract/coinbase.py
CHANGED
@@ -55,6 +55,8 @@ class ImplicitAPI:
|
|
55
55
|
v3_private_get_brokerage_products_product_id = v3PrivateGetBrokerageProductsProductId = Entry('brokerage/products/{product_id}', ['v3', 'private'], 'GET', {})
|
56
56
|
v3_private_get_brokerage_products_product_id_candles = v3PrivateGetBrokerageProductsProductIdCandles = Entry('brokerage/products/{product_id}/candles', ['v3', 'private'], 'GET', {})
|
57
57
|
v3_private_get_brokerage_products_product_id_ticker = v3PrivateGetBrokerageProductsProductIdTicker = Entry('brokerage/products/{product_id}/ticker', ['v3', 'private'], 'GET', {})
|
58
|
+
v3_private_get_brokerage_portfolios = v3PrivateGetBrokeragePortfolios = Entry('brokerage/portfolios', ['v3', 'private'], 'GET', {})
|
59
|
+
v3_private_get_brokerage_portfolios_portfolio_uuid = v3PrivateGetBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'GET', {})
|
58
60
|
v3_private_get_brokerage_transaction_summary = v3PrivateGetBrokerageTransactionSummary = Entry('brokerage/transaction_summary', ['v3', 'private'], 'GET', {})
|
59
61
|
v3_private_get_brokerage_product_book = v3PrivateGetBrokerageProductBook = Entry('brokerage/product_book', ['v3', 'private'], 'GET', {})
|
60
62
|
v3_private_get_brokerage_best_bid_ask = v3PrivateGetBrokerageBestBidAsk = Entry('brokerage/best_bid_ask', ['v3', 'private'], 'GET', {})
|
@@ -64,5 +66,9 @@ class ImplicitAPI:
|
|
64
66
|
v3_private_post_brokerage_orders_batch_cancel = v3PrivatePostBrokerageOrdersBatchCancel = Entry('brokerage/orders/batch_cancel', ['v3', 'private'], 'POST', {})
|
65
67
|
v3_private_post_brokerage_orders_edit = v3PrivatePostBrokerageOrdersEdit = Entry('brokerage/orders/edit', ['v3', 'private'], 'POST', {})
|
66
68
|
v3_private_post_brokerage_orders_edit_preview = v3PrivatePostBrokerageOrdersEditPreview = Entry('brokerage/orders/edit_preview', ['v3', 'private'], 'POST', {})
|
69
|
+
v3_private_post_brokerage_portfolios = v3PrivatePostBrokeragePortfolios = Entry('brokerage/portfolios', ['v3', 'private'], 'POST', {})
|
70
|
+
v3_private_post_brokerage_portfolios_move_funds = v3PrivatePostBrokeragePortfoliosMoveFunds = Entry('brokerage/portfolios/move_funds', ['v3', 'private'], 'POST', {})
|
67
71
|
v3_private_post_brokerage_convert_quote = v3PrivatePostBrokerageConvertQuote = Entry('brokerage/convert/quote', ['v3', 'private'], 'POST', {})
|
68
72
|
v3_private_post_brokerage_convert_trade_trade_id = v3PrivatePostBrokerageConvertTradeTradeId = Entry('brokerage/convert/trade/{trade_id}', ['v3', 'private'], 'POST', {})
|
73
|
+
v3_private_put_brokerage_portfolios_portfolio_uuid = v3PrivatePutBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'PUT', {})
|
74
|
+
v3_private_delete_brokerage_portfolios_portfolio_uuid = v3PrivateDeleteBrokeragePortfoliosPortfolioUuid = Entry('brokerage/portfolios/{portfolio_uuid}', ['v3', 'private'], 'DELETE', {})
|
ccxt/abstract/coinone.py
CHANGED
@@ -2,24 +2,66 @@ from ccxt.base.types import Entry
|
|
2
2
|
|
3
3
|
|
4
4
|
class ImplicitAPI:
|
5
|
-
public_get_orderbook = publicGetOrderbook = Entry('orderbook
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
5
|
+
public_get_orderbook = publicGetOrderbook = Entry('orderbook', 'public', 'GET', {})
|
6
|
+
public_get_ticker = publicGetTicker = Entry('ticker', 'public', 'GET', {})
|
7
|
+
public_get_ticker_utc = publicGetTickerUtc = Entry('ticker_utc', 'public', 'GET', {})
|
8
|
+
public_get_trades = publicGetTrades = Entry('trades', 'public', 'GET', {})
|
9
|
+
v2public_get_range_units = v2PublicGetRangeUnits = Entry('range_units', 'v2Public', 'GET', {})
|
10
|
+
v2public_get_markets_quote_currency = v2PublicGetMarketsQuoteCurrency = Entry('markets/{quote_currency}', 'v2Public', 'GET', {})
|
11
|
+
v2public_get_markets_quote_currency_target_currency = v2PublicGetMarketsQuoteCurrencyTargetCurrency = Entry('markets/{quote_currency}/{target_currency}', 'v2Public', 'GET', {})
|
12
|
+
v2public_get_orderbook_quote_currency_target_currency = v2PublicGetOrderbookQuoteCurrencyTargetCurrency = Entry('orderbook/{quote_currency}/{target_currency}', 'v2Public', 'GET', {})
|
13
|
+
v2public_get_trades_quote_currency_target_currency = v2PublicGetTradesQuoteCurrencyTargetCurrency = Entry('trades/{quote_currency}/{target_currency}', 'v2Public', 'GET', {})
|
14
|
+
v2public_get_ticker_new_quote_currency = v2PublicGetTickerNewQuoteCurrency = Entry('ticker_new/{quote_currency}', 'v2Public', 'GET', {})
|
15
|
+
v2public_get_ticker_new_quote_currency_target_currency = v2PublicGetTickerNewQuoteCurrencyTargetCurrency = Entry('ticker_new/{quote_currency}/{target_currency}', 'v2Public', 'GET', {})
|
16
|
+
v2public_get_ticker_utc_new_quote_currency = v2PublicGetTickerUtcNewQuoteCurrency = Entry('ticker_utc_new/{quote_currency}', 'v2Public', 'GET', {})
|
17
|
+
v2public_get_ticker_utc_new_quote_currency_target_currency = v2PublicGetTickerUtcNewQuoteCurrencyTargetCurrency = Entry('ticker_utc_new/{quote_currency}/{target_currency}', 'v2Public', 'GET', {})
|
18
|
+
v2public_get_currencies = v2PublicGetCurrencies = Entry('currencies', 'v2Public', 'GET', {})
|
19
|
+
v2public_get_currencies_currency = v2PublicGetCurrenciesCurrency = Entry('currencies/{currency}', 'v2Public', 'GET', {})
|
20
|
+
v2public_get_chart_quote_currency_target_currency = v2PublicGetChartQuoteCurrencyTargetCurrency = Entry('chart/{quote_currency}/{target_currency}', 'v2Public', 'GET', {})
|
21
|
+
private_post_account_deposit_address = privatePostAccountDepositAddress = Entry('account/deposit_address', 'private', 'POST', {})
|
22
|
+
private_post_account_btc_deposit_address = privatePostAccountBtcDepositAddress = Entry('account/btc_deposit_address', 'private', 'POST', {})
|
23
|
+
private_post_account_balance = privatePostAccountBalance = Entry('account/balance', 'private', 'POST', {})
|
24
|
+
private_post_account_daily_balance = privatePostAccountDailyBalance = Entry('account/daily_balance', 'private', 'POST', {})
|
25
|
+
private_post_account_user_info = privatePostAccountUserInfo = Entry('account/user_info', 'private', 'POST', {})
|
26
|
+
private_post_account_virtual_account = privatePostAccountVirtualAccount = Entry('account/virtual_account', 'private', 'POST', {})
|
27
|
+
private_post_order_cancel_all = privatePostOrderCancelAll = Entry('order/cancel_all', 'private', 'POST', {})
|
28
|
+
private_post_order_cancel = privatePostOrderCancel = Entry('order/cancel', 'private', 'POST', {})
|
29
|
+
private_post_order_limit_buy = privatePostOrderLimitBuy = Entry('order/limit_buy', 'private', 'POST', {})
|
30
|
+
private_post_order_limit_sell = privatePostOrderLimitSell = Entry('order/limit_sell', 'private', 'POST', {})
|
31
|
+
private_post_order_complete_orders = privatePostOrderCompleteOrders = Entry('order/complete_orders', 'private', 'POST', {})
|
32
|
+
private_post_order_limit_orders = privatePostOrderLimitOrders = Entry('order/limit_orders', 'private', 'POST', {})
|
33
|
+
private_post_order_order_info = privatePostOrderOrderInfo = Entry('order/order_info', 'private', 'POST', {})
|
34
|
+
private_post_transaction_auth_number = privatePostTransactionAuthNumber = Entry('transaction/auth_number', 'private', 'POST', {})
|
35
|
+
private_post_transaction_history = privatePostTransactionHistory = Entry('transaction/history', 'private', 'POST', {})
|
36
|
+
private_post_transaction_krw_history = privatePostTransactionKrwHistory = Entry('transaction/krw/history', 'private', 'POST', {})
|
37
|
+
private_post_transaction_btc = privatePostTransactionBtc = Entry('transaction/btc', 'private', 'POST', {})
|
38
|
+
private_post_transaction_coin = privatePostTransactionCoin = Entry('transaction/coin', 'private', 'POST', {})
|
39
|
+
v2private_post_account_balance = v2PrivatePostAccountBalance = Entry('account/balance', 'v2Private', 'POST', {})
|
40
|
+
v2private_post_account_deposit_address = v2PrivatePostAccountDepositAddress = Entry('account/deposit_address', 'v2Private', 'POST', {})
|
41
|
+
v2private_post_account_user_info = v2PrivatePostAccountUserInfo = Entry('account/user_info', 'v2Private', 'POST', {})
|
42
|
+
v2private_post_account_virtual_account = v2PrivatePostAccountVirtualAccount = Entry('account/virtual_account', 'v2Private', 'POST', {})
|
43
|
+
v2private_post_order_cancel = v2PrivatePostOrderCancel = Entry('order/cancel', 'v2Private', 'POST', {})
|
44
|
+
v2private_post_order_limit_buy = v2PrivatePostOrderLimitBuy = Entry('order/limit_buy', 'v2Private', 'POST', {})
|
45
|
+
v2private_post_order_limit_sell = v2PrivatePostOrderLimitSell = Entry('order/limit_sell', 'v2Private', 'POST', {})
|
46
|
+
v2private_post_order_limit_orders = v2PrivatePostOrderLimitOrders = Entry('order/limit_orders', 'v2Private', 'POST', {})
|
47
|
+
v2private_post_order_complete_orders = v2PrivatePostOrderCompleteOrders = Entry('order/complete_orders', 'v2Private', 'POST', {})
|
48
|
+
v2private_post_order_query_order = v2PrivatePostOrderQueryOrder = Entry('order/query_order', 'v2Private', 'POST', {})
|
49
|
+
v2private_post_transaction_auth_number = v2PrivatePostTransactionAuthNumber = Entry('transaction/auth_number', 'v2Private', 'POST', {})
|
50
|
+
v2private_post_transaction_btc = v2PrivatePostTransactionBtc = Entry('transaction/btc', 'v2Private', 'POST', {})
|
51
|
+
v2private_post_transaction_history = v2PrivatePostTransactionHistory = Entry('transaction/history', 'v2Private', 'POST', {})
|
52
|
+
v2private_post_transaction_krw_history = v2PrivatePostTransactionKrwHistory = Entry('transaction/krw/history', 'v2Private', 'POST', {})
|
53
|
+
v2_1private_post_account_balance_all = v2_1PrivatePostAccountBalanceAll = Entry('account/balance/all', 'v2_1Private', 'POST', {})
|
54
|
+
v2_1private_post_account_balance = v2_1PrivatePostAccountBalance = Entry('account/balance', 'v2_1Private', 'POST', {})
|
55
|
+
v2_1private_post_account_trade_fee = v2_1PrivatePostAccountTradeFee = Entry('account/trade_fee', 'v2_1Private', 'POST', {})
|
56
|
+
v2_1private_post_account_trade_fee_quote_currency_target_currency = v2_1PrivatePostAccountTradeFeeQuoteCurrencyTargetCurrency = Entry('account/trade_fee/{quote_currency}/{target_currency}', 'v2_1Private', 'POST', {})
|
57
|
+
v2_1private_post_order_limit = v2_1PrivatePostOrderLimit = Entry('order/limit', 'v2_1Private', 'POST', {})
|
58
|
+
v2_1private_post_order_cancel = v2_1PrivatePostOrderCancel = Entry('order/cancel', 'v2_1Private', 'POST', {})
|
59
|
+
v2_1private_post_order_cancel_all = v2_1PrivatePostOrderCancelAll = Entry('order/cancel/all', 'v2_1Private', 'POST', {})
|
60
|
+
v2_1private_post_order_open_orders = v2_1PrivatePostOrderOpenOrders = Entry('order/open_orders', 'v2_1Private', 'POST', {})
|
61
|
+
v2_1private_post_order_open_orders_all = v2_1PrivatePostOrderOpenOrdersAll = Entry('order/open_orders/all', 'v2_1Private', 'POST', {})
|
62
|
+
v2_1private_post_order_complete_orders = v2_1PrivatePostOrderCompleteOrders = Entry('order/complete_orders', 'v2_1Private', 'POST', {})
|
63
|
+
v2_1private_post_order_complete_orders_all = v2_1PrivatePostOrderCompleteOrdersAll = Entry('order/complete_orders/all', 'v2_1Private', 'POST', {})
|
64
|
+
v2_1private_post_order_info = v2_1PrivatePostOrderInfo = Entry('order/info', 'v2_1Private', 'POST', {})
|
65
|
+
v2_1private_post_transaction_krw_history = v2_1PrivatePostTransactionKrwHistory = Entry('transaction/krw/history', 'v2_1Private', 'POST', {})
|
66
|
+
v2_1private_post_transaction_coin_history = v2_1PrivatePostTransactionCoinHistory = Entry('transaction/coin/history', 'v2_1Private', 'POST', {})
|
67
|
+
v2_1private_post_transaction_coin_withdrawal_limit = v2_1PrivatePostTransactionCoinWithdrawalLimit = Entry('transaction/coin/withdrawal/limit', 'v2_1Private', 'POST', {})
|
ccxt/abstract/kucoinfutures.py
CHANGED
@@ -168,6 +168,7 @@ class ImplicitAPI:
|
|
168
168
|
futuresprivate_get_withdrawals_quotas = futuresPrivateGetWithdrawalsQuotas = Entry('withdrawals/quotas', 'futuresPrivate', 'GET', {'cost': 1})
|
169
169
|
futuresprivate_get_withdrawal_list = futuresPrivateGetWithdrawalList = Entry('withdrawal-list', 'futuresPrivate', 'GET', {'cost': 1})
|
170
170
|
futuresprivate_get_sub_api_key = futuresPrivateGetSubApiKey = Entry('sub/api-key', 'futuresPrivate', 'GET', {'cost': 1})
|
171
|
+
futuresprivate_get_trade_statistics = futuresPrivateGetTradeStatistics = Entry('trade-statistics', 'futuresPrivate', 'GET', {'cost': 1})
|
171
172
|
futuresprivate_post_transfer_out = futuresPrivatePostTransferOut = Entry('transfer-out', 'futuresPrivate', 'POST', {'cost': 1})
|
172
173
|
futuresprivate_post_transfer_in = futuresPrivatePostTransferIn = Entry('transfer-in', 'futuresPrivate', 'POST', {'cost': 1})
|
173
174
|
futuresprivate_post_orders = futuresPrivatePostOrders = Entry('orders', 'futuresPrivate', 'POST', {'cost': 1.33})
|
@@ -185,5 +186,6 @@ class ImplicitAPI:
|
|
185
186
|
futuresprivate_delete_withdrawals_withdrawalid = futuresPrivateDeleteWithdrawalsWithdrawalId = Entry('withdrawals/{withdrawalId}', 'futuresPrivate', 'DELETE', {'cost': 1})
|
186
187
|
futuresprivate_delete_cancel_transfer_out = futuresPrivateDeleteCancelTransferOut = Entry('cancel/transfer-out', 'futuresPrivate', 'DELETE', {'cost': 1})
|
187
188
|
futuresprivate_delete_sub_api_key = futuresPrivateDeleteSubApiKey = Entry('sub/api-key', 'futuresPrivate', 'DELETE', {'cost': 1})
|
189
|
+
futuresprivate_delete_orders_client_order_clientoid = futuresPrivateDeleteOrdersClientOrderClientOid = Entry('orders/client-order/{clientOid}', 'futuresPrivate', 'DELETE', {'cost': 1})
|
188
190
|
webexchange_get_currency_currency_chain_info = webExchangeGetCurrencyCurrencyChainInfo = Entry('currency/currency/chain-info', 'webExchange', 'GET', {'cost': 1})
|
189
191
|
webexchange_get_contract_symbol_funding_rates = webExchangeGetContractSymbolFundingRates = Entry('contract/{symbol}/funding-rates', 'webExchange', 'GET', {'cost': 1})
|
ccxt/abstract/okx.py
CHANGED
@@ -74,6 +74,7 @@ class ImplicitAPI:
|
|
74
74
|
public_get_copytrading_public_subpositions_history = publicGetCopytradingPublicSubpositionsHistory = Entry('copytrading/public-subpositions-history', 'public', 'GET', {'cost': 4})
|
75
75
|
private_get_rfq_counterparties = privateGetRfqCounterparties = Entry('rfq/counterparties', 'private', 'GET', {'cost': 4})
|
76
76
|
private_get_rfq_maker_instrument_settings = privateGetRfqMakerInstrumentSettings = Entry('rfq/maker-instrument-settings', 'private', 'GET', {'cost': 4})
|
77
|
+
private_get_rfq_mmp_config = privateGetRfqMmpConfig = Entry('rfq/mmp-config', 'private', 'GET', {'cost': 4})
|
77
78
|
private_get_rfq_rfqs = privateGetRfqRfqs = Entry('rfq/rfqs', 'private', 'GET', {'cost': 10})
|
78
79
|
private_get_rfq_quotes = privateGetRfqQuotes = Entry('rfq/quotes', 'private', 'GET', {'cost': 10})
|
79
80
|
private_get_rfq_trades = privateGetRfqTrades = Entry('rfq/trades', 'private', 'GET', {'cost': 4})
|
@@ -199,6 +200,7 @@ class ImplicitAPI:
|
|
199
200
|
private_post_rfq_execute_quote = privatePostRfqExecuteQuote = Entry('rfq/execute-quote', 'private', 'POST', {'cost': 15})
|
200
201
|
private_post_rfq_maker_instrument_settings = privatePostRfqMakerInstrumentSettings = Entry('rfq/maker-instrument-settings', 'private', 'POST', {'cost': 4})
|
201
202
|
private_post_rfq_mmp_reset = privatePostRfqMmpReset = Entry('rfq/mmp-reset', 'private', 'POST', {'cost': 4})
|
203
|
+
private_post_rfq_mmp_config = privatePostRfqMmpConfig = Entry('rfq/mmp-config', 'private', 'POST', {'cost': 100})
|
202
204
|
private_post_rfq_create_quote = privatePostRfqCreateQuote = Entry('rfq/create-quote', 'private', 'POST', {'cost': 0.4})
|
203
205
|
private_post_rfq_cancel_quote = privatePostRfqCancelQuote = Entry('rfq/cancel-quote', 'private', 'POST', {'cost': 0.4})
|
204
206
|
private_post_rfq_cancel_batch_quotes = privatePostRfqCancelBatchQuotes = Entry('rfq/cancel-batch-quotes', 'private', 'POST', {'cost': 10})
|
ccxt/async_support/__init__.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.1.
|
5
|
+
__version__ = '4.1.95'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -120,6 +120,9 @@ class Exchange(BaseExchange):
|
|
120
120
|
if self.own_session:
|
121
121
|
await self.session.close()
|
122
122
|
self.session = None
|
123
|
+
if self.socks_proxy_session is not None:
|
124
|
+
await self.socks_proxy_session.close()
|
125
|
+
self.socks_proxy_session = None
|
123
126
|
|
124
127
|
async def fetch(self, url, method='GET', headers=None, body=None):
|
125
128
|
"""Perform a HTTP request and return decoded JSON data"""
|
@@ -134,7 +137,7 @@ class Exchange(BaseExchange):
|
|
134
137
|
url = proxyUrl + url
|
135
138
|
# proxy agents
|
136
139
|
final_proxy = None # set default
|
137
|
-
|
140
|
+
self.socks_proxy_session = None
|
138
141
|
httpProxy, httpsProxy, socksProxy = self.check_proxy_settings(url, method, headers, body)
|
139
142
|
if httpProxy:
|
140
143
|
final_proxy = httpProxy
|
@@ -154,7 +157,7 @@ class Exchange(BaseExchange):
|
|
154
157
|
enable_cleanup_closed=True
|
155
158
|
)
|
156
159
|
# override session
|
157
|
-
|
160
|
+
self.socks_proxy_session = aiohttp.ClientSession(loop=self.asyncio_loop, connector=connector, trust_env=self.aiohttp_trust_env)
|
158
161
|
# add aiohttp_proxy for python as exclusion
|
159
162
|
elif self.aiohttp_proxy:
|
160
163
|
final_proxy = self.aiohttp_proxy
|
@@ -175,7 +178,8 @@ class Exchange(BaseExchange):
|
|
175
178
|
request_body = body
|
176
179
|
encoded_body = body.encode() if body else None
|
177
180
|
self.open()
|
178
|
-
|
181
|
+
final_session = self.socks_proxy_session if self.socks_proxy_session is not None else self.session
|
182
|
+
session_method = getattr(final_session, method.lower())
|
179
183
|
|
180
184
|
http_response = None
|
181
185
|
http_status_code = None
|
ccxt/async_support/binance.py
CHANGED
@@ -3036,7 +3036,7 @@ class binance(Exchange, ImplicitAPI):
|
|
3036
3036
|
:see: https://binance-docs.github.io/apidocs/futures/en/#24hr-ticker-price-change-statistics # swap
|
3037
3037
|
:see: https://binance-docs.github.io/apidocs/delivery/en/#24hr-ticker-price-change-statistics # future
|
3038
3038
|
:see: https://binance-docs.github.io/apidocs/voptions/en/#24hr-ticker-price-change-statistics # option
|
3039
|
-
:param str[]
|
3039
|
+
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
3040
3040
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3041
3041
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
3042
3042
|
"""
|
@@ -3050,18 +3050,19 @@ class binance(Exchange, ImplicitAPI):
|
|
3050
3050
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
3051
3051
|
subType = None
|
3052
3052
|
subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
|
3053
|
-
|
3054
|
-
defaultMethod = None
|
3053
|
+
response = None
|
3055
3054
|
if type == 'option':
|
3056
|
-
|
3055
|
+
response = await self.eapiPublicGetTicker(params)
|
3057
3056
|
elif self.is_linear(type, subType):
|
3058
|
-
|
3057
|
+
response = await self.fapiPublicGetTicker24hr(params)
|
3059
3058
|
elif self.is_inverse(type, subType):
|
3060
|
-
|
3059
|
+
response = await self.dapiPublicGetTicker24hr(params)
|
3061
3060
|
else:
|
3062
|
-
|
3063
|
-
|
3064
|
-
|
3061
|
+
request = {}
|
3062
|
+
if symbols is not None:
|
3063
|
+
marketIds = self.market_ids(symbols)
|
3064
|
+
request['symbols'] = self.json(marketIds)
|
3065
|
+
response = await self.publicGetTicker24hr(self.extend(request, params))
|
3065
3066
|
return self.parse_tickers(response, symbols)
|
3066
3067
|
|
3067
3068
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
ccxt/async_support/bingx.py
CHANGED
@@ -877,14 +877,17 @@ class bingx(Exchange, ImplicitAPI):
|
|
877
877
|
type = 'spot' if (cost is None) else 'swap'
|
878
878
|
currencyId = self.safe_string_2(trade, 'currency', 'N')
|
879
879
|
currencyCode = self.safe_currency_code(currencyId)
|
880
|
-
m = self.safe_value(trade, 'm'
|
880
|
+
m = self.safe_value(trade, 'm')
|
881
881
|
marketId = self.safe_string(trade, 's')
|
882
882
|
isBuyerMaker = self.safe_value_2(trade, 'buyerMaker', 'isBuyerMaker')
|
883
|
-
takeOrMaker =
|
883
|
+
takeOrMaker = None
|
884
|
+
if (isBuyerMaker is not None) or (m is not None):
|
885
|
+
takeOrMaker = 'maker' if (isBuyerMaker or m) else 'taker'
|
884
886
|
side = self.safe_string_lower_2(trade, 'side', 'S')
|
885
887
|
if side is None:
|
886
|
-
|
887
|
-
|
888
|
+
if (isBuyerMaker is not None) or (m is not None):
|
889
|
+
side = 'sell' if (isBuyerMaker or m) else 'buy'
|
890
|
+
takeOrMaker = 'taker'
|
888
891
|
return self.safe_trade({
|
889
892
|
'id': self.safe_string_n(trade, ['id', 't']),
|
890
893
|
'info': trade,
|
@@ -896,7 +899,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
896
899
|
'side': self.parse_order_side(side),
|
897
900
|
'takerOrMaker': takeOrMaker,
|
898
901
|
'price': self.safe_string_2(trade, 'price', 'p'),
|
899
|
-
'amount': self.safe_string_n(trade, ['qty', 'amount', 'q']),
|
902
|
+
'amount': self.safe_string_n(trade, ['qty', 'volume', 'amount', 'q']),
|
900
903
|
'cost': cost,
|
901
904
|
'fee': {
|
902
905
|
'cost': self.parse_number(Precise.string_abs(self.safe_string_2(trade, 'commission', 'n'))),
|