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_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 !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> 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