Skip to main content

RestApi

Struct RestApi 

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

Implementations§

Source§

impl RestApi

Source

pub fn new(configuration: ConfigurationRestApi) -> Self

Source

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 to
  • method - The HTTP method to use for the request
  • query_params - A map of query parameters to send with the request
  • body_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

Source

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 to
  • method - The HTTP method to use for the request
  • query_params - A map of query parameters to send with the request
  • body_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

Source

pub async fn get_bfusd_account( &self, params: GetBfusdAccountParams, ) -> Result<RestApiResponse<GetBfusdAccountResponse>>

Get BFUSD Account (USER_DATA)

Get BFUSD account information.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetBfusdAccountResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_bfusd_quota_details( &self, params: GetBfusdQuotaDetailsParams, ) -> Result<RestApiResponse<GetBfusdQuotaDetailsResponse>>

Get BFUSD Quota Details (USER_DATA)

Get BFUSD quota details including subscription quota, fast redemption quota and standard redemption quota.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetBfusdQuotaDetailsResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_bfusd_rate_history( &self, params: GetBfusdRateHistoryParams, ) -> Result<RestApiResponse<GetBfusdRateHistoryResponse>>

Get BFUSD Rate History (USER_DATA)

Get BFUSD rate history sorted by descending order.

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time minus one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetBfusdRateHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_bfusd_redemption_history( &self, params: GetBfusdRedemptionHistoryParams, ) -> Result<RestApiResponse<GetBfusdRedemptionHistoryResponse>>

Get BFUSD Redemption History (USER_DATA)

Get BFUSD redemption history.

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time minus one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetBfusdRedemptionHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_bfusd_rewards_history( &self, params: GetBfusdRewardsHistoryParams, ) -> Result<RestApiResponse<GetBfusdRewardsHistoryResponse>>

Get BFUSD Rewards History (USER_DATA)

Get BFUSD rewards history.

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time minus one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetBfusdRewardsHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_bfusd_subscription_history( &self, params: GetBfusdSubscriptionHistoryParams, ) -> Result<RestApiResponse<GetBfusdSubscriptionHistoryResponse>>

Get BFUSD subscription history(USER_DATA)

Get BFUSD subscription history

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time advanced by one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetBfusdSubscriptionHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn redeem_bfusd( &self, params: RedeemBfusdParams, ) -> Result<RestApiResponse<RedeemBfusdResponse>>

Redeem BFUSD(TRADE)

Redeem BFUSD to USDT

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::RedeemBfusdResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn subscribe_bfusd( &self, params: SubscribeBfusdParams, ) -> Result<RestApiResponse<SubscribeBfusdResponse>>

Subscribe BFUSD(TRADE)

Subscribe BFUSD

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::SubscribeBfusdResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_collateral_record( &self, params: GetCollateralRecordParams, ) -> Result<RestApiResponse<GetCollateralRecordResponse>>

Get Collateral Record(USER_DATA)

Get Collateral Record

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 1

§Arguments
§Returns

RestApiResponse<models::GetCollateralRecordResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_flexible_personal_left_quota( &self, params: GetFlexiblePersonalLeftQuotaParams, ) -> Result<RestApiResponse<GetFlexiblePersonalLeftQuotaResponse>>

Get Flexible Personal Left Quota(USER_DATA)

Get Flexible Personal Left Quota

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetFlexiblePersonalLeftQuotaResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_flexible_product_position( &self, params: GetFlexibleProductPositionParams, ) -> Result<RestApiResponse<GetFlexibleProductPositionResponse>>

Get Flexible Product Position(USER_DATA)

Get Flexible Product Position

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetFlexibleProductPositionResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_flexible_redemption_record( &self, params: GetFlexibleRedemptionRecordParams, ) -> Result<RestApiResponse<GetFlexibleRedemptionRecordResponse>>

Get Flexible Redemption Record(USER_DATA)

Get Flexible Redemption Record

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetFlexibleRedemptionRecordResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_flexible_rewards_history( &self, params: GetFlexibleRewardsHistoryParams, ) -> Result<RestApiResponse<GetFlexibleRewardsHistoryResponse>>

Get Flexible Rewards History(USER_DATA)

Get Flexible Rewards History

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetFlexibleRewardsHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_flexible_subscription_preview( &self, params: GetFlexibleSubscriptionPreviewParams, ) -> Result<RestApiResponse<GetFlexibleSubscriptionPreviewResponse>>

Get Flexible Subscription Preview(USER_DATA)

Get Flexible Subscription Preview

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetFlexibleSubscriptionPreviewResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_flexible_subscription_record( &self, params: GetFlexibleSubscriptionRecordParams, ) -> Result<RestApiResponse<GetFlexibleSubscriptionRecordResponse>>

Get Flexible Subscription Record(USER_DATA)

Get Flexible Subscription Record

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetFlexibleSubscriptionRecordResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_locked_personal_left_quota( &self, params: GetLockedPersonalLeftQuotaParams, ) -> Result<RestApiResponse<GetLockedPersonalLeftQuotaResponse>>

Get Locked Personal Left Quota(USER_DATA)

Get Locked Personal Left Quota

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetLockedPersonalLeftQuotaResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_locked_product_position( &self, params: GetLockedProductPositionParams, ) -> Result<RestApiResponse<GetLockedProductPositionResponse>>

Get Locked Product Position

Get Locked Product Position

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetLockedProductPositionResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_locked_redemption_record( &self, params: GetLockedRedemptionRecordParams, ) -> Result<RestApiResponse<GetLockedRedemptionRecordResponse>>

Get Locked Redemption Record(USER_DATA)

Get Locked Redemption Record

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetLockedRedemptionRecordResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_locked_rewards_history( &self, params: GetLockedRewardsHistoryParams, ) -> Result<RestApiResponse<GetLockedRewardsHistoryResponse>>

Get Locked Rewards History(USER_DATA)

Get Locked Rewards History

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetLockedRewardsHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_locked_subscription_preview( &self, params: GetLockedSubscriptionPreviewParams, ) -> Result<RestApiResponse<Vec<GetLockedSubscriptionPreviewResponseInner>>>

Get Locked Subscription Preview(USER_DATA)

Get Locked Subscription Preview

Weight: 150

§Arguments
§Returns

RestApiResponse<Vec<models::GetLockedSubscriptionPreviewResponseInner>> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_locked_subscription_record( &self, params: GetLockedSubscriptionRecordParams, ) -> Result<RestApiResponse<GetLockedSubscriptionRecordResponse>>

Get Locked Subscription Record(USER_DATA)

Get Locked Subscription Record

  • The time between startTime and endTime cannot be longer than 30 days.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetLockedSubscriptionRecordResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rate_history( &self, params: GetRateHistoryParams, ) -> Result<RestApiResponse<GetRateHistoryResponse>>

Get Rate History(USER_DATA)

Get Rate History

  • The time between startTime and endTime cannot be longer than 1 year.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, the next 30 days’ data beginning from startTime will be returned.
  • If endTime is sent but startTime is not sent, the 30 days’ data before endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRateHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_simple_earn_flexible_product_list( &self, params: GetSimpleEarnFlexibleProductListParams, ) -> Result<RestApiResponse<GetSimpleEarnFlexibleProductListResponse>>

Get Simple Earn Flexible Product List(USER_DATA)

Get available Simple Earn flexible product list

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetSimpleEarnFlexibleProductListResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_simple_earn_locked_product_list( &self, params: GetSimpleEarnLockedProductListParams, ) -> Result<RestApiResponse<GetSimpleEarnLockedProductListResponse>>

Get Simple Earn Locked Product List(USER_DATA)

Get Simple Earn Locked Product List

  • Get available Simple Earn locked product list

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetSimpleEarnLockedProductListResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn redeem_flexible_product( &self, params: RedeemFlexibleProductParams, ) -> Result<RestApiResponse<RedeemFlexibleProductResponse>>

Redeem Flexible Product(TRADE)

Redeem Flexible Product

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 1

§Arguments
§Returns

RestApiResponse<models::RedeemFlexibleProductResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn redeem_locked_product( &self, params: RedeemLockedProductParams, ) -> Result<RestApiResponse<RedeemLockedProductResponse>>

Redeem Locked Product(TRADE)

Redeem Locked Product

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 1/3s per account

§Arguments
§Returns

RestApiResponse<models::RedeemLockedProductResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn set_flexible_auto_subscribe( &self, params: SetFlexibleAutoSubscribeParams, ) -> Result<RestApiResponse<SetFlexibleAutoSubscribeResponse>>

Set Flexible Auto Subscribe(USER_DATA)

Set Flexible Auto Subscribe

Weight: 150

§Arguments
§Returns

RestApiResponse<models::SetFlexibleAutoSubscribeResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn set_locked_auto_subscribe( &self, params: SetLockedAutoSubscribeParams, ) -> Result<RestApiResponse<SetLockedAutoSubscribeResponse>>

Set Locked Auto Subscribe(USER_DATA)

Set locked auto subscribe

Weight: 150

§Arguments
§Returns

RestApiResponse<models::SetLockedAutoSubscribeResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn set_locked_product_redeem_option( &self, params: SetLockedProductRedeemOptionParams, ) -> Result<RestApiResponse<SetLockedProductRedeemOptionResponse>>

Set Locked Product Redeem Option(USER_DATA)

Set redeem option for Locked product

Weight: 50

§Arguments
§Returns

RestApiResponse<models::SetLockedProductRedeemOptionResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn simple_account( &self, params: SimpleAccountParams, ) -> Result<RestApiResponse<SimpleAccountResponse>>

Simple Account(USER_DATA)

Simple Account query

Weight: 150

§Arguments
§Returns

RestApiResponse<models::SimpleAccountResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn subscribe_flexible_product( &self, params: SubscribeFlexibleProductParams, ) -> Result<RestApiResponse<SubscribeFlexibleProductResponse>>

Subscribe Flexible Product(TRADE)

Subscribe Flexible Product

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 1

§Arguments
§Returns

RestApiResponse<models::SubscribeFlexibleProductResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn subscribe_locked_product( &self, params: SubscribeLockedProductParams, ) -> Result<RestApiResponse<SubscribeLockedProductResponse>>

Subscribe Locked Product(TRADE)

Subscribe Locked Product

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 1

§Arguments
§Returns

RestApiResponse<models::SubscribeLockedProductResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rwusd_account( &self, params: GetRwusdAccountParams, ) -> Result<RestApiResponse<GetRwusdAccountResponse>>

Get RWUSD Account (USER_DATA)

Get RWUSD account information.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRwusdAccountResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rwusd_quota_details( &self, params: GetRwusdQuotaDetailsParams, ) -> Result<RestApiResponse<GetRwusdQuotaDetailsResponse>>

Get RWUSD Quota Details (USER_DATA)

Get RWUSD quota details including subscription quota, fast redemption quota, and standard redemption quota.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRwusdQuotaDetailsResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rwusd_rate_history( &self, params: GetRwusdRateHistoryParams, ) -> Result<RestApiResponse<GetRwusdRateHistoryResponse>>

Get RWUSD Rate History (USER_DATA)

Get RWUSD rate history sorted by descending order.

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time minus one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRwusdRateHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rwusd_redemption_history( &self, params: GetRwusdRedemptionHistoryParams, ) -> Result<RestApiResponse<GetRwusdRedemptionHistoryResponse>>

Get RWUSD Redemption History (USER_DATA)

Get RWUSD redemption history.

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time minus one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRwusdRedemptionHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rwusd_rewards_history( &self, params: GetRwusdRewardsHistoryParams, ) -> Result<RestApiResponse<GetRwusdRewardsHistoryResponse>>

Get RWUSD Rewards History (USER_DATA)

Get RWUSD rewards history.

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time minus one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRwusdRewardsHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_rwusd_subscription_history( &self, params: GetRwusdSubscriptionHistoryParams, ) -> Result<RestApiResponse<GetRwusdSubscriptionHistoryResponse>>

Get RWUSD subscription history(USER_DATA)

Get RWUSD subscription history

  • The time between startTime and endTime cannot be longer than 6 months.
  • If startTime and endTime are both not sent, then the last 30 days’ data will be returned.
  • If startTime is sent but endTime is not sent, endTime will default to current time, and results from startTime onward will be returned.
  • If endTime is sent but startTime is not sent, startTime defaults to the current time advanced by one month, and data between startTime and endTime will be returned.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetRwusdSubscriptionHistoryResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn redeem_rwusd( &self, params: RedeemRwusdParams, ) -> Result<RestApiResponse<RedeemRwusdResponse>>

Redeem RWUSD(TRADE)

Redeem RWUSD to USDC

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::RedeemRwusdResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn subscribe_rwusd( &self, params: SubscribeRwusdParams, ) -> Result<RestApiResponse<SubscribeRwusdResponse>>

Subscribe RWUSD(TRADE)

Subscribe RWUSD

  • You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::SubscribeRwusdResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Source

pub async fn get_yield_arena_activities( &self, params: GetYieldArenaActivitiesParams, ) -> Result<RestApiResponse<GetYieldArenaActivitiesResponse>>

Get Yield Arena Activities (USER_DATA)

Get the list of Earn Yield Arena giveaway activities currently available to the user.

Supported locales: en, en-GB, en-AU, cn, zh, zh-CN, tw, zh-TW, zh-HK, ja, ja-JP, ru, ru-RU, es, es-ES, es-LA, pt, pt-BR, pt-PT, fr, fr-FR, de, de-DE, it, it-IT, id, id-ID, vi, vi-VN, ar, ar-SA, pl, pl-PL, uk, uk-UA, cs, cs-CZ, ro, ro-RO, sv, sv-SE, bg, bg-BG, da, da-DK, el, el-GR, hu, hu-HU, lv, lv-LV, sk, sk-SK, sl, sl-SI.

Weight: 150

§Arguments
§Returns

RestApiResponse<models::GetYieldArenaActivitiesResponse> 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:
    • RequiredError
    • ConnectorClientError
    • UnauthorizedError
    • ForbiddenError
    • TooManyRequestsError
    • RateLimitBanError
    • ServerError
    • NotFoundError
    • NetworkError
    • BadRequestError

For full API details, see the Binance API Documentation.

Trait Implementations§

Source§

impl Clone for RestApi

Source§

fn clone(&self) -> RestApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RestApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

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

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

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

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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