AssetClient

Struct AssetClient 

Source
pub struct AssetClient { /* private fields */ }

Implementations§

Source§

impl AssetClient

Source

pub fn new(client: RestClient) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more