R/wallet_api.R

# Binance Public Spot API
#
# OpenAPI Specifications for the Binance Public Spot API  API documents:   - [https://github.com/binance/binance-spot-api-docs](https://github.com/binance/binance-spot-api-docs)   - [https://binance-docs.github.io/apidocs/spot/en](https://binance-docs.github.io/apidocs/spot/en)
#
# The version of the OpenAPI document: 1.0
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title Wallet operations
#' @description binanceRapi.Wallet
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ SapiV1AccountApiRestrictionsGet } \emph{ Get API Key Permission (USER_DATA) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20050} \cr
#'
#'
#' \item status code : 200 | API Key permissions
#'
#' \item return type : InlineResponse20050 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AccountApiTradingStatusGet } \emph{ Account API Trading Status (USER_DATA) }
#' Fetch account API trading status with details.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20040} \cr
#'
#'
#' \item status code : 200 | Account API trading status
#'
#' \item return type : InlineResponse20040 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AccountDisableFastWithdrawSwitchPost } \emph{ Disable Fast Withdraw Switch (USER_DATA) }
#' - This request will disable fastwithdraw switch under your account. - You need to enable \"trade\" option for the api key which requests this endpoint.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#'
#'
#' \item status code : 200 | OK
#'
#' \item return type : object 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AccountEnableFastWithdrawSwitchPost } \emph{ Enable Fast Withdraw Switch (USER_DATA) }
#' - This request will enable fastwithdraw switch under your account. You need to enable \"trade\" option for the api key which requests this endpoint. - When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#'
#'
#' \item status code : 200 | OK
#'
#' \item return type : object 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AccountSnapshotGet } \emph{ Daily Account Snapshot (USER_DATA) }
#' - The query time period must be less than 30 days - Support query within the last one month only - If startTimeand endTime not sent, return records of the last 7 days by default  Weight(IP): 2400
#'
#' \itemize{
#' \item \emph{ @param } type Enum < [SPOT, MARGIN, FUTURES] >
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{OneOfsnapshotSpotsnapshotMarginsnapshotFutures} \cr
#'
#'
#' \item status code : 200 | Account Snapshot
#'
#' \item return type : OneOfsnapshotSpotsnapshotMarginsnapshotFutures 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AccountStatusGet } \emph{ Account Status (USER_DATA) }
#' Fetch account status detail.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20039} \cr
#'
#'
#' \item status code : 200 | OK
#'
#' \item return type : InlineResponse20039 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetAssetDetailGet } \emph{ Asset Detail (USER_DATA) }
#' Fetch details of assets supported on Binance.  - Please get network and other deposit or withdraw details from &#x60;GET /sapi/v1/capital/config/getall&#x60;.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } asset character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20045} \cr
#'
#'
#' \item status code : 200 | Asset detail
#'
#' \item return type : InlineResponse20045 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetAssetDividendGet } \emph{ Asset Dividend Record (USER_DATA) }
#' Query asset Dividend Record  Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } asset character
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @returnType } \link{InlineResponse20044} \cr
#'
#'
#' \item status code : 200 | Records of asset dividend
#'
#' \item return type : InlineResponse20044 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetDribbletGet } \emph{ DustLog(USER_DATA) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20041} \cr
#'
#'
#' \item status code : 200 | Dust log records
#'
#' \item return type : InlineResponse20041
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error  
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetDustBtcPost } \emph{ Get Assets That Can Be Converted Into BNB (USER_DATA) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } timestamp integer
#' \item \emph{ @param } signature character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20042} \cr
#'
#'
#' \item status code : 200 | Account assets available to be converted to BNB
#'
#' \item return type : InlineResponse20042 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetDustPost } \emph{ Dust Transfer (USER_DATA) }
#' Convert dust assets to BNB.  Weight(UID): 10
#'
#' \itemize{
#' \item \emph{ @param } asset list( character )
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20043} \cr
#'
#'
#' \item status code : 200 | Dust log records
#'
#' \item return type : InlineResponse20043 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetGetFundingAssetPost } \emph{ Funding Wallet (USER_DATA) }
#' - Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } asset character
#' \item \emph{ @param } need.btc.valuation Enum < [true, false] >
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_49} ) \cr
#'
#'
#' \item status code : 200 | Funding asset detail
#'
#' \item return type : array[InlineResponse20049] 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetTradeFeeGet } \emph{ Trade Fee (USER_DATA) }
#' Fetch trade fee  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } symbol character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_46} ) \cr
#'
#'
#' \item status code : 200 | Trade fee info per symbol
#'
#' \item return type : array[InlineResponse20046] 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetTransferGet } \emph{ Query User Universal Transfer History (USER_DATA) }
#' - &#x60;fromSymbol&#x60; must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - &#x60;toSymbol&#x60; must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - Support query within the last 6 months only - If &#x60;startTime&#x60; and &#x60;endTime&#x60; not sent, return records of the last 7 days by default  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } type Enum < [MAIN_C2C, MAIN_UMFUTURE, MAIN_CMFUTURE, MAIN_MARGIN, MAIN_MINING, C2C_MAIN, C2C_UMFUTURE, C2C_MINING, C2C_MARGIN, UMFUTURE_MAIN, UMFUTURE_C2C, UMFUTURE_MARGIN, CMFUTURE_MAIN, CMFUTURE_MARGIN, MARGIN_MAIN, MARGIN_UMFUTURE, MARGIN_CMFUTURE, MARGIN_MINING, MARGIN_C2C, MINING_MAIN, MINING_UMFUTURE, MINING_C2C, MINING_MARGIN, MAIN_PAY, PAY_MAIN, ISOLATEDMARGIN_MARGIN, MARGIN_ISOLATEDMARGIN, ISOLATEDMARGIN_ISOLATEDMARGIN] >
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } current integer
#' \item \emph{ @param } size integer
#' \item \emph{ @param } from.symbol character
#' \item \emph{ @param } to.symbol character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20047} \cr
#'
#'
#' \item status code : 200 | Universal transfer history
#'
#' \item return type : InlineResponse20047 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1AssetTransferPost } \emph{ User Universal Transfer (USER_DATA) }
#' You need to enable &#x60;Permits Universal Transfer&#x60; option for the api key which requests this endpoint.  - &#x60;fromSymbol&#x60; must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - &#x60;toSymbol&#x60; must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN  ENUM of transfer types: - MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account - MAIN_CMFUTURE Spot account transfer to COIN-M Futures account - MAIN_MARGIN Spot account transfer to Margin(cross)account - UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account - UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account - CMFUTURE_MAIN COIN-M Futures account transfer to Spot account - CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account - MARGIN_MAIN Margin(cross)account transfer to Spot account - MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures - MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures - ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account - MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account - ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account - MAIN_FUNDING Spot account transfer to Funding account - FUNDING_MAIN Funding account transfer to Spot account - FUNDING_UMFUTURE Funding account transfer to UMFUTURE account - UMFUTURE_FUNDING UMFUTURE account transfer to Funding account - MARGIN_FUNDING MARGIN account transfer to Funding account - FUNDING_MARGIN Funding account transfer to Margin account - FUNDING_CMFUTURE Funding account transfer to CMFUTURE account - CMFUTURE_FUNDING CMFUTURE account transfer to Funding account  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } type Enum < [MAIN_C2C, MAIN_UMFUTURE, MAIN_CMFUTURE, MAIN_MARGIN, MAIN_MINING, C2C_MAIN, C2C_UMFUTURE, C2C_MINING, C2C_MARGIN, UMFUTURE_MAIN, UMFUTURE_C2C, UMFUTURE_MARGIN, CMFUTURE_MAIN, CMFUTURE_MARGIN, MARGIN_MAIN, MARGIN_UMFUTURE, MARGIN_CMFUTURE, MARGIN_MINING, MARGIN_C2C, MINING_MAIN, MINING_UMFUTURE, MINING_C2C, MINING_MARGIN, MAIN_PAY, PAY_MAIN, ISOLATEDMARGIN_MARGIN, MARGIN_ISOLATEDMARGIN, ISOLATEDMARGIN_ISOLATEDMARGIN] >
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } from.symbol character
#' \item \emph{ @param } to.symbol character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20048} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20048 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1CapitalConfigGetallGet } \emph{ All Coins&#39; Information (USER_DATA) }
#' Get information of coins (available for deposit and withdraw) for user.  Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_34} ) \cr
#'
#'
#' \item status code : 200 | All coins details information
#'
#' \item return type : array[InlineResponse20034] 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1CapitalDepositAddressGet } \emph{ Deposit Address (supporting network) (USER_DATA) }
#' Fetch deposit address with network.  - If network is not send, return with default network of the coin. - You can get network and isDefault in networkList in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256).  Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } coin character
#' \item \emph{ @param } network character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20038} \cr
#'
#'
#' \item status code : 200 | Deposit address info
#'
#' \item return type : InlineResponse20038 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1CapitalDepositHisrecGet } \emph{ Deposit History(supporting network) (USER_DATA) }
#' Fetch deposit history.  - Please notice the default &#x60;startTime&#x60; and &#x60;endTime&#x60; to make sure that time interval is within 0-90 days. - If both &#x60;startTime&#x60; and &#x60;endTime&#x60; are sent, time between &#x60;startTime&#x60; and &#x60;endTime&#x60; must be less than 90 days.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } coin character
#' \item \emph{ @param } status Enum < [0, 6, 1] >
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } offset integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_36} ) \cr
#'
#'
#' \item status code : 200 | List of deposits
#'
#' \item return type : array[InlineResponse20036] 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1CapitalWithdrawApplyPost } \emph{ Withdraw (USER_DATA) }
#' Submit a withdraw request.  - If &#x60;network&#x60; not send, return with default network of the coin. - You can get &#x60;network&#x60; and &#x60;isDefault&#x60; in &#x60;networkList&#x60; of a coin in the response of &#x60;Get /sapi/v1/capital/config/getall (HMAC SHA256)&#x60;.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } coin character
#' \item \emph{ @param } address character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } withdraw.order.id character
#' \item \emph{ @param } network character
#' \item \emph{ @param } address.tag character
#' \item \emph{ @param } transaction.fee.flag character
#' \item \emph{ @param } name character
#' \item \emph{ @param } wallet.type integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20035} \cr
#'
#'
#' \item status code : 200 | Transafer Id
#'
#' \item return type : InlineResponse20035 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1CapitalWithdrawHistoryGet } \emph{ Withdraw History (supporting network) (USER_DATA) }
#' Fetch withdraw history.  - &#x60;network&#x60; may not be in the response for old withdraw. - Please notice the default &#x60;startTime&#x60; and &#x60;endTime&#x60; to make sure that time interval is within 0-90 days. - If both &#x60;startTime&#x60; and &#x60;endTime&#x60; are sent, time between &#x60;startTime&#x60; and &#x60;endTime&#x60; must be less than 90 days  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } coin character
#' \item \emph{ @param } withdraw.order.id character
#' \item \emph{ @param } status Enum < [0, 1, 2, 3, 4, 5, 6] >
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } offset integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_37} ) \cr
#'
#'
#' \item status code : 200 | List of withdraw history
#'
#' \item return type : array[InlineResponse20037] 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Bad Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Unauthorized Request
#'
#' \item return type : Error 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ SapiV1SystemStatusGet } \emph{ System Status (System) }
#' Fetch system status.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @returnType } \link{InlineResponse20033} \cr
#'
#'
#' \item status code : 200 | OK
#'
#' \item return type : InlineResponse20033 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' ####################  SapiV1AccountApiRestrictionsGet  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Get API Key Permission (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AccountApiRestrictionsGet(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AccountApiTradingStatusGet  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Account API Trading Status (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AccountApiTradingStatusGet(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AccountDisableFastWithdrawSwitchPost  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Disable Fast Withdraw Switch (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AccountDisableFastWithdrawSwitchPost(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AccountEnableFastWithdrawSwitchPost  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Enable Fast Withdraw Switch (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AccountEnableFastWithdrawSwitchPost(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AccountSnapshotGet  ####################
#'
#' library(binanceRapi)
#' var.type <- 'type_example' # character | 
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.limit <- 7 # integer | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Daily Account Snapshot (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AccountSnapshotGet(var.type, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AccountStatusGet  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Account Status (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AccountStatusGet(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetAssetDetailGet  ####################
#'
#' library(binanceRapi)
#' var.asset <- 'BNB' # character | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Asset Detail (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetAssetDetailGet(asset=var.asset, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetAssetDividendGet  ####################
#'
#' library(binanceRapi)
#' var.asset <- 'BNB' # character | 
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.limit <- 20 # integer | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Asset Dividend Record (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetAssetDividendGet(asset=var.asset, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetDribbletGet  ####################
#'
#' library(binanceRapi)
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #DustLog(USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetDribbletGet(start.time=var.start.time, end.time=var.end.time, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetDustBtcPost  ####################
#'
#' library(binanceRapi)
#' var.timestamp <- 56 # integer | UTC timestamp in ms
#' var.signature <- 'signature_example' # character | Signature
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Get Assets That Can Be Converted Into BNB (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetDustBtcPost(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetDustPost  ####################
#'
#' library(binanceRapi)
#' var.asset <- ['asset_example'] # array[character] | The asset being converted. For example, asset=BTC&asset=USDT
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Dust Transfer (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetDustPost(var.asset, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetGetFundingAssetPost  ####################
#'
#' library(binanceRapi)
#' var.asset <- 'BNB' # character | 
#' var.need.btc.valuation <- 'need.btc.valuation_example' # character | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Funding Wallet (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetGetFundingAssetPost(asset=var.asset, need.btc.valuation=var.need.btc.valuation, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetTradeFeeGet  ####################
#'
#' library(binanceRapi)
#' var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Trade Fee (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetTradeFeeGet(symbol=var.symbol, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetTransferGet  ####################
#'
#' library(binanceRapi)
#' var.type <- 'MAIN_C2C' # character | Universal transfer type
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.current <- 1 # integer | Current querying page. Start from 1. Default:1
#' var.size <- 100 # integer | Default:10 Max:100
#' var.from.symbol <- 'BNBUSDT' # character | Must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
#' var.to.symbol <- 'BNBUSDT' # character | Must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Query User Universal Transfer History (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetTransferGet(var.type, start.time=var.start.time, end.time=var.end.time, current=var.current, size=var.size, from.symbol=var.from.symbol, to.symbol=var.to.symbol, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1AssetTransferPost  ####################
#'
#' library(binanceRapi)
#' var.type <- 'MAIN_C2C' # character | Universal transfer type
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.from.symbol <- 'BNBUSDT' # character | Must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
#' var.to.symbol <- 'BNBUSDT' # character | Must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #User Universal Transfer (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1AssetTransferPost(var.type, var.asset, var.amount, from.symbol=var.from.symbol, to.symbol=var.to.symbol, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1CapitalConfigGetallGet  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #All Coins' Information (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1CapitalConfigGetallGet(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1CapitalDepositAddressGet  ####################
#'
#' library(binanceRapi)
#' var.coin <- 'BNB' # character | Coin name
#' var.network <- 'ETH' # character | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Deposit Address (supporting network) (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1CapitalDepositAddressGet(var.coin, network=var.network, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1CapitalDepositHisrecGet  ####################
#'
#' library(binanceRapi)
#' var.coin <- 'BNB' # character | Coin name
#' var.status <- 56 # integer | * `0` - pending * `6` - credited but cannot withdraw * `1` - success
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.offset <- 56 # integer | 
#' var.limit <- 500 # integer | Default 500; max 1000.
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Deposit History(supporting network) (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1CapitalDepositHisrecGet(var.coin, status=var.status, start.time=var.start.time, end.time=var.end.time, offset=var.offset, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1CapitalWithdrawApplyPost  ####################
#'
#' library(binanceRapi)
#' var.coin <- 'BNB' # character | Coin name
#' var.address <- 'address_example' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.withdraw.order.id <- 'withdraw.order.id_example' # character | Client id for withdraw
#' var.network <- 'network_example' # character | Get the value from `GET /sapi/v1/capital/config/getall`
#' var.address.tag <- 'address.tag_example' # character | Secondary address identifier for coins like XRP,XMR etc.
#' var.transaction.fee.flag <- FALSE # character | When making internal transfer - `true` ->  returning the fee to the destination account; - `false` -> returning the fee back to the departure account.
#' var.name <- 'name_example' # character | 
#' var.wallet.type <- 56 # integer | The wallet type for withdraw,0-Spot wallet, 1- Funding wallet. Default is Spot wallet
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Withdraw (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1CapitalWithdrawApplyPost(var.coin, var.address, var.amount, withdraw.order.id=var.withdraw.order.id, network=var.network, address.tag=var.address.tag, transaction.fee.flag=var.transaction.fee.flag, name=var.name, wallet.type=var.wallet.type, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1CapitalWithdrawHistoryGet  ####################
#'
#' library(binanceRapi)
#' var.coin <- 'BNB' # character | Coin name
#' var.withdraw.order.id <- 'withdraw.order.id_example' # character | 
#' var.status <- 56 # integer | * `0` - Email Sent * `1` - Cancelled * `2` - Awaiting Approval * `3` - Rejected * `4` - Processing * `5` - Failure * `6` - Completed
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.offset <- 56 # integer | 
#' var.limit <- 500 # integer | Default 500; max 1000.
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Withdraw History (supporting network) (USER_DATA)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1CapitalWithdrawHistoryGet(var.coin, withdraw.order.id=var.withdraw.order.id, status=var.status, start.time=var.start.time, end.time=var.end.time, offset=var.offset, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SystemStatusGet  ####################
#'
#' library(binanceRapi)
#'
#' #System Status (System)
#' api.instance <- WalletApi$new()
#'
#' result <- api.instance$SapiV1SystemStatusGet()
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
WalletApi <- R6::R6Class(
  'WalletApi',
  public = list(
    apiClient = NULL,
    initialize = function(apiClient){
      if (!missing(apiClient)) {
        self$apiClient <- apiClient
      }
      else {
        self$apiClient <- ApiClient$new()
      }
    },
    SapiV1AccountApiRestrictionsGet = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1AccountApiRestrictionsGetWithHttpInfo(recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AccountApiRestrictionsGetWithHttpInfo = function(recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/account/apiRestrictions"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20050", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AccountApiTradingStatusGet = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1AccountApiTradingStatusGetWithHttpInfo(recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AccountApiTradingStatusGetWithHttpInfo = function(recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/account/apiTradingStatus"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20040", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AccountDisableFastWithdrawSwitchPost = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1AccountDisableFastWithdrawSwitchPostWithHttpInfo(recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AccountDisableFastWithdrawSwitchPostWithHttpInfo = function(recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/account/disableFastWithdrawSwitch"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "object", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AccountEnableFastWithdrawSwitchPost = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1AccountEnableFastWithdrawSwitchPostWithHttpInfo(recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AccountEnableFastWithdrawSwitchPostWithHttpInfo = function(recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/account/enableFastWithdrawSwitch"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "object", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AccountSnapshotGet = function(type,  start.time=NULL, end.time=NULL, limit=7, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AccountSnapshotGetWithHttpInfo(type,  start.time, end.time, limit, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AccountSnapshotGetWithHttpInfo = function(type,  start.time=NULL, end.time=NULL, limit=7, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`type`)) {
        stop("Missing required parameter `type`.")
      }

      queryParams['type'] <- type

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/accountSnapshot"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "OneOfsnapshotSpotsnapshotMarginsnapshotFutures", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AccountStatusGet = function( recv.window=NULL, ...){
      apiResponse <- self$SapiV1AccountStatusGetWithHttpInfo( recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AccountStatusGetWithHttpInfo = function( recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/account/status"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20039", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetAssetDetailGet = function( asset=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetAssetDetailGetWithHttpInfo( asset, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetAssetDetailGetWithHttpInfo = function( asset=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['asset'] <- asset

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/assetDetail"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20045", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetAssetDividendGet = function(asset=NULL, start.time=NULL, end.time=NULL, limit=20, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetAssetDividendGetWithHttpInfo(asset, start.time, end.time, limit, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetAssetDividendGetWithHttpInfo = function(asset=NULL, start.time=NULL, end.time=NULL, limit=20, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['asset'] <- asset

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/assetDividend"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20044", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetDribbletGet = function( start.time=NULL, end.time=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetDribbletGetWithHttpInfo( start.time, end.time, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetDribbletGetWithHttpInfo = function( start.time=NULL, end.time=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/dribblet"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20041", loadNamespace("binanceRapi")),
          error = function(e){
            stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetDustBtcPost = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetDustBtcPostWithHttpInfo(recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },
    
    SapiV1AssetDustBtcPostWithHttpInfo = function(recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()
      
      queryParams['recvWindow'] <- recv.window
      
      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)
      
      body <- NULL
      urlPath <- "/sapi/v1/asset/dust-btc"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }
      
      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                     method = "POST",
                                     queryParams = queryParams,
                                     headerParams = headerParams,
                                     body = body,
                                     ...)
      
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20042", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetDustPost = function(asset,  recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetDustPostWithHttpInfo(asset,  recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetDustPostWithHttpInfo = function(asset,  recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`asset`)) {
        stop("Missing required parameter `asset`.")
      }

      queryParams['asset'] <- asset

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/dust"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20043", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetGetFundingAssetPost = function( asset=NULL, need.btc.valuation=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetGetFundingAssetPostWithHttpInfo( asset, need.btc.valuation, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetGetFundingAssetPostWithHttpInfo = function( asset=NULL, need.btc.valuation=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['asset'] <- asset

      queryParams['needBtcValuation'] <- need.btc.valuation

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/get-funding-asset"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "array[InlineResponse20049]", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetTradeFeeGet = function( symbol=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetTradeFeeGetWithHttpInfo( symbol, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetTradeFeeGetWithHttpInfo = function( symbol=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['symbol'] <- symbol

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/tradeFee"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "array[InlineResponse20046]", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetTransferGet = function(type,  start.time=NULL, end.time=NULL, current=NULL, size=NULL, from.symbol=NULL, to.symbol=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetTransferGetWithHttpInfo(type,  start.time, end.time, current, size, from.symbol, to.symbol, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetTransferGetWithHttpInfo = function(type,  start.time=NULL, end.time=NULL, current=NULL, size=NULL, from.symbol=NULL, to.symbol=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`type`)) {
        stop("Missing required parameter `type`.")
      }

      queryParams['type'] <- type

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['current'] <- current

      queryParams['size'] <- size

      queryParams['fromSymbol'] <- from.symbol

      queryParams['toSymbol'] <- to.symbol

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/transfer"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20047", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1AssetTransferPost = function(type, asset, amount,  from.symbol=NULL, to.symbol=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1AssetTransferPostWithHttpInfo(type, asset, amount,  from.symbol, to.symbol, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1AssetTransferPostWithHttpInfo = function(type, asset, amount,  from.symbol=NULL, to.symbol=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`type`)) {
        stop("Missing required parameter `type`.")
      }

      if (missing(`asset`)) {
        stop("Missing required parameter `asset`.")
      }

      if (missing(`amount`)) {
        stop("Missing required parameter `amount`.")
      }

      queryParams['type'] <- type

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['fromSymbol'] <- from.symbol

      queryParams['toSymbol'] <- to.symbol

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/asset/transfer"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20048", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1CapitalConfigGetallGet = function( recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalConfigGetallGetWithHttpInfo( recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1CapitalConfigGetallGetWithHttpInfo = function( recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/capital/config/getall"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "array[InlineResponse20034]", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1CapitalDepositAddressGet = function(coin,  network=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalDepositAddressGetWithHttpInfo(coin,  network, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1CapitalDepositAddressGetWithHttpInfo = function(coin,  network=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`coin`)) {
        stop("Missing required parameter `coin`.")
      }

      queryParams['coin'] <- coin

      queryParams['network'] <- network

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/capital/deposit/address"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20038", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1CapitalDepositHisrecGet = function(coin=NULL,  status=NULL, start.time=NULL, end.time=NULL, offset=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalDepositHisrecGetWithHttpInfo(coin,  status, start.time, end.time, offset, limit, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1CapitalDepositHisrecGetWithHttpInfo = function(coin=NULL,  status=NULL, start.time=NULL, end.time=NULL, offset=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['coin'] <- coin

      queryParams['status'] <- status

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['offset'] <- offset

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/capital/deposit/hisrec"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "array[InlineResponse20036]", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1CapitalWithdrawApplyPost = function(coin, address, amount,  withdraw.order.id=NULL, network=NULL, address.tag=NULL, transaction.fee.flag=FALSE, name=NULL, wallet.type=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalWithdrawApplyPostWithHttpInfo(coin, address, amount,  withdraw.order.id, network, address.tag, transaction.fee.flag, name, wallet.type, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1CapitalWithdrawApplyPostWithHttpInfo = function(coin, address, amount,  withdraw.order.id=NULL, network=NULL, address.tag=NULL, transaction.fee.flag=FALSE, name=NULL, wallet.type=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`coin`)) {
        stop("Missing required parameter `coin`.")
      }

      if (missing(`address`)) {
        stop("Missing required parameter `address`.")
      }

      if (missing(`amount`)) {
        stop("Missing required parameter `amount`.")
      }

      queryParams['coin'] <- coin

      queryParams['withdrawOrderId'] <- withdraw.order.id

      queryParams['network'] <- network

      queryParams['address'] <- address

      queryParams['addressTag'] <- address.tag

      queryParams['amount'] <- amount

      queryParams['transactionFeeFlag'] <- transaction.fee.flag

      queryParams['name'] <- name

      queryParams['walletType'] <- wallet.type

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/capital/withdraw/apply"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20035", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1CapitalWithdrawHistoryGet = function(coin=NULL,  withdraw.order.id=NULL, status=NULL, start.time=NULL, end.time=NULL, offset=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalWithdrawHistoryGetWithHttpInfo(coin,  withdraw.order.id, status, start.time, end.time, offset, limit, recv.window, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1CapitalWithdrawHistoryGetWithHttpInfo = function(coin=NULL,  withdraw.order.id=NULL, status=NULL, start.time=NULL, end.time=NULL, offset=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['coin'] <- coin

      queryParams['withdrawOrderId'] <- withdraw.order.id

      queryParams['status'] <- status

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['offset'] <- offset

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)

      body <- NULL
      urlPath <- "/sapi/v1/capital/withdraw/history"
      # API key authentication
      if (nchar(self$apiClient$credentials$key) > 0) {
        headerParams['X-MBX-APIKEY'] <- self$apiClient$credentials$key
      }

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "array[InlineResponse20037]", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    SapiV1SystemStatusGet = function(...){
      apiResponse <- self$SapiV1SystemStatusGetWithHttpInfo(...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    SapiV1SystemStatusGetWithHttpInfo = function(...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      body <- NULL
      urlPath <- "/sapi/v1/system/status"

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20033", loadNamespace("binanceRapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    }
  )
)
grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.