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 account_commission(
&self,
params: AccountCommissionParams,
) -> Result<RestApiResponse<AccountCommissionResponse>>
pub async fn account_commission( &self, params: AccountCommissionParams, ) -> Result<RestApiResponse<AccountCommissionResponse>>
Query Commission Rates
Get current account commission rates. Weight: 20
§Arguments
params:AccountCommissionParamsThe parameters for this operation.
§Returns
RestApiResponse<models::AccountCommissionResponse> 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 all_order_list(
&self,
params: AllOrderListParams,
) -> Result<RestApiResponse<Vec<AllOrderListResponseInner>>>
pub async fn all_order_list( &self, params: AllOrderListParams, ) -> Result<RestApiResponse<Vec<AllOrderListResponseInner>>>
Query all Order lists
Retrieves all order lists based on provided optional parameters.
Note that the time between startTime and endTime can’t be longer than 24 hours.
Weight: 20
§Arguments
params:AllOrderListParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::AllOrderListResponseInner>> 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 all_orders(
&self,
params: AllOrdersParams,
) -> Result<RestApiResponse<Vec<AllOrdersResponseInner>>>
pub async fn all_orders( &self, params: AllOrdersParams, ) -> Result<RestApiResponse<Vec<AllOrdersResponseInner>>>
All orders
Get all account orders; active, canceled, or filled. Weight: 20
§Arguments
params:AllOrdersParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::AllOrdersResponseInner>> 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_account(
&self,
params: GetAccountParams,
) -> Result<RestApiResponse<GetAccountResponse>>
pub async fn get_account( &self, params: GetAccountParams, ) -> Result<RestApiResponse<GetAccountResponse>>
Account information
Get current account information. Weight: 20
§Arguments
params:GetAccountParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetAccountResponse> 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_open_orders(
&self,
params: GetOpenOrdersParams,
) -> Result<RestApiResponse<Vec<AllOrdersResponseInner>>>
pub async fn get_open_orders( &self, params: GetOpenOrdersParams, ) -> Result<RestApiResponse<Vec<AllOrdersResponseInner>>>
Current open orders
Get all open orders on a symbol. Careful when accessing this with no symbol. Weight: 6 for a single symbol; 80 when the symbol parameter is omitted
§Arguments
params:GetOpenOrdersParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::AllOrdersResponseInner>> 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_order(
&self,
params: GetOrderParams,
) -> Result<RestApiResponse<GetOrderResponse>>
pub async fn get_order( &self, params: GetOrderParams, ) -> Result<RestApiResponse<GetOrderResponse>>
Query order
Check an order’s status. Weight: 4
§Arguments
params:GetOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetOrderResponse> 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_order_list(
&self,
params: GetOrderListParams,
) -> Result<RestApiResponse<GetOrderListResponse>>
pub async fn get_order_list( &self, params: GetOrderListParams, ) -> Result<RestApiResponse<GetOrderListResponse>>
Query Order list
Retrieves a specific order list based on provided optional parameters. Weight: 4
§Arguments
params:GetOrderListParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetOrderListResponse> 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 my_allocations(
&self,
params: MyAllocationsParams,
) -> Result<RestApiResponse<Vec<MyAllocationsResponseInner>>>
pub async fn my_allocations( &self, params: MyAllocationsParams, ) -> Result<RestApiResponse<Vec<MyAllocationsResponseInner>>>
Query Allocations
Retrieves allocations resulting from SOR order placement. Weight: 20
§Arguments
params:MyAllocationsParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::MyAllocationsResponseInner>> 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 my_filters(
&self,
params: MyFiltersParams,
) -> Result<RestApiResponse<MyFiltersResponse>>
pub async fn my_filters( &self, params: MyFiltersParams, ) -> Result<RestApiResponse<MyFiltersResponse>>
Query relevant filters
Retrieves the list of filters relevant to an account on a given symbol. This is the only endpoint that shows if an account has MAX_ASSET filters applied to it.
Weight: 40
§Arguments
params:MyFiltersParamsThe parameters for this operation.
§Returns
RestApiResponse<models::MyFiltersResponse> 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 my_prevented_matches(
&self,
params: MyPreventedMatchesParams,
) -> Result<RestApiResponse<Vec<MyPreventedMatchesResponseInner>>>
pub async fn my_prevented_matches( &self, params: MyPreventedMatchesParams, ) -> Result<RestApiResponse<Vec<MyPreventedMatchesResponseInner>>>
Query Prevented Matches
Displays the list of orders that were expired due to STP.
These are the combinations supported:
symbol+preventedMatchIdsymbol+orderIdsymbol+orderId+fromPreventedMatchId(limitwill default to 500)symbol+orderId+fromPreventedMatchId+limitWeight: Case | Weight –– | —– Ifsymbolis invalid | 2 Querying bypreventedMatchId| 2 Querying byorderId| 20
§Arguments
params:MyPreventedMatchesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::MyPreventedMatchesResponseInner>> 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 my_trades(
&self,
params: MyTradesParams,
) -> Result<RestApiResponse<Vec<MyTradesResponseInner>>>
pub async fn my_trades( &self, params: MyTradesParams, ) -> Result<RestApiResponse<Vec<MyTradesResponseInner>>>
Account trade list
Get trades for a specific account and symbol. Weight: Condition| Weight| —| — |Without orderId|20| |With orderId|5|
§Arguments
params:MyTradesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::MyTradesResponseInner>> 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 open_order_list(
&self,
params: OpenOrderListParams,
) -> Result<RestApiResponse<Vec<OpenOrderListResponseInner>>>
pub async fn open_order_list( &self, params: OpenOrderListParams, ) -> Result<RestApiResponse<Vec<OpenOrderListResponseInner>>>
Query Open Order lists
Weight: 6
§Arguments
params:OpenOrderListParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::OpenOrderListResponseInner>> 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 order_amendments(
&self,
params: OrderAmendmentsParams,
) -> Result<RestApiResponse<Vec<OrderAmendmentsResponseInner>>>
pub async fn order_amendments( &self, params: OrderAmendmentsParams, ) -> Result<RestApiResponse<Vec<OrderAmendmentsResponseInner>>>
Query Order Amendments
Queries all amendments of a single order. Weight: 4
§Arguments
params:OrderAmendmentsParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::OrderAmendmentsResponseInner>> 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 rate_limit_order(
&self,
params: RateLimitOrderParams,
) -> Result<RestApiResponse<Vec<RateLimitOrderResponseInner>>>
pub async fn rate_limit_order( &self, params: RateLimitOrderParams, ) -> Result<RestApiResponse<Vec<RateLimitOrderResponseInner>>>
Query Unfilled Order Count
Displays the user’s unfilled order count for all intervals. Weight: 40
§Arguments
params:RateLimitOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::RateLimitOrderResponseInner>> 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 exchange_info(
&self,
params: ExchangeInfoParams,
) -> Result<RestApiResponse<ExchangeInfoResponse>>
pub async fn exchange_info( &self, params: ExchangeInfoParams, ) -> Result<RestApiResponse<ExchangeInfoResponse>>
Exchange information
Current exchange trading rules and symbol information Weight: 20
§Arguments
params:ExchangeInfoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::ExchangeInfoResponse> 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 execution_rules(
&self,
params: ExecutionRulesParams,
) -> Result<RestApiResponse<ExecutionRulesResponse>>
pub async fn execution_rules( &self, params: ExecutionRulesParams, ) -> Result<RestApiResponse<ExecutionRulesResponse>>
Query Execution Rules
| Weight: Parameter | Weight |
|---|---|
symbol | 2 |
symbols | 2 for each symbol, capped at a max of 40 |
symbolStatus | 40 |
| None | 40 |
§Arguments
params:ExecutionRulesParamsThe parameters for this operation.
§Returns
RestApiResponse<models::ExecutionRulesResponse> 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 ping(&self) -> Result<RestApiResponse<Value>>
pub async fn ping(&self) -> Result<RestApiResponse<Value>>
Test connectivity
Test connectivity to the Rest API. Weight: 1
§Arguments
params: [PingParams] 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 time(&self) -> Result<RestApiResponse<TimeResponse>>
pub async fn time(&self) -> Result<RestApiResponse<TimeResponse>>
Check server time
Test connectivity to the Rest API and get the current server time. Weight: 1
§Arguments
params: [TimeParams] The parameters for this operation.
§Returns
RestApiResponse<models::TimeResponse> 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 agg_trades(
&self,
params: AggTradesParams,
) -> Result<RestApiResponse<Vec<AggTradesResponseInner>>>
pub async fn agg_trades( &self, params: AggTradesParams, ) -> Result<RestApiResponse<Vec<AggTradesResponseInner>>>
Compressed/Aggregate trades list
Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated. Weight: 4
§Arguments
params:AggTradesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::AggTradesResponseInner>> 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 avg_price(
&self,
params: AvgPriceParams,
) -> Result<RestApiResponse<AvgPriceResponse>>
pub async fn avg_price( &self, params: AvgPriceParams, ) -> Result<RestApiResponse<AvgPriceResponse>>
Current average price
Current average price for a symbol. Weight: 2
§Arguments
params:AvgPriceParamsThe parameters for this operation.
§Returns
RestApiResponse<models::AvgPriceResponse> 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 depth(
&self,
params: DepthParams,
) -> Result<RestApiResponse<DepthResponse>>
pub async fn depth( &self, params: DepthParams, ) -> Result<RestApiResponse<DepthResponse>>
Order book
Weight: Adjusted based on the limit:
| Limit | Request Weight |
|---|---|
| 1-100 | 5 |
| 101-500 | 25 |
| 501-1000 | 50 |
| 1001-5000 | 250 |
§Arguments
params:DepthParamsThe parameters for this operation.
§Returns
RestApiResponse<models::DepthResponse> 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_trades(
&self,
params: GetTradesParams,
) -> Result<RestApiResponse<Vec<HistoricalTradesResponseInner>>>
pub async fn get_trades( &self, params: GetTradesParams, ) -> Result<RestApiResponse<Vec<HistoricalTradesResponseInner>>>
Recent trades list
Get recent trades. Weight: 25
§Arguments
params:GetTradesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::HistoricalTradesResponseInner>> 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 historical_block_trades(
&self,
params: HistoricalBlockTradesParams,
) -> Result<RestApiResponse<Vec<HistoricalBlockTradesResponseInner>>>
pub async fn historical_block_trades( &self, params: HistoricalBlockTradesParams, ) -> Result<RestApiResponse<Vec<HistoricalBlockTradesResponseInner>>>
Historical Block Trades
Get block trades. Weight: 25
§Arguments
params:HistoricalBlockTradesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::HistoricalBlockTradesResponseInner>> 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 historical_trades(
&self,
params: HistoricalTradesParams,
) -> Result<RestApiResponse<Vec<HistoricalTradesResponseInner>>>
pub async fn historical_trades( &self, params: HistoricalTradesParams, ) -> Result<RestApiResponse<Vec<HistoricalTradesResponseInner>>>
Old trade lookup
Get older trades. Weight: 25
§Arguments
params:HistoricalTradesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::HistoricalTradesResponseInner>> 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 klines(
&self,
params: KlinesParams,
) -> Result<RestApiResponse<Vec<Vec<KlinesItemInner>>>>
pub async fn klines( &self, params: KlinesParams, ) -> Result<RestApiResponse<Vec<Vec<KlinesItemInner>>>>
Kline/Candlestick data
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time. Weight: 2
§Arguments
params:KlinesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<Vec<models::KlinesItemInner>>> 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 reference_price(
&self,
params: ReferencePriceParams,
) -> Result<RestApiResponse<ReferencePriceResponse>>
pub async fn reference_price( &self, params: ReferencePriceParams, ) -> Result<RestApiResponse<ReferencePriceResponse>>
Query Reference Price
Weight: 2
§Arguments
params:ReferencePriceParamsThe parameters for this operation.
§Returns
RestApiResponse<models::ReferencePriceResponse> 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 reference_price_calculation(
&self,
params: ReferencePriceCalculationParams,
) -> Result<RestApiResponse<ReferencePriceCalculationResponse>>
pub async fn reference_price_calculation( &self, params: ReferencePriceCalculationParams, ) -> Result<RestApiResponse<ReferencePriceCalculationResponse>>
Query Reference Price Calculation
Describes how reference price is calculated for a given symbol. Weight: 2
§Arguments
params:ReferencePriceCalculationParamsThe parameters for this operation.
§Returns
RestApiResponse<models::ReferencePriceCalculationResponse> 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 ticker(
&self,
params: TickerParams,
) -> Result<RestApiResponse<TickerResponse>>
pub async fn ticker( &self, params: TickerParams, ) -> Result<RestApiResponse<TickerResponse>>
Rolling window price change statistics
Weight: 4 for each requested symbol regardless of windowSize.
The weight for this request will cap at 200 once the number of symbols in the request is more than 50.
§Arguments
params:TickerParamsThe parameters for this operation.
§Returns
RestApiResponse<models::TickerResponse> 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 ticker24hr(
&self,
params: Ticker24hrParams,
) -> Result<RestApiResponse<Ticker24hrResponse>>
pub async fn ticker24hr( &self, params: Ticker24hrParams, ) -> Result<RestApiResponse<Ticker24hrResponse>>
24hr ticker price change statistics
24 hour rolling window price change statistics. Careful when accessing this with no symbol. Weight:
| Parameter | Symbols Provided | Weight |
|---|---|---|
| symbol | 1 | 2 |
| symbol parameter is omitted | 80 | |
| symbols | 1-20 | 2 |
| 21-100 | 40 | |
| 101 or more | 80 | |
| symbols parameter is omitted | 80 |
§Arguments
params:Ticker24hrParamsThe parameters for this operation.
§Returns
RestApiResponse<models::Ticker24hrResponse> 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 ticker_book_ticker(
&self,
params: TickerBookTickerParams,
) -> Result<RestApiResponse<TickerBookTickerResponse>>
pub async fn ticker_book_ticker( &self, params: TickerBookTickerParams, ) -> Result<RestApiResponse<TickerBookTickerResponse>>
Symbol order book ticker
Best price/qty on the order book for a symbol or symbols. Weight:
| Parameter | Symbols Provided | Weight |
|---|---|---|
| symbol | 1 | 2 |
| symbol parameter is omitted | 4 | |
| symbols | Any | 4 |
§Arguments
params:TickerBookTickerParamsThe parameters for this operation.
§Returns
RestApiResponse<models::TickerBookTickerResponse> 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 ticker_price(
&self,
params: TickerPriceParams,
) -> Result<RestApiResponse<TickerPriceResponse>>
pub async fn ticker_price( &self, params: TickerPriceParams, ) -> Result<RestApiResponse<TickerPriceResponse>>
Symbol price ticker
Latest price for a symbol or symbols. Weight:
| Parameter | Symbols Provided | Weight |
|---|---|---|
| symbol | 1 | 2 |
| symbol parameter is omitted | 4 | |
| symbols | Any | 4 |
§Arguments
params:TickerPriceParamsThe parameters for this operation.
§Returns
RestApiResponse<models::TickerPriceResponse> 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 ticker_trading_day(
&self,
params: TickerTradingDayParams,
) -> Result<RestApiResponse<TickerTradingDayResponse>>
pub async fn ticker_trading_day( &self, params: TickerTradingDayParams, ) -> Result<RestApiResponse<TickerTradingDayResponse>>
Trading Day Ticker
Price change statistics for a trading day.
Weight: 4 for each requested symbol.
The weight for this request will cap at 200 once the number of symbols in the request is more than 50.
§Arguments
params:TickerTradingDayParamsThe parameters for this operation.
§Returns
RestApiResponse<models::TickerTradingDayResponse> 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 ui_klines(
&self,
params: UiKlinesParams,
) -> Result<RestApiResponse<Vec<Vec<KlinesItemInner>>>>
pub async fn ui_klines( &self, params: UiKlinesParams, ) -> Result<RestApiResponse<Vec<Vec<KlinesItemInner>>>>
UIKlines
The request is similar to klines having the same parameters and response.
uiKlines return modified kline data, optimized for presentation of candlestick charts.
Weight: 2
§Arguments
params:UiKlinesParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<Vec<models::KlinesItemInner>>> 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_open_orders(
&self,
params: DeleteOpenOrdersParams,
) -> Result<RestApiResponse<Vec<DeleteOpenOrdersResponseInner>>>
pub async fn delete_open_orders( &self, params: DeleteOpenOrdersParams, ) -> Result<RestApiResponse<Vec<DeleteOpenOrdersResponseInner>>>
Cancel All Open Orders on a Symbol
Cancels all active orders on a symbol. This includes orders that are part of an order list. Weight: 1
§Arguments
params:DeleteOpenOrdersParamsThe parameters for this operation.
§Returns
RestApiResponse<Vec<models::DeleteOpenOrdersResponseInner>> 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_order(
&self,
params: DeleteOrderParams,
) -> Result<RestApiResponse<DeleteOrderResponse>>
pub async fn delete_order( &self, params: DeleteOrderParams, ) -> Result<RestApiResponse<DeleteOrderResponse>>
Cancel order
Cancel an active order. Weight: 1
§Arguments
params:DeleteOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::DeleteOrderResponse> 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_order_list(
&self,
params: DeleteOrderListParams,
) -> Result<RestApiResponse<DeleteOrderListResponse>>
pub async fn delete_order_list( &self, params: DeleteOrderListParams, ) -> Result<RestApiResponse<DeleteOrderListResponse>>
Cancel Order list
Cancel an entire Order list Weight: 1
§Arguments
params:DeleteOrderListParamsThe parameters for this operation.
§Returns
RestApiResponse<models::DeleteOrderListResponse> 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 new_order(
&self,
params: NewOrderParams,
) -> Result<RestApiResponse<NewOrderResponse>>
pub async fn new_order( &self, params: NewOrderParams, ) -> Result<RestApiResponse<NewOrderResponse>>
New order
Send in a new order.
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Weight: 1
§Arguments
params:NewOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::NewOrderResponse> 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 order_amend_keep_priority(
&self,
params: OrderAmendKeepPriorityParams,
) -> Result<RestApiResponse<OrderAmendKeepPriorityResponse>>
pub async fn order_amend_keep_priority( &self, params: OrderAmendKeepPriorityParams, ) -> Result<RestApiResponse<OrderAmendKeepPriorityResponse>>
Order Amend Keep Priority
Reduce the quantity of an existing open order.
This adds 0 orders to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read Order Amend Keep Priority FAQ to learn more. Weight: 4
§Arguments
params:OrderAmendKeepPriorityParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderAmendKeepPriorityResponse> 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 order_cancel_replace(
&self,
params: OrderCancelReplaceParams,
) -> Result<RestApiResponse<OrderCancelReplaceResponse>>
pub async fn order_cancel_replace( &self, params: OrderCancelReplaceParams, ) -> Result<RestApiResponse<OrderCancelReplaceResponse>>
Cancel an Existing Order and Send a New Order
- Cancels an existing order and places a new order on the same symbol.
- Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs.
- A new order that was not attempted (i.e. when
newOrderResult: NOT_ATTEMPTED), will still increase the unfilled order count by 1. - You can only cancel an individual order from an orderList using this endpoint, but the result is the same as canceling the entire orderList. Weight: 1
§Arguments
params:OrderCancelReplaceParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderCancelReplaceResponse> 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 order_list_oco(
&self,
params: OrderListOcoParams,
) -> Result<RestApiResponse<OrderListOcoResponse>>
pub async fn order_list_oco( &self, params: OrderListOcoParams, ) -> Result<RestApiResponse<OrderListOcoResponse>>
New Order list - OCO
Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.
- An OCO has 2 orders called the above order and below order.
- One of the orders must be a
LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMITorder and the other must beSTOP_LOSSorSTOP_LOSS_LIMITorder. - Price restrictions
- If the OCO is on the
SELLside: LIMIT_MAKER/TAKE_PROFIT_LIMITprice> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMITstopPriceTAKE_PROFIT stopPrice> Last Traded Price >STOP_LOSS/STOP_LOSS_LIMIT stopPrice- If the OCO is on the
BUYside: LIMIT_MAKER/TAKE_PROFIT_LIMIT price< Last Traded Price <stopPriceTAKE_PROFIT stopPrice< Last Traded Price <STOP_LOSS/STOP_LOSS_LIMIT stopPrice- OCOs add 2 orders to the
EXCHANGE_MAX_ORDERSfilter and theMAX_NUM_ORDERSfilter. Weight: 1
Unfilled Order Count: 2
§Arguments
params:OrderListOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderListOcoResponse> 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 order_list_opo(
&self,
params: OrderListOpoParams,
) -> Result<RestApiResponse<OrderListOpoResponse>>
pub async fn order_list_opo( &self, params: OrderListOpoParams, ) -> Result<RestApiResponse<OrderListOpoResponse>>
New Order List - OPO
Place an OPO.
- OPOs add 2 orders to the
EXCHANGE_MAX_NUM_ORDERSfilter andMAX_NUM_ORDERSfilter. Weight: 1
Unfilled Order Count: 2
§Arguments
params:OrderListOpoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderListOpoResponse> 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 order_list_opoco(
&self,
params: OrderListOpocoParams,
) -> Result<RestApiResponse<OrderListOpocoResponse>>
pub async fn order_list_opoco( &self, params: OrderListOpocoParams, ) -> Result<RestApiResponse<OrderListOpocoResponse>>
New Order List - OPOCO
Place an OPOCO. Weight: 1
Unfilled Order Count: 3
§Arguments
params:OrderListOpocoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderListOpocoResponse> 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 order_list_oto(
&self,
params: OrderListOtoParams,
) -> Result<RestApiResponse<OrderListOtoResponse>>
pub async fn order_list_oto( &self, params: OrderListOtoParams, ) -> Result<RestApiResponse<OrderListOtoResponse>>
New Order list - OTO
Place an OTO.
- 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
EXCHANGE_MAX_NUM_ORDERSfilter andMAX_NUM_ORDERSfilter. Weight: 1
Unfilled Order Count: 2
§Arguments
params:OrderListOtoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderListOtoResponse> 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 order_list_otoco(
&self,
params: OrderListOtocoParams,
) -> Result<RestApiResponse<OrderListOtocoResponse>>
pub async fn order_list_otoco( &self, params: OrderListOtocoParams, ) -> Result<RestApiResponse<OrderListOtocoResponse>>
New Order list - OTOCO
Place an OTOCO.
- 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 to the
EXCHANGE_MAX_NUM_ORDERSfilter andMAX_NUM_ORDERSfilter. Weight: 1
Unfilled Order Count: 3
§Arguments
params:OrderListOtocoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderListOtocoResponse> 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 order_oco(
&self,
params: OrderOcoParams,
) -> Result<RestApiResponse<OrderOcoResponse>>
👎Deprecated
pub async fn order_oco( &self, params: OrderOcoParams, ) -> Result<RestApiResponse<OrderOcoResponse>>
New OCO - Deprecated
Send in a new OCO.
- Price Restrictions:
SELL: Limit Price > Last Price > Stop PriceBUY: Limit Price < Last Price < Stop Price- Quantity Restrictions:
- Both legs must have the same quantity.
ICEBERGquantities however do not have to be the sameOCOadds 2 orders to theEXCHANGE_MAX_ORDERSfilter and theMAX_NUM_ORDERSfilter. Weight: 1
Unfilled Order Count: 2
§Arguments
params:OrderOcoParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderOcoResponse> 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.
§Deprecation
Deprecated: This method may be removed in a future version.
Sourcepub async fn order_test(
&self,
params: OrderTestParams,
) -> Result<RestApiResponse<OrderTestResponse>>
pub async fn order_test( &self, params: OrderTestParams, ) -> Result<RestApiResponse<OrderTestResponse>>
Test new order
Test new order creation and signature/recvWindow long.
Creates and validates a new order but does not send it into the matching engine.
Weight: |Condition| Request Weight|
|———— | ———— |
|Without computeCommissionRates| 1|
|With computeCommissionRates|20|
§Arguments
params:OrderTestParamsThe parameters for this operation.
§Returns
RestApiResponse<models::OrderTestResponse> 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 sor_order(
&self,
params: SorOrderParams,
) -> Result<RestApiResponse<SorOrderResponse>>
pub async fn sor_order( &self, params: SorOrderParams, ) -> Result<RestApiResponse<SorOrderResponse>>
New order using SOR
Places an order using smart order routing (SOR).
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read SOR FAQ to learn more. Weight: 1
Unfilled Order Count: 1
§Arguments
params:SorOrderParamsThe parameters for this operation.
§Returns
RestApiResponse<models::SorOrderResponse> 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 sor_order_test(
&self,
params: SorOrderTestParams,
) -> Result<RestApiResponse<SorOrderTestResponse>>
pub async fn sor_order_test( &self, params: SorOrderTestParams, ) -> Result<RestApiResponse<SorOrderTestResponse>>
Test new order using SOR
Test new order creation and signature/recvWindow using smart order routing (SOR).
Creates and validates a new order but does not send it into the matching engine.
Weight: | Condition | Request Weight |
| ——— | ––––––– |
| Without computeCommissionRates | 1 |
| With computeCommissionRates | 20 |
§Arguments
params:SorOrderTestParamsThe parameters for this operation.
§Returns
RestApiResponse<models::SorOrderTestResponse> 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.