pub struct TradingClient {
pub api_key: String,
pub base_url: Url,
/* private fields */
}Expand description
The client for the Lemon API.
Fields§
§api_key: StringThe API key.
base_url: UrlThe base url for the API
Implementations§
Source§impl TradingClient
impl TradingClient
Sourcepub fn get_order(
&self,
id: Option<String>,
) -> Result<GenericResponse<OrderResults>, Error>
pub fn get_order( &self, id: Option<String>, ) -> Result<GenericResponse<OrderResults>, Error>
Get orders
Sourcepub fn post_order(
&self,
_body: OrderPlacing,
) -> Result<GenericResponse<OrderResults>, Error>
pub fn post_order( &self, _body: OrderPlacing, ) -> Result<GenericResponse<OrderResults>, Error>
Post and create a new order.
Source§impl TradingClient
impl TradingClient
Source§impl TradingClient
impl TradingClient
Sourcepub fn get_account_information(
&self,
) -> Result<AccountInformation<AccountResults>, Error>
pub fn get_account_information( &self, ) -> Result<AccountInformation<AccountResults>, Error>
Get account information
Source§impl TradingClient
impl TradingClient
Sourcepub fn get_positions_performance(
&self,
) -> Result<PaginationResponse<PositionPerformance>, Error>
pub fn get_positions_performance( &self, ) -> Result<PaginationResponse<PositionPerformance>, Error>
Get an overview of your position performances Using this endpoint, you can retrieve when positions were opened and closed, potential profits/losses, or related fees for position orders.
Source§impl TradingClient
impl TradingClient
Sourcepub fn get_statements(
&self,
limit: Option<i64>,
page: Option<u32>,
) -> Result<PaginationResponse<Statement>, Error>
pub fn get_statements( &self, limit: Option<i64>, page: Option<u32>, ) -> Result<PaginationResponse<Statement>, Error>
Get all change events happening to your positions.
Source§impl TradingClient
impl TradingClient
Sourcepub fn get_positions(&self) -> Result<PaginationResponse<Position>, Error>
pub fn get_positions(&self) -> Result<PaginationResponse<Position>, Error>
Get all positions
Source§impl TradingClient
impl TradingClient
Sourcepub fn paper_client(api_key: &str) -> Self
pub fn paper_client(api_key: &str) -> Self
Create a new client for paper trading with the given API key.
Sourcepub fn live_client(api_key: String) -> Self
pub fn live_client(api_key: String) -> Self
Create a new client for live trading with the given API key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TradingClient
impl !RefUnwindSafe for TradingClient
impl Send for TradingClient
impl Sync for TradingClient
impl Unpin for TradingClient
impl UnsafeUnpin for TradingClient
impl !UnwindSafe for TradingClient
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
Mutably borrows from an owned value. Read more