ccxt 4.4.20__py2.py3-none-any.whl → 4.4.22__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/bitflyer.py +1 -0
- ccxt/abstract/bitget.py +3 -0
- ccxt/abstract/bybit.py +1 -0
- ccxt/abstract/cex.py +28 -29
- ccxt/abstract/gate.py +5 -0
- ccxt/abstract/gateio.py +5 -0
- ccxt/abstract/kucoin.py +2 -0
- ccxt/abstract/kucoinfutures.py +2 -0
- ccxt/abstract/okx.py +4 -0
- ccxt/alpaca.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +1 -0
- ccxt/async_support/base/exchange.py +7 -1
- ccxt/async_support/bigone.py +3 -0
- ccxt/async_support/binance.py +96 -10
- ccxt/async_support/bingx.py +5 -1
- ccxt/async_support/bitflyer.py +56 -1
- ccxt/async_support/bitget.py +73 -1
- ccxt/async_support/bybit.py +135 -4
- ccxt/async_support/cex.py +1247 -1326
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/gate.py +97 -2
- ccxt/async_support/htx.py +27 -7
- ccxt/async_support/hyperliquid.py +15 -12
- ccxt/async_support/kucoin.py +42 -88
- ccxt/async_support/kucoinfutures.py +2 -2
- ccxt/async_support/okx.py +76 -10
- ccxt/base/exchange.py +33 -1
- ccxt/base/types.py +9 -0
- ccxt/bigone.py +3 -0
- ccxt/binance.py +96 -10
- ccxt/bingx.py +5 -1
- ccxt/bitflyer.py +56 -1
- ccxt/bitget.py +73 -1
- ccxt/bybit.py +135 -4
- ccxt/cex.py +1246 -1326
- ccxt/cryptocom.py +1 -1
- ccxt/gate.py +97 -2
- ccxt/htx.py +27 -7
- ccxt/hyperliquid.py +15 -12
- ccxt/kucoin.py +42 -88
- ccxt/kucoinfutures.py +2 -2
- ccxt/okx.py +76 -10
- ccxt/pro/__init__.py +1 -1
- ccxt/test/tests_async.py +4 -4
- ccxt/test/tests_sync.py +4 -4
- {ccxt-4.4.20.dist-info → ccxt-4.4.22.dist-info}/METADATA +5 -5
- {ccxt-4.4.20.dist-info → ccxt-4.4.22.dist-info}/RECORD +52 -52
- {ccxt-4.4.20.dist-info → ccxt-4.4.22.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.20.dist-info → ccxt-4.4.22.dist-info}/WHEEL +0 -0
- {ccxt-4.4.20.dist-info → ccxt-4.4.22.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/bitflyer.py
CHANGED
@@ -11,6 +11,7 @@ class ImplicitAPI:
|
|
11
11
|
public_get_gethealth = publicGetGethealth = Entry('gethealth', 'public', 'GET', {})
|
12
12
|
public_get_getboardstate = publicGetGetboardstate = Entry('getboardstate', 'public', 'GET', {})
|
13
13
|
public_get_getchats = publicGetGetchats = Entry('getchats', 'public', 'GET', {})
|
14
|
+
public_get_getfundingrate = publicGetGetfundingrate = Entry('getfundingrate', 'public', 'GET', {})
|
14
15
|
private_get_getpermissions = privateGetGetpermissions = Entry('getpermissions', 'private', 'GET', {})
|
15
16
|
private_get_getbalance = privateGetGetbalance = Entry('getbalance', 'private', 'GET', {})
|
16
17
|
private_get_getbalancehistory = privateGetGetbalancehistory = Entry('getbalancehistory', 'private', 'GET', {})
|
ccxt/abstract/bitget.py
CHANGED
@@ -68,12 +68,14 @@ class ImplicitAPI:
|
|
68
68
|
public_mix_get_v2_mix_market_current_fund_rate = publicMixGetV2MixMarketCurrentFundRate = Entry('v2/mix/market/current-fund-rate', ['public', 'mix'], 'GET', {'cost': 1})
|
69
69
|
public_mix_get_v2_mix_market_contracts = publicMixGetV2MixMarketContracts = Entry('v2/mix/market/contracts', ['public', 'mix'], 'GET', {'cost': 1})
|
70
70
|
public_mix_get_v2_mix_market_query_position_lever = publicMixGetV2MixMarketQueryPositionLever = Entry('v2/mix/market/query-position-lever', ['public', 'mix'], 'GET', {'cost': 2})
|
71
|
+
public_mix_get_v2_mix_market_account_long_short = publicMixGetV2MixMarketAccountLongShort = Entry('v2/mix/market/account-long-short', ['public', 'mix'], 'GET', {'cost': 20})
|
71
72
|
public_margin_get_margin_v1_cross_public_interestrateandlimit = publicMarginGetMarginV1CrossPublicInterestRateAndLimit = Entry('margin/v1/cross/public/interestRateAndLimit', ['public', 'margin'], 'GET', {'cost': 2})
|
72
73
|
public_margin_get_margin_v1_isolated_public_interestrateandlimit = publicMarginGetMarginV1IsolatedPublicInterestRateAndLimit = Entry('margin/v1/isolated/public/interestRateAndLimit', ['public', 'margin'], 'GET', {'cost': 2})
|
73
74
|
public_margin_get_margin_v1_cross_public_tierdata = publicMarginGetMarginV1CrossPublicTierData = Entry('margin/v1/cross/public/tierData', ['public', 'margin'], 'GET', {'cost': 2})
|
74
75
|
public_margin_get_margin_v1_isolated_public_tierdata = publicMarginGetMarginV1IsolatedPublicTierData = Entry('margin/v1/isolated/public/tierData', ['public', 'margin'], 'GET', {'cost': 2})
|
75
76
|
public_margin_get_margin_v1_public_currencies = publicMarginGetMarginV1PublicCurrencies = Entry('margin/v1/public/currencies', ['public', 'margin'], 'GET', {'cost': 1})
|
76
77
|
public_margin_get_v2_margin_currencies = publicMarginGetV2MarginCurrencies = Entry('v2/margin/currencies', ['public', 'margin'], 'GET', {'cost': 2})
|
78
|
+
public_margin_get_v2_margin_market_long_short_ratio = publicMarginGetV2MarginMarketLongShortRatio = Entry('v2/margin/market/long-short-ratio', ['public', 'margin'], 'GET', {'cost': 20})
|
77
79
|
public_earn_get_v2_earn_loan_public_coininfos = publicEarnGetV2EarnLoanPublicCoinInfos = Entry('v2/earn/loan/public/coinInfos', ['public', 'earn'], 'GET', {'cost': 2})
|
78
80
|
public_earn_get_v2_earn_loan_public_hour_interest = publicEarnGetV2EarnLoanPublicHourInterest = Entry('v2/earn/loan/public/hour-interest', ['public', 'earn'], 'GET', {'cost': 2})
|
79
81
|
private_spot_get_spot_v1_wallet_deposit_address = privateSpotGetSpotV1WalletDepositAddress = Entry('spot/v1/wallet/deposit-address', ['private', 'spot'], 'GET', {'cost': 4})
|
@@ -220,6 +222,7 @@ class ImplicitAPI:
|
|
220
222
|
private_mix_get_v2_mix_order_orders_history = privateMixGetV2MixOrderOrdersHistory = Entry('v2/mix/order/orders-history', ['private', 'mix'], 'GET', {'cost': 2})
|
221
223
|
private_mix_get_v2_mix_order_orders_plan_pending = privateMixGetV2MixOrderOrdersPlanPending = Entry('v2/mix/order/orders-plan-pending', ['private', 'mix'], 'GET', {'cost': 2})
|
222
224
|
private_mix_get_v2_mix_order_orders_plan_history = privateMixGetV2MixOrderOrdersPlanHistory = Entry('v2/mix/order/orders-plan-history', ['private', 'mix'], 'GET', {'cost': 2})
|
225
|
+
private_mix_get_v2_mix_market_position_long_short = privateMixGetV2MixMarketPositionLongShort = Entry('v2/mix/market/position-long-short', ['private', 'mix'], 'GET', {'cost': 20})
|
223
226
|
private_mix_post_mix_v1_account_sub_account_contract_assets = privateMixPostMixV1AccountSubAccountContractAssets = Entry('mix/v1/account/sub-account-contract-assets', ['private', 'mix'], 'POST', {'cost': 200})
|
224
227
|
private_mix_post_mix_v1_account_open_count = privateMixPostMixV1AccountOpenCount = Entry('mix/v1/account/open-count', ['private', 'mix'], 'POST', {'cost': 1})
|
225
228
|
private_mix_post_mix_v1_account_setleverage = privateMixPostMixV1AccountSetLeverage = Entry('mix/v1/account/setLeverage', ['private', 'mix'], 'POST', {'cost': 4})
|
ccxt/abstract/bybit.py
CHANGED
@@ -163,6 +163,7 @@ class ImplicitAPI:
|
|
163
163
|
private_get_v5_user_del_submember = privateGetV5UserDelSubmember = Entry('v5/user/del-submember', 'private', 'GET', {'cost': 5})
|
164
164
|
private_get_v5_user_submembers = privateGetV5UserSubmembers = Entry('v5/user/submembers', 'private', 'GET', {'cost': 5})
|
165
165
|
private_get_v5_spot_lever_token_order_record = privateGetV5SpotLeverTokenOrderRecord = Entry('v5/spot-lever-token/order-record', 'private', 'GET', {'cost': 1})
|
166
|
+
private_get_v5_spot_margin_trade_interest_rate_history = privateGetV5SpotMarginTradeInterestRateHistory = Entry('v5/spot-margin-trade/interest-rate-history', 'private', 'GET', {'cost': 5})
|
166
167
|
private_get_v5_spot_margin_trade_state = privateGetV5SpotMarginTradeState = Entry('v5/spot-margin-trade/state', 'private', 'GET', {'cost': 5})
|
167
168
|
private_get_v5_spot_cross_margin_trade_loan_info = privateGetV5SpotCrossMarginTradeLoanInfo = Entry('v5/spot-cross-margin-trade/loan-info', 'private', 'GET', {'cost': 1})
|
168
169
|
private_get_v5_spot_cross_margin_trade_account = privateGetV5SpotCrossMarginTradeAccount = Entry('v5/spot-cross-margin-trade/account', 'private', 'GET', {'cost': 1})
|
ccxt/abstract/cex.py
CHANGED
@@ -2,32 +2,31 @@ from ccxt.base.types import Entry
|
|
2
2
|
|
3
3
|
|
4
4
|
class ImplicitAPI:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
private_post_raw_tx_history = privatePostRawTxHistory = Entry('raw_tx_history', 'private', 'POST', {})
|
5
|
+
public_post_get_server_time = publicPostGetServerTime = Entry('get_server_time', 'public', 'POST', {'cost': 1})
|
6
|
+
public_post_get_pairs_info = publicPostGetPairsInfo = Entry('get_pairs_info', 'public', 'POST', {'cost': 1})
|
7
|
+
public_post_get_currencies_info = publicPostGetCurrenciesInfo = Entry('get_currencies_info', 'public', 'POST', {'cost': 1})
|
8
|
+
public_post_get_processing_info = publicPostGetProcessingInfo = Entry('get_processing_info', 'public', 'POST', {'cost': 10})
|
9
|
+
public_post_get_ticker = publicPostGetTicker = Entry('get_ticker', 'public', 'POST', {'cost': 1})
|
10
|
+
public_post_get_trade_history = publicPostGetTradeHistory = Entry('get_trade_history', 'public', 'POST', {'cost': 1})
|
11
|
+
public_post_get_order_book = publicPostGetOrderBook = Entry('get_order_book', 'public', 'POST', {'cost': 1})
|
12
|
+
public_post_get_candles = publicPostGetCandles = Entry('get_candles', 'public', 'POST', {'cost': 1})
|
13
|
+
private_post_get_my_current_fee = privatePostGetMyCurrentFee = Entry('get_my_current_fee', 'private', 'POST', {'cost': 5})
|
14
|
+
private_post_get_fee_strategy = privatePostGetFeeStrategy = Entry('get_fee_strategy', 'private', 'POST', {'cost': 1})
|
15
|
+
private_post_get_my_volume = privatePostGetMyVolume = Entry('get_my_volume', 'private', 'POST', {'cost': 5})
|
16
|
+
private_post_do_create_account = privatePostDoCreateAccount = Entry('do_create_account', 'private', 'POST', {'cost': 1})
|
17
|
+
private_post_get_my_account_status_v3 = privatePostGetMyAccountStatusV3 = Entry('get_my_account_status_v3', 'private', 'POST', {'cost': 5})
|
18
|
+
private_post_get_my_wallet_balance = privatePostGetMyWalletBalance = Entry('get_my_wallet_balance', 'private', 'POST', {'cost': 5})
|
19
|
+
private_post_get_my_orders = privatePostGetMyOrders = Entry('get_my_orders', 'private', 'POST', {'cost': 5})
|
20
|
+
private_post_do_my_new_order = privatePostDoMyNewOrder = Entry('do_my_new_order', 'private', 'POST', {'cost': 1})
|
21
|
+
private_post_do_cancel_my_order = privatePostDoCancelMyOrder = Entry('do_cancel_my_order', 'private', 'POST', {'cost': 1})
|
22
|
+
private_post_do_cancel_all_orders = privatePostDoCancelAllOrders = Entry('do_cancel_all_orders', 'private', 'POST', {'cost': 5})
|
23
|
+
private_post_get_order_book = privatePostGetOrderBook = Entry('get_order_book', 'private', 'POST', {'cost': 1})
|
24
|
+
private_post_get_candles = privatePostGetCandles = Entry('get_candles', 'private', 'POST', {'cost': 1})
|
25
|
+
private_post_get_trade_history = privatePostGetTradeHistory = Entry('get_trade_history', 'private', 'POST', {'cost': 1})
|
26
|
+
private_post_get_my_transaction_history = privatePostGetMyTransactionHistory = Entry('get_my_transaction_history', 'private', 'POST', {'cost': 1})
|
27
|
+
private_post_get_my_funding_history = privatePostGetMyFundingHistory = Entry('get_my_funding_history', 'private', 'POST', {'cost': 5})
|
28
|
+
private_post_do_my_internal_transfer = privatePostDoMyInternalTransfer = Entry('do_my_internal_transfer', 'private', 'POST', {'cost': 1})
|
29
|
+
private_post_get_processing_info = privatePostGetProcessingInfo = Entry('get_processing_info', 'private', 'POST', {'cost': 10})
|
30
|
+
private_post_get_deposit_address = privatePostGetDepositAddress = Entry('get_deposit_address', 'private', 'POST', {'cost': 5})
|
31
|
+
private_post_do_deposit_funds_from_wallet = privatePostDoDepositFundsFromWallet = Entry('do_deposit_funds_from_wallet', 'private', 'POST', {'cost': 1})
|
32
|
+
private_post_do_withdrawal_funds_to_wallet = privatePostDoWithdrawalFundsToWallet = Entry('do_withdrawal_funds_to_wallet', 'private', 'POST', {'cost': 1})
|
ccxt/abstract/gate.py
CHANGED
@@ -92,8 +92,13 @@ class ImplicitAPI:
|
|
92
92
|
private_unified_get_interest_records = privateUnifiedGetInterestRecords = Entry('interest_records', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
93
93
|
private_unified_get_estimate_rate = privateUnifiedGetEstimateRate = Entry('estimate_rate', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
94
94
|
private_unified_get_currency_discount_tiers = privateUnifiedGetCurrencyDiscountTiers = Entry('currency_discount_tiers', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
95
|
+
private_unified_get_risk_units = privateUnifiedGetRiskUnits = Entry('risk_units', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
96
|
+
private_unified_get_unified_mode = privateUnifiedGetUnifiedMode = Entry('unified_mode', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
97
|
+
private_unified_get_loan_margin_tiers = privateUnifiedGetLoanMarginTiers = Entry('loan_margin_tiers', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
95
98
|
private_unified_post_account_mode = privateUnifiedPostAccountMode = Entry('account_mode', ['private', 'unified'], 'POST', {'cost': 1.3333333333333333})
|
96
99
|
private_unified_post_loans = privateUnifiedPostLoans = Entry('loans', ['private', 'unified'], 'POST', {'cost': 13.333333333333334})
|
100
|
+
private_unified_post_portfolio_calculator = privateUnifiedPostPortfolioCalculator = Entry('portfolio_calculator', ['private', 'unified'], 'POST', {'cost': 1.3333333333333333})
|
101
|
+
private_unified_put_unified_mode = privateUnifiedPutUnifiedMode = Entry('unified_mode', ['private', 'unified'], 'PUT', {'cost': 1.3333333333333333})
|
97
102
|
private_spot_get_fee = privateSpotGetFee = Entry('fee', ['private', 'spot'], 'GET', {'cost': 1})
|
98
103
|
private_spot_get_batch_fee = privateSpotGetBatchFee = Entry('batch_fee', ['private', 'spot'], 'GET', {'cost': 1})
|
99
104
|
private_spot_get_accounts = privateSpotGetAccounts = Entry('accounts', ['private', 'spot'], 'GET', {'cost': 1})
|
ccxt/abstract/gateio.py
CHANGED
@@ -92,8 +92,13 @@ class ImplicitAPI:
|
|
92
92
|
private_unified_get_interest_records = privateUnifiedGetInterestRecords = Entry('interest_records', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
93
93
|
private_unified_get_estimate_rate = privateUnifiedGetEstimateRate = Entry('estimate_rate', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
94
94
|
private_unified_get_currency_discount_tiers = privateUnifiedGetCurrencyDiscountTiers = Entry('currency_discount_tiers', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
95
|
+
private_unified_get_risk_units = privateUnifiedGetRiskUnits = Entry('risk_units', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
96
|
+
private_unified_get_unified_mode = privateUnifiedGetUnifiedMode = Entry('unified_mode', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
97
|
+
private_unified_get_loan_margin_tiers = privateUnifiedGetLoanMarginTiers = Entry('loan_margin_tiers', ['private', 'unified'], 'GET', {'cost': 1.3333333333333333})
|
95
98
|
private_unified_post_account_mode = privateUnifiedPostAccountMode = Entry('account_mode', ['private', 'unified'], 'POST', {'cost': 1.3333333333333333})
|
96
99
|
private_unified_post_loans = privateUnifiedPostLoans = Entry('loans', ['private', 'unified'], 'POST', {'cost': 13.333333333333334})
|
100
|
+
private_unified_post_portfolio_calculator = privateUnifiedPostPortfolioCalculator = Entry('portfolio_calculator', ['private', 'unified'], 'POST', {'cost': 1.3333333333333333})
|
101
|
+
private_unified_put_unified_mode = privateUnifiedPutUnifiedMode = Entry('unified_mode', ['private', 'unified'], 'PUT', {'cost': 1.3333333333333333})
|
97
102
|
private_spot_get_fee = privateSpotGetFee = Entry('fee', ['private', 'spot'], 'GET', {'cost': 1})
|
98
103
|
private_spot_get_batch_fee = privateSpotGetBatchFee = Entry('batch_fee', ['private', 'spot'], 'GET', {'cost': 1})
|
99
104
|
private_spot_get_accounts = privateSpotGetAccounts = Entry('accounts', ['private', 'spot'], 'GET', {'cost': 1})
|
ccxt/abstract/kucoin.py
CHANGED
@@ -20,6 +20,7 @@ class ImplicitAPI:
|
|
20
20
|
public_get_mark_price_symbol_current = publicGetMarkPriceSymbolCurrent = Entry('mark-price/{symbol}/current', 'public', 'GET', {'cost': 3})
|
21
21
|
public_get_mark_price_all_symbols = publicGetMarkPriceAllSymbols = Entry('mark-price/all-symbols', 'public', 'GET', {'cost': 3})
|
22
22
|
public_get_margin_config = publicGetMarginConfig = Entry('margin/config', 'public', 'GET', {'cost': 25})
|
23
|
+
public_get_announcements = publicGetAnnouncements = Entry('announcements', 'public', 'GET', {'cost': 20})
|
23
24
|
public_post_bullet_public = publicPostBulletPublic = Entry('bullet-public', 'public', 'POST', {'cost': 15})
|
24
25
|
private_get_user_info = privateGetUserInfo = Entry('user-info', 'private', 'GET', {'cost': 30})
|
25
26
|
private_get_accounts = privateGetAccounts = Entry('accounts', 'private', 'GET', {'cost': 7.5})
|
@@ -123,6 +124,7 @@ class ImplicitAPI:
|
|
123
124
|
private_post_lend_purchase_update = privatePostLendPurchaseUpdate = Entry('lend/purchase/update', 'private', 'POST', {'cost': 10})
|
124
125
|
private_post_bullet_private = privatePostBulletPrivate = Entry('bullet-private', 'private', 'POST', {'cost': 10})
|
125
126
|
private_post_position_update_user_leverage = privatePostPositionUpdateUserLeverage = Entry('position/update-user-leverage', 'private', 'POST', {'cost': 5})
|
127
|
+
private_post_deposit_address_create = privatePostDepositAddressCreate = Entry('deposit-address/create', 'private', 'POST', {'cost': 20})
|
126
128
|
private_delete_sub_api_key = privateDeleteSubApiKey = Entry('sub/api-key', 'private', 'DELETE', {'cost': 45})
|
127
129
|
private_delete_withdrawals_withdrawalid = privateDeleteWithdrawalsWithdrawalId = Entry('withdrawals/{withdrawalId}', 'private', 'DELETE', {'cost': 30})
|
128
130
|
private_delete_hf_orders_orderid = privateDeleteHfOrdersOrderId = Entry('hf/orders/{orderId}', 'private', 'DELETE', {'cost': 1})
|
ccxt/abstract/kucoinfutures.py
CHANGED
@@ -20,6 +20,7 @@ class ImplicitAPI:
|
|
20
20
|
public_get_mark_price_symbol_current = publicGetMarkPriceSymbolCurrent = Entry('mark-price/{symbol}/current', 'public', 'GET', {'cost': 3})
|
21
21
|
public_get_mark_price_all_symbols = publicGetMarkPriceAllSymbols = Entry('mark-price/all-symbols', 'public', 'GET', {'cost': 3})
|
22
22
|
public_get_margin_config = publicGetMarginConfig = Entry('margin/config', 'public', 'GET', {'cost': 25})
|
23
|
+
public_get_announcements = publicGetAnnouncements = Entry('announcements', 'public', 'GET', {'cost': 20})
|
23
24
|
public_post_bullet_public = publicPostBulletPublic = Entry('bullet-public', 'public', 'POST', {'cost': 15})
|
24
25
|
private_get_user_info = privateGetUserInfo = Entry('user-info', 'private', 'GET', {'cost': 30})
|
25
26
|
private_get_accounts = privateGetAccounts = Entry('accounts', 'private', 'GET', {'cost': 7.5})
|
@@ -123,6 +124,7 @@ class ImplicitAPI:
|
|
123
124
|
private_post_lend_purchase_update = privatePostLendPurchaseUpdate = Entry('lend/purchase/update', 'private', 'POST', {'cost': 10})
|
124
125
|
private_post_bullet_private = privatePostBulletPrivate = Entry('bullet-private', 'private', 'POST', {'cost': 10})
|
125
126
|
private_post_position_update_user_leverage = privatePostPositionUpdateUserLeverage = Entry('position/update-user-leverage', 'private', 'POST', {'cost': 5})
|
127
|
+
private_post_deposit_address_create = privatePostDepositAddressCreate = Entry('deposit-address/create', 'private', 'POST', {'cost': 20})
|
126
128
|
private_delete_sub_api_key = privateDeleteSubApiKey = Entry('sub/api-key', 'private', 'DELETE', {'cost': 45})
|
127
129
|
private_delete_withdrawals_withdrawalid = privateDeleteWithdrawalsWithdrawalId = Entry('withdrawals/{withdrawalId}', 'private', 'DELETE', {'cost': 30})
|
128
130
|
private_delete_hf_orders_orderid = privateDeleteHfOrdersOrderId = Entry('hf/orders/{orderId}', 'private', 'DELETE', {'cost': 1})
|
ccxt/abstract/okx.py
CHANGED
@@ -48,6 +48,7 @@ class ImplicitAPI:
|
|
48
48
|
public_get_rubik_stat_taker_volume = publicGetRubikStatTakerVolume = Entry('rubik/stat/taker-volume', 'public', 'GET', {'cost': 4})
|
49
49
|
public_get_rubik_stat_margin_loan_ratio = publicGetRubikStatMarginLoanRatio = Entry('rubik/stat/margin/loan-ratio', 'public', 'GET', {'cost': 4})
|
50
50
|
public_get_rubik_stat_contracts_long_short_account_ratio = publicGetRubikStatContractsLongShortAccountRatio = Entry('rubik/stat/contracts/long-short-account-ratio', 'public', 'GET', {'cost': 4})
|
51
|
+
public_get_rubik_stat_contracts_long_short_account_ratio_contract = publicGetRubikStatContractsLongShortAccountRatioContract = Entry('rubik/stat/contracts/long-short-account-ratio-contract', 'public', 'GET', {'cost': 4})
|
51
52
|
public_get_rubik_stat_contracts_open_interest_volume = publicGetRubikStatContractsOpenInterestVolume = Entry('rubik/stat/contracts/open-interest-volume', 'public', 'GET', {'cost': 4})
|
52
53
|
public_get_rubik_stat_option_open_interest_volume = publicGetRubikStatOptionOpenInterestVolume = Entry('rubik/stat/option/open-interest-volume', 'public', 'GET', {'cost': 4})
|
53
54
|
public_get_rubik_stat_option_open_interest_volume_ratio = publicGetRubikStatOptionOpenInterestVolumeRatio = Entry('rubik/stat/option/open-interest-volume-ratio', 'public', 'GET', {'cost': 4})
|
@@ -153,6 +154,9 @@ class ImplicitAPI:
|
|
153
154
|
private_get_account_fixed_loan_borrowing_limit = privateGetAccountFixedLoanBorrowingLimit = Entry('account/fixed-loan/borrowing-limit', 'private', 'GET', {'cost': 4})
|
154
155
|
private_get_account_fixed_loan_borrowing_quote = privateGetAccountFixedLoanBorrowingQuote = Entry('account/fixed-loan/borrowing-quote', 'private', 'GET', {'cost': 5})
|
155
156
|
private_get_account_fixed_loan_borrowing_orders_list = privateGetAccountFixedLoanBorrowingOrdersList = Entry('account/fixed-loan/borrowing-orders-list', 'private', 'GET', {'cost': 5})
|
157
|
+
private_get_account_spot_manual_borrow_repay = privateGetAccountSpotManualBorrowRepay = Entry('account/spot-manual-borrow-repay', 'private', 'GET', {'cost': 10})
|
158
|
+
private_get_account_set_auto_repay = privateGetAccountSetAutoRepay = Entry('account/set-auto-repay', 'private', 'GET', {'cost': 4})
|
159
|
+
private_get_account_spot_borrow_repay_history = privateGetAccountSpotBorrowRepayHistory = Entry('account/spot-borrow-repay-history', 'private', 'GET', {'cost': 4})
|
156
160
|
private_get_users_subaccount_list = privateGetUsersSubaccountList = Entry('users/subaccount/list', 'private', 'GET', {'cost': 10})
|
157
161
|
private_get_account_subaccount_balances = privateGetAccountSubaccountBalances = Entry('account/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
|
158
162
|
private_get_asset_subaccount_balances = privateGetAssetSubaccountBalances = Entry('asset/subaccount/balances', 'private', 'GET', {'cost': 3.3333333333333335})
|
ccxt/alpaca.py
CHANGED
@@ -69,6 +69,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
69
69
|
'fetchDepositsWithdrawals': False,
|
70
70
|
'fetchFundingHistory': False,
|
71
71
|
'fetchFundingRate': False,
|
72
|
+
'fetchFundingRateHistory': False,
|
72
73
|
'fetchFundingRates': False,
|
73
74
|
'fetchL1OrderBook': True,
|
74
75
|
'fetchL2OrderBook': False,
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/alpaca.py
CHANGED
@@ -69,6 +69,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
69
69
|
'fetchDepositsWithdrawals': False,
|
70
70
|
'fetchFundingHistory': False,
|
71
71
|
'fetchFundingRate': False,
|
72
|
+
'fetchFundingRateHistory': False,
|
72
73
|
'fetchFundingRates': False,
|
73
74
|
'fetchL1OrderBook': True,
|
74
75
|
'fetchL2OrderBook': False,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.4.
|
5
|
+
__version__ = '4.4.22'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -707,6 +707,12 @@ class Exchange(BaseExchange):
|
|
707
707
|
async def set_margin(self, symbol: str, amount: float, params={}):
|
708
708
|
raise NotSupported(self.id + ' setMargin() is not supported yet')
|
709
709
|
|
710
|
+
async def fetch_long_short_ratio(self, symbol: str, timeframe: Str = None, params={}):
|
711
|
+
raise NotSupported(self.id + ' fetchLongShortRatio() is not supported yet')
|
712
|
+
|
713
|
+
async def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}):
|
714
|
+
raise NotSupported(self.id + ' fetchLongShortRatioHistory() is not supported yet')
|
715
|
+
|
710
716
|
async def fetch_margin_adjustment_history(self, symbol: Str = None, type: Str = None, since: Num = None, limit: Num = None, params={}):
|
711
717
|
"""
|
712
718
|
fetches the history of margin added or reduced from contract isolated positions
|
ccxt/async_support/bigone.py
CHANGED
@@ -55,7 +55,10 @@ class bigone(Exchange, ImplicitAPI):
|
|
55
55
|
'fetchDepositAddresses': False,
|
56
56
|
'fetchDepositAddressesByNetwork': False,
|
57
57
|
'fetchDeposits': True,
|
58
|
+
'fetchFundingHistory': False,
|
58
59
|
'fetchFundingRate': False,
|
60
|
+
'fetchFundingRateHistory': False,
|
61
|
+
'fetchFundingRates': False,
|
59
62
|
'fetchMarkets': True,
|
60
63
|
'fetchMyTrades': True,
|
61
64
|
'fetchOHLCV': True,
|
ccxt/async_support/binance.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import LongShortRatio, Balances, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -129,6 +129,8 @@ class binance(Exchange, ImplicitAPI):
|
|
129
129
|
'fetchLeverages': True,
|
130
130
|
'fetchLeverageTiers': True,
|
131
131
|
'fetchLiquidations': False,
|
132
|
+
'fetchLongShortRatio': False,
|
133
|
+
'fetchLongShortRatioHistory': True,
|
132
134
|
'fetchMarginAdjustmentHistory': True,
|
133
135
|
'fetchMarginMode': 'emulated',
|
134
136
|
'fetchMarginModes': True,
|
@@ -11138,15 +11140,6 @@ class binance(Exchange, ImplicitAPI):
|
|
11138
11140
|
#
|
11139
11141
|
return self.parse_borrow_rate_history(response, code, since, limit)
|
11140
11142
|
|
11141
|
-
def parse_borrow_rate_history(self, response, code, since, limit):
|
11142
|
-
result = []
|
11143
|
-
for i in range(0, len(response)):
|
11144
|
-
item = response[i]
|
11145
|
-
borrowRate = self.parse_borrow_rate(item)
|
11146
|
-
result.append(borrowRate)
|
11147
|
-
sorted = self.sort_by(result, 'timestamp')
|
11148
|
-
return self.filter_by_currency_since_limit(sorted, code, since, limit)
|
11149
|
-
|
11150
11143
|
def parse_borrow_rate(self, info, currency: Currency = None):
|
11151
11144
|
#
|
11152
11145
|
# {
|
@@ -12710,3 +12703,96 @@ class binance(Exchange, ImplicitAPI):
|
|
12710
12703
|
#
|
12711
12704
|
result = self.parse_funding_rates(response, market)
|
12712
12705
|
return self.filter_by_array(result, 'symbol', symbols)
|
12706
|
+
|
12707
|
+
async def fetch_long_short_ratio_history(self, symbol: Str = None, timeframe: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LongShortRatio]:
|
12708
|
+
"""
|
12709
|
+
fetches the long short ratio history for a unified market symbol
|
12710
|
+
:see: https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
12711
|
+
:see: https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
12712
|
+
:param str symbol: unified symbol of the market to fetch the long short ratio for
|
12713
|
+
:param str [timeframe]: the period for the ratio, default is 24 hours
|
12714
|
+
:param int [since]: the earliest time in ms to fetch ratios for
|
12715
|
+
:param int [limit]: the maximum number of long short ratio structures to retrieve
|
12716
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
12717
|
+
:param int [params.until]: timestamp in ms of the latest ratio to fetch
|
12718
|
+
:returns dict[]: an array of `long short ratio structures <https://docs.ccxt.com/#/?id=long-short-ratio-structure>`
|
12719
|
+
"""
|
12720
|
+
await self.load_markets()
|
12721
|
+
market = self.market(symbol)
|
12722
|
+
if timeframe is None:
|
12723
|
+
timeframe = '1d'
|
12724
|
+
request: dict = {
|
12725
|
+
'period': timeframe,
|
12726
|
+
}
|
12727
|
+
request, params = self.handle_until_option('endTime', request, params)
|
12728
|
+
if since is not None:
|
12729
|
+
request['startTime'] = since
|
12730
|
+
if limit is not None:
|
12731
|
+
request['limit'] = limit
|
12732
|
+
subType = None
|
12733
|
+
subType, params = self.handle_sub_type_and_params('fetchLongShortRatioHistory', market, params)
|
12734
|
+
response = None
|
12735
|
+
if subType == 'linear':
|
12736
|
+
request['symbol'] = market['id']
|
12737
|
+
response = await self.fapiDataGetGlobalLongShortAccountRatio(self.extend(request, params))
|
12738
|
+
#
|
12739
|
+
# [
|
12740
|
+
# {
|
12741
|
+
# "symbol": "BTCUSDT",
|
12742
|
+
# "longAccount": "0.4558",
|
12743
|
+
# "longShortRatio": "0.8376",
|
12744
|
+
# "shortAccount": "0.5442",
|
12745
|
+
# "timestamp": 1726790400000
|
12746
|
+
# },
|
12747
|
+
# ]
|
12748
|
+
#
|
12749
|
+
elif subType == 'inverse':
|
12750
|
+
request['pair'] = market['info']['pair']
|
12751
|
+
response = await self.dapiDataGetGlobalLongShortAccountRatio(self.extend(request, params))
|
12752
|
+
#
|
12753
|
+
# [
|
12754
|
+
# {
|
12755
|
+
# "longAccount": "0.7262",
|
12756
|
+
# "longShortRatio": "2.6523",
|
12757
|
+
# "shortAccount": "0.2738",
|
12758
|
+
# "pair": "BTCUSD",
|
12759
|
+
# "timestamp": 1726790400000
|
12760
|
+
# },
|
12761
|
+
# ]
|
12762
|
+
#
|
12763
|
+
else:
|
12764
|
+
raise BadRequest(self.id + ' fetchLongShortRatioHistory() supports linear and inverse subTypes only')
|
12765
|
+
return self.parse_long_short_ratio_history(response, market)
|
12766
|
+
|
12767
|
+
def parse_long_short_ratio(self, info: dict, market: Market = None) -> LongShortRatio:
|
12768
|
+
#
|
12769
|
+
# linear
|
12770
|
+
#
|
12771
|
+
# {
|
12772
|
+
# "symbol": "BTCUSDT",
|
12773
|
+
# "longAccount": "0.4558",
|
12774
|
+
# "longShortRatio": "0.8376",
|
12775
|
+
# "shortAccount": "0.5442",
|
12776
|
+
# "timestamp": 1726790400000
|
12777
|
+
# }
|
12778
|
+
#
|
12779
|
+
# inverse
|
12780
|
+
#
|
12781
|
+
# {
|
12782
|
+
# "longAccount": "0.7262",
|
12783
|
+
# "longShortRatio": "2.6523",
|
12784
|
+
# "shortAccount": "0.2738",
|
12785
|
+
# "pair": "BTCUSD",
|
12786
|
+
# "timestamp": 1726790400000
|
12787
|
+
# }
|
12788
|
+
#
|
12789
|
+
marketId = self.safe_string(info, 'symbol')
|
12790
|
+
timestamp = self.safe_integer_omit_zero(info, 'timestamp')
|
12791
|
+
return {
|
12792
|
+
'info': info,
|
12793
|
+
'symbol': self.safe_symbol(marketId, market, None, 'contract'),
|
12794
|
+
'timestamp': timestamp,
|
12795
|
+
'datetime': self.iso8601(timestamp),
|
12796
|
+
'timeframe': None,
|
12797
|
+
'longShortRatio': self.safe_number(info, 'longShortRatio'),
|
12798
|
+
}
|
ccxt/async_support/bingx.py
CHANGED
@@ -4981,7 +4981,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
4981
4981
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
4982
4982
|
"""
|
4983
4983
|
make a withdrawal
|
4984
|
-
:see: https://bingx-api.github.io/docs/#/
|
4984
|
+
:see: https://bingx-api.github.io/docs/#/en-us/spot/wallet-api.html#Withdraw
|
4985
4985
|
:param str code: unified currency code
|
4986
4986
|
:param float amount: the amount to withdraw
|
4987
4987
|
:param str address: the address to withdraw to
|
@@ -4990,6 +4990,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
4990
4990
|
:param int [params.walletType]: 1 fund account, 2 standard account, 3 perpetual account
|
4991
4991
|
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
4992
4992
|
"""
|
4993
|
+
tag, params = self.handle_withdraw_tag_and_params(tag, params)
|
4994
|
+
self.check_address(address)
|
4993
4995
|
await self.load_markets()
|
4994
4996
|
currency = self.currency(code)
|
4995
4997
|
walletType = self.safe_integer(params, 'walletType')
|
@@ -5006,6 +5008,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
5006
5008
|
network = self.safe_string_upper(params, 'network')
|
5007
5009
|
if network is not None:
|
5008
5010
|
request['network'] = self.network_code_to_id(network)
|
5011
|
+
if tag is not None:
|
5012
|
+
request['addressTag'] = tag
|
5009
5013
|
params = self.omit(params, ['walletType', 'network'])
|
5010
5014
|
response = await self.walletsV1PrivatePostCapitalWithdrawApply(self.extend(request, params))
|
5011
5015
|
data = self.safe_value(response, 'data')
|
ccxt/async_support/bitflyer.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitflyer import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TradingFeeInterface, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -39,6 +39,8 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
39
39
|
'fetchBalance': True,
|
40
40
|
'fetchClosedOrders': 'emulated',
|
41
41
|
'fetchDeposits': True,
|
42
|
+
'fetchFundingRate': True,
|
43
|
+
'fetchFundingRateHistory': False,
|
42
44
|
'fetchMarginMode': False,
|
43
45
|
'fetchMarkets': True,
|
44
46
|
'fetchMyTrades': True,
|
@@ -78,6 +80,7 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
78
80
|
'gethealth',
|
79
81
|
'getboardstate',
|
80
82
|
'getchats',
|
83
|
+
'getfundingrate',
|
81
84
|
],
|
82
85
|
},
|
83
86
|
'private': {
|
@@ -963,6 +966,58 @@ class bitflyer(Exchange, ImplicitAPI):
|
|
963
966
|
'fee': fee,
|
964
967
|
}
|
965
968
|
|
969
|
+
async def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
970
|
+
"""
|
971
|
+
fetch the current funding rate
|
972
|
+
:see: https://lightning.bitflyer.com/docs#funding-rate
|
973
|
+
:param str symbol: unified market symbol
|
974
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
975
|
+
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
976
|
+
"""
|
977
|
+
await self.load_markets()
|
978
|
+
market = self.market(symbol)
|
979
|
+
request: dict = {
|
980
|
+
'product_code': market['id'],
|
981
|
+
}
|
982
|
+
response = await self.publicGetGetfundingrate(self.extend(request, params))
|
983
|
+
#
|
984
|
+
# {
|
985
|
+
# "current_funding_rate": -0.003750000000
|
986
|
+
# "next_funding_rate_settledate": "2024-04-15T13:00:00"
|
987
|
+
# }
|
988
|
+
#
|
989
|
+
return self.parse_funding_rate(response, market)
|
990
|
+
|
991
|
+
def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
|
992
|
+
#
|
993
|
+
# {
|
994
|
+
# "current_funding_rate": -0.003750000000
|
995
|
+
# "next_funding_rate_settledate": "2024-04-15T13:00:00"
|
996
|
+
# }
|
997
|
+
#
|
998
|
+
nextFundingDatetime = self.safe_string(contract, 'next_funding_rate_settledate')
|
999
|
+
nextFundingTimestamp = self.parse8601(nextFundingDatetime)
|
1000
|
+
return {
|
1001
|
+
'info': contract,
|
1002
|
+
'symbol': self.safe_string(market, 'symbol'),
|
1003
|
+
'markPrice': None,
|
1004
|
+
'indexPrice': None,
|
1005
|
+
'interestRate': None,
|
1006
|
+
'estimatedSettlePrice': None,
|
1007
|
+
'timestamp': None,
|
1008
|
+
'datetime': None,
|
1009
|
+
'fundingRate': None,
|
1010
|
+
'fundingTimestamp': None,
|
1011
|
+
'fundingDatetime': None,
|
1012
|
+
'nextFundingRate': self.safe_number(contract, 'current_funding_rate'),
|
1013
|
+
'nextFundingTimestamp': nextFundingTimestamp,
|
1014
|
+
'nextFundingDatetime': self.iso8601(nextFundingTimestamp),
|
1015
|
+
'previousFundingRate': None,
|
1016
|
+
'previousFundingTimestamp': None,
|
1017
|
+
'previousFundingDatetime': None,
|
1018
|
+
'interval': None,
|
1019
|
+
}
|
1020
|
+
|
966
1021
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
967
1022
|
request = '/' + self.version + '/'
|
968
1023
|
if api == 'private':
|