pub struct AssetManager {
pub client: Client,
pub recv_window: u16,
}Fields§
§client: Client§recv_window: u16Implementations§
Source§impl AssetManager
impl AssetManager
Sourcepub async fn get_settlement_record<'a>(
&self,
req: SettlementRecordRequest<'a>,
) -> Result<SettlementRecordResponse, BybitError>
pub async fn get_settlement_record<'a>( &self, req: SettlementRecordRequest<'a>, ) -> Result<SettlementRecordResponse, BybitError>
Get USDC session settlement records
Query session settlement records of USDC perpetual and futures. During periods of extreme market volatility, this interface may experience increased latency or temporary delays in data delivery.
§Arguments
req- ASettlementRecordRequestcontaining the query parameters
§Returns
Returns a Result containing SettlementRecordResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_coin_exchange_records<'a>(
&self,
req: CoinExchangeRecordRequest<'a>,
) -> Result<CoinExchangeRecordResponse, BybitError>
pub async fn get_coin_exchange_records<'a>( &self, req: CoinExchangeRecordRequest<'a>, ) -> Result<CoinExchangeRecordResponse, BybitError>
Sourcepub async fn get_coin_info<'a>(
&self,
req: CoinInfoRequest<'a>,
) -> Result<CoinInfoResponse, BybitError>
pub async fn get_coin_info<'a>( &self, req: CoinInfoRequest<'a>, ) -> Result<CoinInfoResponse, BybitError>
Sourcepub async fn get_sub_uid(&self) -> Result<SubUidResponse, BybitError>
pub async fn get_sub_uid(&self) -> Result<SubUidResponse, BybitError>
Get sub UID list
Query the sub UIDs under a main UID. It returns up to 2000 sub accounts. Query by the master UID’s api key only.
§Returns
Returns a Result containing SubUidResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_delivery_record<'a>(
&self,
req: DeliveryRecordRequest<'a>,
) -> Result<DeliveryRecordResponse, BybitError>
pub async fn get_delivery_record<'a>( &self, req: DeliveryRecordRequest<'a>, ) -> Result<DeliveryRecordResponse, BybitError>
Get delivery record
Query delivery records of Inverse Futures, USDC Futures, USDT Futures and Options,
sorted by deliveryTime in descending order.
During periods of extreme market volatility, this interface may experience
increased latency or temporary delays in data delivery.
§Arguments
req- ADeliveryRecordRequestcontaining the query parameters
§Returns
Returns a Result containing DeliveryRecordResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_single_coin_balance<'a>(
&self,
req: SingleCoinBalanceRequest<'a>,
) -> Result<SingleCoinBalanceResponse, BybitError>
pub async fn get_single_coin_balance<'a>( &self, req: SingleCoinBalanceRequest<'a>, ) -> Result<SingleCoinBalanceResponse, BybitError>
Get single coin balance
Query the balance of a specific coin in a specific account type. Supports querying sub UID’s balance. Also, you can check the transferable amount from master to sub account, sub to master account or sub to sub account, especially for user who has an institutional loan.
During periods of extreme market volatility, this interface may experience increased latency or temporary delays in data delivery.
§Arguments
req- ASingleCoinBalanceRequestcontaining the query parameters
§Returns
Returns a Result containing SingleCoinBalanceResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_all_coins_balance<'a>(
&self,
req: AllCoinsBalanceRequest<'a>,
) -> Result<AllCoinsBalanceResponse, BybitError>
pub async fn get_all_coins_balance<'a>( &self, req: AllCoinsBalanceRequest<'a>, ) -> Result<AllCoinsBalanceResponse, BybitError>
Get all coins balance
You could get all coin balance of all account types under the master account, and sub account.
During periods of extreme market volatility, this interface may experience increased latency or temporary delays in data delivery.
§Arguments
req- AAllCoinsBalanceRequestcontaining the query parameters
§Returns
Returns a Result containing AllCoinsBalanceResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_withdrawable_amount<'a>(
&self,
req: WithdrawableAmountRequest<'a>,
) -> Result<WithdrawableAmountResponse, BybitError>
pub async fn get_withdrawable_amount<'a>( &self, req: WithdrawableAmountRequest<'a>, ) -> Result<WithdrawableAmountResponse, BybitError>
Get withdrawable amount
Query the withdrawable amount for a specific coin.
During periods of extreme market volatility, this interface may experience increased latency or temporary delays in data delivery.
§Arguments
req- AWithdrawableAmountRequestcontaining the query parameters
§Returns
Returns a Result containing WithdrawableAmountResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn create_internal_transfer<'a>(
&self,
req: InternalTransferRequest<'a>,
) -> Result<InternalTransferResponse, BybitError>
pub async fn create_internal_transfer<'a>( &self, req: InternalTransferRequest<'a>, ) -> Result<InternalTransferResponse, BybitError>
Sourcepub async fn get_internal_transfer_records<'a>(
&self,
req: InternalTransferRecordsRequest<'a>,
) -> Result<InternalTransferRecordsResponse, BybitError>
pub async fn get_internal_transfer_records<'a>( &self, req: InternalTransferRecordsRequest<'a>, ) -> Result<InternalTransferRecordsResponse, BybitError>
Get internal transfer records
Query the internal transfer records between different account types under the same UID.
§Arguments
req- AInternalTransferRecordsRequestcontaining the query parameters
§Returns
Returns a Result containing InternalTransferRecordsResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn create_universal_transfer<'a>(
&self,
req: UniversalTransferRequest<'a>,
) -> Result<UniversalTransferResponse, BybitError>
pub async fn create_universal_transfer<'a>( &self, req: UniversalTransferRequest<'a>, ) -> Result<UniversalTransferResponse, BybitError>
Sourcepub async fn get_universal_transfer_records<'a>(
&self,
req: UniversalTransferRecordsRequest<'a>,
) -> Result<UniversalTransferRecordsResponse, BybitError>
pub async fn get_universal_transfer_records<'a>( &self, req: UniversalTransferRecordsRequest<'a>, ) -> Result<UniversalTransferRecordsResponse, BybitError>
Sourcepub async fn get_transferable_coin_list<'a>(
&self,
req: TransferableCoinRequest<'a>,
) -> Result<TransferableCoinResponse, BybitError>
pub async fn get_transferable_coin_list<'a>( &self, req: TransferableCoinRequest<'a>, ) -> Result<TransferableCoinResponse, BybitError>
Sourcepub async fn set_deposit_account<'a>(
&self,
req: SetDepositAccountRequest<'a>,
) -> Result<SetDepositAccountResponse, BybitError>
pub async fn set_deposit_account<'a>( &self, req: SetDepositAccountRequest<'a>, ) -> Result<SetDepositAccountResponse, BybitError>
Set deposit account
Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI.
Only main UID can access.
§Arguments
req- ASetDepositAccountRequestcontaining the account type
§Returns
Returns a Result containing SetDepositAccountResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_deposit_records<'a>(
&self,
req: DepositRecordRequest<'a>,
) -> Result<DepositRecordResponse, BybitError>
pub async fn get_deposit_records<'a>( &self, req: DepositRecordRequest<'a>, ) -> Result<DepositRecordResponse, BybitError>
Get deposit records (on-chain)
Query deposit records.
endTime-startTimeshould be less than 30 days. Query last 30 days records by default.- Support using main or sub UID api key to query deposit records respectively.
§Arguments
req- ADepositRecordRequestcontaining the query parameters
§Returns
Returns a Result containing DepositRecordResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_sub_deposit_records<'a>(
&self,
req: SubDepositRecordRequest<'a>,
) -> Result<SubDepositRecordResponse, BybitError>
pub async fn get_sub_deposit_records<'a>( &self, req: SubDepositRecordRequest<'a>, ) -> Result<SubDepositRecordResponse, BybitError>
Get sub deposit records (on-chain)
Query subaccount’s deposit records by main UID’s API key.
endTime-startTimeshould be less than 30 days. Queries for the last 30 days worth of records by default.
§Arguments
req- ASubDepositRecordRequestcontaining the query parameters
§Returns
Returns a Result containing SubDepositRecordResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_internal_deposit_records<'a>(
&self,
req: InternalDepositRecordRequest<'a>,
) -> Result<InternalDepositRecordResponse, BybitError>
pub async fn get_internal_deposit_records<'a>( &self, req: InternalDepositRecordRequest<'a>, ) -> Result<InternalDepositRecordResponse, BybitError>
Get internal deposit records (off-chain)
Query deposit records within the Bybit platform. These transactions are not on the blockchain.
- The maximum difference between the start time and the end time is 30 days
- Support to get deposit records by Master or Sub Member Api Key
§Arguments
req- AInternalDepositRecordRequestcontaining the query parameters
§Returns
Returns a Result containing InternalDepositRecordResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_master_deposit_address<'a>(
&self,
req: MasterDepositAddressRequest<'a>,
) -> Result<MasterDepositAddressResponse, BybitError>
pub async fn get_master_deposit_address<'a>( &self, req: MasterDepositAddressRequest<'a>, ) -> Result<MasterDepositAddressResponse, BybitError>
Sourcepub async fn get_sub_deposit_address<'a>(
&self,
req: SubDepositAddressRequest<'a>,
) -> Result<SubDepositAddressResponse, BybitError>
pub async fn get_sub_deposit_address<'a>( &self, req: SubDepositAddressRequest<'a>, ) -> Result<SubDepositAddressResponse, BybitError>
Get sub deposit address
Query the deposit address information of SUB account.
- Use master UID’s api key only
- Custodial sub account deposit address cannot be obtained
§Arguments
req- ASubDepositAddressRequestcontaining the query parameters
§Returns
Returns a Result containing SubDepositAddressResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_withdrawal_address<'a>(
&self,
req: WithdrawalAddressRequest<'a>,
) -> Result<WithdrawalAddressResponse, BybitError>
pub async fn get_withdrawal_address<'a>( &self, req: WithdrawalAddressRequest<'a>, ) -> Result<WithdrawalAddressResponse, BybitError>
Get withdrawal address list
Query the withdrawal addresses in the address book.
§Note
The API key for querying this endpoint must have withdrawal permissions.
§Arguments
req- AWithdrawalAddressRequestcontaining the query parameters
§Returns
Returns a Result containing WithdrawalAddressResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_withdrawal_records<'a>(
&self,
req: WithdrawalRecordRequest<'a>,
) -> Result<WithdrawalRecordResponse, BybitError>
pub async fn get_withdrawal_records<'a>( &self, req: WithdrawalRecordRequest<'a>, ) -> Result<WithdrawalRecordResponse, BybitError>
Get withdrawal records
Query withdrawal records.
§Notes
endTime-startTimeshould be less than 30 days. Query last 30 days records by default.- Can query by the master UID’s api key only
§Arguments
req- AWithdrawalRecordRequestcontaining the query parameters
§Returns
Returns a Result containing WithdrawalRecordResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn get_vasp_list(&self) -> Result<VaspListResponse, BybitError>
pub async fn get_vasp_list(&self) -> Result<VaspListResponse, BybitError>
Get available WASPs (Virtual Asset Service Providers)
This endpoint is used for querying the available WASPs. This API distinguishes which compliance zone the user belongs to and the corresponding list of exchanges based on the user’s UID.
§Arguments
None - This endpoint takes no parameters
§Returns
Returns a Result containing VaspListResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn withdraw<'a>(
&self,
req: WithdrawRequest<'a>,
) -> Result<WithdrawResponse, BybitError>
pub async fn withdraw<'a>( &self, req: WithdrawRequest<'a>, ) -> Result<WithdrawResponse, BybitError>
Create a withdrawal
Withdraw assets from your Bybit account. You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.
§Notes
- Although the API rate limit for this endpoint is 5 req/s, there is also a secondary limit: you can only withdraw once every 10 seconds per chain/coin combination.
- Make sure you have whitelisted your wallet address
- Request by the master UID’s api key only
§Arguments
req- AWithdrawRequestcontaining the withdrawal parameters
§Returns
Returns a Result containing WithdrawResponse if successful,
or BybitError if an error occurs.
Sourcepub async fn cancel_withdraw<'a>(
&self,
req: CancelWithdrawRequest<'a>,
) -> Result<CancelWithdrawResponse, BybitError>
pub async fn cancel_withdraw<'a>( &self, req: CancelWithdrawRequest<'a>, ) -> Result<CancelWithdrawResponse, BybitError>
Trait Implementations§
Source§impl Bybit for AssetManager
impl Bybit for AssetManager
Source§fn new(api_key: Option<String>, secret_key: Option<String>) -> AssetManager
fn new(api_key: Option<String>, secret_key: Option<String>) -> AssetManager
Source§fn new_with_config(
config: &Config,
api_key: Option<String>,
secret_key: Option<String>,
) -> AssetManager
fn new_with_config( config: &Config, api_key: Option<String>, secret_key: Option<String>, ) -> AssetManager
Source§impl Clone for AssetManager
impl Clone for AssetManager
Source§fn clone(&self) -> AssetManager
fn clone(&self) -> AssetManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more