pub struct BybitClient { /* private fields */ }Expand description
Bybit HTTP API client.
Implementations§
Source§impl BybitClient
impl BybitClient
Sourcepub fn new(config: ClientConfig) -> Result<Self>
pub fn new(config: ClientConfig) -> Result<Self>
Create a new client with the given configuration.
Sourcepub fn with_credentials(
api_key: impl Into<String>,
api_secret: impl Into<String>,
) -> Result<Self>
pub fn with_credentials( api_key: impl Into<String>, api_secret: impl Into<String>, ) -> Result<Self>
Create a new client with API credentials using default settings.
Sourcepub fn testnet(
api_key: impl Into<String>,
api_secret: impl Into<String>,
) -> Result<Self>
pub fn testnet( api_key: impl Into<String>, api_secret: impl Into<String>, ) -> Result<Self>
Create a new client for testnet.
Sourcepub fn demo(
api_key: impl Into<String>,
api_secret: impl Into<String>,
) -> Result<Self>
pub fn demo( api_key: impl Into<String>, api_secret: impl Into<String>, ) -> Result<Self>
Create a new client for demo environment.
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Get the client configuration.
Sourcepub async fn get_public<T: DeserializeOwned>(
&self,
endpoint: &str,
params: &[(&str, &str)],
) -> Result<T>
pub async fn get_public<T: DeserializeOwned>( &self, endpoint: &str, params: &[(&str, &str)], ) -> Result<T>
Send a public GET request (no authentication).
Source§impl BybitClient
impl BybitClient
Sourcepub async fn get_wallet_balance(
&self,
account_type: AccountType,
) -> Result<WalletBalance>
pub async fn get_wallet_balance( &self, account_type: AccountType, ) -> Result<WalletBalance>
Sourcepub async fn get_account_info(&self) -> Result<AccountInfo>
pub async fn get_account_info(&self) -> Result<AccountInfo>
Get account info.
Sourcepub async fn get_fee_rate(
&self,
category: Category,
symbol: Option<&str>,
) -> Result<FeeRates>
pub async fn get_fee_rate( &self, category: Category, symbol: Option<&str>, ) -> Result<FeeRates>
Sourcepub async fn get_transaction_log(
&self,
category: Option<Category>,
limit: Option<u32>,
) -> Result<TransactionLogs>
pub async fn get_transaction_log( &self, category: Option<Category>, limit: Option<u32>, ) -> Result<TransactionLogs>
Get transaction log.
§Arguments
category- Optional category filterlimit- Optional limit (default 20)
Sourcepub async fn set_margin_mode(&self, margin_mode: MarginMode) -> Result<Value>
pub async fn set_margin_mode(&self, margin_mode: MarginMode) -> Result<Value>
Sourcepub async fn get_collateral_info(
&self,
currency: Option<&str>,
) -> Result<CollateralInfo>
pub async fn get_collateral_info( &self, currency: Option<&str>, ) -> Result<CollateralInfo>
Sourcepub async fn get_borrow_history(
&self,
currency: Option<&str>,
limit: Option<u32>,
) -> Result<BorrowHistory>
pub async fn get_borrow_history( &self, currency: Option<&str>, limit: Option<u32>, ) -> Result<BorrowHistory>
Get borrow history.
§Arguments
currency- Optional currency filterlimit- Optional limit (default 20)
pub async fn batch_set_collateral( &self, params: BatchSetCollateralParams, ) -> Result<BatchSetCollateralResponse>
pub async fn get_account_instruments( &self, category: Category, symbol: Option<&str>, limit: Option<u32>, cursor: Option<&str>, ) -> Result<GetAccountInstrumentsResponse>
pub async fn get_coin_greeks( &self, base_coin: Option<&str>, ) -> Result<GetCoinGreeksResponse>
pub async fn get_dcp_info(&self) -> Result<GetDcpInfoResponse>
pub async fn get_group_fee_rate( &self, product_type: &str, group_id: Option<&str>, ) -> Result<GetGroupFeeRateResponse>
pub async fn get_mmp_state( &self, base_coin: &str, ) -> Result<GetMmpStateResponse>
pub async fn get_smp_group(&self) -> Result<GetSmpGroupResponse>
pub async fn get_transferable_amount( &self, coin_name: &str, ) -> Result<GetTransferableAmountResponse>
pub async fn get_user_settings(&self) -> Result<GetUserSettingsResponse>
pub async fn manual_borrow( &self, params: ManualBorrowParams, ) -> Result<ManualBorrowResponse>
pub async fn manual_repay( &self, params: ManualRepayParams, ) -> Result<ManualRepayResponse>
pub async fn no_convert_repay( &self, params: NoConvertRepayParams, ) -> Result<NoConvertRepayResponse>
pub async fn one_click_repay( &self, params: OneClickRepayParams, ) -> Result<OneClickRepayResponse>
pub async fn reset_mmp( &self, params: ResetMmpParams, ) -> Result<ResetMmpResponse>
pub async fn set_collateral_coin( &self, params: SetCollateralCoinParams, ) -> Result<Value>
pub async fn set_mmp(&self, params: SetMmpParams) -> Result<SetMmpResponse>
pub async fn set_price_limit( &self, params: SetPriceLimitParams, ) -> Result<SetPriceLimitResponse>
pub async fn set_spot_hedging( &self, params: SetSpotHedgingParams, ) -> Result<SetSpotHedgingResponse>
pub async fn upgrade_to_uta_pro(&self) -> Result<UpgradeToUtaProResponse>
Source§impl BybitClient
impl BybitClient
Sourcepub async fn get_coin_info(
&self,
coin: Option<&str>,
) -> Result<CoinInfoResponse>
pub async fn get_coin_info( &self, coin: Option<&str>, ) -> Result<CoinInfoResponse>
Sourcepub async fn internal_transfer(
&self,
coin: &str,
amount: &str,
from_account: &str,
to_account: &str,
) -> Result<TransferResponse>
pub async fn internal_transfer( &self, coin: &str, amount: &str, from_account: &str, to_account: &str, ) -> Result<TransferResponse>
Internal transfer between accounts.
§Arguments
coin- Coin to transferamount- Amount to transferfrom_account- Source account typeto_account- Destination account type
Sourcepub async fn get_internal_transfer_list(
&self,
coin: Option<&str>,
limit: Option<u32>,
) -> Result<TransferList>
pub async fn get_internal_transfer_list( &self, coin: Option<&str>, limit: Option<u32>, ) -> Result<TransferList>
Get internal transfer list.
§Arguments
coin- Optional coin filterlimit- Optional limit (default 20)
Sourcepub async fn get_deposit_address(
&self,
coin: &str,
chain_type: Option<&str>,
) -> Result<DepositAddressResponse>
pub async fn get_deposit_address( &self, coin: &str, chain_type: Option<&str>, ) -> Result<DepositAddressResponse>
Sourcepub async fn get_deposit_records(
&self,
coin: Option<&str>,
limit: Option<u32>,
) -> Result<DepositRecords>
pub async fn get_deposit_records( &self, coin: Option<&str>, limit: Option<u32>, ) -> Result<DepositRecords>
Sourcepub async fn withdraw(&self, params: WithdrawParams) -> Result<WithdrawResponse>
pub async fn withdraw(&self, params: WithdrawParams) -> Result<WithdrawResponse>
Sourcepub async fn cancel_withdraw(&self, withdraw_id: &str) -> Result<Value>
pub async fn cancel_withdraw(&self, withdraw_id: &str) -> Result<Value>
Sourcepub async fn get_withdraw_records(
&self,
coin: Option<&str>,
limit: Option<u32>,
) -> Result<WithdrawRecords>
pub async fn get_withdraw_records( &self, coin: Option<&str>, limit: Option<u32>, ) -> Result<WithdrawRecords>
Sourcepub async fn get_withdrawable_amount(
&self,
coin: &str,
) -> Result<WithdrawableAmount>
pub async fn get_withdrawable_amount( &self, coin: &str, ) -> Result<WithdrawableAmount>
Source§impl BybitClient
impl BybitClient
Sourcepub async fn query_broker_account_info(
&self,
) -> Result<QueryBrokerAccountInfoResponse>
pub async fn query_broker_account_info( &self, ) -> Result<QueryBrokerAccountInfoResponse>
Get Broker Account Info.
Sourcepub async fn query_broker_all_uid_details(
&self,
uids: Option<&str>,
limit: Option<i64>,
cursor: Option<&str>,
) -> Result<QueryBrokerAllUidDetailsResponse>
pub async fn query_broker_all_uid_details( &self, uids: Option<&str>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<QueryBrokerAllUidDetailsResponse>
Query Broker All UID Rate Limits.
Sourcepub async fn query_broker_cap(&self) -> Result<QueryBrokerCapResponse>
pub async fn query_broker_cap(&self) -> Result<QueryBrokerCapResponse>
Query Broker Rate Limit Cap.
Sourcepub async fn query_broker_earning(
&self,
biz_type: Option<&str>,
begin: Option<&str>,
end: Option<&str>,
uid: Option<&str>,
limit: Option<i64>,
cursor: Option<&str>,
) -> Result<QueryBrokerEarningResponse>
pub async fn query_broker_earning( &self, biz_type: Option<&str>, begin: Option<&str>, end: Option<&str>, uid: Option<&str>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<QueryBrokerEarningResponse>
Get Broker Earnings Info.
Sourcepub async fn set_broker_api_limit(
&self,
params: SetBrokerApiLimitParams,
) -> Result<SetBrokerApiLimitResponse>
pub async fn set_broker_api_limit( &self, params: SetBrokerApiLimitParams, ) -> Result<SetBrokerApiLimitResponse>
Set Broker API Rate Limit.
Sourcepub async fn distribute_award(
&self,
params: DistributeAwardParams,
) -> Result<Value>
pub async fn distribute_award( &self, params: DistributeAwardParams, ) -> Result<Value>
Distribute voucher.
Sourcepub async fn get_award_info(
&self,
params: GetAwardInfoParams,
) -> Result<GetAwardInfoResponse>
pub async fn get_award_info( &self, params: GetAwardInfoParams, ) -> Result<GetAwardInfoResponse>
Get voucher details.
Sourcepub async fn get_distribution_record(
&self,
params: GetDistributionRecordParams,
) -> Result<GetDistributionRecordResponse>
pub async fn get_distribution_record( &self, params: GetDistributionRecordParams, ) -> Result<GetDistributionRecordResponse>
Query voucher distribution record.
Source§impl BybitClient
impl BybitClient
Sourcepub async fn adjust_ltv(
&self,
params: AdjustLtvParams,
) -> Result<AdjustLtvResponse>
pub async fn adjust_ltv( &self, params: AdjustLtvParams, ) -> Result<AdjustLtvResponse>
Adjust Collateral (Add or Remove)
Sourcepub async fn calculate_max_loan(
&self,
params: CalculateMaxLoanParams,
) -> Result<CalculateMaxLoanResponse>
pub async fn calculate_max_loan( &self, params: CalculateMaxLoanParams, ) -> Result<CalculateMaxLoanResponse>
Calculate Max Borrowable Amount
Sourcepub async fn cancel_fixed_borrow_order(
&self,
params: CancelFixedBorrowOrderParams,
) -> Result<CancelFixedBorrowOrderResponse>
pub async fn cancel_fixed_borrow_order( &self, params: CancelFixedBorrowOrderParams, ) -> Result<CancelFixedBorrowOrderResponse>
Cancel Borrow Order
Sourcepub async fn create_fixed_borrow(
&self,
params: CreateFixedBorrowParams,
) -> Result<CreateFixedBorrowResponse>
pub async fn create_fixed_borrow( &self, params: CreateFixedBorrowParams, ) -> Result<CreateFixedBorrowResponse>
Create Fixed-Term Borrow Order
Sourcepub async fn fully_repay_fixed_loan(
&self,
params: FullyRepayFixedLoanParams,
) -> Result<FullyRepayFixedLoanResponse>
pub async fn fully_repay_fixed_loan( &self, params: FullyRepayFixedLoanParams, ) -> Result<FullyRepayFixedLoanResponse>
Fully Repay Loan
Sourcepub async fn get_adjustment_history(
&self,
adjust_id: Option<i64>,
collateral_currency: Option<&str>,
limit: Option<i64>,
cursor: Option<i64>,
) -> Result<GetAdjustmentHistoryResponse>
pub async fn get_adjustment_history( &self, adjust_id: Option<i64>, collateral_currency: Option<&str>, limit: Option<i64>, cursor: Option<i64>, ) -> Result<GetAdjustmentHistoryResponse>
Get Collateral Adjustment History
Sourcepub async fn get_collateral_data(
&self,
currency: Option<&str>,
) -> Result<GetCollateralDataResponse>
pub async fn get_collateral_data( &self, currency: Option<&str>, ) -> Result<GetCollateralDataResponse>
Get Collateral Currency Data
Sourcepub async fn get_fixed_repayment_history(&self) -> Result<Value>
pub async fn get_fixed_repayment_history(&self) -> Result<Value>
Get Repayment History
Sourcepub async fn get_fixed_supply_contract_info(&self) -> Result<Value>
pub async fn get_fixed_supply_contract_info(&self) -> Result<Value>
Get Supply Contract Info
Sourcepub async fn get_fixed_supply_order_info(&self) -> Result<Value>
pub async fn get_fixed_supply_order_info(&self) -> Result<Value>
Get Supply Order Info
Sourcepub async fn get_fixed_supply_order_quote(
&self,
) -> Result<GetCryptoLoanFixedSupplyOrderQuoteResponse>
pub async fn get_fixed_supply_order_quote( &self, ) -> Result<GetCryptoLoanFixedSupplyOrderQuoteResponse>
Get Supply Market Quotes
Sourcepub async fn get_flexible_borrow_history(
&self,
) -> Result<GetCryptoLoanFlexibleBorrowHistoryResponse>
pub async fn get_flexible_borrow_history( &self, ) -> Result<GetCryptoLoanFlexibleBorrowHistoryResponse>
Get Flexible Borrow History
Sourcepub async fn get_flexible_ongoing_coin(&self) -> Result<Value>
pub async fn get_flexible_ongoing_coin(&self) -> Result<Value>
Get Ongoing Flexible Borrow Info
Sourcepub async fn get_flexible_repayment_history(
&self,
) -> Result<GetCryptoLoanFlexibleRepaymentHistoryResponse>
pub async fn get_flexible_repayment_history( &self, ) -> Result<GetCryptoLoanFlexibleRepaymentHistoryResponse>
Get Flexible Repayment History
Sourcepub async fn get_fixed_borrow_contract_info(
&self,
order_id: Option<&str>,
loan_id: Option<&str>,
order_currency: Option<&str>,
term: Option<&str>,
limit: Option<i64>,
cursor: Option<i64>,
) -> Result<Value>
pub async fn get_fixed_borrow_contract_info( &self, order_id: Option<&str>, loan_id: Option<&str>, order_currency: Option<&str>, term: Option<&str>, limit: Option<i64>, cursor: Option<i64>, ) -> Result<Value>
Get Borrow Contract Info
Sourcepub async fn get_fixed_borrow_order_info(
&self,
order_id: Option<&str>,
order_currency: Option<&str>,
state: Option<&str>,
term: Option<&str>,
limit: Option<i64>,
cursor: Option<i64>,
) -> Result<Value>
pub async fn get_fixed_borrow_order_info( &self, order_id: Option<&str>, order_currency: Option<&str>, state: Option<&str>, term: Option<&str>, limit: Option<i64>, cursor: Option<i64>, ) -> Result<Value>
Get Borrow Order Info
Sourcepub async fn get_fixed_borrow_order_quote(
&self,
order_currency: Option<&str>,
term: Option<&str>,
order_by: Option<&str>,
sort: Option<i64>,
limit: Option<i64>,
) -> Result<GetFixedBorrowOrderQuoteResponse>
pub async fn get_fixed_borrow_order_quote( &self, order_currency: Option<&str>, term: Option<&str>, order_by: Option<&str>, sort: Option<i64>, limit: Option<i64>, ) -> Result<GetFixedBorrowOrderQuoteResponse>
Get Borrow Market Quotes
Sourcepub async fn get_fixed_renew_info(
&self,
order_id: Option<&str>,
order_currency: Option<&str>,
limit: Option<i64>,
cursor: Option<i64>,
) -> Result<Value>
pub async fn get_fixed_renew_info( &self, order_id: Option<&str>, order_currency: Option<&str>, limit: Option<i64>, cursor: Option<i64>, ) -> Result<Value>
Get Renewal Information
Sourcepub async fn get_loan_position(&self) -> Result<GetLoanPositionResponse>
pub async fn get_loan_position(&self) -> Result<GetLoanPositionResponse>
Get Crypto Loan Position
Sourcepub async fn get_loanable_data(
&self,
currency: Option<&str>,
vip_level: Option<&str>,
) -> Result<GetLoanableDataResponse>
pub async fn get_loanable_data( &self, currency: Option<&str>, vip_level: Option<&str>, ) -> Result<GetLoanableDataResponse>
Get Loanable Currency Data
Sourcepub async fn get_max_collateral_amount(
&self,
currency: &str,
) -> Result<GetMaxCollateralAmountResponse>
pub async fn get_max_collateral_amount( &self, currency: &str, ) -> Result<GetMaxCollateralAmountResponse>
Get Max Collateral Redeem Amount
Sourcepub async fn repay_fixed_collateral(
&self,
params: PostCryptoLoanFixedRepayCollateralParams,
) -> Result<PostCryptoLoanFixedRepayCollateralResponse>
pub async fn repay_fixed_collateral( &self, params: PostCryptoLoanFixedRepayCollateralParams, ) -> Result<PostCryptoLoanFixedRepayCollateralResponse>
Repay with Collateral (Fixed)
Sourcepub async fn create_fixed_supply(
&self,
params: PostCryptoLoanFixedSupplyParams,
) -> Result<Value>
pub async fn create_fixed_supply( &self, params: PostCryptoLoanFixedSupplyParams, ) -> Result<Value>
Create Supply Order
Sourcepub async fn cancel_fixed_supply_order(
&self,
params: PostCryptoLoanFixedSupplyOrderCancelParams,
) -> Result<PostCryptoLoanFixedSupplyOrderCancelResponse>
pub async fn cancel_fixed_supply_order( &self, params: PostCryptoLoanFixedSupplyOrderCancelParams, ) -> Result<PostCryptoLoanFixedSupplyOrderCancelResponse>
Cancel Supply Order
Sourcepub async fn create_flexible_borrow(
&self,
params: PostCryptoLoanFlexibleBorrowParams,
) -> Result<PostCryptoLoanFlexibleBorrowResponse>
pub async fn create_flexible_borrow( &self, params: PostCryptoLoanFlexibleBorrowParams, ) -> Result<PostCryptoLoanFlexibleBorrowResponse>
Create Flexible Borrow Order
Sourcepub async fn repay_flexible_loan(
&self,
params: PostCryptoLoanFlexibleRepayParams,
) -> Result<Value>
pub async fn repay_flexible_loan( &self, params: PostCryptoLoanFlexibleRepayParams, ) -> Result<Value>
Repay Flexible Loan
Sourcepub async fn repay_flexible_collateral(
&self,
params: PostCryptoLoanFlexibleRepayCollateralParams,
) -> Result<PostCryptoLoanFlexibleRepayCollateralResponse>
pub async fn repay_flexible_collateral( &self, params: PostCryptoLoanFlexibleRepayCollateralParams, ) -> Result<PostCryptoLoanFlexibleRepayCollateralResponse>
Repay with Collateral (Flexible)
Sourcepub async fn renew_fixed_loan(
&self,
params: RenewFixedLoanParams,
) -> Result<Value>
pub async fn renew_fixed_loan( &self, params: RenewFixedLoanParams, ) -> Result<Value>
Renew Loan
Source§impl BybitClient
impl BybitClient
pub async fn add_liquidity( &self, params: AddLiquidityParams, ) -> Result<AddLiquidityResponse>
pub async fn add_liquidity_mining_margin(&self, params: Value) -> Result<Value>
pub async fn claim_liquidity_interest( &self, params: ClaimLiquidityInterestParams, ) -> Result<ClaimLiquidityInterestResponse>
pub async fn get_advance_earn_order( &self, category: Category, product_id: Option<i64>, order_id: Option<&str>, order_link_id: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetAdvanceEarnOrderResponse>
pub async fn get_advance_earn_position( &self, category: Category, product_id: Option<i64>, coin: Option<&str>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetAdvanceEarnPositionResponse>
pub async fn get_advance_earn_product( &self, category: Category, coin: Option<&str>, duration: Option<&str>, ) -> Result<GetAdvanceEarnProductResponse>
pub async fn get_advance_earn_product_extra_info( &self, category: Category, product_id: Option<i64>, ) -> Result<GetAdvanceEarnProductExtraInfoResponse>
pub async fn get_double_win_leverage( &self, product_id: i64, initial_price: &str, lower_price: &str, upper_price: &str, ) -> Result<GetDoubleWinLeverageResponse>
pub async fn get_earn_apr_history( &self, category: Category, product_id: &str, start_time: i64, end_time: i64, ) -> Result<GetEarnAprHistoryResponse>
pub async fn get_earn_hourly_yield_history( &self, category: Category, product_id: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetEarnHourlyYieldHistoryResponse>
pub async fn get_earn_order_history( &self, category: Category, order_id: Option<&str>, order_link_id: Option<&str>, product_id: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetEarnOrderHistoryResponse>
pub async fn get_earn_position( &self, category: Category, product_id: Option<&str>, coin: Option<&str>, ) -> Result<GetEarnPositionResponse>
pub async fn get_earn_product( &self, category: Category, coin: Option<&str>, ) -> Result<GetEarnProductResponse>
pub async fn get_earn_yield_history( &self, category: Category, product_id: Option<i64>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetEarnYieldHistoryResponse>
pub async fn get_fixed_term_order( &self, order_type: Option<&str>, product_id: Option<&str>, category: Option<Category>, order_id: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetFixedTermOrderResponse>
pub async fn get_fixed_term_position( &self, product_id: Option<&str>, category: Option<Category>, coin: Option<&str>, ) -> Result<GetFixedTermPositionResponse>
pub async fn get_fixed_term_product( &self, coin: Option<&str>, ) -> Result<GetFixedTermProductResponse>
pub async fn get_hold_to_earn_product( &self, ) -> Result<GetHoldToEarnProductResponse>
pub async fn get_hold_to_earn_yield_history( &self, time_start: Option<i64>, time_end: Option<i64>, limit: i64, cursor: Option<&str>, ) -> Result<GetHoldToEarnYieldHistoryResponse>
pub async fn get_liquidity_mining_liquidation_records( &self, base_coin: Option<&str>, quote_coin: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetLiquidityMiningLiquidationRecordsResponse>
pub async fn get_liquidity_mining_orders( &self, order_id: Option<&str>, order_link_id: Option<&str>, product_id: Option<&str>, order_type: Option<&str>, status: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetLiquidityMiningOrdersResponse>
pub async fn get_liquidity_mining_positions( &self, product_id: Option<&str>, base_coin: Option<&str>, ) -> Result<GetLiquidityMiningPositionsResponse>
pub async fn get_liquidity_mining_products( &self, base_coin: Option<&str>, quote_coin: Option<&str>, ) -> Result<GetLiquidityMiningProductsResponse>
pub async fn get_liquidity_mining_yield_records( &self, base_coin: Option<&str>, quote_coin: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetLiquidityMiningYieldRecordsResponse>
pub async fn get_rwa_order_list( &self, order_id: Option<&str>, order_link_id: Option<&str>, order_type: Option<&str>, product_id: Option<i64>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetRwaOrderListResponse>
pub async fn get_rwa_position_list(&self) -> Result<GetRwaPositionListResponse>
pub async fn get_rwa_product_list( &self, coin: Option<&str>, ) -> Result<GetRwaProductListResponse>
pub async fn get_smart_leverage_redeem_est_amount_list( &self, category: Category, position_ids: &str, ) -> Result<GetSmartLeverageRedeemEstAmountListResponse>
pub async fn get_token_daily_yield( &self, coin: &str, start_time: Option<i64>, end_time: Option<i64>, cursor: Option<&str>, limit: Option<i64>, ) -> Result<GetTokenDailyYieldResponse>
pub async fn get_token_historical_apr( &self, coin: &str, range: i64, ) -> Result<GetTokenHistoricalAprResponse>
pub async fn get_token_hourly_yield( &self, coin: &str, start_time: Option<i64>, end_time: Option<i64>, cursor: Option<&str>, limit: Option<i64>, ) -> Result<GetTokenHourlyYieldResponse>
pub async fn get_token_order_list( &self, coin: &str, order_link_id: Option<&str>, order_id: Option<&str>, order_type: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, cursor: Option<&str>, limit: Option<i64>, ) -> Result<GetTokenOrderListResponse>
pub async fn get_token_position( &self, coin: &str, ) -> Result<GetTokenPositionResponse>
pub async fn get_token_product( &self, coin: &str, ) -> Result<GetTokenProductResponse>
pub async fn list_earn_coupons( &self, category: Category, ) -> Result<ListEarnCouponsResponse>
pub async fn modify_earn_position( &self, params: ModifyEarnPositionParams, ) -> Result<Value>
pub async fn place_advance_earn_order( &self, params: PlaceAdvanceEarnOrderParams, ) -> Result<PlaceAdvanceEarnOrderResponse>
pub async fn place_earn_order( &self, params: PlaceEarnOrderParams, ) -> Result<PlaceEarnOrderResponse>
pub async fn place_fixed_term_order( &self, params: PlaceFixedTermOrderParams, ) -> Result<PlaceFixedTermOrderResponse>
pub async fn place_rwa_order( &self, params: PlaceRwaOrderParams, ) -> Result<PlaceRwaOrderResponse>
pub async fn place_token_order( &self, params: PlaceTokenOrderParams, ) -> Result<PlaceTokenOrderResponse>
pub async fn pwm_asset_trend( &self, plan_id: &str, start_time: Option<i64>, end_time: Option<i64>, ) -> Result<PwmAssetTrendResponse>
pub async fn pwm_claim( &self, params: PwmClaimParams, ) -> Result<PwmClaimResponse>
pub async fn pwm_create_custom_plan( &self, params: PwmCreateCustomPlanParams, ) -> Result<PwmCreateCustomPlanResponse>
pub async fn pwm_fund_transfer( &self, params: PwmFundTransferParams, ) -> Result<PwmFundTransferResponse>
pub async fn pwm_get_new_plan_detail( &self, plan_id: &str, ) -> Result<PwmGetNewPlanDetailResponse>
pub async fn pwm_get_plan_detail( &self, plan_id: &str, ) -> Result<PwmGetPlanDetailResponse>
pub async fn pwm_inst_create_fund( &self, params: PwmInstCreateFundParams, ) -> Result<PwmInstCreateFundResponse>
pub async fn pwm_inst_create_investment_plan( &self, params: PwmInstCreateInvestmentPlanParams, ) -> Result<PwmInstCreateInvestmentPlanResponse>
pub async fn pwm_inst_create_sub_account( &self, params: PwmInstCreateSubAccountParams, ) -> Result<PwmInstCreateSubAccountResponse>
pub async fn pwm_inst_get_investment_plans( &self, plan_id: Option<&str>, status: Option<&str>, subscription_uid: Option<&str>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<PwmInstGetInvestmentPlansResponse>
pub async fn pwm_inst_list_funds( &self, fund_id: Option<&str>, coin: Option<&str>, status: Option<&str>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<PwmInstListFundsResponse>
pub async fn pwm_inst_list_orders( &self, fund_id: Option<&str>, order_type: Option<&str>, status: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<PwmInstListOrdersResponse>
pub async fn pwm_inst_manage_investment_plan( &self, params: PwmInstManageInvestmentPlanParams, ) -> Result<PwmInstManageInvestmentPlanResponse>
pub async fn pwm_inst_manage_order( &self, params: PwmInstManageOrderParams, ) -> Result<PwmInstManageOrderResponse>
pub async fn pwm_inst_settle_profit( &self, params: PwmInstSettleProfitParams, ) -> Result<PwmInstSettleProfitResponse>
pub async fn pwm_invest_more( &self, params: PwmInvestMoreParams, ) -> Result<PwmInvestMoreResponse>
pub async fn pwm_list_investment_plans( &self, plan_id: Option<&str>, status: Option<&str>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<PwmListInvestmentPlansResponse>
pub async fn pwm_list_order( &self, plan_id: Option<&str>, category: Option<Category>, order_type: Option<&str>, status: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, order_link_id: Option<&str>, ) -> Result<PwmListOrderResponse>
pub async fn pwm_list_product_cards( &self, ) -> Result<PwmListProductCardsResponse>
pub async fn pwm_query_fund_transfer_result( &self, transfer_id: Option<&str>, from_user_id: Option<i64>, ) -> Result<PwmQueryFundTransferResultResponse>
pub async fn pwm_redeem( &self, params: PwmRedeemParams, ) -> Result<PwmRedeemResponse>
pub async fn pwm_subscribe( &self, params: PwmSubscribeParams, ) -> Result<PwmSubscribeResponse>
pub async fn redeem_fixed_term( &self, params: RedeemFixedTermParams, ) -> Result<RedeemFixedTermResponse>
pub async fn reinvest_liquidity( &self, params: ReinvestLiquidityParams, ) -> Result<Value>
pub async fn remove_liquidity( &self, params: RemoveLiquidityParams, ) -> Result<Value>
pub async fn set_fixed_term_auto_invest( &self, params: SetFixedTermAutoInvestParams, ) -> Result<Value>
Source§impl BybitClient
impl BybitClient
Sourcepub async fn apply_quote(
&self,
params: ApplyQuoteParams,
) -> Result<ApplyQuoteResponse>
pub async fn apply_quote( &self, params: ApplyQuoteParams, ) -> Result<ApplyQuoteResponse>
Request a Quote.
Sourcepub async fn confirm_quote(
&self,
params: ConfirmQuoteParams,
) -> Result<ConfirmQuoteResponse>
pub async fn confirm_quote( &self, params: ConfirmQuoteParams, ) -> Result<ConfirmQuoteResponse>
Confirm Quote and Execute Trade.
Sourcepub async fn get_p2p_personal_info(&self) -> Result<Value>
pub async fn get_p2p_personal_info(&self) -> Result<Value>
Get Account Information.
Sourcepub async fn get_ads(&self, params: GetAdsParams) -> Result<GetAdsResponse>
pub async fn get_ads(&self, params: GetAdsParams) -> Result<GetAdsResponse>
Get Ads.
Sourcepub async fn get_all_orders(&self, params: Value) -> Result<Value>
pub async fn get_all_orders(&self, params: Value) -> Result<Value>
Get All Orders.
Sourcepub async fn get_chat_messages(
&self,
params: GetChatMessagesParams,
) -> Result<GetChatMessagesResponse>
pub async fn get_chat_messages( &self, params: GetChatMessagesParams, ) -> Result<GetChatMessagesResponse>
Get Chat Message.
Sourcepub async fn get_coin_balance(
&self,
account_type: AccountType,
member_id: Option<&str>,
coin: Option<&str>,
with_bonus: Option<i64>,
) -> Result<GetCoinBalanceResponse>
pub async fn get_coin_balance( &self, account_type: AccountType, member_id: Option<&str>, coin: Option<&str>, with_bonus: Option<i64>, ) -> Result<GetCoinBalanceResponse>
Get Coin Balance.
Sourcepub async fn get_counterparty_user_info(
&self,
params: GetCounterpartyUserInfoParams,
) -> Result<GetCounterpartyUserInfoResponse>
pub async fn get_counterparty_user_info( &self, params: GetCounterpartyUserInfoParams, ) -> Result<GetCounterpartyUserInfoResponse>
Get Counterparty User Info.
Sourcepub async fn get_my_ad_details(
&self,
params: GetMyAdDetailsParams,
) -> Result<GetMyAdDetailsResponse>
pub async fn get_my_ad_details( &self, params: GetMyAdDetailsParams, ) -> Result<GetMyAdDetailsResponse>
Get My Ad Details.
Sourcepub async fn get_my_ads(
&self,
params: GetMyAdsParams,
) -> Result<GetMyAdsResponse>
pub async fn get_my_ads( &self, params: GetMyAdsParams, ) -> Result<GetMyAdsResponse>
Get My Ads.
Sourcepub async fn get_order_detail(
&self,
params: GetOrderDetailParams,
) -> Result<GetOrderDetailResponse>
pub async fn get_order_detail( &self, params: GetOrderDetailParams, ) -> Result<GetOrderDetailResponse>
Get Order Detail.
Sourcepub async fn get_pending_orders(
&self,
params: GetPendingOrdersParams,
) -> Result<GetPendingOrdersResponse>
pub async fn get_pending_orders( &self, params: GetPendingOrdersParams, ) -> Result<GetPendingOrdersResponse>
Get Pending Orders.
Sourcepub async fn get_reference_price(
&self,
symbol: &str,
payment_method: Option<&str>,
) -> Result<GetReferencePriceResponse>
pub async fn get_reference_price( &self, symbol: &str, payment_method: Option<&str>, ) -> Result<GetReferencePriceResponse>
Get Reference Price.
Sourcepub async fn get_user_payment(&self) -> Result<GetUserPaymentResponse>
pub async fn get_user_payment(&self) -> Result<GetUserPaymentResponse>
Get User Payment.
Sourcepub async fn mark_order_as_paid(
&self,
params: MarkOrderAsPaidParams,
) -> Result<MarkOrderAsPaidResponse>
pub async fn mark_order_as_paid( &self, params: MarkOrderAsPaidParams, ) -> Result<MarkOrderAsPaidResponse>
Mark Order as Paid.
Sourcepub async fn post_ad(&self, params: PostAdParams) -> Result<PostAdResponse>
pub async fn post_ad(&self, params: PostAdParams) -> Result<PostAdResponse>
Post Ad.
Sourcepub async fn query_balance(
&self,
account_category: Option<&str>,
currency: Option<&str>,
) -> Result<QueryBalanceResponse>
pub async fn query_balance( &self, account_category: Option<&str>, currency: Option<&str>, ) -> Result<QueryBalanceResponse>
Query Account Balance.
Sourcepub async fn query_coin_list(
&self,
side: Option<i64>,
) -> Result<QueryCoinListResponse>
pub async fn query_coin_list( &self, side: Option<i64>, ) -> Result<QueryCoinListResponse>
Get Trading Pairs.
Sourcepub async fn query_funding_detail_api(
&self,
create_time_from: Option<&str>,
create_time_to: Option<&str>,
limit: Option<&str>,
cursor: Option<&str>,
) -> Result<QueryFundingDetailApiResponse>
pub async fn query_funding_detail_api( &self, create_time_from: Option<&str>, create_time_to: Option<&str>, limit: Option<&str>, cursor: Option<&str>, ) -> Result<QueryFundingDetailApiResponse>
Get Funding History.
Sourcepub async fn query_trade(
&self,
trade_no: Option<&str>,
merchant_request_id: Option<&str>,
) -> Result<QueryTradeResponse>
pub async fn query_trade( &self, trade_no: Option<&str>, merchant_request_id: Option<&str>, ) -> Result<QueryTradeResponse>
Query Trade Status.
Sourcepub async fn query_trade_history(
&self,
index: Option<i64>,
limit: Option<i64>,
start_time: Option<&str>,
end_time: Option<&str>,
) -> Result<QueryTradeHistoryResponse>
pub async fn query_trade_history( &self, index: Option<i64>, limit: Option<i64>, start_time: Option<&str>, end_time: Option<&str>, ) -> Result<QueryTradeHistoryResponse>
Query Trade History.
Sourcepub async fn release_assets(&self, params: ReleaseAssetsParams) -> Result<Value>
pub async fn release_assets(&self, params: ReleaseAssetsParams) -> Result<Value>
Release Assets.
Sourcepub async fn remove_ad(&self, params: RemoveAdParams) -> Result<Value>
pub async fn remove_ad(&self, params: RemoveAdParams) -> Result<Value>
Remove Ad.
Sourcepub async fn send_chat_message(
&self,
params: SendChatMessageParams,
) -> Result<Value>
pub async fn send_chat_message( &self, params: SendChatMessageParams, ) -> Result<Value>
Send Chat Message.
Sourcepub async fn update_ad(
&self,
params: UpdateAdParams,
) -> Result<UpdateAdResponse>
pub async fn update_ad( &self, params: UpdateAdParams, ) -> Result<UpdateAdResponse>
Update / Relist Ad.
Sourcepub async fn upload_chat_file(
&self,
params: UploadChatFileParams,
) -> Result<UploadChatFileResponse>
pub async fn upload_chat_file( &self, params: UploadChatFileParams, ) -> Result<UploadChatFileResponse>
Upload Chat File.
Source§impl BybitClient
impl BybitClient
Sourcepub async fn create_f_mart_bot(
&self,
params: CreateFMartBotParams,
) -> Result<CreateFMartBotResponse>
pub async fn create_f_mart_bot( &self, params: CreateFMartBotParams, ) -> Result<CreateFMartBotResponse>
Create a new futures Martingale bot with DCA averaging strategy.
Source§impl BybitClient
impl BybitClient
Sourcepub async fn get_server_time(&self) -> Result<ServerTime>
pub async fn get_server_time(&self) -> Result<ServerTime>
Get server time.
§Example
let client = BybitClient::testnet("key", "secret")?;
let time = client.get_server_time().await?;
println!("Server time: {}", time.time_second);Sourcepub async fn get_instruments_info(
&self,
category: Category,
symbol: Option<&str>,
) -> Result<InstrumentsInfo>
pub async fn get_instruments_info( &self, category: Category, symbol: Option<&str>, ) -> Result<InstrumentsInfo>
Sourcepub async fn get_orderbook(
&self,
category: Category,
symbol: &str,
limit: Option<u32>,
) -> Result<Orderbook>
pub async fn get_orderbook( &self, category: Category, symbol: &str, limit: Option<u32>, ) -> Result<Orderbook>
Get orderbook.
§Arguments
category- Product categorysymbol- Symbol namelimit- Optional depth limit (1-500, default 25)
Sourcepub async fn get_tickers(
&self,
category: Category,
symbol: Option<&str>,
) -> Result<Tickers>
pub async fn get_tickers( &self, category: Category, symbol: Option<&str>, ) -> Result<Tickers>
Get tickers.
§Arguments
category- Product categorysymbol- Optional symbol filter (returns all if None)
Sourcepub async fn get_klines(
&self,
category: Category,
symbol: &str,
interval: Interval,
limit: Option<u32>,
) -> Result<Klines>
pub async fn get_klines( &self, category: Category, symbol: &str, interval: Interval, limit: Option<u32>, ) -> Result<Klines>
Get klines (candlestick data).
§Arguments
category- Product categorysymbol- Symbol nameinterval- Kline intervallimit- Optional limit (1-1000, default 200)
Sourcepub async fn get_funding_history(
&self,
category: Category,
symbol: &str,
limit: Option<u32>,
) -> Result<FundingHistory>
pub async fn get_funding_history( &self, category: Category, symbol: &str, limit: Option<u32>, ) -> Result<FundingHistory>
Get funding rate history.
§Arguments
category- Product category (linear or inverse)symbol- Symbol namelimit- Optional limit (default 200)
Sourcepub async fn get_recent_trades(
&self,
category: Category,
symbol: &str,
limit: Option<u32>,
) -> Result<RecentTrades>
pub async fn get_recent_trades( &self, category: Category, symbol: &str, limit: Option<u32>, ) -> Result<RecentTrades>
Get recent trades.
§Arguments
category- Product categorysymbol- Symbol namelimit- Optional limit (1-1000, default 500)
Sourcepub async fn get_open_interest(
&self,
category: Category,
symbol: &str,
interval_time: &str,
limit: Option<u32>,
) -> Result<OpenInterest>
pub async fn get_open_interest( &self, category: Category, symbol: &str, interval_time: &str, limit: Option<u32>, ) -> Result<OpenInterest>
Get open interest.
§Arguments
category- Product category (linear or inverse)symbol- Symbol nameinterval_time- Interval (5min, 15min, 30min, 1h, 4h, 1d)limit- Optional limit (default 50)
Sourcepub async fn get_risk_limit(
&self,
category: Category,
symbol: Option<&str>,
) -> Result<RiskLimits>
pub async fn get_risk_limit( &self, category: Category, symbol: Option<&str>, ) -> Result<RiskLimits>
Get risk limit info.
§Arguments
category- Product category (linear or inverse)symbol- Optional symbol filter
Sourcepub async fn get_mark_price_kline(
&self,
category: Category,
symbol: &str,
interval: Interval,
limit: Option<u32>,
) -> Result<Klines>
pub async fn get_mark_price_kline( &self, category: Category, symbol: &str, interval: Interval, limit: Option<u32>, ) -> Result<Klines>
Get mark price kline.
Sourcepub async fn get_index_price_kline(
&self,
category: Category,
symbol: &str,
interval: Interval,
limit: Option<u32>,
) -> Result<Klines>
pub async fn get_index_price_kline( &self, category: Category, symbol: &str, interval: Interval, limit: Option<u32>, ) -> Result<Klines>
Get index price kline.
Get premium index price kline.
pub async fn get_adl_alert( &self, symbol: Option<&str>, ) -> Result<GetAdlAlertResponse>
pub async fn get_delivery_price( &self, category: Category, symbol: Option<&str>, base_coin: Option<&str>, settle_coin: Option<&str>, limit: Option<u32>, cursor: Option<&str>, ) -> Result<GetDeliveryPriceResponse>
pub async fn get_historical_volatility( &self, category: Category, base_coin: Option<&str>, quote_coin: Option<&str>, period: Option<u32>, start_time: Option<u64>, end_time: Option<u64>, ) -> Result<GetHistoricalVolatilityResponse>
pub async fn get_index_price_components( &self, index_name: &str, ) -> Result<GetIndexPriceComponentsResponse>
pub async fn get_insurance_pool( &self, coin: Option<&str>, ) -> Result<GetInsurancePoolResponse>
pub async fn get_long_short_ratio( &self, category: Category, symbol: &str, period: &str, start_time: Option<&str>, end_time: Option<&str>, limit: Option<u32>, cursor: Option<&str>, ) -> Result<GetLongShortRatioResponse>
pub async fn get_new_delivery_price( &self, category: Category, base_coin: &str, settle_coin: Option<&str>, ) -> Result<GetNewDeliveryPriceResponse>
pub async fn get_order_price_limit( &self, category: Option<Category>, symbol: &str, ) -> Result<GetOrderPriceLimitResponse>
pub async fn get_rpi_orderbook( &self, category: Option<Category>, symbol: &str, limit: u32, ) -> Result<GetRpiOrderbookResponse>
Source§impl BybitClient
impl BybitClient
Sourcepub async fn get_positions(
&self,
category: Category,
symbol: Option<&str>,
settle_coin: Option<&str>,
) -> Result<PositionList>
pub async fn get_positions( &self, category: Category, symbol: Option<&str>, settle_coin: Option<&str>, ) -> Result<PositionList>
Get position list.
§Arguments
category- Product categorysymbol- Optional symbol filtersettle_coin- Optional settle coin filter (e.g., “USDT”)
Sourcepub async fn set_leverage(
&self,
category: Category,
symbol: &str,
buy_leverage: &str,
sell_leverage: &str,
) -> Result<Value>
pub async fn set_leverage( &self, category: Category, symbol: &str, buy_leverage: &str, sell_leverage: &str, ) -> Result<Value>
Set leverage.
§Arguments
category- Product categorysymbol- Symbol namebuy_leverage- Buy leveragesell_leverage- Sell leverage
Sourcepub async fn set_trading_stop(&self, params: TradingStopParams) -> Result<Value>
pub async fn set_trading_stop(&self, params: TradingStopParams) -> Result<Value>
Sourcepub async fn switch_position_mode(
&self,
category: Category,
mode: PositionMode,
) -> Result<Value>
pub async fn switch_position_mode( &self, category: Category, mode: PositionMode, ) -> Result<Value>
Switch position mode.
§Arguments
category- Product categorymode- Position mode (0=merged, 3=both sides)
Sourcepub async fn set_risk_limit(
&self,
category: Category,
symbol: &str,
risk_id: i32,
) -> Result<Value>
pub async fn set_risk_limit( &self, category: Category, symbol: &str, risk_id: i32, ) -> Result<Value>
Sourcepub async fn add_margin(
&self,
category: Category,
symbol: &str,
margin: &str,
) -> Result<Value>
pub async fn add_margin( &self, category: Category, symbol: &str, margin: &str, ) -> Result<Value>
Add or reduce margin.
§Arguments
category- Product categorysymbol- Symbol namemargin- Margin amount (positive to add, negative to reduce)
Sourcepub async fn get_closed_pnl(
&self,
category: Category,
symbol: Option<&str>,
limit: Option<u32>,
) -> Result<ClosedPnlList>
pub async fn get_closed_pnl( &self, category: Category, symbol: Option<&str>, limit: Option<u32>, ) -> Result<ClosedPnlList>
Get closed PnL history.
§Arguments
category- Product categorysymbol- Optional symbol filterlimit- Optional limit (default 20)
Sourcepub async fn get_executions(
&self,
category: Category,
symbol: Option<&str>,
limit: Option<u32>,
) -> Result<ExecutionList>
pub async fn get_executions( &self, category: Category, symbol: Option<&str>, limit: Option<u32>, ) -> Result<ExecutionList>
Get execution list (trade history).
§Arguments
category- Product categorysymbol- Optional symbol filterlimit- Optional limit (default 50)
pub async fn confirm_new_risk_limit( &self, params: ConfirmNewRiskLimitParams, ) -> Result<ConfirmNewRiskLimitResponse>
pub async fn get_close_position( &self, category: Category, symbol: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, limit: Option<i64>, cursor: Option<&str>, ) -> Result<GetClosePositionResponse>
pub async fn get_move_position_history( &self, category: Option<Category>, symbol: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, status: Option<&str>, block_trade_id: Option<&str>, limit: Option<&str>, cursor: Option<&str>, ) -> Result<GetMovePositionHistoryResponse>
pub async fn move_position( &self, params: MovePositionParams, ) -> Result<MovePositionResponse>
pub async fn set_auto_add_margin( &self, params: SetAutoAddMarginParams, ) -> Result<SetAutoAddMarginResponse>
Source§impl BybitClient
impl BybitClient
Sourcepub async fn accept_non_lp_quote(
&self,
params: AcceptNonLpQuoteParams,
) -> Result<AcceptNonLpQuoteResponse>
pub async fn accept_non_lp_quote( &self, params: AcceptNonLpQuoteParams, ) -> Result<AcceptNonLpQuoteResponse>
Accept Non-LP Quote.
Sourcepub async fn cancel_all_quotes(
&self,
params: CancelAllQuotesParams,
) -> Result<CancelAllQuotesResponse>
pub async fn cancel_all_quotes( &self, params: CancelAllQuotesParams, ) -> Result<CancelAllQuotesResponse>
Cancel All Quotes.
Sourcepub async fn cancel_all_rfqs(
&self,
params: CancelAllRfqsParams,
) -> Result<CancelAllRfqsResponse>
pub async fn cancel_all_rfqs( &self, params: CancelAllRfqsParams, ) -> Result<CancelAllRfqsResponse>
Cancel All RFQs.
Sourcepub async fn cancel_quote(
&self,
params: CancelQuoteParams,
) -> Result<CancelQuoteResponse>
pub async fn cancel_quote( &self, params: CancelQuoteParams, ) -> Result<CancelQuoteResponse>
Cancel Quote.
Sourcepub async fn cancel_rfq(
&self,
params: CancelRfqParams,
) -> Result<CancelRfqResponse>
pub async fn cancel_rfq( &self, params: CancelRfqParams, ) -> Result<CancelRfqResponse>
Cancel RFQ.
Sourcepub async fn create_quote(
&self,
params: CreateQuoteParams,
) -> Result<CreateQuoteResponse>
pub async fn create_quote( &self, params: CreateQuoteParams, ) -> Result<CreateQuoteResponse>
Create Quote.
Sourcepub async fn create_rfq(
&self,
params: CreateRfqParams,
) -> Result<CreateRfqResponse>
pub async fn create_rfq( &self, params: CreateRfqParams, ) -> Result<CreateRfqResponse>
Create RFQ.
Sourcepub async fn execute_quote(
&self,
params: ExecuteQuoteParams,
) -> Result<ExecuteQuoteResponse>
pub async fn execute_quote( &self, params: ExecuteQuoteParams, ) -> Result<ExecuteQuoteResponse>
Execute Quote.
Sourcepub async fn get_public_trades(
&self,
start_time: Option<i64>,
end_time: Option<i64>,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<GetPublicTradesResponse>
pub async fn get_public_trades( &self, start_time: Option<i64>, end_time: Option<i64>, limit: Option<u32>, cursor: Option<&str>, ) -> Result<GetPublicTradesResponse>
Get Public Trades.
Sourcepub async fn get_quotes(&self, p: GetQuotesParams) -> Result<GetQuotesResponse>
pub async fn get_quotes(&self, p: GetQuotesParams) -> Result<GetQuotesResponse>
Get Quotes.
§Example
let client = BybitClient::testnet("k", "s")?;
let quotes = client.get_quotes(GetQuotesParams {
rfq_id: Some("xxx".into()),
limit: Some(20),
..Default::default()
}).await?;Sourcepub async fn get_quotes_realtime(
&self,
rfq_id: Option<&str>,
quote_id: Option<&str>,
quote_link_id: Option<&str>,
trader_type: Option<&str>,
) -> Result<GetQuotesRealtimeResponse>
pub async fn get_quotes_realtime( &self, rfq_id: Option<&str>, quote_id: Option<&str>, quote_link_id: Option<&str>, trader_type: Option<&str>, ) -> Result<GetQuotesRealtimeResponse>
Get Quotes Realtime.
Sourcepub async fn get_rfq_config(&self) -> Result<GetRfqConfigResponse>
pub async fn get_rfq_config(&self) -> Result<GetRfqConfigResponse>
Get RFQ Config.
Sourcepub async fn get_rfqs(
&self,
rfq_id: Option<&str>,
rfq_link_id: Option<&str>,
trader_type: Option<&str>,
status: Option<&str>,
limit: Option<u32>,
cursor: Option<&str>,
) -> Result<GetRfqsResponse>
pub async fn get_rfqs( &self, rfq_id: Option<&str>, rfq_link_id: Option<&str>, trader_type: Option<&str>, status: Option<&str>, limit: Option<u32>, cursor: Option<&str>, ) -> Result<GetRfqsResponse>
Get RFQs.
Sourcepub async fn get_rfqs_realtime(
&self,
rfq_id: Option<&str>,
rfq_link_id: Option<&str>,
trader_type: Option<&str>,
) -> Result<GetRfqsRealtimeResponse>
pub async fn get_rfqs_realtime( &self, rfq_id: Option<&str>, rfq_link_id: Option<&str>, trader_type: Option<&str>, ) -> Result<GetRfqsRealtimeResponse>
Get RFQs Realtime.
Sourcepub async fn get_trade_history(
&self,
p: GetTradeHistoryParams,
) -> Result<GetTradeHistoryResponse>
pub async fn get_trade_history( &self, p: GetTradeHistoryParams, ) -> Result<GetTradeHistoryResponse>
Get Trade History.
Source§impl BybitClient
impl BybitClient
Sourcepub async fn get_historical_interest_rate(
&self,
currency: &str,
vip_level: Option<&str>,
start_time: Option<i64>,
end_time: Option<i64>,
) -> Result<GetHistoricalInterestRateResponse>
pub async fn get_historical_interest_rate( &self, currency: &str, vip_level: Option<&str>, start_time: Option<i64>, end_time: Option<i64>, ) -> Result<GetHistoricalInterestRateResponse>
Get Historical Interest Rate.
Sourcepub async fn get_position_tiers(
&self,
currency: Option<&str>,
) -> Result<GetPositionTiersResponse>
pub async fn get_position_tiers( &self, currency: Option<&str>, ) -> Result<GetPositionTiersResponse>
Get Position Tiers.
Sourcepub async fn get_tiered_collateral_ratio(
&self,
currency: Option<&str>,
) -> Result<GetTieredCollateralRatioResponse>
pub async fn get_tiered_collateral_ratio( &self, currency: Option<&str>, ) -> Result<GetTieredCollateralRatioResponse>
Get Tiered Collateral Ratio.
Sourcepub async fn get_vip_margin_data(
&self,
vip_level: Option<&str>,
currency: Option<&str>,
) -> Result<GetVipMarginDataResponse>
pub async fn get_vip_margin_data( &self, vip_level: Option<&str>, currency: Option<&str>, ) -> Result<GetVipMarginDataResponse>
Get VIP Margin Data.
Source§impl BybitClient
impl BybitClient
Sourcepub async fn place_order(
&self,
params: PlaceOrderParams,
) -> Result<OrderResponse>
pub async fn place_order( &self, params: PlaceOrderParams, ) -> Result<OrderResponse>
Sourcepub async fn amend_order(
&self,
params: AmendOrderParams,
) -> Result<OrderResponse>
pub async fn amend_order( &self, params: AmendOrderParams, ) -> Result<OrderResponse>
Amend an existing order.
Sourcepub async fn cancel_order(
&self,
params: CancelOrderParams,
) -> Result<OrderResponse>
pub async fn cancel_order( &self, params: CancelOrderParams, ) -> Result<OrderResponse>
Cancel an order.
Sourcepub async fn cancel_all_orders(
&self,
category: Category,
symbol: Option<&str>,
) -> Result<CancelAllResponse>
pub async fn cancel_all_orders( &self, category: Category, symbol: Option<&str>, ) -> Result<CancelAllResponse>
Cancel all orders.
§Arguments
category- Product categorysymbol- Optional symbol filter (cancel all if None)
Sourcepub async fn place_batch_order(
&self,
category: Category,
orders: Vec<PlaceOrderParams>,
) -> Result<BatchOrderResponse>
pub async fn place_batch_order( &self, category: Category, orders: Vec<PlaceOrderParams>, ) -> Result<BatchOrderResponse>
Place batch orders (up to 10 orders).
§Arguments
category- Product categoryorders- List of orders to place
Sourcepub async fn amend_batch_order(
&self,
category: Category,
orders: Vec<AmendOrderParams>,
) -> Result<BatchOrderResponse>
pub async fn amend_batch_order( &self, category: Category, orders: Vec<AmendOrderParams>, ) -> Result<BatchOrderResponse>
Amend batch orders.
Sourcepub async fn cancel_batch_order(
&self,
category: Category,
orders: Vec<CancelOrderParams>,
) -> Result<BatchOrderResponse>
pub async fn cancel_batch_order( &self, category: Category, orders: Vec<CancelOrderParams>, ) -> Result<BatchOrderResponse>
Cancel batch orders.
Sourcepub async fn get_open_orders(
&self,
category: Category,
symbol: Option<&str>,
) -> Result<OrdersList>
pub async fn get_open_orders( &self, category: Category, symbol: Option<&str>, ) -> Result<OrdersList>
Sourcepub async fn get_order_history(
&self,
category: Category,
symbol: Option<&str>,
limit: Option<u32>,
) -> Result<OrdersList>
pub async fn get_order_history( &self, category: Category, symbol: Option<&str>, limit: Option<u32>, ) -> Result<OrdersList>
Get order history.
§Arguments
category- Product categorysymbol- Optional symbol filterlimit- Optional limit (default 20)
pub async fn dcp_set_timewindow( &self, params: DcpSetTimewindowParams, ) -> Result<DcpSetTimewindowResponse>
pub async fn get_spot_borrow_quota( &self, category: Category, symbol: &str, side: Side, ) -> Result<GetSpotBorrowQuotaResponse>
pub async fn pre_check_order( &self, params: PreCheckOrderParams, ) -> Result<PreCheckOrderResponse>
Source§impl BybitClient
impl BybitClient
Sourcepub async fn get_affiliate_sub_list(
&self,
cursor: Option<&str>,
size: Option<i64>,
start_date: Option<&str>,
end_date: Option<&str>,
sub_aff_id: Option<i64>,
) -> Result<GetAffiliateSubListResponse>
pub async fn get_affiliate_sub_list( &self, cursor: Option<&str>, size: Option<i64>, start_date: Option<&str>, end_date: Option<&str>, sub_aff_id: Option<i64>, ) -> Result<GetAffiliateSubListResponse>
Get affiliate sub-affiliate list.
Sourcepub async fn get_affiliate_user_info(
&self,
uid: &str,
) -> Result<GetAffiliateUserInfoResponse>
pub async fn get_affiliate_user_info( &self, uid: &str, ) -> Result<GetAffiliateUserInfoResponse>
Get single direct client user info.
Sourcepub async fn get_affiliate_user_list(
&self,
cursor: Option<&str>,
size: Option<i64>,
need_deposit: Option<bool>,
need30: Option<bool>,
need365: Option<bool>,
start_date: Option<&str>,
end_date: Option<&str>,
) -> Result<GetAffiliateUserListResponse>
pub async fn get_affiliate_user_list( &self, cursor: Option<&str>, size: Option<i64>, need_deposit: Option<bool>, need30: Option<bool>, need365: Option<bool>, start_date: Option<&str>, end_date: Option<&str>, ) -> Result<GetAffiliateUserListResponse>
Get affiliate user list.
Sourcepub async fn create_sub_api_key(
&self,
params: CreateSubApiKeyParams,
) -> Result<CreateSubApiKeyResponse>
pub async fn create_sub_api_key( &self, params: CreateSubApiKeyParams, ) -> Result<CreateSubApiKeyResponse>
Create Sub API Key.
Sourcepub async fn create_sub_member(
&self,
params: CreateSubMemberParams,
) -> Result<CreateSubMemberResponse>
pub async fn create_sub_member( &self, params: CreateSubMemberParams, ) -> Result<CreateSubMemberResponse>
Create Sub UID.
Sourcepub async fn delete_api_key(
&self,
params: DeleteApiKeyParams,
) -> Result<DeleteApiKeyResponse>
pub async fn delete_api_key( &self, params: DeleteApiKeyParams, ) -> Result<DeleteApiKeyResponse>
Delete Master API Key.
Sourcepub async fn delete_sub_api_key(
&self,
params: DeleteSubApiKeyParams,
) -> Result<DeleteSubApiKeyResponse>
pub async fn delete_sub_api_key( &self, params: DeleteSubApiKeyParams, ) -> Result<DeleteSubApiKeyResponse>
Delete Sub-account API Key.
Sourcepub async fn delete_sub_member_v5(
&self,
params: DeleteSubMemberV5Params,
) -> Result<DeleteSubMemberV5Response>
pub async fn delete_sub_member_v5( &self, params: DeleteSubMemberV5Params, ) -> Result<DeleteSubMemberV5Response>
Delete Sub-account.
Sourcepub async fn frozen_sub_member(
&self,
params: FrozenSubMemberParams,
) -> Result<FrozenSubMemberResponse>
pub async fn frozen_sub_member( &self, params: FrozenSubMemberParams, ) -> Result<FrozenSubMemberResponse>
Freeze/Unfreeze Sub UID.
Sourcepub async fn get_member_account_type(
&self,
member_ids: Option<&str>,
) -> Result<Value>
pub async fn get_member_account_type( &self, member_ids: Option<&str>, ) -> Result<Value>
Get Member Account Type.
Sourcepub async fn list_sub_api_keys_v5(
&self,
sub_member_id: i64,
limit: Option<i64>,
cursor: Option<&str>,
) -> Result<ListSubApiKeysV5Response>
pub async fn list_sub_api_keys_v5( &self, sub_member_id: i64, limit: Option<i64>, cursor: Option<&str>, ) -> Result<ListSubApiKeysV5Response>
List Sub-account API Keys.
See: https://bybit-exchange.github.io/docs/v5/user/list-sub-apikeys
Sourcepub async fn query_api_key(&self) -> Result<QueryApiKeyResponse>
pub async fn query_api_key(&self) -> Result<QueryApiKeyResponse>
Get API Key Information.
Sourcepub async fn query_escrow_sub_members_v5(
&self,
next_cursor: Option<i64>,
page_size: Option<i64>,
) -> Result<QueryEscrowSubMembersV5Response>
pub async fn query_escrow_sub_members_v5( &self, next_cursor: Option<i64>, page_size: Option<i64>, ) -> Result<QueryEscrowSubMembersV5Response>
Query Escrow Sub-accounts (Fund Management).
Sourcepub async fn query_referrals(
&self,
cursor: Option<&str>,
size: Option<i64>,
status: Option<&str>,
) -> Result<QueryReferralsResponse>
pub async fn query_referrals( &self, cursor: Option<&str>, size: Option<i64>, status: Option<&str>, ) -> Result<QueryReferralsResponse>
Query Referrals.
Sourcepub async fn query_sub_members(&self) -> Result<QuerySubMembersResponse>
pub async fn query_sub_members(&self) -> Result<QuerySubMembersResponse>
Query Sub UID List.
Sourcepub async fn query_sub_members_v5(
&self,
page_size: Option<i64>,
next_cursor: Option<i64>,
) -> Result<QuerySubMembersV5Response>
pub async fn query_sub_members_v5( &self, page_size: Option<i64>, next_cursor: Option<i64>, ) -> Result<QuerySubMembersV5Response>
Query Sub-accounts List.
Sourcepub async fn sign_agreement(
&self,
params: SignAgreementParams,
) -> Result<SignAgreementResponse>
pub async fn sign_agreement( &self, params: SignAgreementParams, ) -> Result<SignAgreementResponse>
Sign Agreement.
Sourcepub async fn update_api_key(
&self,
params: UpdateApiKeyParams,
) -> Result<UpdateApiKeyResponse>
pub async fn update_api_key( &self, params: UpdateApiKeyParams, ) -> Result<UpdateApiKeyResponse>
Modify Master API Key.
Sourcepub async fn update_sub_api_key(
&self,
params: UpdateSubApiKeyParams,
) -> Result<UpdateSubApiKeyResponse>
pub async fn update_sub_api_key( &self, params: UpdateSubApiKeyParams, ) -> Result<UpdateSubApiKeyResponse>
Modify Sub-account API Key.
Trait Implementations§
Source§impl Clone for BybitClient
impl Clone for BybitClient
Source§fn clone(&self) -> BybitClient
fn clone(&self) -> BybitClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more