Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/asynch/clients/json_rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ mod _std {

pub struct AsyncJsonRpcClient {
url: Url,
client: HttpClient,
}

impl AsyncJsonRpcClient {
pub fn connect(url: Url) -> Self {
Self { url }
Self {
url,
client: HttpClient::new(),
}
}
}

Expand All @@ -58,9 +62,9 @@ mod _std {
&self,
request: XRPLRequest<'a>,
) -> XRPLClientResult<XRPLResponse<'b>> {
let client = HttpClient::new();
let request_json_rpc = request_to_json_rpc(&request)?;
let response = client
let response = self
.client
.post(self.url.as_ref())
.json(&request_json_rpc)
.send()
Expand Down
Loading