pub struct Funding<'a, T> { /* private fields */ }Expand description
Accessor for authenticated funding-account and asset endpoints.
Obtain one via OkxClient::funding. All methods
require credentials. Mutating endpoints operate on the funding account, not
the trading account.
Implementations§
Source§impl<'a, T: Transport> Funding<'a, T>
impl<'a, T: Transport> Funding<'a, T>
Sourcepub async fn get_currencies(
&self,
request: &CurrencyRequest<'_>,
) -> Result<Vec<Currency>, Error>
pub async fn get_currencies( &self, request: &CurrencyRequest<'_>, ) -> Result<Vec<Currency>, Error>
Retrieve currency metadata and chain settings.
GET /api/v5/asset/currencies. Authenticated.
§Errors
Returns RestError::Configuration without credentials, RestError::Okx on a
non-zero OKX code, or transport/decode errors.
Sourcepub async fn get_balances(
&self,
request: &CurrencyRequest<'_>,
) -> Result<Vec<FundingBalance>, Error>
pub async fn get_balances( &self, request: &CurrencyRequest<'_>, ) -> Result<Vec<FundingBalance>, Error>
Retrieve funding-account balances.
GET /api/v5/asset/balances. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn get_non_tradable_assets(
&self,
request: &CurrencyRequest<'_>,
) -> Result<Vec<NonTradableAsset>, Error>
pub async fn get_non_tradable_assets( &self, request: &CurrencyRequest<'_>, ) -> Result<Vec<NonTradableAsset>, Error>
Retrieve non-tradable assets.
GET /api/v5/asset/non-tradable-assets. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn get_deposit_address(
&self,
request: &DepositAddressRequest<'_>,
) -> Result<Vec<DepositAddress>, Error>
pub async fn get_deposit_address( &self, request: &DepositAddressRequest<'_>, ) -> Result<Vec<DepositAddress>, Error>
Retrieve deposit addresses for a currency.
GET /api/v5/asset/deposit-address. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn funds_transfer(
&self,
request: &FundsTransferRequest<'_>,
) -> Result<Vec<TransferResult>, Error>
pub async fn funds_transfer( &self, request: &FundsTransferRequest<'_>, ) -> Result<Vec<TransferResult>, Error>
Transfer funds between OKX account types.
POST /api/v5/asset/transfer. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn transfer_state(
&self,
request: &TransferStateRequest<'_>,
) -> Result<Vec<TransferState>, Error>
pub async fn transfer_state( &self, request: &TransferStateRequest<'_>, ) -> Result<Vec<TransferState>, Error>
Retrieve the state of a funds transfer.
GET /api/v5/asset/transfer-state. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn withdrawal(
&self,
request: &WithdrawalRequest<'_>,
) -> Result<Vec<WithdrawalResult>, Error>
pub async fn withdrawal( &self, request: &WithdrawalRequest<'_>, ) -> Result<Vec<WithdrawalResult>, Error>
Withdraw funds from OKX.
POST /api/v5/asset/withdrawal. Authenticated. This is a real asset
movement endpoint; build requests deliberately with
WithdrawalRequest::new.
§Errors
See get_currencies.
Sourcepub async fn get_deposit_history(
&self,
request: &DepositHistoryRequest<'_>,
) -> Result<Vec<DepositRecord>, Error>
pub async fn get_deposit_history( &self, request: &DepositHistoryRequest<'_>, ) -> Result<Vec<DepositRecord>, Error>
Retrieve deposit history.
GET /api/v5/asset/deposit-history. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn get_bills(
&self,
request: &FundingBillsRequest<'_>,
) -> Result<Vec<FundingBill>, Error>
pub async fn get_bills( &self, request: &FundingBillsRequest<'_>, ) -> Result<Vec<FundingBill>, Error>
Sourcepub async fn get_deposit_lightning(
&self,
request: &DepositLightningRequest<'_>,
) -> Result<Vec<DepositLightning>, Error>
pub async fn get_deposit_lightning( &self, request: &DepositLightningRequest<'_>, ) -> Result<Vec<DepositLightning>, Error>
Create or retrieve a Lightning Network deposit invoice.
GET /api/v5/asset/deposit-lightning. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn withdrawal_lightning(
&self,
request: &WithdrawalLightningRequest<'_>,
) -> Result<Vec<WithdrawalLightning>, Error>
pub async fn withdrawal_lightning( &self, request: &WithdrawalLightningRequest<'_>, ) -> Result<Vec<WithdrawalLightning>, Error>
Withdraw through the Lightning Network.
POST /api/v5/asset/withdrawal-lightning. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn cancel_withdrawal(
&self,
request: &CancelWithdrawalRequest<'_>,
) -> Result<Vec<WithdrawalResult>, Error>
pub async fn cancel_withdrawal( &self, request: &CancelWithdrawalRequest<'_>, ) -> Result<Vec<WithdrawalResult>, Error>
Cancel a withdrawal.
POST /api/v5/asset/cancel-withdrawal. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn get_asset_valuation(
&self,
request: &CurrencyRequest<'_>,
) -> Result<Vec<AssetValuation>, Error>
pub async fn get_asset_valuation( &self, request: &CurrencyRequest<'_>, ) -> Result<Vec<AssetValuation>, Error>
Retrieve total asset valuation.
GET /api/v5/asset/asset-valuation. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn get_deposit_withdraw_status(
&self,
request: &DepositWithdrawStatusRequest<'_>,
) -> Result<Vec<DepositWithdrawStatus>, Error>
pub async fn get_deposit_withdraw_status( &self, request: &DepositWithdrawStatusRequest<'_>, ) -> Result<Vec<DepositWithdrawStatus>, Error>
Retrieve deposit/withdrawal status.
GET /api/v5/asset/deposit-withdraw-status. Authenticated.
§Errors
See get_currencies.
Sourcepub async fn get_withdrawal_history(
&self,
request: &WithdrawalHistoryRequest<'_>,
) -> Result<Vec<WithdrawalRecord>, Error>
pub async fn get_withdrawal_history( &self, request: &WithdrawalHistoryRequest<'_>, ) -> Result<Vec<WithdrawalRecord>, Error>
Retrieve withdrawal history.
GET /api/v5/asset/withdrawal-history. Authenticated.
§Errors
See get_currencies.