pub struct AlpacaHttpClient { /* private fields */ }Expand description
HTTP client for Alpaca API
Implementations§
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub fn new(credentials: Credentials, environment: Environment) -> Result<Self>
pub fn new(credentials: Credentials, environment: Environment) -> Result<Self>
Create a new HTTP client
Sourcepub fn from_env(environment: Environment) -> Result<Self>
pub fn from_env(environment: Environment) -> Result<Self>
Create a new client from environment variables
Sourcepub async fn get<T>(&self, path: &str) -> Result<T>where
T: DeserializeOwned,
pub async fn get<T>(&self, path: &str) -> Result<T>where
T: DeserializeOwned,
Make a GET request
Sourcepub async fn get_with_params<T, P>(&self, path: &str, params: &P) -> Result<T>where
T: DeserializeOwned,
P: Serialize,
pub async fn get_with_params<T, P>(&self, path: &str, params: &P) -> Result<T>where
T: DeserializeOwned,
P: Serialize,
Make a GET request with query parameters
Sourcepub async fn post<T, B>(&self, path: &str, body: &B) -> Result<T>where
T: DeserializeOwned,
B: Serialize,
pub async fn post<T, B>(&self, path: &str, body: &B) -> Result<T>where
T: DeserializeOwned,
B: Serialize,
Make a POST request
Sourcepub async fn put<T, B>(&self, path: &str, body: &B) -> Result<T>where
T: DeserializeOwned,
B: Serialize,
pub async fn put<T, B>(&self, path: &str, body: &B) -> Result<T>where
T: DeserializeOwned,
B: Serialize,
Make a PUT request
Sourcepub async fn patch<T, B>(&self, path: &str, body: &B) -> Result<T>where
T: DeserializeOwned,
B: Serialize,
pub async fn patch<T, B>(&self, path: &str, body: &B) -> Result<T>where
T: DeserializeOwned,
B: Serialize,
Make a PATCH request
Sourcepub async fn delete<T>(&self, path: &str) -> Result<T>where
T: DeserializeOwned,
pub async fn delete<T>(&self, path: &str) -> Result<T>where
T: DeserializeOwned,
Make a DELETE request
Sourcepub fn environment(&self) -> &Environment
pub fn environment(&self) -> &Environment
Get the current environment
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn get_account(&self) -> Result<Account>
pub async fn get_account(&self) -> Result<Account>
Get account information
Sourcepub async fn get_account_configurations(&self) -> Result<AccountConfigurations>
pub async fn get_account_configurations(&self) -> Result<AccountConfigurations>
Get account configurations
Sourcepub async fn update_account_configurations(
&self,
config: &AccountConfigurations,
) -> Result<AccountConfigurations>
pub async fn update_account_configurations( &self, config: &AccountConfigurations, ) -> Result<AccountConfigurations>
Update account configurations
Sourcepub async fn get_account_activities(
&self,
params: &ActivityParams,
) -> Result<Vec<AccountActivity>>
pub async fn get_account_activities( &self, params: &ActivityParams, ) -> Result<Vec<AccountActivity>>
Get account activities
Sourcepub async fn get_portfolio_history(
&self,
params: &PortfolioHistoryParams,
) -> Result<PortfolioHistory>
pub async fn get_portfolio_history( &self, params: &PortfolioHistoryParams, ) -> Result<PortfolioHistory>
Get portfolio history
Sourcepub async fn get_assets(&self, params: &AssetParams) -> Result<Vec<Asset>>
pub async fn get_assets(&self, params: &AssetParams) -> Result<Vec<Asset>>
Get all assets
Sourcepub async fn get_asset_by_symbol(&self, symbol: &str) -> Result<Asset>
pub async fn get_asset_by_symbol(&self, symbol: &str) -> Result<Asset>
Get asset by symbol
Sourcepub async fn get_orders(&self, params: &OrderParams) -> Result<Vec<Order>>
pub async fn get_orders(&self, params: &OrderParams) -> Result<Vec<Order>>
Get all orders
Sourcepub async fn create_order(&self, order: &CreateOrderRequest) -> Result<Order>
pub async fn create_order(&self, order: &CreateOrderRequest) -> Result<Order>
Create a new order
Sourcepub async fn get_order_by_client_id(
&self,
client_order_id: &str,
) -> Result<Order>
pub async fn get_order_by_client_id( &self, client_order_id: &str, ) -> Result<Order>
Get order by client order ID
Sourcepub async fn replace_order(
&self,
order_id: &Uuid,
order: &ReplaceOrderRequest,
) -> Result<Order>
pub async fn replace_order( &self, order_id: &Uuid, order: &ReplaceOrderRequest, ) -> Result<Order>
Replace an order
Sourcepub async fn cancel_order(&self, order_id: &Uuid) -> Result<()>
pub async fn cancel_order(&self, order_id: &Uuid) -> Result<()>
Cancel an order
Sourcepub async fn cancel_all_orders(&self) -> Result<Vec<CancelOrderResponse>>
pub async fn cancel_all_orders(&self) -> Result<Vec<CancelOrderResponse>>
Cancel all orders
Sourcepub async fn get_positions(&self) -> Result<Vec<Position>>
pub async fn get_positions(&self) -> Result<Vec<Position>>
Get all positions
Sourcepub async fn get_position(&self, symbol: &str) -> Result<Position>
pub async fn get_position(&self, symbol: &str) -> Result<Position>
Get position by symbol
Sourcepub async fn close_all_positions(
&self,
cancel_orders: bool,
) -> Result<Vec<ClosePositionResponse>>
pub async fn close_all_positions( &self, cancel_orders: bool, ) -> Result<Vec<ClosePositionResponse>>
Close all positions
Sourcepub async fn close_position(
&self,
symbol: &str,
_params: &ClosePositionRequest,
) -> Result<Order>
pub async fn close_position( &self, symbol: &str, _params: &ClosePositionRequest, ) -> Result<Order>
Close position by symbol
Sourcepub async fn get_watchlists(&self) -> Result<Vec<Watchlist>>
pub async fn get_watchlists(&self) -> Result<Vec<Watchlist>>
Get all watchlists
Sourcepub async fn create_watchlist(
&self,
watchlist: &CreateWatchlistRequest,
) -> Result<Watchlist>
pub async fn create_watchlist( &self, watchlist: &CreateWatchlistRequest, ) -> Result<Watchlist>
Create a new watchlist
Sourcepub async fn get_watchlist(&self, watchlist_id: &Uuid) -> Result<Watchlist>
pub async fn get_watchlist(&self, watchlist_id: &Uuid) -> Result<Watchlist>
Get watchlist by ID
Sourcepub async fn update_watchlist(
&self,
watchlist_id: &Uuid,
watchlist: &UpdateWatchlistRequest,
) -> Result<Watchlist>
pub async fn update_watchlist( &self, watchlist_id: &Uuid, watchlist: &UpdateWatchlistRequest, ) -> Result<Watchlist>
Update watchlist
Sourcepub async fn delete_watchlist(&self, watchlist_id: &Uuid) -> Result<()>
pub async fn delete_watchlist(&self, watchlist_id: &Uuid) -> Result<()>
Delete watchlist
Sourcepub async fn add_to_watchlist(
&self,
watchlist_id: &Uuid,
symbol: &str,
) -> Result<Watchlist>
pub async fn add_to_watchlist( &self, watchlist_id: &Uuid, symbol: &str, ) -> Result<Watchlist>
Add asset to watchlist
Sourcepub async fn remove_from_watchlist(
&self,
watchlist_id: &Uuid,
symbol: &str,
) -> Result<()>
pub async fn remove_from_watchlist( &self, watchlist_id: &Uuid, symbol: &str, ) -> Result<()>
Remove asset from watchlist
Sourcepub async fn get_bars(
&self,
symbol: &str,
params: &BarsParams,
) -> Result<BarsResponse>
pub async fn get_bars( &self, symbol: &str, params: &BarsParams, ) -> Result<BarsResponse>
Get bars for a symbol
Sourcepub async fn get_quotes(
&self,
symbol: &str,
params: &QuotesParams,
) -> Result<QuotesResponse>
pub async fn get_quotes( &self, symbol: &str, params: &QuotesParams, ) -> Result<QuotesResponse>
Get quotes for a symbol
Sourcepub async fn get_trades(
&self,
symbol: &str,
params: &TradesParams,
) -> Result<TradesResponse>
pub async fn get_trades( &self, symbol: &str, params: &TradesParams, ) -> Result<TradesResponse>
Get trades for a symbol
Sourcepub async fn get_latest_bar(&self, symbol: &str) -> Result<LatestBarResponse>
pub async fn get_latest_bar(&self, symbol: &str) -> Result<LatestBarResponse>
Get latest bar for a symbol
Sourcepub async fn get_latest_quote(
&self,
symbol: &str,
) -> Result<LatestQuoteResponse>
pub async fn get_latest_quote( &self, symbol: &str, ) -> Result<LatestQuoteResponse>
Get latest quote for a symbol
Sourcepub async fn get_latest_trade(
&self,
symbol: &str,
) -> Result<LatestTradeResponse>
pub async fn get_latest_trade( &self, symbol: &str, ) -> Result<LatestTradeResponse>
Get latest trade for a symbol
Sourcepub async fn get_calendar(
&self,
params: &CalendarParams,
) -> Result<Vec<Calendar>>
pub async fn get_calendar( &self, params: &CalendarParams, ) -> Result<Vec<Calendar>>
Get market calendar
Sourcepub async fn get_news(&self, params: &NewsParams) -> Result<NewsResponse>
pub async fn get_news(&self, params: &NewsParams) -> Result<NewsResponse>
Get news articles
Sourcepub async fn get_crypto_bars(
&self,
symbol: &str,
params: &CryptoBarsParams,
) -> Result<CryptoBarsResponse>
pub async fn get_crypto_bars( &self, symbol: &str, params: &CryptoBarsParams, ) -> Result<CryptoBarsResponse>
Get crypto bars
Sourcepub async fn get_crypto_quotes(
&self,
symbol: &str,
params: &CryptoQuotesParams,
) -> Result<CryptoQuotesResponse>
pub async fn get_crypto_quotes( &self, symbol: &str, params: &CryptoQuotesParams, ) -> Result<CryptoQuotesResponse>
Get crypto quotes
Sourcepub async fn get_crypto_trades(
&self,
symbol: &str,
params: &CryptoTradesParams,
) -> Result<CryptoTradesResponse>
pub async fn get_crypto_trades( &self, symbol: &str, params: &CryptoTradesParams, ) -> Result<CryptoTradesResponse>
Get crypto trades
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn get_option_contracts(
&self,
params: &OptionContractParams,
) -> Result<OptionContractsResponse>
pub async fn get_option_contracts( &self, params: &OptionContractParams, ) -> Result<OptionContractsResponse>
Sourcepub async fn get_option_contract(
&self,
symbol_or_id: &str,
) -> Result<OptionContract>
pub async fn get_option_contract( &self, symbol_or_id: &str, ) -> Result<OptionContract>
Sourcepub async fn exercise_option(
&self,
request: &OptionExerciseRequest,
) -> Result<Order>
pub async fn exercise_option( &self, request: &OptionExerciseRequest, ) -> Result<Order>
Sourcepub async fn get_option_bars(
&self,
params: &OptionBarsParams,
) -> Result<OptionBarsResponse>
pub async fn get_option_bars( &self, params: &OptionBarsParams, ) -> Result<OptionBarsResponse>
Sourcepub async fn get_option_snapshots(
&self,
symbols: &str,
) -> Result<OptionSnapshotsResponse>
pub async fn get_option_snapshots( &self, symbols: &str, ) -> Result<OptionSnapshotsResponse>
Sourcepub async fn get_option_chain(
&self,
underlying_symbol: &str,
) -> Result<OptionSnapshotsResponse>
pub async fn get_option_chain( &self, underlying_symbol: &str, ) -> Result<OptionSnapshotsResponse>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn get_stock_bars(
&self,
params: &MultiBarsParams,
) -> Result<MultiBarsResponse>
pub async fn get_stock_bars( &self, params: &MultiBarsParams, ) -> Result<MultiBarsResponse>
Sourcepub async fn get_stock_quotes(
&self,
params: &MultiQuotesParams,
) -> Result<MultiQuotesResponse>
pub async fn get_stock_quotes( &self, params: &MultiQuotesParams, ) -> Result<MultiQuotesResponse>
Sourcepub async fn get_stock_trades(
&self,
params: &MultiTradesParams,
) -> Result<MultiTradesResponse>
pub async fn get_stock_trades( &self, params: &MultiTradesParams, ) -> Result<MultiTradesResponse>
Sourcepub async fn get_stock_snapshots(
&self,
symbols: &str,
) -> Result<StockSnapshotsResponse>
pub async fn get_stock_snapshots( &self, symbols: &str, ) -> Result<StockSnapshotsResponse>
Sourcepub async fn get_latest_bars(&self, symbols: &str) -> Result<LatestBarsResponse>
pub async fn get_latest_bars(&self, symbols: &str) -> Result<LatestBarsResponse>
Sourcepub async fn get_latest_quotes(
&self,
symbols: &str,
) -> Result<LatestQuotesResponse>
pub async fn get_latest_quotes( &self, symbols: &str, ) -> Result<LatestQuotesResponse>
Sourcepub async fn get_latest_trades(
&self,
symbols: &str,
) -> Result<LatestTradesResponse>
pub async fn get_latest_trades( &self, symbols: &str, ) -> Result<LatestTradesResponse>
Sourcepub async fn get_corporate_actions(
&self,
params: &CorporateActionsParams,
) -> Result<CorporateActionsResponse>
pub async fn get_corporate_actions( &self, params: &CorporateActionsParams, ) -> Result<CorporateActionsResponse>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn create_broker_account(
&self,
request: &CreateBrokerAccountRequest,
) -> Result<BrokerAccount>
pub async fn create_broker_account( &self, request: &CreateBrokerAccountRequest, ) -> Result<BrokerAccount>
Sourcepub async fn list_broker_accounts(
&self,
params: &ListBrokerAccountsParams,
) -> Result<Vec<BrokerAccount>>
pub async fn list_broker_accounts( &self, params: &ListBrokerAccountsParams, ) -> Result<Vec<BrokerAccount>>
Sourcepub async fn get_broker_account(
&self,
account_id: &str,
) -> Result<BrokerAccount>
pub async fn get_broker_account( &self, account_id: &str, ) -> Result<BrokerAccount>
Sourcepub async fn update_broker_account(
&self,
account_id: &str,
request: &UpdateBrokerAccountRequest,
) -> Result<BrokerAccount>
pub async fn update_broker_account( &self, account_id: &str, request: &UpdateBrokerAccountRequest, ) -> Result<BrokerAccount>
Sourcepub async fn close_broker_account(&self, account_id: &str) -> Result<()>
pub async fn close_broker_account(&self, account_id: &str) -> Result<()>
Sourcepub async fn get_broker_trading_account(
&self,
account_id: &str,
) -> Result<Account>
pub async fn get_broker_trading_account( &self, account_id: &str, ) -> Result<Account>
Sourcepub async fn upload_document(
&self,
account_id: &str,
document: &Document,
) -> Result<DocumentUploadResponse>
pub async fn upload_document( &self, account_id: &str, document: &Document, ) -> Result<DocumentUploadResponse>
Sourcepub async fn list_documents(
&self,
account_id: &str,
) -> Result<Vec<DocumentInfo>>
pub async fn list_documents( &self, account_id: &str, ) -> Result<Vec<DocumentInfo>>
Sourcepub async fn get_document(
&self,
account_id: &str,
document_id: &str,
) -> Result<DocumentInfo>
pub async fn get_document( &self, account_id: &str, document_id: &str, ) -> Result<DocumentInfo>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn create_ach_relationship(
&self,
account_id: &str,
request: &CreateAchRelationshipRequest,
) -> Result<AchRelationship>
pub async fn create_ach_relationship( &self, account_id: &str, request: &CreateAchRelationshipRequest, ) -> Result<AchRelationship>
Sourcepub async fn list_ach_relationships(
&self,
account_id: &str,
) -> Result<Vec<AchRelationship>>
pub async fn list_ach_relationships( &self, account_id: &str, ) -> Result<Vec<AchRelationship>>
Sourcepub async fn delete_ach_relationship(
&self,
account_id: &str,
relationship_id: &str,
) -> Result<()>
pub async fn delete_ach_relationship( &self, account_id: &str, relationship_id: &str, ) -> Result<()>
Delete an ACH relationship.
§Arguments
account_id- The account IDrelationship_id- The relationship ID to delete
Sourcepub async fn create_transfer(
&self,
account_id: &str,
request: &CreateTransferRequest,
) -> Result<Transfer>
pub async fn create_transfer( &self, account_id: &str, request: &CreateTransferRequest, ) -> Result<Transfer>
Sourcepub async fn list_transfers(
&self,
account_id: &str,
params: &ListTransfersParams,
) -> Result<Vec<Transfer>>
pub async fn list_transfers( &self, account_id: &str, params: &ListTransfersParams, ) -> Result<Vec<Transfer>>
Sourcepub async fn create_wire_bank(
&self,
account_id: &str,
request: &CreateWireBankRequest,
) -> Result<WireBank>
pub async fn create_wire_bank( &self, account_id: &str, request: &CreateWireBankRequest, ) -> Result<WireBank>
Sourcepub async fn create_journal(
&self,
request: &CreateJournalRequest,
) -> Result<Journal>
pub async fn create_journal( &self, request: &CreateJournalRequest, ) -> Result<Journal>
Sourcepub async fn list_journals(
&self,
params: &ListJournalsParams,
) -> Result<Vec<Journal>>
pub async fn list_journals( &self, params: &ListJournalsParams, ) -> Result<Vec<Journal>>
Sourcepub async fn create_batch_journals(
&self,
request: &CreateBatchJournalRequest,
) -> Result<Vec<Journal>>
pub async fn create_batch_journals( &self, request: &CreateBatchJournalRequest, ) -> Result<Vec<Journal>>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn list_crypto_wallets(
&self,
account_id: &str,
) -> Result<Vec<BrokerCryptoWallet>>
pub async fn list_crypto_wallets( &self, account_id: &str, ) -> Result<Vec<BrokerCryptoWallet>>
Sourcepub async fn create_crypto_wallet(
&self,
account_id: &str,
request: &CreateCryptoWalletRequest,
) -> Result<BrokerCryptoWallet>
pub async fn create_crypto_wallet( &self, account_id: &str, request: &CreateCryptoWalletRequest, ) -> Result<BrokerCryptoWallet>
Sourcepub async fn get_crypto_wallet(
&self,
account_id: &str,
asset: &str,
) -> Result<BrokerCryptoWallet>
pub async fn get_crypto_wallet( &self, account_id: &str, asset: &str, ) -> Result<BrokerCryptoWallet>
Sourcepub async fn list_crypto_transfers(
&self,
account_id: &str,
) -> Result<Vec<CryptoTransfer>>
pub async fn list_crypto_transfers( &self, account_id: &str, ) -> Result<Vec<CryptoTransfer>>
Sourcepub async fn create_crypto_transfer(
&self,
account_id: &str,
asset: &str,
request: &CreateCryptoTransferRequest,
) -> Result<CryptoTransfer>
pub async fn create_crypto_transfer( &self, account_id: &str, asset: &str, request: &CreateCryptoTransferRequest, ) -> Result<CryptoTransfer>
Sourcepub async fn list_crypto_whitelists(
&self,
account_id: &str,
) -> Result<Vec<CryptoWhitelistAddress>>
pub async fn list_crypto_whitelists( &self, account_id: &str, ) -> Result<Vec<CryptoWhitelistAddress>>
Sourcepub async fn create_crypto_whitelist(
&self,
account_id: &str,
request: &CreateCryptoWhitelistRequest,
) -> Result<CryptoWhitelistAddress>
pub async fn create_crypto_whitelist( &self, account_id: &str, request: &CreateCryptoWhitelistRequest, ) -> Result<CryptoWhitelistAddress>
Sourcepub async fn get_multi_crypto_bars(
&self,
params: &CryptoBarsParams,
) -> Result<MultiCryptoBarsResponse>
pub async fn get_multi_crypto_bars( &self, params: &CryptoBarsParams, ) -> Result<MultiCryptoBarsResponse>
Sourcepub async fn get_latest_crypto_bars(
&self,
symbols: &str,
) -> Result<LatestCryptoBarsResponse>
pub async fn get_latest_crypto_bars( &self, symbols: &str, ) -> Result<LatestCryptoBarsResponse>
Sourcepub async fn get_latest_crypto_quotes(
&self,
symbols: &str,
) -> Result<LatestCryptoQuotesResponse>
pub async fn get_latest_crypto_quotes( &self, symbols: &str, ) -> Result<LatestCryptoQuotesResponse>
Sourcepub async fn get_latest_crypto_trades(
&self,
symbols: &str,
) -> Result<LatestCryptoTradesResponse>
pub async fn get_latest_crypto_trades( &self, symbols: &str, ) -> Result<LatestCryptoTradesResponse>
Sourcepub async fn get_multi_crypto_snapshots(
&self,
symbols: &str,
) -> Result<MultiCryptoSnapshotsResponse>
pub async fn get_multi_crypto_snapshots( &self, symbols: &str, ) -> Result<MultiCryptoSnapshotsResponse>
Sourcepub async fn get_crypto_orderbooks(
&self,
symbols: &str,
) -> Result<CryptoOrderbooksResponse>
pub async fn get_crypto_orderbooks( &self, symbols: &str, ) -> Result<CryptoOrderbooksResponse>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn get_enhanced_news(
&self,
params: &NewsParams,
) -> Result<EnhancedNewsResponse>
pub async fn get_enhanced_news( &self, params: &NewsParams, ) -> Result<EnhancedNewsResponse>
Sourcepub async fn get_enhanced_news_for_symbols(
&self,
symbols: &str,
limit: u32,
) -> Result<EnhancedNewsResponse>
pub async fn get_enhanced_news_for_symbols( &self, symbols: &str, limit: u32, ) -> Result<EnhancedNewsResponse>
Sourcepub async fn get_latest_enhanced_news(
&self,
limit: u32,
) -> Result<EnhancedNewsResponse>
pub async fn get_latest_enhanced_news( &self, limit: u32, ) -> Result<EnhancedNewsResponse>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn oauth_exchange_code(
&self,
request: &OAuthTokenRequest,
) -> Result<OAuthToken>
pub async fn oauth_exchange_code( &self, request: &OAuthTokenRequest, ) -> Result<OAuthToken>
Sourcepub async fn oauth_refresh_token(
&self,
request: &OAuthTokenRequest,
) -> Result<OAuthToken>
pub async fn oauth_refresh_token( &self, request: &OAuthTokenRequest, ) -> Result<OAuthToken>
Sourcepub async fn oauth_revoke_token(
&self,
request: &OAuthRevokeRequest,
) -> Result<()>
pub async fn oauth_revoke_token( &self, request: &OAuthRevokeRequest, ) -> Result<()>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub fn get_account_status_events_url(&self, params: &SseEventParams) -> String
pub fn get_account_status_events_url(&self, params: &SseEventParams) -> String
Sourcepub fn get_transfer_status_events_url(&self, params: &SseEventParams) -> String
pub fn get_transfer_status_events_url(&self, params: &SseEventParams) -> String
Sourcepub fn get_trade_events_url(&self, params: &SseEventParams) -> String
pub fn get_trade_events_url(&self, params: &SseEventParams) -> String
Sourcepub fn get_journal_status_events_url(&self, params: &SseEventParams) -> String
pub fn get_journal_status_events_url(&self, params: &SseEventParams) -> String
Sourcepub fn get_nta_events_url(&self, params: &SseEventParams) -> String
pub fn get_nta_events_url(&self, params: &SseEventParams) -> String
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn list_enhanced_assets(
&self,
params: &ListAssetsParams,
) -> Result<Vec<EnhancedAsset>>
pub async fn list_enhanced_assets( &self, params: &ListAssetsParams, ) -> Result<Vec<EnhancedAsset>>
Sourcepub async fn get_enhanced_asset(
&self,
symbol_or_id: &str,
) -> Result<EnhancedAsset>
pub async fn get_enhanced_asset( &self, symbol_or_id: &str, ) -> Result<EnhancedAsset>
Sourcepub async fn get_asset_options(
&self,
symbol: &str,
) -> Result<Vec<OptionContractAsset>>
pub async fn get_asset_options( &self, symbol: &str, ) -> Result<Vec<OptionContractAsset>>
Sourcepub async fn list_announcements(
&self,
params: &ListAnnouncementsParams,
) -> Result<Vec<CorporateActionAnnouncement>>
pub async fn list_announcements( &self, params: &ListAnnouncementsParams, ) -> Result<Vec<CorporateActionAnnouncement>>
Sourcepub async fn get_announcement(
&self,
announcement_id: &str,
) -> Result<CorporateActionAnnouncement>
pub async fn get_announcement( &self, announcement_id: &str, ) -> Result<CorporateActionAnnouncement>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn list_activities(
&self,
params: &ListActivitiesParams,
) -> Result<Vec<AccountActivity>>
pub async fn list_activities( &self, params: &ListActivitiesParams, ) -> Result<Vec<AccountActivity>>
Sourcepub async fn list_activities_by_type(
&self,
activity_type: &str,
params: &ListActivitiesParams,
) -> Result<Vec<AccountActivity>>
pub async fn list_activities_by_type( &self, activity_type: &str, params: &ListActivitiesParams, ) -> Result<Vec<AccountActivity>>
Sourcepub async fn list_broker_activities(
&self,
params: &ListActivitiesParams,
) -> Result<Vec<AccountActivity>>
pub async fn list_broker_activities( &self, params: &ListActivitiesParams, ) -> Result<Vec<AccountActivity>>
Sourcepub async fn list_broker_account_activities(
&self,
account_id: &str,
params: &ListActivitiesParams,
) -> Result<Vec<AccountActivity>>
pub async fn list_broker_account_activities( &self, account_id: &str, params: &ListActivitiesParams, ) -> Result<Vec<AccountActivity>>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn create_rebalance_portfolio(
&self,
request: &RebalancePortfolioRequest,
) -> Result<RebalancePortfolio>
pub async fn create_rebalance_portfolio( &self, request: &RebalancePortfolioRequest, ) -> Result<RebalancePortfolio>
Sourcepub async fn list_rebalance_portfolios(&self) -> Result<Vec<RebalancePortfolio>>
pub async fn list_rebalance_portfolios(&self) -> Result<Vec<RebalancePortfolio>>
Sourcepub async fn get_rebalance_portfolio(
&self,
portfolio_id: &str,
) -> Result<RebalancePortfolio>
pub async fn get_rebalance_portfolio( &self, portfolio_id: &str, ) -> Result<RebalancePortfolio>
Sourcepub async fn delete_rebalance_portfolio(&self, portfolio_id: &str) -> Result<()>
pub async fn delete_rebalance_portfolio(&self, portfolio_id: &str) -> Result<()>
Sourcepub async fn execute_rebalance(
&self,
request: &RebalanceRunRequest,
) -> Result<RebalanceRun>
pub async fn execute_rebalance( &self, request: &RebalanceRunRequest, ) -> Result<RebalanceRun>
Sourcepub async fn list_rebalance_runs(&self) -> Result<Vec<RebalanceRun>>
pub async fn list_rebalance_runs(&self) -> Result<Vec<RebalanceRun>>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn get_locates(&self) -> Result<Vec<LocateResponse>>
pub async fn get_locates(&self) -> Result<Vec<LocateResponse>>
Sourcepub async fn request_locate(
&self,
request: &LocateRequest,
) -> Result<LocateResponse>
pub async fn request_locate( &self, request: &LocateRequest, ) -> Result<LocateResponse>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn reset_paper_account(&self) -> Result<Account>
pub async fn reset_paper_account(&self) -> Result<Account>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn get_exchange_rates(&self) -> Result<Vec<ExchangeRate>>
pub async fn get_exchange_rates(&self) -> Result<Vec<ExchangeRate>>
Sourcepub async fn get_exchange_rate(
&self,
currency_pair: &str,
) -> Result<ExchangeRate>
pub async fn get_exchange_rate( &self, currency_pair: &str, ) -> Result<ExchangeRate>
Source§impl AlpacaHttpClient
impl AlpacaHttpClient
Sourcepub async fn list_ira_contributions(
&self,
account_id: &str,
) -> Result<Vec<IraContribution>>
pub async fn list_ira_contributions( &self, account_id: &str, ) -> Result<Vec<IraContribution>>
Sourcepub async fn create_ira_contribution(
&self,
account_id: &str,
request: &CreateIraContributionRequest,
) -> Result<IraContribution>
pub async fn create_ira_contribution( &self, account_id: &str, request: &CreateIraContributionRequest, ) -> Result<IraContribution>
Sourcepub async fn list_ira_distributions(
&self,
account_id: &str,
) -> Result<Vec<IraDistribution>>
pub async fn list_ira_distributions( &self, account_id: &str, ) -> Result<Vec<IraDistribution>>
Sourcepub async fn list_ira_beneficiaries(
&self,
account_id: &str,
) -> Result<Vec<IraBeneficiary>>
pub async fn list_ira_beneficiaries( &self, account_id: &str, ) -> Result<Vec<IraBeneficiary>>
Trait Implementations§
Source§impl Clone for AlpacaHttpClient
impl Clone for AlpacaHttpClient
Source§fn clone(&self) -> AlpacaHttpClient
fn clone(&self) -> AlpacaHttpClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more