diff --git a/src/horizon_client.rs b/src/horizon_client.rs
index 5ef70fe..6f6dbaf 100644
--- a/src/horizon_client.rs
+++ b/src/horizon_client.rs
@@ -21,17 +21,17 @@ pub struct HorizonClient {
impl HorizonClient {
/// Creates a new instance of the `HorizonClient`.
///
- /// This constructor method initializes a new `HorizonClient` with the specified base URL
- /// for the Horizon API server. It performs validation on the provided URL to ensure it is
+ /// This constructor method initializes a new `HorizonClient` with the specified base URL
+ /// for the Horizon API server. It performs validation on the provided URL to ensure it is
/// well-formed and appropriate for establishing a connection.
- ///
+ ///
/// # Arguments
/// * `base_url` - A `String` representing the base URL of the Horizon server.
- ///
+ ///
/// # Returns
- /// If successful, this method returns a `Result` containing the initialized `HorizonClient`
+ /// If successful, this method returns a `Result` containing the initialized `HorizonClient`
/// instance. If the URL validation fails, it returns an error encapsulated within `Result`.
- ///
+ ///
/// # Example
/// ```rust
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
@@ -44,32 +44,31 @@ impl HorizonClient {
}
/// Retrieves a list of accounts filtered by specific criteria.
- ///
- /// This method retrieves a list of accounts from the Horizon server, filtering the results
+ ///
+ /// This method retrieves a list of accounts from the Horizon server, filtering the results
/// based on one of four categories: sponsor, signer, asset, or liquidity pool.
- ///
+ ///
/// Adheres to the List All Accounts
/// endpoint.
- ///
+ ///
/// # Arguments
- /// * `request` - A reference to an implementation of the [`ValidAccountsRequest`] trait,
+ /// * `request` - A reference to an implementation of the [`ValidAccountsRequest`] trait,
/// which specifies the filter criteria for the account list request.
///
/// # Returns
- /// If successful, this method returns a `Result` containing an [`AccountsResponse`],
- /// which encapsulates the list of accounts retrieved from the server.
+ /// If successful, this method returns a `Result` containing an [`AccountsResponse`],
+ /// which encapsulates the list of accounts retrieved from the server.
/// In case of a failure in the request, it returns an error encapsulated within `Result`.
///
/// # Example
/// To use this method, create an instance of [`AccountsRequest`] and set at least
/// one of the four filter options. For example, filtering by signer:
- ///
+ ///
/// ```rust
/// # use stellar_rust_sdk::accounts::prelude::*;
- /// # use stellar_rust_sdk::accounts::accounts_request::Signer;
/// # use stellar_rust_sdk::models::Request;
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
- /// #
+ /// #
/// # async fn example() -> Result<(), Box> {
/// # let base_url = "https://horizon-testnet.stellar.org".to_string();
/// # let horizon_client = HorizonClient::new(base_url)
@@ -77,7 +76,7 @@ impl HorizonClient {
/// let request = AccountsRequest::new()
/// .set_signer("GDQJUTQYK2MQX2VGDR2FYWLIYAQIEGXTQVTFEMGH2BEWFG4BRUY4CKI7")
/// .unwrap();
- ///
+ ///
/// let response: Result = horizon_client
/// .get_account_list(&request)
/// .await;
@@ -93,39 +92,38 @@ impl HorizonClient {
/// Retrieves detailed information for a specific account from the Horizon server.
///
/// This asynchronous method is designed to fetch information for a single account on the Horizon server.
- /// It requires a [`SingleAccountRequest`] with the account ID to be queried.
- ///
+ /// It requires a [`SingleAccountRequest`] with the account ID to be queried.
+ ///
/// Adheres to the Retrieve an Account
/// endpoint.
///
/// # Arguments
- /// * `request` - A reference to a [`SingleAccountRequest`] instance, containing the
+ /// * `request` - A reference to a [`SingleAccountRequest`] instance, containing the
/// account ID for which details are to be fetched.
///
/// # Returns
///
- /// On success, returns a `Result` wrapping a [`SingleAccountResponse`], which includes the
- /// detailed information of the requested account. If the request fails, it returns an error
+ /// On success, returns a `Result` wrapping a [`SingleAccountResponse`], which includes the
+ /// detailed information of the requested account. If the request fails, it returns an error
/// encapsulated within `Result`.
///
/// # Usage
- /// To use this method, create an instance of [`SingleAccountRequest`] and set the
+ /// To use this method, create an instance of [`SingleAccountRequest`] and set the
/// account ID of the target account.
///
/// ```
/// # use stellar_rust_sdk::accounts::prelude::*;
- /// # use stellar_rust_sdk::accounts::accounts_request::Signer;
/// # use stellar_rust_sdk::models::Request;
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
- /// #
+ /// #
/// # async fn example() -> Result<(), Box> {
/// # let base_url = "https://horizon-testnet.stellar.org".to_string();
/// # let horizon_client = HorizonClient::new(base_url)
/// # .expect("Failed to create Horizon Client");
- /// let request: SingleAccountRequest = SingleAccountRequest::new()
+ /// let request = SingleAccountRequest::new()
/// .set_account_id("GDQJUTQYK2MQX2VGDR2FYWLIYAQIEGXTQVTFEMGH2BEWFG4BRUY4CKI7".to_string())
/// .unwrap();
- ///
+ ///
/// let response = horizon_client.get_single_account(&request).await;
/// # Ok({})
/// # }
@@ -140,23 +138,45 @@ impl HorizonClient {
/// Retrieves a list of all assets.
///
- /// This asynchronous method fetches a complete list of assets.
- /// It requires a [`AllAssetsRequest`] to specify optional query parameters
- /// such as filters by `asset_code` or `asset_issuer`.
- ///
+ /// This asynchronous method fetches a complete list of assets.
+ /// It requires a [`AllAssetsRequest`] to specify optional query parameters
+ /// such as filters by `asset_code` or `asset_issuer`.
+ ///
/// Adheres to the List all Assets
/// endpoint.
- ///
+ ///
/// # Arguments
- /// * `request` - A reference to an [`AllAssetsRequest`] instance, containing the
+ /// * `request` - A reference to an [`AllAssetsRequest`] instance, containing the
/// parameters for the assets list request.
///
/// # Returns
///
- /// On success, this method returns a `Result` wrapping an [`AllAssetsResponse`], which includes
- /// the comprehensive list of assets retrieved from the Horizon server. If the request
+ /// On success, this method returns a `Result` wrapping an [`AllAssetsResponse`], which includes
+ /// the comprehensive list of assets retrieved from the Horizon server. If the request
/// encounters an issue, an error is returned within `Result`.
- ///
+ ///
+ /// # Example
+ /// To use this method, create an instance of [`AllAssetsRequest`], set any desired
+ /// filters or parameters and pass
+ ///
+ /// ```
+ /// # use stellar_rust_sdk::assets::prelude::*;
+ /// # use stellar_rust_sdk::models::Request;
+ /// # use stellar_rust_sdk::horizon_client::HorizonClient;
+ /// #
+ /// # async fn example() -> Result<(), Box> {
+ /// # let base_url = "https://horizon-testnet.stellar.org".to_string();
+ /// # let horizon_client = HorizonClient::new(base_url)
+ /// # .expect("Failed to create Horizon Client");
+ /// let request = AllAssetsRequest::new()
+ /// .set_asset_code("USD")
+ /// .unwrap();
+ ///
+ /// let response = horizon_client.get_all_assets(&request).await;
+ /// # Ok({})
+ /// # }
+ /// ```
+ ///
pub async fn get_all_assets(
&self,
request: &AllAssetsRequest,
@@ -166,21 +186,43 @@ impl HorizonClient {
/// Retrieves all claimable balances.
///
- /// This asynchronous method queries the Horizon server for all claimable balances. It
+ /// This asynchronous method queries the Horizon server for all claimable balances. It
/// requires a [`AllClaimableBalancesRequest`] to specify the query parameters.
- ///
+ ///
/// Adheres to the List All Claimable Balances
/// endpoint.
- ///
+ ///
/// # Arguments
- /// * `request` - A reference to an [`AllClaimableBalancesRequest`] instance, which contains
+ /// * `request` - A reference to an [`AllClaimableBalancesRequest`] instance, which contains
/// the parameters for the claimable balances request.
///
/// # Returns
///
- /// Returns a `Result` containing an [`AllClaimableBalancesResponse`] with the list of all
+ /// Returns a `Result` containing an [`AllClaimableBalancesResponse`] with the list of all
/// claimable balances if successful. In case of a failure, it returns an error within `Result`.
///
+ /// # Example
+ /// To use this method, create an instance of [`AllClaimableBalancesRequest`], set any desired
+ /// filters or parameters and pass
+ ///
+ /// ```
+ /// # use stellar_rust_sdk::claimable_balances::prelude::*;
+ /// # use stellar_rust_sdk::models::Request;
+ /// # use stellar_rust_sdk::horizon_client::HorizonClient;
+ /// #
+ /// # async fn example() -> Result<(), Box> {
+ /// # let base_url = "https://horizon-testnet.stellar.org".to_string();
+ /// # let horizon_client = HorizonClient::new(base_url)
+ /// # .expect("Failed to create Horizon Client");
+ /// let request = AllClaimableBalancesRequest::new()
+ /// .set_sponsor("GDQJUTQYK2MQX2VGDR2FYWLIYAQIEGXTQVTFEMGH2BEWFG4BRUY4CKI7".to_string())
+ /// .unwrap();
+ ///
+ /// let response = horizon_client.get_all_claimable_balances(&request).await;
+ /// # Ok({})
+ /// # }
+ /// ```
+ ///
pub async fn get_all_claimable_balances(
&self,
request: &AllClaimableBalancesRequest,
@@ -190,39 +232,39 @@ impl HorizonClient {
/// Retrieves detailed information about a specific claimable balance from the Horizon server.
///
- /// This asynchronous method is used to fetch detailed information about a single claimable
- /// balance from the Horizon server. It requires a [`SingleClaimableBalanceRequest`] that
+ /// This asynchronous method is used to fetch detailed information about a single claimable
+ /// balance from the Horizon server. It requires a [`SingleClaimableBalanceRequest`] that
/// includes the unique identifier of the claimable balance to be retrieved.
- ///
+ ///
/// Adheres to the Retrieve a Claimable Balance
/// endpoint.
- ///
+ ///
/// # Arguments
- /// * `request` - A reference to a [`SingleClaimableBalanceRequest`] instance containing the
+ /// * `request` - A reference to a [`SingleClaimableBalanceRequest`] instance containing the
/// unique ID of the claimable balance to be fetched.
///
/// # Returns
///
- /// On successful execution, returns a `Result` containing a [`SingleClaimableBalanceResponse`],
- /// which includes detailed information about the requested claimable balance. If the request
+ /// On successful execution, returns a `Result` containing a [`SingleClaimableBalanceResponse`],
+ /// which includes detailed information about the requested claimable balance. If the request
/// fails, it returns an error within `Result`.
///
- /// # Usage
- /// To use this method, create an instance of [`SingleClaimableBalanceRequest`]
+ /// # Example
+ /// To use this method, create an instance of [`SingleClaimableBalanceRequest`]
/// with the specific claimable balance ID.
///
/// ```
/// # use stellar_rust_sdk::claimable_balances::prelude::*;
/// # use stellar_rust_sdk::models::Request;
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
- /// #
+ /// #
/// # async fn example() -> Result<(), Box> {
/// # let base_url = "https://horizon-testnet.stellar.org".to_string();
/// # let horizon_client = HorizonClient::new(base_url)
/// # .expect("Failed to create Horizon Client");
- /// let request: SingleClaimableBalanceRequest = SingleClaimableBalanceRequest::new()
+ /// let request = SingleClaimableBalanceRequest::new()
/// .set_claimable_balance_id("000000006520216af66d20d63a58534d6cbdf28ba9f2a9c1e03f8d9a756bb7d988b29bca".to_string());
- ///
+ ///
/// let response = horizon_client.get_single_claimable_balance(&request).await;
/// # Ok({})
/// # }
@@ -237,22 +279,44 @@ impl HorizonClient {
/// Retrieves a list of all ledgers.
///
- /// This asynchronous method is designed to fetch list of ledgers
- /// from the Horizon server. It requires a [`LedgersRequest`] to specify the parameters
+ /// This asynchronous method is designed to fetch list of ledgers
+ /// from the Horizon server. It requires a [`LedgersRequest`] to specify the parameters
/// for the ledger retrieval.
- ///
+ ///
/// Adheres to the List All Ledgers
/// endpoint.
///
/// # Arguments
- /// * `request` - A reference to a [`LedgersRequest`] instance, specifying the query
+ /// * `request` - A reference to a [`LedgersRequest`] instance, specifying the query
/// parameters for retrieving the ledgers.
///
/// # Returns
///
- /// On successful execution, returns a `Result` containing a [`LedgersResponse`],
- /// which includes the list of all ledgers obtained from the Horizon server. If the request
+ /// On successful execution, returns a `Result` containing a [`LedgersResponse`],
+ /// which includes the list of all ledgers obtained from the Horizon server. If the request
/// fails, it returns an error within `Result`.
+ ///
+ /// # Example
+ /// To use this method, create an instance of [`LedgersRequest`], set any
+ /// desired pagination parameters.
+ ///
+ /// ```
+ /// # use stellar_rust_sdk::ledgers::prelude::*;
+ /// # use stellar_rust_sdk::models::Request;
+ /// # use stellar_rust_sdk::horizon_client::HorizonClient;
+ /// #
+ /// # async fn example() -> Result<(), Box> {
+ /// # let base_url = "https://horizon-testnet.stellar.org".to_string();
+ /// # let horizon_client = HorizonClient::new(base_url)
+ /// # .expect("Failed to create Horizon Client");
+ /// let request = LedgersRequest::new()
+ /// .set_limit(2)
+ /// .unwrap();
+ ///
+ /// let response = horizon_client.get_all_ledgers(&request).await;
+ /// # Ok({})
+ /// # }
+ /// ```
///
pub async fn get_all_ledgers(
&self,
@@ -263,39 +327,39 @@ impl HorizonClient {
/// Retrieves detailed information for a specific ledger from the Horizon server.
///
- /// This asynchronous method fetches details of a single ledger from the Horizon server.
- /// It requires a [`SingleLedgerRequest`] parameterized with `Sequence`, which includes the sequence number
- /// of the ledger to be retrieved.
- ///
+ /// This asynchronous method fetches details of a single ledger from the Horizon server.
+ /// It requires a [`SingleLedgerRequest`] parameterized with `Sequence`, which includes the sequence number
+ /// of the ledger to be retrieved.
+ ///
/// Adheres to the Retrieve a Ledger
/// endpoint.
- ///
+ ///
/// # Arguments
- /// * `request` - A reference to a [`SingleLedgerRequest`] instance, containing the
+ /// * `request` - A reference to a [`SingleLedgerRequest`] instance, containing the
/// sequence number of the ledger for which details are to be fetched.
///
/// # Returns
///
- /// Returns a `Result` containing a [`SingleLedgerResponse`], which includes detailed
- /// information about the requested ledger. If the request fails, it returns an error
+ /// Returns a `Result` containing a [`SingleLedgerResponse`], which includes detailed
+ /// information about the requested ledger. If the request fails, it returns an error
/// encapsulated within `Result`.
- ///
+ ///
/// # Usage
- /// To use this method, create an instance of [`SingleLedgerRequest`] and set the
+ /// To use this method, create an instance of [`SingleLedgerRequest`] and set the
/// sequence number of the ledger to be queried.
///
/// ```
/// # use stellar_rust_sdk::ledgers::prelude::*;
/// # use stellar_rust_sdk::models::Request;
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
- /// #
+ /// #
/// # async fn example() -> Result<(), Box> {
/// # let base_url = "https://horizon-testnet.stellar.org".to_string();
/// # let horizon_client = HorizonClient::new(base_url)
/// # .expect("Failed to create Horizon Client");
/// let request = SingleLedgerRequest::new()
/// .set_sequence(2).unwrap();
- ///
+ ///
/// let response = horizon_client.get_single_ledger(&request).await;
/// # Ok({})
/// # }
@@ -313,7 +377,7 @@ impl HorizonClient {
/// This internal asynchronous method is designed to handle various GET requests to the
/// Horizon server. It is generic over the response type, allowing for flexibility in
/// handling different types of responses as dictated by the caller. This method performs
- /// key tasks such as request validation, URL construction, sending the request, and
+ /// key tasks such as request validation, URL construction, sending the request, and
/// processing the received response.
///
/// # Type Parameters
@@ -328,8 +392,8 @@ impl HorizonClient {
///
/// # Returns
///
- /// Returns a `Result` containing the response of type [`Response`] if the request is
- /// successful. In case of failure (e.g., network issues, server errors), it returns an
+ /// Returns a `Result` containing the response of type [`Response`] if the request is
+ /// successful. In case of failure (e.g., network issues, server errors), it returns an
/// error encapsulated as a `String`.
///
/// # Example Usage
@@ -363,11 +427,11 @@ impl HorizonClient {
/// Handles the response received from an HTTP request made to the Horizon server.
///
-/// This asynchronous internal function processes the [`reqwest::Response`] obtained from a
-/// GET request. It is generic over the type `Response` which must implement the
-/// [`Response`] trait. The function primarily checks the HTTP status code of the
-/// response. If the status is `OK`, it attempts to deserialize the response body into
-/// the specified `Response` type. For other status codes, it treats the response as an
+/// This asynchronous internal function processes the [`reqwest::Response`] obtained from a
+/// GET request. It is generic over the type `Response` which must implement the
+/// [`Response`] trait. The function primarily checks the HTTP status code of the
+/// response. If the status is `OK`, it attempts to deserialize the response body into
+/// the specified `Response` type. For other status codes, it treats the response as an
/// error message.
///
/// # Type Parameters
@@ -381,10 +445,10 @@ impl HorizonClient {
///
/// # Returns
///
-/// On success (HTTP status `OK`), returns a `Result` containing the deserialized
-/// `Response`. If deserialization fails, or if the HTTP status is not `OK`, it returns
+/// On success (HTTP status `OK`), returns a `Result` containing the deserialized
+/// `Response`. If deserialization fails, or if the HTTP status is not `OK`, it returns
/// an error encapsulated as a `String`.
-///
+///
/// # Example Usage
/// This function is not intended to be called directly. It is designed to be called
/// exclusively by the [`HorizonClient::get`](crate::horizon_client::HorizonClient::get) function.
@@ -414,9 +478,9 @@ async fn handle_response(
/// Validates the format of a given URL.
///
/// This function is an internal utility for validating the format of a URL.
-/// It is typically invoked by [`HorizonClient::new`](crate::horizon_client::HorizonClient::new) to ensure that the URL
-/// provided for initializing the client is correctly formatted. The function checks if
-/// the URL begins with "http://" or "https://", and attempts to parse it using the `Url`
+/// It is typically invoked by [`HorizonClient::new`](crate::horizon_client::HorizonClient::new) to ensure that the URL
+/// provided for initializing the client is correctly formatted. The function checks if
+/// the URL begins with "http://" or "https://", and attempts to parse it using the `Url`
/// type from the `url` crate.
///
/// # Arguments
@@ -425,14 +489,14 @@ async fn handle_response(
///
/// # Returns
///
-/// Returns `Ok(())` if the URL is valid, indicating that the URL has the correct format
-/// and scheme. If the URL is invalid, it returns an `Err` with a message describing
+/// Returns `Ok(())` if the URL is valid, indicating that the URL has the correct format
+/// and scheme. If the URL is invalid, it returns an `Err` with a message describing
/// the issue.
///
/// # Example Usage
///
/// While this function is primarily used internally by [`HorizonClient::new`](crate::horizon_client::HorizonClient::new),
-/// it can also be utilized in scenarios where URL validation is necessary before further
+/// it can also be utilized in scenarios where URL validation is necessary before further
/// processing or usage.
///
fn url_validate(url: &str) -> Result<(), String> {
@@ -491,7 +555,7 @@ mod tests {
// call the get_account_list method to retrieve the account list response
let _accounts_response: Result =
horizon_client.get_account_list(&accounts_request).await;
-
+
assert!(_accounts_response.is_ok());
assert_eq!(
@@ -638,7 +702,7 @@ mod tests {
let single_account_request = SingleAccountRequest::new()
.set_account_id("GDQJUTQYK2MQX2VGDR2FYWLIYAQIEGXTQVTFEMGH2BEWFG4BRUY4CKI7".to_string())
.unwrap();
-
+
let _single_account_response = horizon_client
.get_single_account(&single_account_request)
.await;
diff --git a/src/lib.rs b/src/lib.rs
index 89f06b1..d7d137b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,26 +1,26 @@
//! Stellar Horizon SDK for Rust
//!
-//! This Rust library provides a user-friendly interface to the Stellar Horizon API,
-//! allowing developers to easily query and transact on the Stellar network. Centered
-//! around the `HorizonClient`, the SDK abstracts the underlying HTTP request and response
+//! This Rust library provides a user-friendly interface to the Stellar Horizon API,
+//! allowing developers to easily query and transact on the Stellar network. Centered
+//! around the `HorizonClient`, the SDK abstracts the underlying HTTP request and response
//! mechanisms into a set of simple, high-level methods.
//!
-//! The SDK is designed with a focus on developer experience, providing clear abstractions,
+//! The SDK is designed with a focus on developer experience, providing clear abstractions,
//! sensible defaults, and streamlined error handling.
//!
//! ## Status
//!
-//! The SDK is under active development. It is functional but should be considered a
-//! work-in-progress. Features may be added or changed, and the SDK may evolve before
+//! The SDK is under active development. It is functional but should be considered a
+//! work-in-progress. Features may be added or changed, and the SDK may evolve before
//! stabilization.
-//!
+//!
//! #### Supported endpoints:
//! ![25%](https://progress-bar.dev/25/?width=200)
//! * Accounts
//! * Assets
//! * Claimable balance
//! * Ledgers
-//!
+//!
//! #### Endpoints on the roadmap:
//! * Effects
//! * Fee stats
@@ -37,7 +37,7 @@
//!
//! ## Example Usage
//!
-//! The following example demonstrates how to use the `HorizonClient` to retrieve a list
+//! The following example demonstrates how to use the `HorizonClient` to retrieve a list
//! of accounts with a specific signer:
//!
//! ```rust
@@ -73,27 +73,27 @@
//! }
//! ```
//!
-//! This example initializes a `HorizonClient`, constructs an `AccountsRequest` to filter
-//! accounts by signer, and calls `get_account_list` to retrieve the relevant data.
-//! The result is then handled in a match expression, demonstrating the SDK's straightforward
+//! This example initializes a `HorizonClient`, constructs an `AccountsRequest` to filter
+//! accounts by signer, and calls `get_account_list` to retrieve the relevant data.
+//! The result is then handled in a match expression, demonstrating the SDK's straightforward
//! error handling.
//!
-//! Visit the documentation for `HorizonClient` and endpoint-specific request and response
+//! Visit the documentation for `HorizonClient` and endpoint-specific request and response
//! types for more examples and detailed usage instructions.
/// Requests and Response for retrieving accounts.
///
-/// This module provides a set of specialized request and response structures designed for
+/// This module provides a set of specialized request and response structures designed for
/// interacting with the accounts-related endpoints of the Horizon server. These structures
/// facilitate the construction of requests to query account data and the interpretation of
/// the corresponding responses.
-///
+///
/// # Usage
///
-/// This module is intended to be used in conjunction with the [`HorizonClient`](crate::horizon_client::HorizonClient)
-/// for making specific account-related API calls to the Horizon server. The request
-/// structures are designed to be passed to the client's methods, which handle the
+/// This module is intended to be used in conjunction with the [`HorizonClient`](crate::horizon_client::HorizonClient)
+/// for making specific account-related API calls to the Horizon server. The request
+/// structures are designed to be passed to the client's methods, which handle the
/// communication with the server and return the corresponding response structures.
///
/// # Example
@@ -102,7 +102,7 @@
/// # use stellar_rust_sdk::accounts::prelude::{AccountsRequest, AccountsResponse};
/// # use stellar_rust_sdk::models::Request;
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
-/// #
+/// #
/// # async fn example() -> Result<(), Box> {
/// # let base_url = "https://horizon-testnet.stellar.org".to_string();
/// # let horizon_client = HorizonClient::new(base_url)
@@ -110,41 +110,41 @@
/// let request = AccountsRequest::new()
/// .set_signer("GDQJUTQYK2MQX2VGDR2FYWLIYAQIEGXTQVTFEMGH2BEWFG4BRUY4CKI7").unwrap()
/// .set_limit(10).unwrap();
-///
+///
/// let response: Result = horizon_client
/// .get_account_list(&request)
/// .await;
/// # Ok({})
/// # }
-///
+///
pub mod accounts;
pub mod assets;
pub mod claimable_balances;
-/// Client for calling the Stellar Horizon API
-///
+/// Client for calling the Stellar Horizon API
+///
/// # Constructing a `HorizonClient`
/// A string containing the base URL for the Horizon API is required to contruct a client.
/// For example, to construct a client for the Horizon API testnet:
/// ```rust
/// use stellar_rust_sdk::horizon_client::HorizonClient;
-///
+///
/// let base_url = "https://horizon-testnet.stellar.org".to_string();
/// let horizon_client = HorizonClient::new(base_url)
/// .expect("Failed to create Horizon Client");;
/// ```
-///
+///
/// # Using the `HorizonClient`
/// The HorizonClient has a function that can be called for each endpoind provided
-/// by the Horizon API. For example, it has a [`HorizonClient::get_account_list`](crate::horizon_client::HorizonClient::get_account_list)
+/// by the Horizon API. For example, it has a [`HorizonClient::get_account_list`](crate::horizon_client::HorizonClient::get_account_list)
/// function, which returns an async future that contains a result, as illustrated below:
/// ```rust
/// # use stellar_rust_sdk::assets::prelude::{AllAssetsRequest, AllAssetsResponse};
/// # use stellar_rust_sdk::models::Request;
/// # use stellar_rust_sdk::horizon_client::HorizonClient;
-/// #
+/// #
/// # async fn example() -> Result<(), Box> {
/// # let base_url = "https://horizon-testnet.stellar.org".to_string();
/// # let horizon_client = HorizonClient::new(base_url)
@@ -162,13 +162,13 @@ pub mod ledgers;
/// Contains core data structures and traits.
///
-/// This module is used by the Stellar Rust SDK to interact with the Horizon API.
-/// It defines enums, traits, and functions that encapsulate the logic for
-/// creating and processing HTTP requests and responses, as well as handling the
+/// This module is used by the Stellar Rust SDK to interact with the Horizon API.
+/// It defines enums, traits, and functions that encapsulate the logic for
+/// creating and processing HTTP requests and responses, as well as handling the
/// data involved in these operations.
-///
-/// The `models` module plays a critical role in abstracting the complexities
-/// of the Horizon API, allowing developers to work with high-level Rust constructs
+///
+/// The `models` module plays a critical role in abstracting the complexities
+/// of the Horizon API, allowing developers to work with high-level Rust constructs
/// instead of raw HTTP requests and JSON responses.
pub mod models;
@@ -182,16 +182,16 @@ pub mod models;
///
/// * `Native` - Represents the native asset of the Stellar network (often referred to as XLM).
/// * `Issued` - Represents an asset that is issued by an account on the Stellar network.
-/// In its current implementation, it does not hold the asset code and issuer account ID,
+/// In its current implementation, it does not hold the asset code and issuer account ID,
/// but future enhancements are intended to include these details for complete asset specification.
///
/// # Note
///
-/// The `Issued` variant is currently a placeholder and does not encapsulate the complete
-/// information required for an issued asset (i.e., Asset Code and Issuer Account ID).
-/// This is a known limitation and should be addressed in future versions to ensure full
+/// The `Issued` variant is currently a placeholder and does not encapsulate the complete
+/// information required for an issued asset (i.e., Asset Code and Issuer Account ID).
+/// This is a known limitation and should be addressed in future versions to ensure full
/// functionality.
-///
+///
#[derive(Clone)]
pub enum AssetType {
Native,
@@ -210,26 +210,28 @@ impl std::fmt::Display for AssetType {
/// Extension trait for building query parameter strings from a vector of optional values.
///
-/// This trait provides a method to construct a query string from a vector of optional
-/// values (`Option`). It is designed to be used for generating query parameters in
+/// This trait provides a method to construct a query string from a vector of optional
+/// values (`Option`). It is designed to be used for generating query parameters in
/// URL construction, where each parameter is only included if it has a value (`Some`).
///
/// # Usage
-/// This trait is typically used internally in constructing URLs with query parameters
-/// by implementors of the [`Request::get_query_parameters`](crate::models::Request::get_query_parameters)
-/// method. It enables a convenient and efficient way to handle optional parameters in
+/// This trait is typically used internally in constructing URLs with query parameters
+/// by implementors of the [`Request::get_query_parameters`](crate::models::Request::get_query_parameters)
+/// method. It enables a convenient and efficient way to handle optional parameters in
/// a URL query string.
///
trait BuildQueryParametersExt {
/// Constructs a query string for an HTTP request from the object's properties.
///
- /// This method transforms the properties of the implementing object into a URL-encoded query
- /// string. Each property is converted to a key-value pair, and pairs are concatenated with '&'.
- /// Properties that are `None` are omitted from the string.
+ /// This method transforms the properties of the implementing object into a URL-encoded query
+ /// string.
///
- /// # Returns
- /// A `String` representing the query parameters of the HTTP request. If there are no
- /// parameters, or all properties are `None`, an empty string is returned.
+ /// # Implementation for `Vec