rustyschwab-types
Unofficial wire types for the Charles Schwab Trader and Market Data APIs (not affiliated with Charles Schwab & Co., Inc.): accounts, orders and transactions, quotes, option chains, price history, market hours, movers, and the streamer's messages and numbered field tables.
Most users want rustyschwab, the SDK, which
re-exports these as rustyschwab::types. Depend on this crate directly to
share the types without the HTTP and streaming stack.
[]
= "0.2"
Conventions
- Responses keep what they do not model. Response structs carry an
extramap for fields Schwab adds, and response enums decode a value they do not know asUnknownrather than failing the whole payload. - Requests are strict.
OrderRequestrejects unknown fields, andvalidate()refuses what Schwab would reject or misread:Unknownenum values, fields that do not fit the order type, fractional equity or option quantities, extended-hours orders that are not limits, and more. - Money is exact. Request prices and quantities are
Decimal, read from a string such as"150.25"or a JSON number. Prices go out as strings and quantities as JSON numbers, the forms Schwab's examples use. - Orders have constructors.
OrderRequest::limit,stop,bracket,one_cancels_otherand friends build Schwab's documented shapes, andOptionSymbolreads and writes OSI option symbols.
Features
schemars: derivesJsonSchemaon the request types, for tool schemas (theschwab-mcpserver uses it).
See the repository README for the full documentation set.