bpx_api_client/routes/borrow_lend.rs
1use bpx_api_types::borrow_lend::BorrowLendPosition;
2
3use crate::{BpxClient, Result};
4
5#[doc(hidden)]
6pub const API_BORROW_LEND_POSITIONS: &str = "/api/v1/borrowLend/positions";
7
8impl BpxClient {
9 /// Retrieves all the open borrow lending positions for the account.
10 pub async fn get_borrow_lend_positions(&self) -> Result<Vec<BorrowLendPosition>> {
11 let url = self.base_url.join(API_BORROW_LEND_POSITIONS)?;
12 let res = self.get(url).await?;
13 res.json().await.map_err(Into::into)
14 }
15}