use std::sync::Arc;
use crate::client::HttpCore;
use crate::error::Result;
use crate::types::*;
#[derive(Debug, Clone)]
pub struct Wallet {
pub(crate) core: Arc<HttpCore>,
}
impl Wallet {
pub async fn stats(&self, address: &str) -> Result<WalletStatsResponse> {
self.core
.get(&format!("/wallet/{}", address), &())
.await
}
pub async fn pnl(&self, address: &str) -> Result<WalletPnlResponse> {
self.core
.get(&format!("/wallet/{}/pnl", address), &())
.await
}
pub async fn positions(&self, address: &str) -> Result<WalletPositionsResponse> {
self.core
.get(&format!("/wallet/{}/positions", address), &())
.await
}
pub async fn holdings(
&self,
address: &str,
params: &WalletHoldingsParams,
) -> Result<WalletHoldingsResponse> {
self.core
.get(&format!("/wallet/{}/holdings", address), params)
.await
}
pub async fn trades(
&self,
address: &str,
params: &WalletTradesParams,
) -> Result<WalletTradesResponse> {
self.core
.get(&format!("/wallet/{}/trades", address), params)
.await
}
}