pub struct Savings<'a, T> { /* private fields */ }Expand description
Accessor for Savings endpoints.
Implementations§
Source§impl<T: Transport> Savings<'_, T>
impl<T: Transport> Savings<'_, T>
Sourcepub async fn get_saving_balance(
&self,
request: &CurrencyRequest<'_>,
) -> Result<Vec<SavingBalance>, Error>
pub async fn get_saving_balance( &self, request: &CurrencyRequest<'_>, ) -> Result<Vec<SavingBalance>, Error>
Retrieve savings balances.
GET /api/v5/finance/savings/balance. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero
OKX code, or transport/decode errors.
Sourcepub async fn purchase_redemption(
&self,
request: &SavingsPurchaseRedemptionRequest<'_>,
) -> Result<Vec<SavingsPurchaseRedemptionResult>, Error>
pub async fn purchase_redemption( &self, request: &SavingsPurchaseRedemptionRequest<'_>, ) -> Result<Vec<SavingsPurchaseRedemptionResult>, Error>
Purchase or redeem savings.
POST /api/v5/finance/savings/purchase-redempt. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero
OKX code, or transport/decode errors.
Sourcepub async fn set_lending_rate(
&self,
request: &SetLendingRateRequest<'_>,
) -> Result<Vec<SetLendingRateResult>, Error>
pub async fn set_lending_rate( &self, request: &SetLendingRateRequest<'_>, ) -> Result<Vec<SetLendingRateResult>, Error>
Set the savings lending rate.
POST /api/v5/finance/savings/set-lending-rate. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero
OKX code, or transport/decode errors.
Sourcepub async fn get_lending_history(
&self,
request: &FinanceHistoryRequest<'_>,
) -> Result<Vec<LendingHistory>, Error>
pub async fn get_lending_history( &self, request: &FinanceHistoryRequest<'_>, ) -> Result<Vec<LendingHistory>, Error>
Retrieve lending history.
GET /api/v5/finance/savings/lending-history. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero
OKX code, or transport/decode errors.
Sourcepub async fn get_public_borrow_history(
&self,
request: &FinanceHistoryRequest<'_>,
) -> Result<Vec<PublicBorrowHistory>, Error>
pub async fn get_public_borrow_history( &self, request: &FinanceHistoryRequest<'_>, ) -> Result<Vec<PublicBorrowHistory>, Error>
Retrieve public borrow history.
GET /api/v5/finance/savings/lending-rate-history. Public.
§Errors
Returns RestError::Okx on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn get_public_borrow_info(
&self,
request: &CurrencyRequest<'_>,
) -> Result<Vec<PublicBorrowInfo>, Error>
pub async fn get_public_borrow_info( &self, request: &CurrencyRequest<'_>, ) -> Result<Vec<PublicBorrowInfo>, Error>
Retrieve public borrow info.
GET /api/v5/finance/savings/lending-rate-summary. Public.
§Errors
Returns RestError::Okx on a non-zero OKX code, or transport/decode errors.