Crates.io | rsbit |
lib.rs | rsbit |
version | 0.5.4 |
source | src |
created_at | 2023-12-13 15:21:29.7837 |
updated_at | 2024-05-12 12:31:31.954317 |
description | This is a library for the Bybit API. |
homepage | |
repository | https://github.com/torohash/rsbit |
max_upload_size | |
id | 1068114 |
size | 648,900 |
I am live coding on YouTube. If you're interested, please feel free to visit.
※日本語で話しています。
YouTube Channel Link
This is a library for the Bybit API.
The response is returned in the form of a deserialized struct.
use rsbit::v5::api::{
BybitApi,
get::market::get_public_recent_trading_history::{
GetPublicRecentTradingHistoryParameters,
GetPublicRecentTradingHistoryCategory,
}
};
#[tokio::main]
async fn main() {
// If you're only using public APIs, there is no need to set it up with an API key or API secret.
let bybit_api = BybitApi::new()
.with_mainnet() // The default is for the testnet, so please add it for use on the mainnet.
.with_testnet() // You can also revert to the testnet if needed.
.with_api_key("your_api_key")
.with_api_secret("your_api_secret");
let params = GetPublicRecentTradingHistoryParameters::new(
GetPublicRecentTradingHistoryCategory::Linear,
).with_symbol("BTCUSDT".to_string());
let result = bybit_api.get_public_recent_trading_history;
match result {
Ok(result) => {
// Do something with the result.
},
Err(err) => {
// Do something with the error.
}
}
}