pub struct Questrade { /* private fields */ }
Expand description
Questrade client
Implementations
sourceimpl Questrade
impl Questrade
sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
Creates a new API instance with the specified client
sourcepub fn with_authentication_only(auth_info: AuthenticationInfo) -> Self
pub fn with_authentication_only(auth_info: AuthenticationInfo) -> Self
Creates a new API instance with the specified auth info.
sourcepub fn with_authentication(auth_info: AuthenticationInfo, client: Client) -> Self
pub fn with_authentication(auth_info: AuthenticationInfo, client: Client) -> Self
Creates a new API instance with the specified auth info.
sourcepub async fn authenticate(
&self,
refresh_token: &str,
is_demo: bool
) -> Result<(), ApiError>
pub async fn authenticate(
&self,
refresh_token: &str,
is_demo: bool
) -> Result<(), ApiError>
Authenticates using the supplied token.
sourcepub async fn get_auth_info(&self) -> Option<AuthenticationInfo>
pub async fn get_auth_info(&self) -> Option<AuthenticationInfo>
Retrieves the current authentication info (if set).
sourcepub async fn accounts(&self) -> Result<Vec<Account>, ApiError>
pub async fn accounts(&self) -> Result<Vec<Account>, ApiError>
List all accounts associated with the authenticated user.
sourcepub async fn account_activity(
&self,
account_number: &str,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>
) -> Result<Vec<AccountActivity>, ApiError>
pub async fn account_activity(
&self,
account_number: &str,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>
) -> Result<Vec<AccountActivity>, ApiError>
Retrieve account activities, including cash transactions, dividends, trades, etc.
sourcepub async fn account_orders(
&self,
account_number: &str,
start_time: Option<DateTime<Utc>>,
end_time: Option<DateTime<Utc>>,
state: Option<OrderStateFilter>
) -> Result<Vec<AccountOrder>, ApiError>
pub async fn account_orders(
&self,
account_number: &str,
start_time: Option<DateTime<Utc>>,
end_time: Option<DateTime<Utc>>,
state: Option<OrderStateFilter>
) -> Result<Vec<AccountOrder>, ApiError>
Search for account orders.
Parameters:
- start_time
optional start of time range. Defaults to start of today, 12:00am
- end_time
optional end of time range. Defaults to end of today, 11:59pm
- state_filter
optionally filters order states
sourcepub async fn account_order(
&self,
account_number: &str,
order_id: u32
) -> Result<Option<AccountOrder>, ApiError>
pub async fn account_order(
&self,
account_number: &str,
order_id: u32
) -> Result<Option<AccountOrder>, ApiError>
Retrieve details for an order with a specific id
sourcepub async fn account_executions(
&self,
account_number: &str,
start_time: Option<DateTime<Utc>>,
end_time: Option<DateTime<Utc>>
) -> Result<Vec<AccountExecution>, ApiError>
pub async fn account_executions(
&self,
account_number: &str,
start_time: Option<DateTime<Utc>>,
end_time: Option<DateTime<Utc>>
) -> Result<Vec<AccountExecution>, ApiError>
Retrieves executions for a specific account.
Parameters:
- start_time
optional start of time range. Defaults to start of today, 12:00am
- end_time
optional end of time range. Defaults to end of today, 11:59pm
sourcepub async fn account_balance(
&self,
account_number: &str
) -> Result<AccountBalances, ApiError>
pub async fn account_balance(
&self,
account_number: &str
) -> Result<AccountBalances, ApiError>
Retrieves per-currency and combined balances for a specified account.
sourcepub async fn account_positions(
&self,
account_number: &str
) -> Result<Vec<AccountPosition>, ApiError>
pub async fn account_positions(
&self,
account_number: &str
) -> Result<Vec<AccountPosition>, ApiError>
Retrieves positions in a specified account.
sourcepub async fn market_quote(
&self,
ids: &[u32]
) -> Result<Vec<MarketQuote>, ApiError>
pub async fn market_quote(
&self,
ids: &[u32]
) -> Result<Vec<MarketQuote>, ApiError>
Retrieves a single Level 1 market data quote for one or more symbols.
IMPORTANT NOTE: Questrade user needs to be subscribed to a real-time data package, to receive market quotes in real-time, otherwise call to get quote is considered snap quote and limit per market can be quickly reached. Without real-time data package, once limit is reached, the response will return delayed data. (Please check “delay” parameter in response always)
sourcepub async fn symbol_search(
&self,
prefix: &str,
offset: u32
) -> Result<Vec<SearchEquitySymbol>, ApiError>
pub async fn symbol_search(
&self,
prefix: &str,
offset: u32
) -> Result<Vec<SearchEquitySymbol>, ApiError>
Searches for the specified symbol.
params
prefix
Prefix of a symbol or any word in the description.offset
Offset in number of records from the beginning of a result set.
Auto Trait Implementations
impl !RefUnwindSafe for Questrade
impl Send for Questrade
impl Sync for Questrade
impl Unpin for Questrade
impl !UnwindSafe for Questrade
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more