Expand description
§WhaleAPI SDK for Rust
longportwhale provides an easy-to-use interface for invokes WhaleAPI]
§Quickstart
Add dependencies to Cargo.toml
[dependencies]
longportwhale = "1.0.0"Setting environment variables(MacOS/Linux)
export LONGPORT_APP_KEY="App Key get from user center"
export LONGPORT_APP_SECRET="App Secret get from user center"
export LONGPORT_ACCESS_TOKEN="Access Token get from user center"Setting environment variables(Windows)
setx LONGPORT_APP_KEY "App Key get from user center"
setx LONGPORT_APP_SECRET "App Secret get from user center"
setx LONGPORT_ACCESS_TOKEN "Access Token get from user center"§Crate features
To avoid compiling unused dependencies, longport gates certain features, all of which are disabled by default:
| Feature | Description |
|---|---|
| blocking | Provides the blocking client API. |
§License
Licensed under either of
- Apache License, Version 2.0,(LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Re-exports§
pub use trade::TradeContext;pub use longportwhale_httpcli as httpclient;
Modules§
- trade
- Trade related types
Macros§
- decimal
- A macro to construct decimal.
Structs§
- Config
- Configuration options for LongPort sdk
- Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare 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.
Enums§
- Error
- LongPort OpenAPI SDK error type
- Language
- Language identifier
- Market
- Market
- Simple
Error - Simple error type
Type Aliases§
- Result
- LongPort OpenAPI SDK result type