Skip to main content

Crate projectx_client

Crate projectx_client 

Source
Expand description

Async Rust client for the ProjectX Gateway API.

This crate models ProjectX’s provider-native HTTP contract. It deliberately owns no trading-engine concepts, runtime, environment loading, or application state. Applications authenticate explicitly and translate these types at their own boundary.

Authenticated REST requests use shared rolling-window admission control. Safe queries wait asynchronously for capacity, while mutations return Error::LocallyRateLimited before sending when the local budget is full.

§Example

use projectx_client::{Client, Credentials};

let credentials = Credentials::new("user", "api-key")?;
let client = Client::builder(credentials).build()?;
client.authenticate().await?;
let accounts = client.search_active_accounts().await?;

Structs§

Account
A ProjectX account.
AccountId
Validated ProjectX account identifier.
ApplicationCredentials
ProjectX authorized-application credentials.
ApplicationCredentialsBuilder
Builder for validated ApplicationCredentials.
Bar
A historical OHLCV bar.
Bracket
ProjectX bracket-leg configuration.
CancelOrder
Order cancellation parameters.
Client
Authenticated ProjectX REST client.
ClientBuilder
Builder for Client.
CloseContract
Position close parameters.
Contract
A ProjectX futures contract.
ContractId
Validated ProjectX contract identifier.
Credentials
ProjectX API-key credentials.
Decimal
Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.
Endpoints
REST and real-time endpoints for one ProjectX deployment.
HistoryRequest
Historical-bar request parameters.
HistoryRequestBuilder
Builder for a validated HistoryRequest.
MarketDepth
Depth-of-market update from the market hub.
MarketQuote
Sparse quote update from the market hub.
MarketTrade
Trade print from the market hub.
ModifyOrder
Order modification parameters.
ModifyOrderBuilder
Builder for a validated ModifyOrder.
OperationResponse
Successful response for an operation without a result body.
Order
A ProjectX order.
OrderId
Validated ProjectX order identifier.
OrderPage
One page returned by Client::query_orders.
OrderQuery
Filtered, paginated order-query parameters.
OrderQueryBuilder
Builder for a validated OrderQuery.
OrderResponse
Successful order-placement result.
OrderSearch
Historical order search parameters.
PartialCloseContract
Partial-position close parameters.
PlaceOrder
Order placement parameters.
PlaceOrderBuilder
Builder for a validated PlaceOrder.
Position
A ProjectX open position.
PositionId
Validated ProjectX position identifier.
ProviderDate
A provider civil date parsed from an ISO-8601 YYYY-MM-DD value.
ProviderDateError
A string was not a valid provider civil date.
ProviderError
A provider-declared failed operation.
RateLimit
One rolling-window request limit.
RateLimitConfig
Rate limits applied to authenticated ProjectX REST requests.
RealtimeClient
SignalR-over-WebSocket client for one ProjectX hub.
RealtimeEventReceiver
Single-consumer bounded receiver for real-time events.
SearchContracts
Contract search parameters.
SessionValidator
Guard for a periodic token-validation task.
SignalRInvocation
A decoded SignalR invocation frame.
SymbolId
Validated ProjectX symbol identifier.
Timestamp
An absolute provider timestamp parsed from an ISO-8601/RFC-3339 value.
TimestampError
A string was not a valid absolute provider timestamp.
Trade
A ProjectX execution trade.
TradeId
Validated ProjectX trade identifier.
TradeQuery
Trade search parameters with independently optional timestamp bounds.
TradeQueryBuilder
Builder for a validated TradeQuery.
TradeSearch
Trade search parameters.

Enums§

BarUnit
Historical-bar aggregation unit.
DepthType
A ProjectX depth-of-market update kind.
Error
Errors returned by the ProjectX client.
Hub
ProjectX real-time hub.
OrderSortBy
Field used to sort an OrderQuery result page.
OrderSortDirection
Direction used to sort an OrderQuery result page.
OrderStatus
A ProjectX order lifecycle status.
OrderType
A ProjectX order type.
PositionType
A ProjectX position direction.
RateLimitKind
Identifies one provider REST rate-limit budget.
RealtimeError
Errors returned by the real-time transport.
RealtimeEvent
Events emitted by a RealtimeClient.
RequestValidationError
Validation failures while constructing a provider request.
Side
A ProjectX order side.
TradeLogType
A ProjectX market-trade aggressor classification.