pub struct RestApi { /* private fields */ }Implementations§
Source§impl RestApi
impl RestApi
pub fn new(configuration: ConfigurationRestApi) -> Self
Sourcepub async fn send_request<R: DeserializeOwned + Send + 'static>(
&self,
endpoint: &str,
method: Method,
query_params: BTreeMap<String, Value>,
body_params: BTreeMap<String, Value>,
) -> Result<RestApiResponse<R>>
pub async fn send_request<R: DeserializeOwned + Send + 'static>( &self, endpoint: &str, method: Method, query_params: BTreeMap<String, Value>, body_params: BTreeMap<String, Value>, ) -> Result<RestApiResponse<R>>
Send an unsigned request to the API
§Arguments
endpoint- The API endpoint to send the request tomethod- The HTTP method to use for the requestquery_params- A map of query parameters to send with the requestbody_params- A map of body parameters to send with the request
§Returns
A RestApiResponse containing the deserialized response data on success, or an error if the request fails
§Errors
Returns an anyhow::Error if the HTTP request fails or if parsing the response fails
Sourcepub async fn send_signed_request<R: DeserializeOwned + Send + 'static>(
&self,
endpoint: &str,
method: Method,
query_params: BTreeMap<String, Value>,
body_params: BTreeMap<String, Value>,
) -> Result<RestApiResponse<R>>
pub async fn send_signed_request<R: DeserializeOwned + Send + 'static>( &self, endpoint: &str, method: Method, query_params: BTreeMap<String, Value>, body_params: BTreeMap<String, Value>, ) -> Result<RestApiResponse<R>>
Send a signed request to the API
§Arguments
endpoint- The API endpoint to send the request tomethod- The HTTP method to use for the requestquery_params- A map of query parameters to send with the requestbody_params- A map of body parameters to send with the request
§Returns
A RestApiResponse containing the deserialized response data on success, or an error if the request fails
§Errors
Returns an anyhow::Error if the HTTP request fails or if parsing the response fails
Sourcepub async fn adjust_cross_margin_max_leverage(
&self,
params: AdjustCrossMarginMaxLeverageParams,
) -> Result<RestApiResponse<AdjustCrossMarginMaxLeverageResponse>>
pub async fn adjust_cross_margin_max_leverage( &self, params: AdjustCrossMarginMaxLeverageParams, ) -> Result<RestApiResponse<AdjustCrossMarginMaxLeverageResponse>>
Adjust cross margin max leverage (USER_DATA)
Adjust cross margin max leverage
- The margin level need higher than the initial risk ratio of adjusted leverage, the initial risk ratio of 3x is 1.5 , the initial risk ratio of 5x is 1.25; The detail conditions on how to switch between Cross Margin Classic and Cross Margin Pro can refer to the FAQ.
Weight: 3000
§Arguments
params:AdjustCrossMarginMaxLeverageParamsThe parameters for this operation.
§Returns
RestApiResponse<models::AdjustCrossMarginMaxLeverageResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn disable_isolated_margin_account(
&self,
params: DisableIsolatedMarginAccountParams,
) -> Result<RestApiResponse<DisableIsolatedMarginAccountResponse>>
pub async fn disable_isolated_margin_account( &self, params: DisableIsolatedMarginAccountParams, ) -> Result<RestApiResponse<DisableIsolatedMarginAccountResponse>>
Disable Isolated Margin Account (TRADE)
Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours.
Weight: 300(UID)
§Arguments
params:DisableIsolatedMarginAccountParamsThe parameters for this operation.
§Returns
RestApiResponse<models::DisableIsolatedMarginAccountResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn enable_isolated_margin_account(
&self,
params: EnableIsolatedMarginAccountParams,
) -> Result<RestApiResponse<EnableIsolatedMarginAccountResponse>>
pub async fn enable_isolated_margin_account( &self, params: EnableIsolatedMarginAccountParams, ) -> Result<RestApiResponse<EnableIsolatedMarginAccountResponse>>
Enable Isolated Margin Account (TRADE)
Enable isolated margin account for a specific symbol(Only supports activation of previously disabled accounts).
Weight: 300(UID)
§Arguments
params:EnableIsolatedMarginAccountParamsThe parameters for this operation.
§Returns
RestApiResponse<models::EnableIsolatedMarginAccountResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_bnb_burn_status(
&self,
params: GetBnbBurnStatusParams,
) -> Result<RestApiResponse<GetBnbBurnStatusResponse>>
pub async fn get_bnb_burn_status( &self, params: GetBnbBurnStatusParams, ) -> Result<RestApiResponse<GetBnbBurnStatusResponse>>
Get BNB Burn Status (USER_DATA)
Get BNB Burn Status
Weight: 1(IP)
§Arguments
params:GetBnbBurnStatusParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetBnbBurnStatusResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_summary_of_margin_account(
&self,
params: GetSummaryOfMarginAccountParams,
) -> Result<RestApiResponse<GetSummaryOfMarginAccountResponse>>
pub async fn get_summary_of_margin_account( &self, params: GetSummaryOfMarginAccountParams, ) -> Result<RestApiResponse<GetSummaryOfMarginAccountResponse>>
Get Summary of Margin account (USER_DATA)
Get personal margin level information
Weight: 10(IP)
§Arguments
params:GetSummaryOfMarginAccountParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetSummaryOfMarginAccountResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_cross_isolated_margin_capital_flow(
&self,
params: QueryCrossIsolatedMarginCapitalFlowParams,
) -> Result<RestApiResponse<Vec<QueryCrossIsolatedMarginCapitalFlowResponseInner>>>
pub async fn query_cross_isolated_margin_capital_flow( &self, params: QueryCrossIsolatedMarginCapitalFlowParams, ) -> Result<RestApiResponse<Vec<QueryCrossIsolatedMarginCapitalFlowResponseInner>>>
Query Cross Isolated Margin Capital Flow (USER_DATA)
Query Cross Isolated Margin Capital Flow
Weight: 100(IP)
§Arguments
params:QueryCrossIsolatedMarginCapitalFlowParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryCrossIsolatedMarginCapitalFlowResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_cross_margin_account_details(
&self,
params: QueryCrossMarginAccountDetailsParams,
) -> Result<RestApiResponse<QueryCrossMarginAccountDetailsResponse>>
pub async fn query_cross_margin_account_details( &self, params: QueryCrossMarginAccountDetailsParams, ) -> Result<RestApiResponse<QueryCrossMarginAccountDetailsResponse>>
Query Cross Margin Account Details (USER_DATA)
Query Cross Margin Account Details
Weight: 10(IP)
§Arguments
params:QueryCrossMarginAccountDetailsParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryCrossMarginAccountDetailsResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_cross_margin_fee_data(
&self,
params: QueryCrossMarginFeeDataParams,
) -> Result<RestApiResponse<Vec<QueryCrossMarginFeeDataResponseInner>>>
pub async fn query_cross_margin_fee_data( &self, params: QueryCrossMarginFeeDataParams, ) -> Result<RestApiResponse<Vec<QueryCrossMarginFeeDataResponseInner>>>
Query Cross Margin Fee Data (USER_DATA)
Get cross margin fee data collection with any vip level or user’s current specific data as https://www.binance.com/en/margin-fee
Weight: 1 when coin is specified;(IP)
§Arguments
params:QueryCrossMarginFeeDataParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryCrossMarginFeeDataResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_enabled_isolated_margin_account_limit(
&self,
params: QueryEnabledIsolatedMarginAccountLimitParams,
) -> Result<RestApiResponse<QueryEnabledIsolatedMarginAccountLimitResponse>>
pub async fn query_enabled_isolated_margin_account_limit( &self, params: QueryEnabledIsolatedMarginAccountLimitParams, ) -> Result<RestApiResponse<QueryEnabledIsolatedMarginAccountLimitResponse>>
Query Enabled Isolated Margin Account Limit (USER_DATA)
Query enabled isolated margin account limit.
Weight: 1(IP)
§Arguments
params:QueryEnabledIsolatedMarginAccountLimitParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryEnabledIsolatedMarginAccountLimitResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_isolated_margin_account_info(
&self,
params: QueryIsolatedMarginAccountInfoParams,
) -> Result<RestApiResponse<QueryIsolatedMarginAccountInfoResponse>>
pub async fn query_isolated_margin_account_info( &self, params: QueryIsolatedMarginAccountInfoParams, ) -> Result<RestApiResponse<QueryIsolatedMarginAccountInfoResponse>>
Query Isolated Margin Account Info (USER_DATA)
Query Isolated Margin Account Info
- If “symbols” is not sent, all isolated assets will be returned.
- If “symbols” is sent, only the isolated assets of the sent symbols will be returned.
Weight: 10(IP)
§Arguments
params:QueryIsolatedMarginAccountInfoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryIsolatedMarginAccountInfoResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_isolated_margin_fee_data(
&self,
params: QueryIsolatedMarginFeeDataParams,
) -> Result<RestApiResponse<Vec<QueryIsolatedMarginFeeDataResponseInner>>>
pub async fn query_isolated_margin_fee_data( &self, params: QueryIsolatedMarginFeeDataParams, ) -> Result<RestApiResponse<Vec<QueryIsolatedMarginFeeDataResponseInner>>>
Query Isolated Margin Fee Data (USER_DATA)
Get isolated margin fee data collection with any vip level or user’s current specific data as https://www.binance.com/en/margin-fee
Weight: 1 when a single is specified;(IP)
§Arguments
params:QueryIsolatedMarginFeeDataParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryIsolatedMarginFeeDataResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_future_hourly_interest_rate(
&self,
params: GetFutureHourlyInterestRateParams,
) -> Result<RestApiResponse<Vec<GetFutureHourlyInterestRateResponseInner>>>
pub async fn get_future_hourly_interest_rate( &self, params: GetFutureHourlyInterestRateParams, ) -> Result<RestApiResponse<Vec<GetFutureHourlyInterestRateResponseInner>>>
Get future hourly interest rate (USER_DATA)
Get future hourly interest rate
Weight: 100
§Arguments
params:GetFutureHourlyInterestRateParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetFutureHourlyInterestRateResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_interest_history(
&self,
params: GetInterestHistoryParams,
) -> Result<RestApiResponse<GetInterestHistoryResponse>>
pub async fn get_interest_history( &self, params: GetInterestHistoryParams, ) -> Result<RestApiResponse<GetInterestHistoryResponse>>
Get Interest History (USER_DATA)
Get Interest History
- Response in descending order
- If isolatedSymbol is not sent, crossed margin data will be returned
- The max interval between
startTimeandendTimeis 30 days. It is a MUST to ensure data correctness. - If
startTimeandendTimenot sent, return records of the last 7 days by default. - If
startTimeis sent andendTimeis not sent, return records of [max(startTime, now-30d), now]. - If
startTimeis not sent andendTimeis sent, return records of [endTime-7,endTime] typein response has 4 enums:PERIODICinterest charged per hourON_BORROWfirst interest charged on borrowPERIODIC_CONVERTEDinterest charged per hour converted into BNBON_BORROW_CONVERTEDfirst interest charged on borrow converted into BNBPORTFOLIOinterest charged daily on the portfolio margin negative balance
Weight: 1(IP)
§Arguments
params:GetInterestHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetInterestHistoryResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_borrow_repay(
&self,
params: MarginAccountBorrowRepayParams,
) -> Result<RestApiResponse<MarginAccountBorrowRepayResponse>>
pub async fn margin_account_borrow_repay( &self, params: MarginAccountBorrowRepayParams, ) -> Result<RestApiResponse<MarginAccountBorrowRepayResponse>>
Margin account borrow/repay(MARGIN)
Margin account borrow/repay(MARGIN)
Weight: 1500
§Arguments
params:MarginAccountBorrowRepayParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountBorrowRepayResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_borrow_repay_records_in_margin_account(
&self,
params: QueryBorrowRepayRecordsInMarginAccountParams,
) -> Result<RestApiResponse<QueryBorrowRepayRecordsInMarginAccountResponse>>
pub async fn query_borrow_repay_records_in_margin_account( &self, params: QueryBorrowRepayRecordsInMarginAccountParams, ) -> Result<RestApiResponse<QueryBorrowRepayRecordsInMarginAccountResponse>>
Query borrow/repay records in Margin account(USER_DATA)
Query borrow/repay records in Margin account
txIdorstartTimemust be sent.txIdtakes precedence.- If an asset is sent, data within 30 days before
endTime; If an asset is not sent, data within 7 days beforeendTime - If neither
startTimenorendTimeis sent, the recent 7-day data will be returned. startTimeset asendTime- 7days by default,endTimeset as current time by default
Weight: 10(IP)
§Arguments
params:QueryBorrowRepayRecordsInMarginAccountParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryBorrowRepayRecordsInMarginAccountResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_interest_rate_history(
&self,
params: QueryMarginInterestRateHistoryParams,
) -> Result<RestApiResponse<Vec<QueryMarginInterestRateHistoryResponseInner>>>
pub async fn query_margin_interest_rate_history( &self, params: QueryMarginInterestRateHistoryParams, ) -> Result<RestApiResponse<Vec<QueryMarginInterestRateHistoryResponseInner>>>
Query Margin Interest Rate History (USER_DATA)
Query Margin Interest Rate History
Weight: 1(IP)
§Arguments
params:QueryMarginInterestRateHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryMarginInterestRateHistoryResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_max_borrow(
&self,
params: QueryMaxBorrowParams,
) -> Result<RestApiResponse<QueryMaxBorrowResponse>>
pub async fn query_max_borrow( &self, params: QueryMaxBorrowParams, ) -> Result<RestApiResponse<QueryMaxBorrowResponse>>
Query Max Borrow (USER_DATA)
Query Max Borrow
- If isolatedSymbol is not sent, crossed margin data will be sent.
borrowLimitis also available from https://www.binance.com/en/margin-fee
Weight: 50(IP)
§Arguments
params:QueryMaxBorrowParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryMaxBorrowResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn cross_margin_collateral_ratio(
&self,
) -> Result<RestApiResponse<Vec<CrossMarginCollateralRatioResponseInner>>>
pub async fn cross_margin_collateral_ratio( &self, ) -> Result<RestApiResponse<Vec<CrossMarginCollateralRatioResponseInner>>>
Cross margin collateral ratio (MARKET_DATA)
Cross margin collateral ratio
Weight: 100(IP)
§Arguments
params: [CrossMarginCollateralRatioParams] The parameters for this operation.
§Returns
RestApiResponse<Vec<models::CrossMarginCollateralRatioResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_all_cross_margin_pairs(
&self,
params: GetAllCrossMarginPairsParams,
) -> Result<RestApiResponse<Vec<GetAllCrossMarginPairsResponseInner>>>
pub async fn get_all_cross_margin_pairs( &self, params: GetAllCrossMarginPairsParams, ) -> Result<RestApiResponse<Vec<GetAllCrossMarginPairsResponseInner>>>
Get All Cross Margin Pairs (MARKET_DATA)
Get All Cross Margin Pairs
Weight: 1(IP)
§Arguments
params:GetAllCrossMarginPairsParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetAllCrossMarginPairsResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_all_isolated_margin_symbol(
&self,
params: GetAllIsolatedMarginSymbolParams,
) -> Result<RestApiResponse<Vec<GetAllIsolatedMarginSymbolResponseInner>>>
pub async fn get_all_isolated_margin_symbol( &self, params: GetAllIsolatedMarginSymbolParams, ) -> Result<RestApiResponse<Vec<GetAllIsolatedMarginSymbolResponseInner>>>
Get All Isolated Margin Symbol(MARKET_DATA)
Get All Isolated Margin Symbol
Weight: 10(IP)
§Arguments
params:GetAllIsolatedMarginSymbolParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetAllIsolatedMarginSymbolResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_all_margin_assets(
&self,
params: GetAllMarginAssetsParams,
) -> Result<RestApiResponse<Vec<GetAllMarginAssetsResponseInner>>>
pub async fn get_all_margin_assets( &self, params: GetAllMarginAssetsParams, ) -> Result<RestApiResponse<Vec<GetAllMarginAssetsResponseInner>>>
Get All Margin Assets (MARKET_DATA)
Get All Margin Assets.
Weight: 1(IP)
§Arguments
params:GetAllMarginAssetsParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetAllMarginAssetsResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_delist_schedule(
&self,
params: GetDelistScheduleParams,
) -> Result<RestApiResponse<Vec<GetDelistScheduleResponseInner>>>
pub async fn get_delist_schedule( &self, params: GetDelistScheduleParams, ) -> Result<RestApiResponse<Vec<GetDelistScheduleResponseInner>>>
Get Delist Schedule (MARKET_DATA)
Get tokens or symbols delist schedule for cross margin and isolated margin
Weight: 100
§Arguments
params:GetDelistScheduleParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetDelistScheduleResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_limit_price_pairs(
&self,
) -> Result<RestApiResponse<GetLimitPricePairsResponse>>
pub async fn get_limit_price_pairs( &self, ) -> Result<RestApiResponse<GetLimitPricePairsResponse>>
Get Limit Price Pairs(MARKET_DATA)
Query trading pairs with restriction on limit price range. In margin trading, you can place orders with limit price. Limit price should be within (-15%, 15%) of current index price for a list of margin trading pairs. This rule only impacts limit sell orders with limit price that is lower than current index price and limit buy orders with limit price that is higher than current index price.
- Buy order: Your order will be rejected with an error message notification if the limit price is 15% above the index price.
- Sell order: Your order will be rejected with an error message notification if the limit price is 15% below the index price. Please review the limit price order placing strategy, backtest and calibrate the planned order size with the trading volume and order book depth to prevent trading loss.
Weight: 1
§Arguments
params: [GetLimitPricePairsParams] The parameters for this operation.
§Returns
RestApiResponse<models::GetLimitPricePairsResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_list_schedule(
&self,
params: GetListScheduleParams,
) -> Result<RestApiResponse<Vec<GetListScheduleResponseInner>>>
pub async fn get_list_schedule( &self, params: GetListScheduleParams, ) -> Result<RestApiResponse<Vec<GetListScheduleResponseInner>>>
Get list Schedule (MARKET_DATA)
Get the upcoming tokens or symbols listing schedule for Cross Margin and Isolated Margin.
Weight: 100
§Arguments
params:GetListScheduleParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetListScheduleResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_margin_asset_risk_based_liquidation_ratio(
&self,
) -> Result<RestApiResponse<Vec<GetMarginAssetRiskBasedLiquidationRatioResponseInner>>>
pub async fn get_margin_asset_risk_based_liquidation_ratio( &self, ) -> Result<RestApiResponse<Vec<GetMarginAssetRiskBasedLiquidationRatioResponseInner>>>
Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA)
Get Margin Asset Risk-Based Liquidation Ratio
Weight: 1
§Arguments
params: [GetMarginAssetRiskBasedLiquidationRatioParams] The parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetMarginAssetRiskBasedLiquidationRatioResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_margin_restricted_assets(
&self,
) -> Result<RestApiResponse<GetMarginRestrictedAssetsResponse>>
pub async fn get_margin_restricted_assets( &self, ) -> Result<RestApiResponse<GetMarginRestrictedAssetsResponse>>
Get Margin Restricted Assets (MARKET_DATA)
Get Margin Restricted Assets
Weight: 1
§Arguments
params: [GetMarginRestrictedAssetsParams] The parameters for this operation.
§Returns
RestApiResponse<models::GetMarginRestrictedAssetsResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_isolated_margin_tier_data(
&self,
params: QueryIsolatedMarginTierDataParams,
) -> Result<RestApiResponse<Vec<QueryIsolatedMarginTierDataResponseInner>>>
pub async fn query_isolated_margin_tier_data( &self, params: QueryIsolatedMarginTierDataParams, ) -> Result<RestApiResponse<Vec<QueryIsolatedMarginTierDataResponseInner>>>
Query Isolated Margin Tier Data (USER_DATA)
Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
Weight: 1(IP)
§Arguments
params:QueryIsolatedMarginTierDataParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryIsolatedMarginTierDataResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_liability_coin_leverage_bracket_in_cross_margin_pro_mode(
&self,
) -> Result<RestApiResponse<Vec<QueryLiabilityCoinLeverageBracketInCrossMarginProModeResponseInner>>>
pub async fn query_liability_coin_leverage_bracket_in_cross_margin_pro_mode( &self, ) -> Result<RestApiResponse<Vec<QueryLiabilityCoinLeverageBracketInCrossMarginProModeResponseInner>>>
Query Liability Coin Leverage Bracket in Cross Margin Pro Mode(MARKET_DATA)
Liability Coin Leverage Bracket in Cross Margin Pro Mode
Weight: 1
§Arguments
params: [QueryLiabilityCoinLeverageBracketInCrossMarginProModeParams] The parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryLiabilityCoinLeverageBracketInCrossMarginProModeResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_available_inventory(
&self,
params: QueryMarginAvailableInventoryParams,
) -> Result<RestApiResponse<QueryMarginAvailableInventoryResponse>>
pub async fn query_margin_available_inventory( &self, params: QueryMarginAvailableInventoryParams, ) -> Result<RestApiResponse<QueryMarginAvailableInventoryResponse>>
Query Margin Available Inventory(USER_DATA)
Margin available Inventory query
Weight: 50
§Arguments
params:QueryMarginAvailableInventoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryMarginAvailableInventoryResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_priceindex(
&self,
params: QueryMarginPriceindexParams,
) -> Result<RestApiResponse<QueryMarginPriceindexResponse>>
pub async fn query_margin_priceindex( &self, params: QueryMarginPriceindexParams, ) -> Result<RestApiResponse<QueryMarginPriceindexResponse>>
Query Margin PriceIndex (MARKET_DATA)
Query Margin PriceIndex
Weight: 10(IP)
§Arguments
params:QueryMarginPriceindexParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryMarginPriceindexResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn close_user_data_stream(&self) -> Result<RestApiResponse<Value>>
pub async fn close_user_data_stream(&self) -> Result<RestApiResponse<Value>>
Close User Data Stream (USER_STREAM)
Close out a user data stream.
Weight: 3000
§Arguments
params: [CloseUserDataStreamParams] The parameters for this operation.
§Returns
RestApiResponse<Value> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn keepalive_user_data_stream(
&self,
params: KeepaliveUserDataStreamParams,
) -> Result<RestApiResponse<Value>>
pub async fn keepalive_user_data_stream( &self, params: KeepaliveUserDataStreamParams, ) -> Result<RestApiResponse<Value>>
Keepalive User Data Stream (USER_STREAM)
Keepalive a user data stream to prevent a time out.
Weight: 1
§Arguments
params:KeepaliveUserDataStreamParamsThe parameters for this operation.
§Returns
RestApiResponse<Value> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn start_user_data_stream(
&self,
) -> Result<RestApiResponse<StartUserDataStreamResponse>>
pub async fn start_user_data_stream( &self, ) -> Result<RestApiResponse<StartUserDataStreamResponse>>
Start User Data Stream (USER_STREAM)
Start a new user data stream.
Weight: 1
§Arguments
params: [StartUserDataStreamParams] The parameters for this operation.
§Returns
RestApiResponse<models::StartUserDataStreamResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn create_special_key(
&self,
params: CreateSpecialKeyParams,
) -> Result<RestApiResponse<CreateSpecialKeyResponse>>
pub async fn create_special_key( &self, params: CreateSpecialKeyParams, ) -> Result<RestApiResponse<CreateSpecialKeyResponse>>
Create Special Key(Low-Latency Trading)(TRADE)
- Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
- If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
Supported Products:
- Cross Margin
- Isolated Margin
- Portfolio Margin Pro
Unsupported Products:
- Portfolio Margin
We support several types of API keys:
- Ed25519 (recommended)
- HMAC
- RSA
We recommend to use Ed25519 API keys as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .
Weight: 1(UID)
§Arguments
params:CreateSpecialKeyParamsThe parameters for this operation.
§Returns
RestApiResponse<models::CreateSpecialKeyResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn delete_special_key(
&self,
params: DeleteSpecialKeyParams,
) -> Result<RestApiResponse<Value>>
pub async fn delete_special_key( &self, params: DeleteSpecialKeyParams, ) -> Result<RestApiResponse<Value>>
Delete Special Key(Low-Latency Trading)(TRADE)
This only applies to Special Key for Low Latency Trading.
If apiKey is given, apiName will be ignored. If apiName is given with no apiKey, all apikeys with given apiName will be deleted.
You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
Weight: 1(UID)
§Arguments
params:DeleteSpecialKeyParamsThe parameters for this operation.
§Returns
RestApiResponse<Value> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn edit_ip_for_special_key(
&self,
params: EditIpForSpecialKeyParams,
) -> Result<RestApiResponse<Value>>
pub async fn edit_ip_for_special_key( &self, params: EditIpForSpecialKeyParams, ) -> Result<RestApiResponse<Value>>
Edit ip for Special Key(Low-Latency Trading)(TRADE)
Edit ip restriction. This only applies to Special Key for Low Latency Trading.
You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
Weight: 1(UID)
§Arguments
params:EditIpForSpecialKeyParamsThe parameters for this operation.
§Returns
RestApiResponse<Value> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_force_liquidation_record(
&self,
params: GetForceLiquidationRecordParams,
) -> Result<RestApiResponse<GetForceLiquidationRecordResponse>>
pub async fn get_force_liquidation_record( &self, params: GetForceLiquidationRecordParams, ) -> Result<RestApiResponse<GetForceLiquidationRecordResponse>>
Get Force Liquidation Record (USER_DATA)
Get Force Liquidation Record
- Response in descending order
Weight: 1(IP)
§Arguments
params:GetForceLiquidationRecordParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetForceLiquidationRecordResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_small_liability_exchange_coin_list(
&self,
params: GetSmallLiabilityExchangeCoinListParams,
) -> Result<RestApiResponse<Vec<GetSmallLiabilityExchangeCoinListResponseInner>>>
pub async fn get_small_liability_exchange_coin_list( &self, params: GetSmallLiabilityExchangeCoinListParams, ) -> Result<RestApiResponse<Vec<GetSmallLiabilityExchangeCoinListResponseInner>>>
Get Small Liability Exchange Coin List (USER_DATA)
Query the coins which can be small liability exchange
Weight: 100
§Arguments
params:GetSmallLiabilityExchangeCoinListParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::GetSmallLiabilityExchangeCoinListResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_small_liability_exchange_history(
&self,
params: GetSmallLiabilityExchangeHistoryParams,
) -> Result<RestApiResponse<GetSmallLiabilityExchangeHistoryResponse>>
pub async fn get_small_liability_exchange_history( &self, params: GetSmallLiabilityExchangeHistoryParams, ) -> Result<RestApiResponse<GetSmallLiabilityExchangeHistoryResponse>>
Get Small Liability Exchange History (USER_DATA)
Get Small liability Exchange History
Weight: 100(UID)
§Arguments
params:GetSmallLiabilityExchangeHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetSmallLiabilityExchangeHistoryResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_cancel_all_open_orders_on_a_symbol(
&self,
params: MarginAccountCancelAllOpenOrdersOnASymbolParams,
) -> Result<RestApiResponse<Vec<MarginAccountCancelAllOpenOrdersOnASymbolResponseInner>>>
pub async fn margin_account_cancel_all_open_orders_on_a_symbol( &self, params: MarginAccountCancelAllOpenOrdersOnASymbolParams, ) -> Result<RestApiResponse<Vec<MarginAccountCancelAllOpenOrdersOnASymbolResponseInner>>>
Margin Account Cancel all Open Orders on a Symbol (TRADE)
Cancels all active orders on a symbol for margin account.
This includes OCO orders.
Weight: 1
§Arguments
params:MarginAccountCancelAllOpenOrdersOnASymbolParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::MarginAccountCancelAllOpenOrdersOnASymbolResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_cancel_oco(
&self,
params: MarginAccountCancelOcoParams,
) -> Result<RestApiResponse<MarginAccountCancelOcoResponse>>
pub async fn margin_account_cancel_oco( &self, params: MarginAccountCancelOcoParams, ) -> Result<RestApiResponse<MarginAccountCancelOcoResponse>>
Margin Account Cancel OCO (TRADE)
Cancel an entire Order List for a margin account.
- Canceling an individual leg will cancel the entire OCO
Weight: 1(UID)
§Arguments
params:MarginAccountCancelOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountCancelOcoResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_cancel_order(
&self,
params: MarginAccountCancelOrderParams,
) -> Result<RestApiResponse<MarginAccountCancelOrderResponse>>
pub async fn margin_account_cancel_order( &self, params: MarginAccountCancelOrderParams, ) -> Result<RestApiResponse<MarginAccountCancelOrderResponse>>
Margin Account Cancel Order (TRADE)
Cancel an active order for margin account.
- Either orderId or origClientOrderId must be sent.
Weight: 10(IP)
§Arguments
params:MarginAccountCancelOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountCancelOrderResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_new_oco(
&self,
params: MarginAccountNewOcoParams,
) -> Result<RestApiResponse<MarginAccountNewOcoResponse>>
pub async fn margin_account_new_oco( &self, params: MarginAccountNewOcoParams, ) -> Result<RestApiResponse<MarginAccountNewOcoResponse>>
Margin Account New OCO (TRADE)
Send in a new OCO for a margin account
- autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
Weight: 6(UID)
§Arguments
params:MarginAccountNewOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountNewOcoResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_new_order(
&self,
params: MarginAccountNewOrderParams,
) -> Result<RestApiResponse<MarginAccountNewOrderResponse>>
pub async fn margin_account_new_order( &self, params: MarginAccountNewOrderParams, ) -> Result<RestApiResponse<MarginAccountNewOrderResponse>>
Margin Account New Order (TRADE)
Post a new order for margin account.
- autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
Weight: 6(UID)
§Arguments
params:MarginAccountNewOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountNewOrderResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_new_oto(
&self,
params: MarginAccountNewOtoParams,
) -> Result<RestApiResponse<MarginAccountNewOtoResponse>>
pub async fn margin_account_new_oto( &self, params: MarginAccountNewOtoParams, ) -> Result<RestApiResponse<MarginAccountNewOtoResponse>>
Margin Account New OTO (TRADE)
Post a new OTO order for margin account:
- An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
- The first order is called the working order and must be
LIMITorLIMIT_MAKER. Initially, only the working order goes on the order book. - The second order is called the pending order. It can be any order type except for
MARKETorders using parameterquoteOrderQty. The pending order is only placed on the order book when the working order gets fully filled. - If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
- When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as
FILLEDbut the pending order will still appear asPENDING_NEW. You need to query the status of the pending order again to see its updated status. - OTOs add 2 orders to the unfilled order count,
EXCHANGE_MAX_NUM_ORDERSfilter andMAX_NUM_ORDERSfilter.
- autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
- Depending on the
pendingTypeorworkingType, some optional parameters will become mandatory:
Weight: 6(UID)
§Arguments
params:MarginAccountNewOtoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountNewOtoResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_account_new_otoco(
&self,
params: MarginAccountNewOtocoParams,
) -> Result<RestApiResponse<MarginAccountNewOtocoResponse>>
pub async fn margin_account_new_otoco( &self, params: MarginAccountNewOtocoParams, ) -> Result<RestApiResponse<MarginAccountNewOtocoResponse>>
Margin Account New OTOCO (TRADE)
Post a new OTOCO order for margin account:
- An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.
- The first order is called the working order and must be
LIMITorLIMIT_MAKER. Initially, only the working order goes on the order book. - The behavior of the working order is the same as the OTO.
- OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.
- The rules of the pending above and pending below follow the same rules as the Order List OCO.
- OTOCOs add 3 orders against the unfilled order count,
EXCHANGE_MAX_NUM_ORDERSfilter, andMAX_NUM_ORDERSfilter.
- autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution
- Depending on the
pendingAboveType/pendingBelowTypeorworkingType, some optional parameters will become mandatory:
Weight: 6(UID)
§Arguments
params:MarginAccountNewOtocoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginAccountNewOtocoResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn margin_manual_liquidation(
&self,
params: MarginManualLiquidationParams,
) -> Result<RestApiResponse<MarginManualLiquidationResponse>>
pub async fn margin_manual_liquidation( &self, params: MarginManualLiquidationParams, ) -> Result<RestApiResponse<MarginManualLiquidationResponse>>
Margin Manual Liquidation(MARGIN)
Margin Manual Liquidation
- This endpoint can support Cross Margin Classic Mode and Pro Mode.
- And only support Isolated Margin for restricted region.
Weight: 3000
§Arguments
params:MarginManualLiquidationParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MarginManualLiquidationResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_current_margin_order_count_usage(
&self,
params: QueryCurrentMarginOrderCountUsageParams,
) -> Result<RestApiResponse<Vec<QueryCurrentMarginOrderCountUsageResponseInner>>>
pub async fn query_current_margin_order_count_usage( &self, params: QueryCurrentMarginOrderCountUsageParams, ) -> Result<RestApiResponse<Vec<QueryCurrentMarginOrderCountUsageResponseInner>>>
Query Current Margin Order Count Usage (TRADE)
Displays the user’s current margin order count usage for all intervals.
Weight: 20(IP)
§Arguments
params:QueryCurrentMarginOrderCountUsageParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryCurrentMarginOrderCountUsageResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_all_oco(
&self,
params: QueryMarginAccountsAllOcoParams,
) -> Result<RestApiResponse<Vec<QueryMarginAccountsAllOcoResponseInner>>>
pub async fn query_margin_accounts_all_oco( &self, params: QueryMarginAccountsAllOcoParams, ) -> Result<RestApiResponse<Vec<QueryMarginAccountsAllOcoResponseInner>>>
Query Margin Account’s all OCO (USER_DATA)
Retrieves all OCO for a specific margin account based on provided optional parameters
Weight: 200(IP)
§Arguments
params:QueryMarginAccountsAllOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryMarginAccountsAllOcoResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_all_orders(
&self,
params: QueryMarginAccountsAllOrdersParams,
) -> Result<RestApiResponse<Vec<QueryMarginAccountsAllOrdersResponseInner>>>
pub async fn query_margin_accounts_all_orders( &self, params: QueryMarginAccountsAllOrdersParams, ) -> Result<RestApiResponse<Vec<QueryMarginAccountsAllOrdersResponseInner>>>
Query Margin Account’s All Orders (USER_DATA)
Query Margin Account’s All Orders
- If orderId is set, it will get orders >= that orderId. Otherwise the orders within 24 hours are returned.
- For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
- Less than 24 hours between startTime and endTime.
Weight: 200(IP)
§Arguments
params:QueryMarginAccountsAllOrdersParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryMarginAccountsAllOrdersResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_oco(
&self,
params: QueryMarginAccountsOcoParams,
) -> Result<RestApiResponse<QueryMarginAccountsOcoResponse>>
pub async fn query_margin_accounts_oco( &self, params: QueryMarginAccountsOcoParams, ) -> Result<RestApiResponse<QueryMarginAccountsOcoResponse>>
Query Margin Account’s OCO (USER_DATA)
Retrieves a specific OCO based on provided optional parameters
Weight: 10(IP)
§Arguments
params:QueryMarginAccountsOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryMarginAccountsOcoResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_open_oco(
&self,
params: QueryMarginAccountsOpenOcoParams,
) -> Result<RestApiResponse<Vec<QueryMarginAccountsOpenOcoResponseInner>>>
pub async fn query_margin_accounts_open_oco( &self, params: QueryMarginAccountsOpenOcoParams, ) -> Result<RestApiResponse<Vec<QueryMarginAccountsOpenOcoResponseInner>>>
Query Margin Account’s Open OCO (USER_DATA)
Query Margin Account’s Open OCO
Weight: 10(IP)
§Arguments
params:QueryMarginAccountsOpenOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryMarginAccountsOpenOcoResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_open_orders(
&self,
params: QueryMarginAccountsOpenOrdersParams,
) -> Result<RestApiResponse<Vec<QueryMarginAccountsOpenOrdersResponseInner>>>
pub async fn query_margin_accounts_open_orders( &self, params: QueryMarginAccountsOpenOrdersParams, ) -> Result<RestApiResponse<Vec<QueryMarginAccountsOpenOrdersResponseInner>>>
Query Margin Account’s Open Orders (USER_DATA)
Query Margin Account’s Open Orders
- If the symbol is not sent, orders for all symbols will be returned in an array.
- When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange.
- If isIsolated =“TRUE”, symbol must be sent.
Weight: 10(IP)
§Arguments
params:QueryMarginAccountsOpenOrdersParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryMarginAccountsOpenOrdersResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_order(
&self,
params: QueryMarginAccountsOrderParams,
) -> Result<RestApiResponse<QueryMarginAccountsOrderResponse>>
pub async fn query_margin_accounts_order( &self, params: QueryMarginAccountsOrderParams, ) -> Result<RestApiResponse<QueryMarginAccountsOrderResponse>>
Query Margin Account’s Order (USER_DATA)
Query Margin Account’s Order
- Either orderId or origClientOrderId must be sent.
- For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
Weight: 10(IP)
§Arguments
params:QueryMarginAccountsOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryMarginAccountsOrderResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_margin_accounts_trade_list(
&self,
params: QueryMarginAccountsTradeListParams,
) -> Result<RestApiResponse<Vec<QueryMarginAccountsTradeListResponseInner>>>
pub async fn query_margin_accounts_trade_list( &self, params: QueryMarginAccountsTradeListParams, ) -> Result<RestApiResponse<Vec<QueryMarginAccountsTradeListResponseInner>>>
Query Margin Account’s Trade List (USER_DATA)
Query Margin Account’s Trade List
- If fromId is set, it will get trades >= that fromId. Otherwise the trades within 24 hours are returned.
- Less than 24 hours between startTime and endTime.
Weight: 10(IP)
§Arguments
params:QueryMarginAccountsTradeListParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryMarginAccountsTradeListResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_prevented_matches(
&self,
params: QueryPreventedMatchesParams,
) -> Result<RestApiResponse<Vec<QueryPreventedMatchesResponseInner>>>
pub async fn query_prevented_matches( &self, params: QueryPreventedMatchesParams, ) -> Result<RestApiResponse<Vec<QueryPreventedMatchesResponseInner>>>
Query Prevented Matches(USER_DATA)
Weight: 10(IP)
§Arguments
params:QueryPreventedMatchesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QueryPreventedMatchesResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_special_key(
&self,
params: QuerySpecialKeyParams,
) -> Result<RestApiResponse<QuerySpecialKeyResponse>>
pub async fn query_special_key( &self, params: QuerySpecialKeyParams, ) -> Result<RestApiResponse<QuerySpecialKeyResponse>>
Query Special key(Low Latency Trading)(TRADE)
Query Special Key Information.
This only applies to Special Key for Low Latency Trading.
Weight: 1(UID)
§Arguments
params:QuerySpecialKeyParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QuerySpecialKeyResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_special_key_list(
&self,
params: QuerySpecialKeyListParams,
) -> Result<RestApiResponse<Vec<QuerySpecialKeyListResponseInner>>>
pub async fn query_special_key_list( &self, params: QuerySpecialKeyListParams, ) -> Result<RestApiResponse<Vec<QuerySpecialKeyListResponseInner>>>
Query Special key List(Low Latency Trading)(TRADE)
This only applies to Special Key for Low Latency Trading.
Weight: 1(UID)
§Arguments
params:QuerySpecialKeyListParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::QuerySpecialKeyListResponseInner>> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn small_liability_exchange(
&self,
params: SmallLiabilityExchangeParams,
) -> Result<RestApiResponse<Value>>
pub async fn small_liability_exchange( &self, params: SmallLiabilityExchangeParams, ) -> Result<RestApiResponse<Value>>
Small Liability Exchange (MARGIN)
Small Liability Exchange
- Only convert once within 6 hours
- Only liability valuation less than 10 USDT are supported
- The maximum number of coin is 10
Weight: 3000(UID)
§Arguments
params:SmallLiabilityExchangeParamsThe parameters for this operation.
§Returns
RestApiResponse<Value> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn get_cross_margin_transfer_history(
&self,
params: GetCrossMarginTransferHistoryParams,
) -> Result<RestApiResponse<GetCrossMarginTransferHistoryResponse>>
pub async fn get_cross_margin_transfer_history( &self, params: GetCrossMarginTransferHistoryParams, ) -> Result<RestApiResponse<GetCrossMarginTransferHistoryResponse>>
Get Cross Margin Transfer History (USER_DATA)
Get Cross Margin Transfer History
- Response in descending order
- The max interval between
startTimeandendTimeis 30 days. - Returns data for last 7 days by default
Weight: 1(IP)
§Arguments
params:GetCrossMarginTransferHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetCrossMarginTransferHistoryResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.
Sourcepub async fn query_max_transfer_out_amount(
&self,
params: QueryMaxTransferOutAmountParams,
) -> Result<RestApiResponse<QueryMaxTransferOutAmountResponse>>
pub async fn query_max_transfer_out_amount( &self, params: QueryMaxTransferOutAmountParams, ) -> Result<RestApiResponse<QueryMaxTransferOutAmountResponse>>
Query Max Transfer-Out Amount (USER_DATA)
Query Max Transfer-Out Amount
- If isolatedSymbol is not sent, crossed margin data will be sent.
Weight: 50(IP)
§Arguments
params:QueryMaxTransferOutAmountParamsThe parameters for this operation.
§Returns
RestApiResponse<models::QueryMaxTransferOutAmountResponse> on success.
§Errors
This function will return an anyhow::Error if:
- the HTTP request fails
- any parameter is invalid
- the response cannot be parsed
- or one of the following occurs:
RequiredErrorConnectorClientErrorUnauthorizedErrorForbiddenErrorTooManyRequestsErrorRateLimitBanErrorServerErrorNotFoundErrorNetworkErrorBadRequestError
For full API details, see the Binance API Documentation.