pub struct Questrade { /* private fields */ }
Expand description
Questrade client
Implementations§
Source§impl 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(
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<(), Box<dyn Error>>
pub async fn authenticate( &self, refresh_token: &str, is_demo: bool, ) -> Result<(), Box<dyn Error>>
Authenticates using the supplied token.
Sourcepub fn get_auth_info(&self) -> Option<AuthenticationInfo>
pub fn get_auth_info(&self) -> Option<AuthenticationInfo>
Retrieves the current authentication info (if set).
Sourcepub async fn accounts(&self) -> Result<Vec<Account>, Box<dyn Error>>
pub async fn accounts(&self) -> Result<Vec<Account>, Box<dyn Error>>
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>, Box<dyn Error>>
pub async fn account_activity( &self, account_number: &str, start_time: DateTime<Utc>, end_time: DateTime<Utc>, ) -> Result<Vec<AccountActivity>, Box<dyn Error>>
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>, Box<dyn Error>>
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>, Box<dyn Error>>
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>, Box<dyn Error>>
pub async fn account_order( &self, account_number: &str, order_id: u32, ) -> Result<Option<AccountOrder>, Box<dyn Error>>
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>, Box<dyn Error>>
pub async fn account_executions( &self, account_number: &str, start_time: Option<DateTime<Utc>>, end_time: Option<DateTime<Utc>>, ) -> Result<Vec<AccountExecution>, Box<dyn Error>>
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, Box<dyn Error>>
pub async fn account_balance( &self, account_number: &str, ) -> Result<AccountBalances, Box<dyn Error>>
Retrieves per-currency and combined balances for a specified account.
Sourcepub async fn account_positions(
&self,
account_number: &str,
) -> Result<Vec<AccountPosition>, Box<dyn Error>>
pub async fn account_positions( &self, account_number: &str, ) -> Result<Vec<AccountPosition>, Box<dyn Error>>
Retrieves positions in a specified account.
Sourcepub async fn market_quote(
&self,
ids: &[u32],
) -> Result<Vec<MarketQuote>, Box<dyn Error>>
pub async fn market_quote( &self, ids: &[u32], ) -> Result<Vec<MarketQuote>, Box<dyn Error>>
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>, Box<dyn Error>>
pub async fn symbol_search( &self, prefix: &str, offset: u32, ) -> Result<Vec<SearchEquitySymbol>, Box<dyn Error>>
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 !Freeze for Questrade
impl !RefUnwindSafe for Questrade
impl Send for Questrade
impl !Sync for Questrade
impl Unpin for Questrade
impl !UnwindSafe for Questrade
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more