Skip to content

Commit

Permalink
Implemented IntoString for method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Luijken committed Aug 22, 2024
1 parent d902d61 commit 1fbcde6
Show file tree
Hide file tree
Showing 3 changed files with 322 additions and 136 deletions.
20 changes: 10 additions & 10 deletions stellar_rust_sdk/src/horizon_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
AllLiquidityPoolsResponse, LiquidityPool, LiquidityPoolId, SingleLiquidityPoolRequest,
},
},
models::{Request, PostRequest, Response},
models::{PostRequest, Request, Response},
offers::prelude::*,
operations::{
operations_for_account_request::OperationsForAccountRequest,
Expand All @@ -33,10 +33,10 @@ use crate::{
details_request::{BuyingAsset, DetailsRequest, SellingAsset},
response::DetailsResponse,
},
payments::prelude::*,
trade_aggregations::prelude::*,
transactions::prelude::*,
trades::prelude::*,
payments::prelude::*
transactions::prelude::*,
};
use reqwest;
use url::Url;
Expand Down Expand Up @@ -168,14 +168,15 @@ impl HorizonClient {
.post(&url)
.form(&request.get_body())
.send()
.await.map_err(|e| e.to_string())?;
.await
.map_err(|e| e.to_string())?;

// Process the response and return the result.
let result: R = handle_response(response).await?;

Ok(result)
}

/// Retrieves a list of accounts filtered by specific criteria.
///
/// This method retrieves a list of accounts from the Horizon server, filtering the results
Expand Down Expand Up @@ -1280,7 +1281,7 @@ impl HorizonClient {
) -> Result<OperationResponse, String> {
self.get::<OperationResponse>(request).await
}

/// Retrieves a list of all operations for a specific transaction from the Horizon server.
///
/// This asynchronous method fetches a list of all operations for a specific transaction from the Horizon server.
Expand Down Expand Up @@ -1330,7 +1331,7 @@ impl HorizonClient {
) -> Result<OperationResponse, String> {
self.get::<OperationResponse>(request).await
}

/// Retrieves a list of order book details from the Horizon server.
///
/// This asynchronous method fetches a list of order book details from the Horizon server.
Expand Down Expand Up @@ -1628,7 +1629,6 @@ impl HorizonClient {
self.get::<AllTradesResponse>(request).await
}


/// Fetches all liquidity pools from the Stellar Horizon API.
///
/// This asynchronous method retrieves a list of all liquidity pools from the Horizon server.
Expand Down Expand Up @@ -2218,7 +2218,7 @@ impl HorizonClient {
/// # .expect("Failed to create Horizon Client");
/// let signed_transaction_xdr = "AAAAAgAAAABi/B0L0JGythwN1lY0aypo19NHxvLCyO5tBEcCVvwF9wAABEwAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAAQfdFrLDgzSIIugR73qs8U0ZiKbwBUclTTPh5thlbgnAFjRXhdigAAAAAAAAAAAAAAAAAA3b5KF6uk1w1fSKYLrzR8gF2lB+AHAi6oU6CaWhunAskAAAAXSHboAAAAAAAAAAAAAAAAAHfmNeMLin2aTUfxa530ZRn4zwRu7ROAQfUJeJco8HSCAAHGv1JjQAAAAAAAAAAAAAAAAAAAlRt2go9sp7E1a5ZWvr7vin4UPrFQThpQax1lOFm33AAAABdIdugAAAAAAAAAAAAAAAAAmv+knlR6JR2VqWeU0k/4FgvZ/tSV5DEY4gu0iOTKgpUAAAAXSHboAAAAAAAAAAAAAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bAAAAF0h26AAAAAABAAAAAACVG3aCj2ynsTVrlla+vu+KfhQ+sVBOGlBrHWU4WbfcAAAABgAAAAFURVNUAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bf/////////8AAAABAAAAAJr/pJ5UeiUdlalnlNJP+BYL2f7UleQxGOILtIjkyoKVAAAABgAAAAFURVNUAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bf/////////8AAAABAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bAAAAAQAAAAAAlRt2go9sp7E1a5ZWvr7vin4UPrFQThpQax1lOFm33AAAAAFURVNUAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bAAAJGE5yoAAAAAABAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bAAAAAQAAAACa/6SeVHolHZWpZ5TST/gWC9n+1JXkMRjiC7SI5MqClQAAAAFURVNUAAAAANpaWLojuOtfC0cmMh+DvQTfPDrkfXhblQTdFXrGYc0bAAAJGE5yoAAAAAAAAAAAAAAAAABKBB+2UBMP/abwcm/M1TXO+/JQWhPwkalgqizKmXyRIQx7qh6aAFYAAAAAAAAAAARW/AX3AAAAQDVB8fT2ZXF0PZqtZX9brK0kz+P4G8VKs1DkDklP6ULsvXRexXFBdH4xG8xRAsR1HJeEBH278hiBNNvUwNw6zgzGYc0bAAAAQLgZUU/oYGL7frWDQhJHhCQu9JmfqN03PrJq4/cJrN1OSUWXnmLc94sv8m2L+cxl2p0skr2Jxy+vt1Lcxkv7wAI4WbfcAAAAQHvZEVqlygIProf3jVTZohDWm2WUNrFAFXf1LctTqDCQBHph14Eo+APwrTURLLYTIvNoXeGzBKbL03SsOARWcQLkyoKVAAAAQHAvKv2/Ro4+cNh6bKQO/G9NNiUozYysGwG1GvJQkFjwy/OTsL6WBfuI0Oye84lVBVrQVk2EY1ERFhgdMpuFSg4=";
/// let request = PostTransactionRequest::new()
/// .set_transaction_envelope_xdr(signed_transaction_xdr.to_string()).unwrap();
/// .set_transaction_envelope_xdr(signed_transaction_xdr).unwrap();
/// let response = horizon_client.post_transaction(&request).await;
/// # Ok({})
/// # }
Expand Down
Loading

0 comments on commit 1fbcde6

Please sign in to comment.