pub struct AssetClient { /* private fields */ }Implementations§
Source§impl AssetClient
impl AssetClient
pub fn new(client: RestClient) -> Self
Sourcepub async fn get_exchange_order_record(
&self,
from_coin: Option<&str>,
to_coin: Option<&str>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_exchange_order_record( &self, from_coin: Option<&str>, to_coin: Option<&str>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get coin exchange records
API: GET /v5/asset/exchange/order-record https://bybit-exchange.github.io/docs/v5/asset/exchange-order-record
Sourcepub async fn get_delivery_record(
&self,
category: &str,
symbol: Option<&str>,
exp_date: Option<&str>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_delivery_record( &self, category: &str, symbol: Option<&str>, exp_date: Option<&str>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get delivery record
API: GET /v5/asset/delivery-record https://bybit-exchange.github.io/docs/v5/asset/delivery
Sourcepub async fn get_settlement_record(
&self,
category: &str,
symbol: Option<&str>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_settlement_record( &self, category: &str, symbol: Option<&str>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get USDC settlement records
API: GET /v5/asset/settlement-record https://bybit-exchange.github.io/docs/v5/asset/settlement
Sourcepub async fn get_coin_info(
&self,
coin: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_coin_info( &self, coin: Option<&str>, ) -> Result<ServerResponse<Value>>
Get coins
API: GET /v5/asset/coin/query-info https://bybit-exchange.github.io/docs/v5/asset/coin-info
Sourcepub async fn get_asset_info(
&self,
account_type: &str,
coin: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_asset_info( &self, account_type: &str, coin: Option<&str>, ) -> Result<ServerResponse<Value>>
Get asset info
API: GET /v5/asset/transfer/query-asset-info https://bybit-exchange.github.io/docs/v5/asset/asset-info
Sourcepub async fn get_sub_member_list(&self) -> Result<ServerResponse<Value>>
pub async fn get_sub_member_list(&self) -> Result<ServerResponse<Value>>
Get sub member list
API: GET /v5/asset/transfer/query-sub-member-list https://bybit-exchange.github.io/docs/v5/asset/sub-member-list
Sourcepub async fn get_deposit_records(
&self,
coin: Option<&str>,
start_time: Option<i64>,
end_time: Option<i64>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_deposit_records( &self, coin: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get deposit records
API: GET /v5/asset/deposit/query-record https://bybit-exchange.github.io/docs/v5/asset/deposit-record
Sourcepub async fn get_sub_deposit_records(
&self,
sub_member_id: &str,
coin: Option<&str>,
start_time: Option<i64>,
end_time: Option<i64>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_sub_deposit_records( &self, sub_member_id: &str, coin: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get sub deposit records
API: GET /v5/asset/deposit/query-sub-member-record https://bybit-exchange.github.io/docs/v5/asset/sub-deposit-record
Sourcepub async fn get_internal_deposit_records(
&self,
start_time: Option<i64>,
end_time: Option<i64>,
coin: Option<&str>,
cursor: Option<&str>,
limit: Option<i32>,
) -> Result<ServerResponse<Value>>
pub async fn get_internal_deposit_records( &self, start_time: Option<i64>, end_time: Option<i64>, coin: Option<&str>, cursor: Option<&str>, limit: Option<i32>, ) -> Result<ServerResponse<Value>>
Get internal deposit records
API: GET /v5/asset/deposit/query-internal-record https://bybit-exchange.github.io/docs/v5/asset/internal-deposit-record
Sourcepub async fn get_master_deposit_address(
&self,
coin: &str,
chain_type: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_master_deposit_address( &self, coin: &str, chain_type: Option<&str>, ) -> Result<ServerResponse<Value>>
Get master deposit address
API: GET /v5/asset/deposit/query-address https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
Sourcepub async fn get_sub_deposit_address(
&self,
coin: &str,
chain_type: &str,
sub_member_id: &str,
) -> Result<ServerResponse<Value>>
pub async fn get_sub_deposit_address( &self, coin: &str, chain_type: &str, sub_member_id: &str, ) -> Result<ServerResponse<Value>>
Get sub deposit address
API: GET /v5/asset/deposit/query-sub-member-address https://bybit-exchange.github.io/docs/v5/asset/sub-deposit-addr
Sourcepub async fn get_allowed_deposit_list(
&self,
coin: Option<&str>,
chain: Option<&str>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_allowed_deposit_list( &self, coin: Option<&str>, chain: Option<&str>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get allowed deposit coin info
API: GET /v5/asset/deposit/query-allowed-list https://bybit-exchange.github.io/docs/v5/asset/deposit-coin-spec
Sourcepub async fn get_withdrawal_records(
&self,
withdraw_id: Option<&str>,
coin: Option<&str>,
withdraw_type: Option<i32>,
start_time: Option<i64>,
end_time: Option<i64>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_withdrawal_records( &self, withdraw_id: Option<&str>, coin: Option<&str>, withdraw_type: Option<i32>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get withdrawal records
API: GET /v5/asset/withdraw/query-record https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
Sourcepub async fn get_withdrawable_amount(
&self,
coin: &str,
) -> Result<ServerResponse<Value>>
pub async fn get_withdrawable_amount( &self, coin: &str, ) -> Result<ServerResponse<Value>>
Get withdrawable amount
API: GET /v5/asset/withdraw/withdrawable-amount https://bybit-exchange.github.io/docs/v5/asset/withdrawable-amount
Sourcepub async fn withdraw(
&self,
coin: &str,
chain: &str,
address: &str,
tag: Option<&str>,
amount: &str,
timestamp: i64,
for_ce_chain: Option<i32>,
account_type: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn withdraw( &self, coin: &str, chain: &str, address: &str, tag: Option<&str>, amount: &str, timestamp: i64, for_ce_chain: Option<i32>, account_type: Option<&str>, ) -> Result<ServerResponse<Value>>
Withdraw
API: POST /v5/asset/withdraw/create https://bybit-exchange.github.io/docs/v5/asset/withdraw
Sourcepub async fn cancel_withdrawal(&self, id: &str) -> Result<ServerResponse<Value>>
pub async fn cancel_withdrawal(&self, id: &str) -> Result<ServerResponse<Value>>
Cancel withdrawal
API: POST /v5/asset/withdraw/cancel https://bybit-exchange.github.io/docs/v5/asset/cancel-withdraw
Sourcepub async fn create_internal_transfer(
&self,
transfer_id: &str,
coin: &str,
amount: &str,
from_account_type: &str,
to_account_type: &str,
) -> Result<ServerResponse<Value>>
pub async fn create_internal_transfer( &self, transfer_id: &str, coin: &str, amount: &str, from_account_type: &str, to_account_type: &str, ) -> Result<ServerResponse<Value>>
Create internal transfer
API: POST /v5/asset/transfer/inter-transfer https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
Sourcepub async fn get_internal_transfer_records(
&self,
transfer_id: Option<&str>,
coin: Option<&str>,
status: Option<&str>,
start_time: Option<i64>,
end_time: Option<i64>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_internal_transfer_records( &self, transfer_id: Option<&str>, coin: Option<&str>, status: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get internal transfer records
API: GET /v5/asset/transfer/query-inter-transfer-list https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
Sourcepub async fn create_universal_transfer(
&self,
transfer_id: &str,
coin: &str,
amount: &str,
from_member_id: &str,
to_member_id: &str,
from_account_type: &str,
to_account_type: &str,
) -> Result<ServerResponse<Value>>
pub async fn create_universal_transfer( &self, transfer_id: &str, coin: &str, amount: &str, from_member_id: &str, to_member_id: &str, from_account_type: &str, to_account_type: &str, ) -> Result<ServerResponse<Value>>
Create universal transfer
API: POST /v5/asset/transfer/universal-transfer https://bybit-exchange.github.io/docs/v5/asset/create-universal-transfer
Sourcepub async fn get_universal_transfer_records(
&self,
transfer_id: Option<&str>,
coin: Option<&str>,
status: Option<&str>,
start_time: Option<i64>,
end_time: Option<i64>,
limit: Option<i32>,
cursor: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_universal_transfer_records( &self, transfer_id: Option<&str>, coin: Option<&str>, status: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i32>, cursor: Option<&str>, ) -> Result<ServerResponse<Value>>
Get universal transfer records
API: GET /v5/asset/transfer/query-universal-transfer-list https://bybit-exchange.github.io/docs/v5/asset/universal-transfer-list
Sourcepub async fn get_allowed_transfer_coin_list(
&self,
from_account_type: &str,
to_account_type: &str,
) -> Result<ServerResponse<Value>>
pub async fn get_allowed_transfer_coin_list( &self, from_account_type: &str, to_account_type: &str, ) -> Result<ServerResponse<Value>>
Get allowed transfer coin list
API: GET /v5/asset/transfer/query-transfer-coin-list https://bybit-exchange.github.io/docs/v5/asset/transferable-coin
Sourcepub async fn request_convert_quote(
&self,
from_coin: &str,
to_coin: &str,
from_coin_type: Option<&str>,
to_coin_type: Option<&str>,
request_coin: &str,
request_amount: &str,
account_type: &str,
request_id: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn request_convert_quote( &self, from_coin: &str, to_coin: &str, from_coin_type: Option<&str>, to_coin_type: Option<&str>, request_coin: &str, request_amount: &str, account_type: &str, request_id: Option<&str>, ) -> Result<ServerResponse<Value>>
Request quote for convert
API: POST /v5/asset/exchange/quote-apply https://bybit-exchange.github.io/docs/v5/asset/request-quote
Sourcepub async fn confirm_convert_quote(
&self,
quote_tx_id: &str,
) -> Result<ServerResponse<Value>>
pub async fn confirm_convert_quote( &self, quote_tx_id: &str, ) -> Result<ServerResponse<Value>>
Confirm quote for convert
API: POST /v5/asset/exchange/convert-execute https://bybit-exchange.github.io/docs/v5/asset/confirm-quote
Sourcepub async fn get_convert_result(
&self,
quote_tx_id: Option<&str>,
account_type: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_convert_result( &self, quote_tx_id: Option<&str>, account_type: Option<&str>, ) -> Result<ServerResponse<Value>>
Get convert status
API: GET /v5/asset/exchange/convert-result-query https://bybit-exchange.github.io/docs/v5/asset/convert-status
Sourcepub async fn get_convert_history(
&self,
account_type: Option<&str>,
index: Option<i32>,
limit: Option<i32>,
) -> Result<ServerResponse<Value>>
pub async fn get_convert_history( &self, account_type: Option<&str>, index: Option<i32>, limit: Option<i32>, ) -> Result<ServerResponse<Value>>
Get convert history
API: GET /v5/asset/exchange/query-convert-history https://bybit-exchange.github.io/docs/v5/asset/convert-history
Sourcepub async fn get_convert_coin_list(
&self,
coin: Option<&str>,
side: Option<i32>,
account_type: &str,
) -> Result<ServerResponse<Value>>
pub async fn get_convert_coin_list( &self, coin: Option<&str>, side: Option<i32>, account_type: &str, ) -> Result<ServerResponse<Value>>
Get convert coin list
API: GET /v5/asset/exchange/query-coin-list https://bybit-exchange.github.io/docs/v5/asset/convert-coin-list
Sourcepub async fn get_coin_greeks(
&self,
base_coin: Option<&str>,
) -> Result<ServerResponse<Value>>
pub async fn get_coin_greeks( &self, base_coin: Option<&str>, ) -> Result<ServerResponse<Value>>
Get coin greeks
API: GET /v5/asset/coin-greeks https://bybit-exchange.github.io/docs/v5/asset/coin-greeks
Sourcepub async fn query_account_coin_balance(
&self,
member_id: Option<&str>,
to_member_id: Option<&str>,
account_type: &str,
to_account_type: Option<&str>,
coin: &str,
with_bonus: Option<i32>,
with_transfer_safe_amount: Option<i32>,
with_ltv_transfer_safe_amount: Option<i32>,
) -> Result<ServerResponse<Value>>
pub async fn query_account_coin_balance( &self, member_id: Option<&str>, to_member_id: Option<&str>, account_type: &str, to_account_type: Option<&str>, coin: &str, with_bonus: Option<i32>, with_transfer_safe_amount: Option<i32>, with_ltv_transfer_safe_amount: Option<i32>, ) -> Result<ServerResponse<Value>>
Query account coin balance
API: GET /v5/asset/transfer/query-account-coin-balance https://bybit-exchange.github.io/docs/v5/asset/account-coin-balance
Sourcepub async fn query_account_coins_balance(
&self,
member_id: Option<&str>,
account_type: &str,
coin: Option<&str>,
with_bonus: Option<i32>,
) -> Result<ServerResponse<Value>>
pub async fn query_account_coins_balance( &self, member_id: Option<&str>, account_type: &str, coin: Option<&str>, with_bonus: Option<i32>, ) -> Result<ServerResponse<Value>>
Query account coins balance
API: GET /v5/asset/transfer/query-account-coins-balance https://bybit-exchange.github.io/docs/v5/asset/account-coins-balance
Sourcepub async fn save_transfer_sub_member(
&self,
coin: Vec<String>,
member_ids: Vec<String>,
) -> Result<ServerResponse<Value>>
pub async fn save_transfer_sub_member( &self, coin: Vec<String>, member_ids: Vec<String>, ) -> Result<ServerResponse<Value>>
Set deposit account
API: POST /v5/asset/transfer/save-transfer-sub-member https://bybit-exchange.github.io/docs/v5/asset/set-deposit-account