renegade_sdk/renegade_wallet_client/actions/
get_balances.rs

1//! Gets all of the balances in the account
2
3use renegade_external_api::{
4    http::balance::{GET_BALANCES_ROUTE, GetBalancesResponse},
5    types::ApiBalance,
6};
7
8use crate::{RenegadeClientError, actions::construct_http_path, client::RenegadeClient};
9
10impl RenegadeClient {
11    /// Fetches all balances in the account.
12    pub async fn get_balances(&self) -> Result<Vec<ApiBalance>, RenegadeClientError> {
13        let path = construct_http_path!(GET_BALANCES_ROUTE, "account_id" => self.get_account_id());
14
15        let GetBalancesResponse { balances } = self.relayer_client.get(&path).await?;
16
17        Ok(balances)
18    }
19}