renegade_sdk/renegade_wallet_client/actions/
get_account.rs

1//! Looks up an account by its ID in the relayer
2
3use renegade_external_api::{
4    http::account::{GET_ACCOUNT_BY_ID_ROUTE, GetAccountResponse},
5    types::ApiAccount,
6};
7
8use crate::{RenegadeClientError, actions::construct_http_path, client::RenegadeClient};
9
10impl RenegadeClient {
11    /// Look up an account by its ID
12    ///
13    /// Returns the account's orders and balances
14    pub async fn get_account(&self) -> Result<ApiAccount, RenegadeClientError> {
15        let path =
16            construct_http_path!(GET_ACCOUNT_BY_ID_ROUTE, "account_id" => self.get_account_id());
17        let GetAccountResponse { account } = self.relayer_client.get(&path).await?;
18        Ok(account)
19    }
20}