| Crates.io | investments-tinkoff |
| lib.rs | investments-tinkoff |
| version | 0.5.1 |
| created_at | 2024-12-14 12:49:47.123746+00 |
| updated_at | 2024-12-29 21:39:42.060354+00 |
| description | Client for Tinkoff Investments Api |
| homepage | |
| repository | https://github.com/Grapple228/rust-investments-tinkoff |
| max_upload_size | |
| id | 1483110 |
| size | 653,580 |
Client for Tinkoff Invesments API over gRPC protocol
For compiling protos, run
cargo run --example build_contracts
TINKOFF_TOKEN # Token for accessing to API
TINKOFF_API # API URL, by default is <https://invest-public-api.tinkoff.ru:443/>
You can also use the env option to set any other argument variables for the build e.g. RUSTFLAGS.
Or create file .cargo/config.toml and set it there like this:
TINKOFF_TOKEN = <token>
Cargo.toml[dependencies]
investments_tinkoff = "0.5.*"
tonic = "0.12"
See Environment variables section above
// Code from /examples/simple.rs
// -- Create api
let api = InvestApi::default().with_app_name("Grapple228.rust-investments-tinkoff");
// -- Create channel
let channel = ChannelBuilder::default()?.connect().await?;
// -- Create users client
let mut users_client = api.users(&channel)?;
// -- Create request
let request = tonic::Request::new(GetAccountsRequest { status: None });
// -- Send request
let response = users_client.get_accounts(request).await?;
println!("RESPONSE={:#?}", response);
Ok(())