sim_cli/client.rs
1//! One construction point, so the CLI product token is set once rather than at
2//! each command's call site.
3
4use simulator_api::client_identity::ClientProduct;
5use simulator_client::BacktestClient;
6
7/// An empty `api_key` is the keyless case, which the client already handles by
8/// omitting the header rather than sending a blank one.
9pub fn new(url: &str, api_key: &str) -> BacktestClient {
10 BacktestClient::builder()
11 .url(url)
12 .api_key(api_key)
13 .product(ClientProduct::Cli)
14 .product_version(env!("CARGO_PKG_VERSION"))
15 .build()
16}