pub struct EthStaking<'a, T> { /* private fields */ }Expand description
Accessor for ETH staking endpoints.
Implementations§
Source§impl<T: Transport> EthStaking<'_, T>
impl<T: Transport> EthStaking<'_, T>
Sourcepub async fn product_info(&self) -> Result<Vec<StakingProductInfo>, Error>
pub async fn product_info(&self) -> Result<Vec<StakingProductInfo>, Error>
Retrieve ETH staking product info.
GET /api/v5/finance/staking-defi/eth/product-info. Authenticated.
§Errors
Returns RestError::Okx on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn purchase(
&self,
request: &AmountRequest<'_>,
) -> Result<Vec<StakingOrder>, Error>
pub async fn purchase( &self, request: &AmountRequest<'_>, ) -> Result<Vec<StakingOrder>, Error>
Purchase ETH staking.
POST /api/v5/finance/staking-defi/eth/purchase. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn redeem(
&self,
request: &AmountRequest<'_>,
) -> Result<Vec<StakingOrder>, Error>
pub async fn redeem( &self, request: &AmountRequest<'_>, ) -> Result<Vec<StakingOrder>, Error>
Redeem ETH staking.
POST /api/v5/finance/staking-defi/eth/redeem. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn cancel_redeem(
&self,
request: &CancelRedeemRequest<'_>,
) -> Result<Vec<CancelRedeem>, Error>
pub async fn cancel_redeem( &self, request: &CancelRedeemRequest<'_>, ) -> Result<Vec<CancelRedeem>, Error>
Cancel redeem ETH staking.
POST /api/v5/finance/staking-defi/eth/cancel-redeem. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx 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 ETH staking balance.
GET /api/v5/finance/staking-defi/eth/balance. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx 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 ETH staking purchase/redeem history.
GET /api/v5/finance/staking-defi/eth/purchase-redeem-history. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a non-zero OKX code, or transport/decode errors.
Sourcepub async fn apy_history(
&self,
request: &ApyHistoryRequest<'_>,
) -> Result<Vec<StakingApyHistory>, Error>
pub async fn apy_history( &self, request: &ApyHistoryRequest<'_>, ) -> Result<Vec<StakingApyHistory>, Error>
Retrieve ETH staking APY history.
GET /api/v5/finance/staking-defi/eth/apy-history. Public.
§Errors
Returns RestError::Okx on a non-zero OKX code, or transport/decode errors.