pub struct SolStaking<'a, T> { /* private fields */ }Expand description
Accessor for SOL staking endpoints.
Implementations§
Source§impl<T: Transport> SolStaking<'_, T>
impl<T: Transport> SolStaking<'_, T>
Sourcepub async fn product_info(&self) -> Result<StakingProductInfo, Error>
pub async fn product_info(&self) -> Result<StakingProductInfo, Error>
Retrieve SOL staking product info.
GET /api/v5/finance/staking-defi/sol/product-info. Authenticated.
§Errors
Returns [Error::Api] on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn purchase(&self, amt: &str) -> Result<Vec<StakingOrder>, Error>
pub async fn purchase(&self, amt: &str) -> Result<Vec<StakingOrder>, Error>
Purchase SOL staking.
POST /api/v5/finance/staking-defi/sol/purchase. Authenticated.
§Errors
Returns [Error::Configuration] without credentials, [Error::Api] on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn redeem(&self, amt: &str) -> Result<Vec<StakingOrder>, Error>
pub async fn redeem(&self, amt: &str) -> Result<Vec<StakingOrder>, Error>
Redeem SOL staking.
POST /api/v5/finance/staking-defi/sol/redeem. Authenticated.
§Errors
Returns [Error::Configuration] without credentials, [Error::Api] on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn balance(&self) -> Result<Vec<StakingBalance>, Error>
pub async fn balance(&self) -> Result<Vec<StakingBalance>, Error>
Retrieve SOL staking balance.
GET /api/v5/finance/staking-defi/sol/balance. Authenticated.
§Errors
Returns [Error::Configuration] without credentials, [Error::Api] on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn purchase_redeem_history(
&self,
request: &FinanceHistoryRequest,
) -> Result<Vec<StakingHistory>, Error>
pub async fn purchase_redeem_history( &self, request: &FinanceHistoryRequest, ) -> Result<Vec<StakingHistory>, Error>
Retrieve SOL staking purchase/redeem history.
GET /api/v5/finance/staking-defi/sol/purchase-redeem-history. Authenticated.
§Errors
Returns [Error::Configuration] without credentials, [Error::Api] on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn apy_history(
&self,
days: &str,
) -> Result<Vec<StakingApyHistory>, Error>
pub async fn apy_history( &self, days: &str, ) -> Result<Vec<StakingApyHistory>, Error>
Retrieve SOL staking APY history.
GET /api/v5/finance/staking-defi/sol/apy-history. Public.
§Errors
Returns [Error::Api] on a non-zero OKX code, or transport/decode errors.