use crate::{
clients::spot::BnSpot,
common::response::{BnRestRespType, BnWsApiRespType},
data::{account_information::BnSpotAccountInformation, enums::ratelimit::BnRateLimitType},
};
use http::Method;
use nonzero_ext::nonzero;
use xapi_shared::rest::SharedRestClientTrait;
impl BnSpot {
pub async fn get_account_information(&self) -> BnRestRespType<BnSpotAccountInformation> {
self.executor
.call_with_no_payload(
&[
(BnRateLimitType::RequestWeight, nonzero!(20u32)),
(BnRateLimitType::RawRequests, nonzero!(1u32)),
],
true,
Method::GET,
self.executor
.get_endpoint()
.build_rest_api_url("/api/v3/account"),
)
.await
}
pub async fn get_account_information_ws(&self) -> BnWsApiRespType<BnSpotAccountInformation> {
self.executor
.call_ws_api(
&[
(BnRateLimitType::RequestWeight, nonzero!(20u32)),
(BnRateLimitType::RawRequests, nonzero!(1u32)),
],
true,
"account.status",
None::<()>,
)
.await
}
}