Skip to main content

Crate brokapi

Crate brokapi 

Source
Expand description

One interface to the APIs of Russian brokers: BCS, T-Bank, Finam and ALOR.

This is the crate you depend on. It re-exports the library and switches brokers on with features, the way tokio does:

[dependencies]
 brokapi = { version = "0.1.0-alpha.5", features = ["bcs"] }   # or "tbank", "finam", "alor", "bybit"
PathWhat is thereFeature
[core]domain types, capability traits, events, errorsalways
[runtime]rate limits, subscription buffers, reconcile, shutdownalways
[sansio]the network-free core of a connector and the recorded-frame test harnessalways
bcsBCS connectors (MarketDataConnector, UserDataConnector); bcs::protocol is the wire clientbcs
tbankT-Bank connectors; tbank::protocol is the gRPC clienttbank
finamFinam connectors; finam::protocol is the gRPC clientfinam
alorALOR connectors; alor::protocol is the HTTP and WebSocket clientalor
bybitBybit connectors; bybit::protocol is the HTTP and WebSocket clientbybit

The guide and the rules for orders are in the book: https://brokapi.ru/docs/. The stage is open alpha: the interface can change before the beta. Before you trade with real money, read https://brokapi.ru/docs/before-live.html.

§Example

A command with no answer is never repeated: the error says so by its class.

use brokapi::core::{Error, ErrorClass};

assert_eq!(Error::Unknown.class(), ErrorClass::Unknown);

Re-exports§

pub use brokapi_core as core;
pub use brokapi_runtime as runtime;
pub use brokapi_sansio as sansio;

Modules§

alor
ALOR connectors and the ALOR wire client.
bcs
BCS connectors and the BCS wire client.
bybit
Bybit connectors and the Bybit wire client.
finam
Finam connectors and the Finam gRPC client.
tbank
T-Bank connectors and the T-Bank gRPC client.