pub struct ExchangeCapabilities {Show 46 fields
pub fetch_markets: bool,
pub fetch_currencies: bool,
pub fetch_ticker: bool,
pub fetch_tickers: bool,
pub fetch_order_book: bool,
pub fetch_trades: bool,
pub fetch_ohlcv: bool,
pub fetch_status: bool,
pub fetch_time: bool,
pub create_order: bool,
pub create_market_order: bool,
pub create_limit_order: bool,
pub cancel_order: bool,
pub cancel_all_orders: bool,
pub edit_order: bool,
pub fetch_order: bool,
pub fetch_orders: bool,
pub fetch_open_orders: bool,
pub fetch_closed_orders: bool,
pub fetch_canceled_orders: bool,
pub fetch_balance: bool,
pub fetch_my_trades: bool,
pub fetch_deposits: bool,
pub fetch_withdrawals: bool,
pub fetch_transactions: bool,
pub fetch_ledger: bool,
pub fetch_deposit_address: bool,
pub create_deposit_address: bool,
pub withdraw: bool,
pub transfer: bool,
pub fetch_borrow_rate: bool,
pub fetch_borrow_rates: bool,
pub fetch_funding_rate: bool,
pub fetch_funding_rates: bool,
pub fetch_positions: bool,
pub set_leverage: bool,
pub set_margin_mode: bool,
pub websocket: bool,
pub watch_ticker: bool,
pub watch_tickers: bool,
pub watch_order_book: bool,
pub watch_trades: bool,
pub watch_ohlcv: bool,
pub watch_balance: bool,
pub watch_orders: bool,
pub watch_my_trades: bool,
}Expand description
Exchange capabilities - describes what features an exchange supports
This struct contains boolean flags for each capability that an exchange may or may not support. Use this to check feature availability before calling methods that may not be implemented.
§Example
use ccxt_core::exchange::ExchangeCapabilities;
let caps = ExchangeCapabilities::public_only();
assert!(caps.fetch_ticker);
assert!(!caps.create_order);Fields§
§fetch_markets: boolCan fetch market definitions
fetch_currencies: boolCan fetch currency definitions
fetch_ticker: boolCan fetch single ticker
fetch_tickers: boolCan fetch multiple tickers
fetch_order_book: boolCan fetch order book
fetch_trades: boolCan fetch public trades
fetch_ohlcv: boolCan fetch OHLCV candlestick data
fetch_status: boolCan fetch exchange status
fetch_time: boolCan fetch server time
create_order: boolCan create orders
create_market_order: boolCan create market orders
create_limit_order: boolCan create limit orders
cancel_order: boolCan cancel orders
cancel_all_orders: boolCan cancel all orders
edit_order: boolCan edit/modify orders
fetch_order: boolCan fetch single order
fetch_orders: boolCan fetch all orders
fetch_open_orders: boolCan fetch open orders
fetch_closed_orders: boolCan fetch closed orders
fetch_canceled_orders: boolCan fetch canceled orders
fetch_balance: boolCan fetch account balance
fetch_my_trades: boolCan fetch user’s trade history
fetch_deposits: boolCan fetch deposit history
fetch_withdrawals: boolCan fetch withdrawal history
fetch_transactions: boolCan fetch transaction history
fetch_ledger: boolCan fetch ledger entries
fetch_deposit_address: boolCan fetch deposit address
create_deposit_address: boolCan create deposit address
withdraw: boolCan withdraw funds
transfer: boolCan transfer between accounts
fetch_borrow_rate: boolCan fetch borrow rate
fetch_borrow_rates: boolCan fetch multiple borrow rates
fetch_funding_rate: boolCan fetch funding rate
fetch_funding_rates: boolCan fetch multiple funding rates
fetch_positions: boolCan fetch positions
set_leverage: boolCan set leverage
set_margin_mode: boolCan set margin mode
websocket: boolWebSocket support available
watch_ticker: boolCan watch ticker updates
watch_tickers: boolCan watch multiple ticker updates
watch_order_book: boolCan watch order book updates
watch_trades: boolCan watch trade updates
watch_ohlcv: boolCan watch OHLCV updates
watch_balance: boolCan watch balance updates
watch_orders: boolCan watch order updates
watch_my_trades: boolCan watch user trade updates
Implementations§
Source§impl ExchangeCapabilities
impl ExchangeCapabilities
Sourcepub fn all() -> Self
pub fn all() -> Self
Create capabilities with all features enabled
§Example
use ccxt_core::exchange::ExchangeCapabilities;
let caps = ExchangeCapabilities::all();
assert!(caps.fetch_ticker);
assert!(caps.create_order);
assert!(caps.websocket);Sourcepub fn public_only() -> Self
pub fn public_only() -> Self
Create capabilities for public API only (no authentication required)
§Example
use ccxt_core::exchange::ExchangeCapabilities;
let caps = ExchangeCapabilities::public_only();
assert!(caps.fetch_ticker);
assert!(!caps.create_order);Sourcepub fn has(&self, capability: &str) -> bool
pub fn has(&self, capability: &str) -> bool
Check if a capability is supported by name
This method allows checking capabilities using CCXT-style camelCase names.
§Arguments
capability- The capability name in camelCase format
§Example
use ccxt_core::exchange::ExchangeCapabilities;
let caps = ExchangeCapabilities::all();
assert!(caps.has("fetchTicker"));
assert!(caps.has("createOrder"));
assert!(!caps.has("unknownCapability"));Sourcepub fn supported_capabilities(&self) -> Vec<&'static str>
pub fn supported_capabilities(&self) -> Vec<&'static str>
Get a list of all supported capability names
Trait Implementations§
Source§impl Clone for ExchangeCapabilities
impl Clone for ExchangeCapabilities
Source§fn clone(&self) -> ExchangeCapabilities
fn clone(&self) -> ExchangeCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more