Skip to content

Commit

Permalink
add request withdrawal response body (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
backpack-exchange-bot authored Jan 7, 2025
1 parent d1a830d commit d5bd896
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust/client/src/routes/capital.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ impl BpxClient {
}

/// Submits a withdrawal request for the specified payload.
pub async fn request_withdrawal(&self, payload: RequestWithdrawalPayload) -> Result<()> {
pub async fn request_withdrawal(&self, payload: RequestWithdrawalPayload) -> Result<Withdrawal> {
let endpoint = format!("{}{}", self.base_url, API_WITHDRAWALS);
self.post(endpoint, payload).await.map(|_| ())
let res = self.post(endpoint, payload).await?;
res.json().await.map_err(Into::into)
}
}

0 comments on commit d5bd896

Please sign in to comment.