Is there any possibility of making custom GET or POST request with the CCXT API? I can't find some of them in the API requests list,
for example, GET /api/account/v3/asset-valuation
or POST /api/margin/v3/accounts/btc-usdt/leverage{"leverage":"10"}
or GET /api/account/v3/sub-account
Or maybe there's some way of extracting CCXT auth headers to make a request with?
Thanks!
The answer is documented in the CCXT Manual:
You can call any API endpoint and send any params as described in the CCXT Manual:
import ccxt
exchange = ccxt.okex({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
'password': 'YOUR_API_KEY_PASSWORD',
'enableRateLimit': True,
})
print(exchange.account_get_asset_valuation({})) # add params if needed
sub_account_params = {'sub-account': 'YOUR_SUB_ACCOUNT_HERE'}
print(exchange.account_get_sub_account(sub_account_params))
leverage_params = {'instrument_id': 'BTC-USDT', 'leverage': YOUR_LEVERAGE_HERE}
print(exchange.margin_post_accounts_instrument_id_leverage(leverage_params))
Or maybe there's some way of extracting CCXT auth headers to make a request with?
No need for that, CCXT allows you to call any endpoint as you like.