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 get_nft_asset(
&self,
params: GetNftAssetParams,
) -> Result<RestApiResponse<GetNftAssetResponse>>
pub async fn get_nft_asset( &self, params: GetNftAssetParams, ) -> Result<RestApiResponse<GetNftAssetResponse>>
Get NFT Asset(USER_DATA)
Get NFT Asset
Weight: 3000
§Arguments
params:GetNftAssetParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetNftAssetResponse> 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_nft_deposit_history(
&self,
params: GetNftDepositHistoryParams,
) -> Result<RestApiResponse<GetNftDepositHistoryResponse>>
pub async fn get_nft_deposit_history( &self, params: GetNftDepositHistoryParams, ) -> Result<RestApiResponse<GetNftDepositHistoryResponse>>
Get NFT Deposit History(USER_DATA)
et NFT Deposit History
- The max interval between startTime and endTime is 90 days.
- If startTime and endTime are not sent, the recent 7 days’ data will be returned.
Weight: 3000
§Arguments
params:GetNftDepositHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetNftDepositHistoryResponse> 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_nft_transaction_history(
&self,
params: GetNftTransactionHistoryParams,
) -> Result<RestApiResponse<GetNftTransactionHistoryResponse>>
pub async fn get_nft_transaction_history( &self, params: GetNftTransactionHistoryParams, ) -> Result<RestApiResponse<GetNftTransactionHistoryResponse>>
Get NFT Transaction History(USER_DATA)
Get NFT Transaction History
- The max interval between startTime and endTime is 90 days.
- If startTime and endTime are not sent, the recent 7 days’ data will be returned.
Weight: 3000
§Arguments
params:GetNftTransactionHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetNftTransactionHistoryResponse> 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_nft_withdraw_history(
&self,
params: GetNftWithdrawHistoryParams,
) -> Result<RestApiResponse<GetNftWithdrawHistoryResponse>>
pub async fn get_nft_withdraw_history( &self, params: GetNftWithdrawHistoryParams, ) -> Result<RestApiResponse<GetNftWithdrawHistoryResponse>>
Get NFT Withdraw History(USER_DATA)
Get NFT Withdraw History
- The max interval between startTime and endTime is 90 days.
- If startTime and endTime are not sent, the recent 7 days’ data will be returned.
Weight: 3000
§Arguments
params:GetNftWithdrawHistoryParamsThe parameters for this operation.
§Returns
RestApiResponse<models::GetNftWithdrawHistoryResponse> 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.