ExchangeCapabilities

Struct ExchangeCapabilities 

Source
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: bool

Can fetch market definitions

§fetch_currencies: bool

Can fetch currency definitions

§fetch_ticker: bool

Can fetch single ticker

§fetch_tickers: bool

Can fetch multiple tickers

§fetch_order_book: bool

Can fetch order book

§fetch_trades: bool

Can fetch public trades

§fetch_ohlcv: bool

Can fetch OHLCV candlestick data

§fetch_status: bool

Can fetch exchange status

§fetch_time: bool

Can fetch server time

§create_order: bool

Can create orders

§create_market_order: bool

Can create market orders

§create_limit_order: bool

Can create limit orders

§cancel_order: bool

Can cancel orders

§cancel_all_orders: bool

Can cancel all orders

§edit_order: bool

Can edit/modify orders

§fetch_order: bool

Can fetch single order

§fetch_orders: bool

Can fetch all orders

§fetch_open_orders: bool

Can fetch open orders

§fetch_closed_orders: bool

Can fetch closed orders

§fetch_canceled_orders: bool

Can fetch canceled orders

§fetch_balance: bool

Can fetch account balance

§fetch_my_trades: bool

Can fetch user’s trade history

§fetch_deposits: bool

Can fetch deposit history

§fetch_withdrawals: bool

Can fetch withdrawal history

§fetch_transactions: bool

Can fetch transaction history

§fetch_ledger: bool

Can fetch ledger entries

§fetch_deposit_address: bool

Can fetch deposit address

§create_deposit_address: bool

Can create deposit address

§withdraw: bool

Can withdraw funds

§transfer: bool

Can transfer between accounts

§fetch_borrow_rate: bool

Can fetch borrow rate

§fetch_borrow_rates: bool

Can fetch multiple borrow rates

§fetch_funding_rate: bool

Can fetch funding rate

§fetch_funding_rates: bool

Can fetch multiple funding rates

§fetch_positions: bool

Can fetch positions

§set_leverage: bool

Can set leverage

§set_margin_mode: bool

Can set margin mode

§websocket: bool

WebSocket support available

§watch_ticker: bool

Can watch ticker updates

§watch_tickers: bool

Can watch multiple ticker updates

§watch_order_book: bool

Can watch order book updates

§watch_trades: bool

Can watch trade updates

§watch_ohlcv: bool

Can watch OHLCV updates

§watch_balance: bool

Can watch balance updates

§watch_orders: bool

Can watch order updates

§watch_my_trades: bool

Can watch user trade updates

Implementations§

Source§

impl ExchangeCapabilities

Source

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);
Source

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);
Source

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"));
Source

pub fn supported_capabilities(&self) -> Vec<&'static str>

Get a list of all supported capability names

Trait Implementations§

Source§

impl Clone for ExchangeCapabilities

Source§

fn clone(&self) -> ExchangeCapabilities

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExchangeCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExchangeCapabilities

Source§

fn default() -> ExchangeCapabilities

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ExchangeCapabilities

Source§

fn eq(&self, other: &ExchangeCapabilities) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ExchangeCapabilities

Source§

impl StructuralPartialEq for ExchangeCapabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more