// This file is @generated by prost-build. /// Order Management Messages #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubmitOrderRequest { #[prost(string, tag = "1")] pub symbol: ::prost::alloc::string::String, #[prost(enumeration = "OrderSide", tag = "2")] pub side: i32, #[prost(double, tag = "3")] pub quantity: f64, #[prost(enumeration = "OrderType", tag = "4")] pub order_type: i32, #[prost(double, optional, tag = "5")] pub price: ::core::option::Option, #[prost(double, optional, tag = "6")] pub stop_price: ::core::option::Option, #[prost(string, tag = "7")] pub account_id: ::prost::alloc::string::String, #[prost(map = "string, string", tag = "8")] pub metadata: ::std::collections::HashMap< ::prost::alloc::string::String, ::prost::alloc::string::String, >, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubmitOrderResponse { #[prost(string, tag = "1")] pub order_id: ::prost::alloc::string::String, #[prost(enumeration = "OrderStatus", tag = "2")] pub status: i32, #[prost(string, tag = "3")] pub message: ::prost::alloc::string::String, #[prost(int64, tag = "4")] pub timestamp: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelOrderRequest { #[prost(string, tag = "1")] pub order_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub account_id: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelOrderResponse { #[prost(bool, tag = "1")] pub success: bool, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, #[prost(int64, tag = "3")] pub timestamp: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetOrderStatusRequest { #[prost(string, tag = "1")] pub order_id: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetOrderStatusResponse { #[prost(message, optional, tag = "1")] pub order: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamOrdersRequest { #[prost(string, optional, tag = "1")] pub account_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(string, optional, tag = "2")] pub symbol: ::core::option::Option<::prost::alloc::string::String>, } /// Position Management Messages #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPositionsRequest { #[prost(string, optional, tag = "1")] pub account_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(string, optional, tag = "2")] pub symbol: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPositionsResponse { #[prost(message, repeated, tag = "1")] pub positions: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamPositionsRequest { #[prost(string, optional, tag = "1")] pub account_id: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPortfolioSummaryRequest { #[prost(string, tag = "1")] pub account_id: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPortfolioSummaryResponse { #[prost(double, tag = "1")] pub total_value: f64, #[prost(double, tag = "2")] pub unrealized_pnl: f64, #[prost(double, tag = "3")] pub realized_pnl: f64, #[prost(double, tag = "4")] pub day_pnl: f64, #[prost(double, tag = "5")] pub buying_power: f64, #[prost(double, tag = "6")] pub margin_used: f64, #[prost(message, repeated, tag = "7")] pub positions: ::prost::alloc::vec::Vec, } /// Market Data Messages #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamMarketDataRequest { #[prost(string, repeated, tag = "1")] pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(enumeration = "MarketDataType", repeated, tag = "2")] pub data_types: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetOrderBookRequest { #[prost(string, tag = "1")] pub symbol: ::prost::alloc::string::String, #[prost(int32, optional, tag = "2")] pub depth: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetOrderBookResponse { #[prost(message, optional, tag = "1")] pub order_book: ::core::option::Option, } /// Execution Messages #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamExecutionsRequest { #[prost(string, optional, tag = "1")] pub account_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(string, optional, tag = "2")] pub symbol: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetExecutionHistoryRequest { #[prost(string, optional, tag = "1")] pub account_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(string, optional, tag = "2")] pub symbol: ::core::option::Option<::prost::alloc::string::String>, #[prost(int64, optional, tag = "3")] pub start_time: ::core::option::Option, #[prost(int64, optional, tag = "4")] pub end_time: ::core::option::Option, #[prost(int32, optional, tag = "5")] pub limit: ::core::option::Option, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetExecutionHistoryResponse { #[prost(message, repeated, tag = "1")] pub executions: ::prost::alloc::vec::Vec, } /// Core Data Types #[derive(Clone, PartialEq, ::prost::Message)] pub struct Order { #[prost(string, tag = "1")] pub order_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub symbol: ::prost::alloc::string::String, #[prost(enumeration = "OrderSide", tag = "3")] pub side: i32, #[prost(double, tag = "4")] pub quantity: f64, #[prost(double, tag = "5")] pub filled_quantity: f64, #[prost(enumeration = "OrderType", tag = "6")] pub order_type: i32, #[prost(double, optional, tag = "7")] pub price: ::core::option::Option, #[prost(double, optional, tag = "8")] pub stop_price: ::core::option::Option, #[prost(enumeration = "OrderStatus", tag = "9")] pub status: i32, #[prost(int64, tag = "10")] pub created_at: i64, #[prost(int64, optional, tag = "11")] pub updated_at: ::core::option::Option, #[prost(string, tag = "12")] pub account_id: ::prost::alloc::string::String, #[prost(map = "string, string", tag = "13")] pub metadata: ::std::collections::HashMap< ::prost::alloc::string::String, ::prost::alloc::string::String, >, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Position { #[prost(string, tag = "1")] pub symbol: ::prost::alloc::string::String, #[prost(double, tag = "2")] pub quantity: f64, #[prost(double, tag = "3")] pub average_price: f64, #[prost(double, tag = "4")] pub market_value: f64, #[prost(double, tag = "5")] pub unrealized_pnl: f64, #[prost(double, tag = "6")] pub realized_pnl: f64, #[prost(string, tag = "7")] pub account_id: ::prost::alloc::string::String, #[prost(int64, tag = "8")] pub updated_at: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Execution { #[prost(string, tag = "1")] pub execution_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub order_id: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub symbol: ::prost::alloc::string::String, #[prost(enumeration = "OrderSide", tag = "4")] pub side: i32, #[prost(double, tag = "5")] pub quantity: f64, #[prost(double, tag = "6")] pub price: f64, #[prost(int64, tag = "7")] pub timestamp: i64, #[prost(string, tag = "8")] pub account_id: ::prost::alloc::string::String, #[prost(map = "string, string", tag = "9")] pub metadata: ::std::collections::HashMap< ::prost::alloc::string::String, ::prost::alloc::string::String, >, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderBook { #[prost(string, tag = "1")] pub symbol: ::prost::alloc::string::String, #[prost(message, repeated, tag = "2")] pub bids: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] pub asks: ::prost::alloc::vec::Vec, #[prost(int64, tag = "4")] pub timestamp: i64, } #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct OrderBookLevel { #[prost(double, tag = "1")] pub price: f64, #[prost(double, tag = "2")] pub quantity: f64, #[prost(int32, tag = "3")] pub order_count: i32, } /// Event Messages #[derive(Clone, PartialEq, ::prost::Message)] pub struct OrderEvent { #[prost(string, tag = "1")] pub order_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub order: ::core::option::Option, #[prost(enumeration = "OrderEventType", tag = "3")] pub event_type: i32, #[prost(int64, tag = "4")] pub timestamp: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct PositionEvent { #[prost(string, tag = "1")] pub symbol: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub position: ::core::option::Option, #[prost(enumeration = "PositionEventType", tag = "3")] pub event_type: i32, #[prost(int64, tag = "4")] pub timestamp: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecutionEvent { #[prost(string, tag = "1")] pub execution_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub execution: ::core::option::Option, #[prost(int64, tag = "3")] pub timestamp: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct MarketDataEvent { #[prost(string, tag = "1")] pub symbol: ::prost::alloc::string::String, #[prost(enumeration = "MarketDataType", tag = "2")] pub data_type: i32, #[prost(int64, tag = "6")] pub timestamp: i64, #[prost(oneof = "market_data_event::Data", tags = "3, 4, 5")] pub data: ::core::option::Option, } /// Nested message and enum types in `MarketDataEvent`. pub mod market_data_event { #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Data { #[prost(message, tag = "3")] Trade(super::Trade), #[prost(message, tag = "4")] Quote(super::Quote), #[prost(message, tag = "5")] OrderBook(super::OrderBook), } } #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Trade { #[prost(double, tag = "1")] pub price: f64, #[prost(double, tag = "2")] pub volume: f64, #[prost(int64, tag = "3")] pub timestamp: i64, } #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Quote { #[prost(double, tag = "1")] pub bid_price: f64, #[prost(double, tag = "2")] pub bid_size: f64, #[prost(double, tag = "3")] pub ask_price: f64, #[prost(double, tag = "4")] pub ask_size: f64, #[prost(int64, tag = "5")] pub timestamp: i64, } /// Enums #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OrderSide { Unspecified = 0, Buy = 1, Sell = 2, } impl OrderSide { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "ORDER_SIDE_UNSPECIFIED", Self::Buy => "ORDER_SIDE_BUY", Self::Sell => "ORDER_SIDE_SELL", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "ORDER_SIDE_UNSPECIFIED" => Some(Self::Unspecified), "ORDER_SIDE_BUY" => Some(Self::Buy), "ORDER_SIDE_SELL" => Some(Self::Sell), _ => None, } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OrderType { Unspecified = 0, Market = 1, Limit = 2, Stop = 3, StopLimit = 4, } impl OrderType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "ORDER_TYPE_UNSPECIFIED", Self::Market => "ORDER_TYPE_MARKET", Self::Limit => "ORDER_TYPE_LIMIT", Self::Stop => "ORDER_TYPE_STOP", Self::StopLimit => "ORDER_TYPE_STOP_LIMIT", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "ORDER_TYPE_MARKET" => Some(Self::Market), "ORDER_TYPE_LIMIT" => Some(Self::Limit), "ORDER_TYPE_STOP" => Some(Self::Stop), "ORDER_TYPE_STOP_LIMIT" => Some(Self::StopLimit), _ => None, } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OrderStatus { Unspecified = 0, Pending = 1, Submitted = 2, PartiallyFilled = 3, Filled = 4, Cancelled = 5, Rejected = 6, } impl OrderStatus { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "ORDER_STATUS_UNSPECIFIED", Self::Pending => "ORDER_STATUS_PENDING", Self::Submitted => "ORDER_STATUS_SUBMITTED", Self::PartiallyFilled => "ORDER_STATUS_PARTIALLY_FILLED", Self::Filled => "ORDER_STATUS_FILLED", Self::Cancelled => "ORDER_STATUS_CANCELLED", Self::Rejected => "ORDER_STATUS_REJECTED", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "ORDER_STATUS_UNSPECIFIED" => Some(Self::Unspecified), "ORDER_STATUS_PENDING" => Some(Self::Pending), "ORDER_STATUS_SUBMITTED" => Some(Self::Submitted), "ORDER_STATUS_PARTIALLY_FILLED" => Some(Self::PartiallyFilled), "ORDER_STATUS_FILLED" => Some(Self::Filled), "ORDER_STATUS_CANCELLED" => Some(Self::Cancelled), "ORDER_STATUS_REJECTED" => Some(Self::Rejected), _ => None, } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OrderEventType { Unspecified = 0, Created = 1, Updated = 2, Filled = 3, Cancelled = 4, Rejected = 5, } impl OrderEventType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "ORDER_EVENT_TYPE_UNSPECIFIED", Self::Created => "ORDER_EVENT_TYPE_CREATED", Self::Updated => "ORDER_EVENT_TYPE_UPDATED", Self::Filled => "ORDER_EVENT_TYPE_FILLED", Self::Cancelled => "ORDER_EVENT_TYPE_CANCELLED", Self::Rejected => "ORDER_EVENT_TYPE_REJECTED", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "ORDER_EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "ORDER_EVENT_TYPE_CREATED" => Some(Self::Created), "ORDER_EVENT_TYPE_UPDATED" => Some(Self::Updated), "ORDER_EVENT_TYPE_FILLED" => Some(Self::Filled), "ORDER_EVENT_TYPE_CANCELLED" => Some(Self::Cancelled), "ORDER_EVENT_TYPE_REJECTED" => Some(Self::Rejected), _ => None, } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PositionEventType { Unspecified = 0, Opened = 1, Updated = 2, Closed = 3, } impl PositionEventType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "POSITION_EVENT_TYPE_UNSPECIFIED", Self::Opened => "POSITION_EVENT_TYPE_OPENED", Self::Updated => "POSITION_EVENT_TYPE_UPDATED", Self::Closed => "POSITION_EVENT_TYPE_CLOSED", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "POSITION_EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "POSITION_EVENT_TYPE_OPENED" => Some(Self::Opened), "POSITION_EVENT_TYPE_UPDATED" => Some(Self::Updated), "POSITION_EVENT_TYPE_CLOSED" => Some(Self::Closed), _ => None, } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum MarketDataType { Unspecified = 0, Trade = 1, Quote = 2, OrderBook = 3, } impl MarketDataType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "MARKET_DATA_TYPE_UNSPECIFIED", Self::Trade => "MARKET_DATA_TYPE_TRADE", Self::Quote => "MARKET_DATA_TYPE_QUOTE", Self::OrderBook => "MARKET_DATA_TYPE_ORDER_BOOK", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "MARKET_DATA_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "MARKET_DATA_TYPE_TRADE" => Some(Self::Trade), "MARKET_DATA_TYPE_QUOTE" => Some(Self::Quote), "MARKET_DATA_TYPE_ORDER_BOOK" => Some(Self::OrderBook), _ => None, } } } /// Generated client implementations. pub mod trading_service_client { #![allow( unused_variables, dead_code, missing_docs, clippy::wildcard_imports, clippy::let_unit_value, )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Trading Service - Complete real-time trading operations #[derive(Debug, Clone)] pub struct TradingServiceClient { inner: tonic::client::Grpc, } impl TradingServiceClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl TradingServiceClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor( inner: T, interceptor: F, ) -> TradingServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, , >>::Error: Into + std::marker::Send + std::marker::Sync, { TradingServiceClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Limits the maximum size of a decoded message. /// /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_decoding_message_size(limit); self } /// Limits the maximum size of an encoded message. /// /// Default: `usize::MAX` #[must_use] pub fn max_encoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_encoding_message_size(limit); self } /// Order Management pub async fn submit_order( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/SubmitOrder", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "SubmitOrder")); self.inner.unary(req, path, codec).await } pub async fn cancel_order( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/CancelOrder", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "CancelOrder")); self.inner.unary(req, path, codec).await } pub async fn get_order_status( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/GetOrderStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "GetOrderStatus")); self.inner.unary(req, path, codec).await } pub async fn stream_orders( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response>, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/StreamOrders", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "StreamOrders")); self.inner.server_streaming(req, path, codec).await } /// Position Management pub async fn get_positions( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/GetPositions", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "GetPositions")); self.inner.unary(req, path, codec).await } pub async fn stream_positions( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response>, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/StreamPositions", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "StreamPositions")); self.inner.server_streaming(req, path, codec).await } pub async fn get_portfolio_summary( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/GetPortfolioSummary", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("trading.TradingService", "GetPortfolioSummary"), ); self.inner.unary(req, path, codec).await } /// Market Data pub async fn stream_market_data( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response>, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/StreamMarketData", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "StreamMarketData")); self.inner.server_streaming(req, path, codec).await } pub async fn get_order_book( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/GetOrderBook", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "GetOrderBook")); self.inner.unary(req, path, codec).await } /// Executions pub async fn stream_executions( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response>, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/StreamExecutions", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("trading.TradingService", "StreamExecutions")); self.inner.server_streaming(req, path, codec).await } pub async fn get_execution_history( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, tonic::Status, > { self.inner .ready() .await .map_err(|e| { tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/trading.TradingService/GetExecutionHistory", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("trading.TradingService", "GetExecutionHistory"), ); self.inner.unary(req, path, codec).await } } }