R/sub_account_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 SubAccount operations
#' @description binanceRapi.SubAccount
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ SapiV1CapitalDepositSubAddressGet } \emph{ Sub-account Spot Assets Summary (For Master Account) }
#' Fetch sub-account deposit address  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } coin character
#' \item \emph{ @param } network character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20058} \cr
#'
#'
#' \item status code : 200 | Deposit address info
#'
#' \item return type : InlineResponse20058 
#' \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{ SapiV1CapitalDepositSubHisrecGet } \emph{ Sub-account Deposit History (For Master Account) }
#' Fetch sub-account deposit history  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } coin character
#' \item \emph{ @param } status integer
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } offset integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_59} ) \cr
#'
#'
#' \item status code : 200 | Sub-account deposit history
#'
#' \item return type : array[InlineResponse20059] 
#' \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{ SapiV1ManagedSubaccountAccountSnapshotGet } \emph{ Managed sub-account snapshot (For Investor Master Account) }
#' - The query time period must be less then 30 days - Support query within the last one month only - If `startTime` and `endTime` not sent, return records of the last 7 days by default  Weight(IP): 2400
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } type character
#' \item \emph{ @param } timestamp integer
#' \item \emph{ @param } signature character
#' \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{InlineResponse20075} \cr
#'
#'
#' \item status code : 200 | Sub-account spot snapshot
#'
#' \item return type : InlineResponse20075
#' \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{ SapiV1ManagedSubaccountAssetGet } \emph{ Managed sub-account asset details(For Investor Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_74} ) \cr
#'
#'
#' \item status code : 200 | List of asset details
#'
#' \item return type : array[InlineResponse20074] 
#' \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{ SapiV1ManagedSubaccountDepositPost } \emph{ Deposit assets into the managed sub-account(For Investor Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } to.email character
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20073} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20073 
#' \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{ SapiV1ManagedSubaccountWithdrawPost } \emph{ Withdrawl assets from the managed sub-account(For Investor Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } from.email character
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } transfer.date integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20073} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20073 
#' \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{ SapiV1SubAccountBlvtEnablePost } \emph{ Enable Leverage Token for Sub-account (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } enable.blvt character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20072} \cr
#'
#'
#' \item status code : 200 | BLVT status
#'
#' \item return type : InlineResponse20072 
#' \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{ SapiV1SubAccountFuturesAccountGet } \emph{ Detail on Sub-account's Futures Account (For Master Account) }
#' Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20065} \cr
#'
#'
#' \item status code : 200 | Futures account details
#'
#' \item return type : InlineResponse20065 
#' \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{ SapiV1SubAccountFuturesAccountSummaryGet } \emph{ Summary of Sub-account's Futures Account (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20066} \cr
#'
#'
#' \item status code : 200 | Futures account summary
#'
#' \item return type : InlineResponse20066 
#' \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{ SapiV1SubAccountFuturesEnablePost } \emph{ Enable Futures for Sub-account (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20064} \cr
#'
#'
#' \item status code : 200 | Futures status
#'
#' \item return type : InlineResponse20064 
#' \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{ SapiV1SubAccountFuturesInternalTransferGet } \emph{ Sub-account Futures Asset Transfer History (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } futures.type integer
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } page integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20054} \cr
#'
#'
#' \item status code : 200 | Sub-account Futures Asset Transfer History
#'
#' \item return type : InlineResponse20054 
#' \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{ SapiV1SubAccountFuturesInternalTransferPost } \emph{ Sub-account Futures Asset Transfer (For Master Account) }
#' - Master account can transfer max 2000 times a minute  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } from.email character
#' \item \emph{ @param } to.email character
#' \item \emph{ @param } futures.type integer
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20055} \cr
#'
#'
#' \item status code : 200 | Futures Asset Transfer Info
#'
#' \item return type : InlineResponse20055 
#' \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{ SapiV1SubAccountFuturesPositionRiskGet } \emph{ Futures Position-Risk of Sub-account (For Master Account) }
#' Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_67} ) \cr
#'
#'
#' \item status code : 200 | Futures account summary
#'
#' \item return type : array[InlineResponse20067] 
#' \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{ SapiV1SubAccountFuturesTransferPost } \emph{ Transfer for Sub-account (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } type Enum < [1, 2, 3, 4] >
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20068} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20068 
#' \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{ SapiV1SubAccountListGet } \emph{ Query Sub-account List (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } is.freeze Enum < [true, false] >
#' \item \emph{ @param } page integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20052} \cr
#'
#'
#' \item status code : 200 | List of sub-accounts
#'
#' \item return type : InlineResponse20052 
#' \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{ SapiV1SubAccountMarginAccountGet } \emph{ Detail on Sub-account&#39;s Margin Account (For Master Account) }
#' Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20062} \cr
#'
#'
#' \item status code : 200 | Margin sub-account details
#'
#' \item return type : InlineResponse20062 
#' \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{ SapiV1SubAccountMarginAccountSummaryGet } \emph{ Summary of Sub-account&#39;s Margin Account (For Master Account) }
#' Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20063} \cr
#'
#'
#' \item status code : 200 | Margin sub-account details
#'
#' \item return type : InlineResponse20063 
#' \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{ SapiV1SubAccountMarginEnablePost } \emph{ Enable Margin for Sub-account (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20061} \cr
#'
#'
#' \item status code : 200 | Margin status
#'
#' \item return type : InlineResponse20061 
#' \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{ SapiV1SubAccountMarginTransferPost } \emph{ Margin Transfer for Sub-account (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } type Enum < [1, 2] >
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20068} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20068 
#' \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{ SapiV1SubAccountSpotSummaryGet } \emph{ Sub-account Spot Assets Summary (For Master Account) }
#' Get BTC valued asset summary of subaccounts.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } page integer
#' \item \emph{ @param } size integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20057} \cr
#'
#'
#' \item status code : 200 | Summary of Sub-account Spot Assets
#'
#' \item return type : InlineResponse20057 
#' \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{ SapiV1SubAccountStatusGet } \emph{ Sub-account&#39;s Status on Margin/Futures (For Master Account) }
#' - If no &#x60;email&#x60; sent, all sub-accounts&#39; information will be returned.  Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_60} ) \cr
#'
#'
#' \item status code : 200 | Status on Margin/Futures
#'
#' \item return type : array[InlineResponse20060] 
#' \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{ SapiV1SubAccountSubAccountApiIpRestrictionGet } \emph{ Get IP Restriction for a Sub-account API Key (For Master Account) }
#' Weight(UID): 3000
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } sub.account.api.key character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20076} \cr
#'
#'
#' \item status code : 200 | IP Restriction information
#'
#' \item return type : InlineResponse20076 
#' \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{ SapiV1SubAccountSubAccountApiIpRestrictionIpListDelete } \emph{ Delete IP List for a Sub-account API Key (For Master Account) }
#' Weight(UID): 3000
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } sub.account.api.key character
#' \item \emph{ @param } ip.address character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20079} \cr
#'
#'
#' \item status code : 200 | Delete IP information
#'
#' \item return type : InlineResponse20079 
#' \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{ SapiV1SubAccountSubAccountApiIpRestrictionIpListPost } \emph{ Add IP List for a Sub-account API Key (For Master Account) }
#' Before the usage of this endpoint, please ensure &#x60;POST /sapi/v1/sub-account/subAccountApi/ipRestriction&#x60; was used to enable the IP restriction.  Weight(UID): 3000
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } sub.account.api.key character
#' \item \emph{ @param } ip.address character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20078} \cr
#'
#'
#' \item status code : 200 | Add IP information
#'
#' \item return type : InlineResponse20078 
#' \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{ SapiV1SubAccountSubAccountApiIpRestrictionPost } \emph{ Enable or Disable IP Restriction for a Sub-account API Key (For Master Account) }
#' Weight(UID): 3000
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } sub.account.api.key character
#' \item \emph{ @param } ip.restrict character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20077} \cr
#'
#'
#' \item status code : 200 | IP Restriction information
#'
#' \item return type : InlineResponse20077 
#' \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{ SapiV1SubAccountSubTransferHistoryGet } \emph{ Sub-account Spot Asset Transfer History (For Master Account) }
#' - fromEmail and toEmail cannot be sent at the same time. - Return fromEmail equal master account email by default.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } from.email character
#' \item \emph{ @param } to.email character
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } page integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_53} ) \cr
#'
#'
#' \item status code : 200 | Sub-account Spot Asset Transfer History
#'
#' \item return type : array[InlineResponse20053] 
#' \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{ SapiV1SubAccountTransferSubToMasterPost } \emph{ Transfer to Master (For Sub-account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20068} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20068 
#' \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{ SapiV1SubAccountTransferSubToSubPost } \emph{ Transfer to Sub-account of Same Master (For Sub-account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } to.email character
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20068} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20068 
#' \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{ SapiV1SubAccountTransferSubUserHistoryGet } \emph{ Sub-account Transfer History (For Sub-account) }
#' - If &#x60;type&#x60; is not sent, the records of type 2: transfer out will be returned by default. - If &#x60;startTime&#x60; and &#x60;endTime&#x60; are not sent, the recent 30-day data will be returned.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } asset character
#' \item \emph{ @param } type Enum < [1, 2] >
#' \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 } list( \link{inline_response_200_69} ) \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : array[InlineResponse20069] 
#' \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{ SapiV1SubAccountUniversalTransferGet } \emph{ Universal Transfer History (For Master Account) }
#' - &#x60;fromEmail&#x60; and &#x60;toEmail&#x60; cannot be sent at the same time. - Return &#x60;fromEmail&#x60; equal master account email by default. - The query time period must be less then 30 days. - If startTime and endTime not sent, return records of the last 30 days by default.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } from.email character
#' \item \emph{ @param } to.email character
#' \item \emph{ @param } client.tran.id character
#' \item \emph{ @param } start.time integer
#' \item \emph{ @param } end.time integer
#' \item \emph{ @param } page integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } list( \link{inline_response_200_70} ) \cr
#'
#'
#' \item status code : 200 | Transfer History
#'
#' \item return type : array[InlineResponse20070] 
#' \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{ SapiV1SubAccountUniversalTransferPost } \emph{ Universal Transfer (For Master Account) }
#' - You need to enable \&quot;internal transfer\&quot; option for the api key which requests this endpoint. - Transfer from master account by default if fromEmail is not sent. - Transfer to master account by default if toEmail is not sent. - Supported transfer scenarios:   - Master account SPOT transfer to sub-account SPOT,USDT_FUTURE,COIN_FUTURE,MARGIN(Cross),ISOLATED_MARGIN   - Sub-account SPOT,USDT_FUTURE,COIN_FUTURE,MARGIN(Cross),ISOLATED_MARGIN transfer to master account SPOT   - Transfer between two sub-account SPOT accounts  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } from.account.type Enum < [SPOT, USDT_FUTURE, COIN_FUTURE, MARGIN, ISOLATED_MARGIN] >
#' \item \emph{ @param } to.account.type Enum < [SPOT, USDT_FUTURE, COIN_FUTURE, MARGIN, ISOLATED_MARGIN] >
#' \item \emph{ @param } asset character
#' \item \emph{ @param } amount numeric
#' \item \emph{ @param } from.email character
#' \item \emph{ @param } to.email character
#' \item \emph{ @param } client.tran.id character
#' \item \emph{ @param } symbol character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20071} \cr
#'
#'
#' \item status code : 200 | Transfer id
#'
#' \item return type : InlineResponse20071 
#' \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{ SapiV1SubAccountVirtualSubAccountPost } \emph{ Create a Virtual Sub-account(For Master Account) }
#' - This request will generate a virtual sub account under your master account. - You need to enable \&quot;trade\&quot; option for the api key which requests this endpoint.  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } sub.account.string character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20051} \cr
#'
#'
#' \item status code : 200 | Return the created virtual email
#'
#' \item return type : InlineResponse20051 
#' \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{ SapiV2SubAccountFuturesAccountGet } \emph{ Detail on Sub-account&#39;s Futures Account V2 (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } futures.type Enum < [1, 2] >
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{OneOfsubAccountUSDTFuturesDetailssubAccountCOINFuturesDetails} \cr
#'
#'
#' \item status code : 200 | USDT or COIN Margined Futures Details
#'
#' \item return type : OneOfsubAccountUSDTFuturesDetailssubAccountCOINFuturesDetails 
#' \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{ SapiV2SubAccountFuturesAccountSummaryGet } \emph{ Summary of Sub-account&#39;s Futures Account V2 (For Master Account) }
#' Weight(IP): 10
#'
#' \itemize{
#' \item \emph{ @param } futures.type Enum < [1, 2] >
#' \item \emph{ @param } page integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{OneOfsubAccountUSDTFuturesSummarysubAccountCOINFuturesSummary} \cr
#'
#'
#' \item status code : 200 | USDT or COIN Margined Futures Summary
#'
#' \item return type : OneOfsubAccountUSDTFuturesSummarysubAccountCOINFuturesSummary 
#' \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{ SapiV2SubAccountFuturesPositionRiskGet } \emph{ Futures Position-Risk of Sub-account V2 (For Master Account) }
#' Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } futures.type Enum < [1, 2] >
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{OneOfsubAccountUSDTFuturesPositionRisksubAccountCOINFuturesPositionRisk} \cr
#'
#'
#' \item status code : 200 | USDT or COIN Margined Futures Position Risk
#'
#' \item return type : OneOfsubAccountUSDTFuturesPositionRisksubAccountCOINFuturesPositionRisk 
#' \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{ SapiV3SubAccountAssetsGet } \emph{ Sub-account Assets (For Master Account) }
#' Fetch sub-account assets  Weight(IP): 1
#'
#' \itemize{
#' \item \emph{ @param } email character
#' \item \emph{ @param } recv.window integer
#' \item \emph{ @returnType } \link{InlineResponse20056} \cr
#'
#'
#' \item status code : 200 | List of assets balances
#'
#' \item return type : InlineResponse20056 
#' \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}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' ####################  SapiV1CapitalDepositSubAddressGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.coin <- 'BNB' # character | Coin name
#' var.network <- 'network_example' # character | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Spot Assets Summary (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1CapitalDepositSubAddressGet(var.email, var.coin, network=var.network, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1CapitalDepositSubHisrecGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.coin <- 'BNB' # character | Coin name
#' var.status <- 56 # integer | 0(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.limit <- 56 # integer | 
#' var.offset <- 56 # integer | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Deposit History (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1CapitalDepositSubHisrecGet(var.email, coin=var.coin, status=var.status, start.time=var.start.time, end.time=var.end.time, limit=var.limit, offset=var.offset, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1ManagedSubaccountAccountSnapshotGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.type <- 'SPOT' # character | \"SPOT\", \"MARGIN\"(cross), \"FUTURES\"(UM)
#' var.timestamp <- 56 # integer | UTC timestamp in ms
#' var.signature <- 'signature_example' # character | Signature
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.limit <- 56 # integer | min 7, max 30, default 7
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Managed sub-account snapshot (For Investor Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1ManagedSubaccountAccountSnapshotGet(var.email, var.type, var.timestamp, var.signature, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1ManagedSubaccountAssetGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Managed sub-account asset details(For Investor Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1ManagedSubaccountAssetGet(var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1ManagedSubaccountDepositPost  ####################
#'
#' library(binanceRapi)
#' var.to.email <- 'to.email_example' # character | Recipient email
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Deposit assets into the managed sub-account(For Investor Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1ManagedSubaccountDepositPost(var.to.email, var.asset, var.amount, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1ManagedSubaccountWithdrawPost  ####################
#'
#' library(binanceRapi)
#' var.from.email <- 'from.email_example' # character | Sender email
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.transfer.date <- 56 # integer | Withdrawals is automatically occur on the transfer date(UTC0). If a date is not selected, the withdrawal occurs right now
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Withdrawl assets from the managed sub-account(For Investor Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1ManagedSubaccountWithdrawPost(var.from.email, var.asset, var.amount, transfer.date=var.transfer.date, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountBlvtEnablePost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.enable.blvt <- 'enable.blvt_example' # character | Only true for now
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Enable Leverage Token for Sub-account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountBlvtEnablePost(var.email, var.enable.blvt, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesAccountGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Detail on Sub-account's Futures Account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesAccountGet(var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesAccountSummaryGet  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Summary of Sub-account's Futures Account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesAccountSummaryGet(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesEnablePost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Enable Futures for Sub-account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesEnablePost(var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesInternalTransferGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.futures.type <- 2 # integer | 1:USDT-margined Futures, 2: Coin-margined Futures
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.page <- 1 # integer | Default 1
#' var.limit <- 56 # integer | Default value: 50, Max value: 500
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Futures Asset Transfer History (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesInternalTransferGet(var.email, var.futures.type, start.time=var.start.time, end.time=var.end.time, page=var.page, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesInternalTransferPost  ####################
#'
#' library(binanceRapi)
#' var.from.email <- 'from.email_example' # character | Sender email
#' var.to.email <- 'to.email_example' # character | Recipient email
#' var.futures.type <- 2 # integer | 1:USDT-margined Futures,2: Coin-margined Futures
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Futures Asset Transfer (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesInternalTransferPost(var.from.email, var.to.email, var.futures.type, var.asset, var.amount, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesPositionRiskGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Futures Position-Risk of Sub-account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesPositionRiskGet(var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountFuturesTransferPost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.type <- 56 # integer | * `1` - transfer from subaccount's spot account to its USDT-margined futures account * `2` - transfer from subaccount's USDT-margined futures account to its spot account * `3` - transfer from subaccount's spot account to its COIN-margined futures account * `4` - transfer from subaccount's COIN-margined futures account to its spot account
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Transfer for Sub-account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountFuturesTransferPost(var.email, var.asset, var.amount, var.type, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountListGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.is.freeze <- 'is.freeze_example' # character | 
#' var.page <- 1 # integer | Default 1
#' var.limit <- 1 # integer | Default 1; max 200
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Query Sub-account List (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountListGet(email=var.email, is.freeze=var.is.freeze, page=var.page, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountMarginAccountGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Detail on Sub-account's Margin Account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountMarginAccountGet(var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountMarginAccountSummaryGet  ####################
#'
#' library(binanceRapi)
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Summary of Sub-account's Margin Account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountMarginAccountSummaryGet(recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountMarginEnablePost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Enable Margin for Sub-account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountMarginEnablePost(var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountMarginTransferPost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.type <- 56 # integer | 1: transfer from subaccount's spot account to margin account  2: transfer from subaccount's margin account to its spot account
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Margin Transfer for Sub-account (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountMarginTransferPost(var.email, var.asset, var.amount, var.type, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountSpotSummaryGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.page <- 1 # integer | Default 1
#' var.size <- 56 # integer | Default:10 Max:20
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Spot Assets Summary (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountSpotSummaryGet(var.email, page=var.page, size=var.size, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountStatusGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account's Status on Margin/Futures (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountStatusGet(email=var.email, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountSubAccountApiIpRestrictionGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.sub.account.api.key <- 'sub.account.api.key_example' # character | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Get IP Restriction for a Sub-account API Key (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountSubAccountApiIpRestrictionGet(var.email, var.sub.account.api.key, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountSubAccountApiIpRestrictionIpListDelete  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.sub.account.api.key <- 'sub.account.api.key_example' # character | 
#'#' var.ip.address <- 'ip.address_example' # character | Can be added in batches, separated by commas
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Delete IP List for a Sub-account API Key (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountSubAccountApiIpRestrictionIpListDelete(var.email, var.sub.account.api.key, var.ip.address, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountSubAccountApiIpRestrictionIpListPost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.sub.account.api.key <- 'sub.account.api.key_example' # character | 
##' var.ip.address <- 'ip.address_example' # character | Can be added in batches, separated by commas
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Add IP List for a Sub-account API Key (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountSubAccountApiIpRestrictionIpListPost(var.email, var.sub.account.api.key, var.ip.address, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountSubAccountApiIpRestrictionPost  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.sub.account.api.key <- 'sub.account.api.key_example' # character | 
#' var.ip.restrict <- 'ip.restrict_example' # character | true or false
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Enable or Disable IP Restriction for a Sub-account API Key (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountSubAccountApiIpRestrictionPost(var.email, var.sub.account.api.key, var.ip.restrict, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountSubTransferHistoryGet  ####################
#'
#' library(binanceRapi)
#' var.from.email <- 'from.email_example' # character | Sub-account email
#' var.to.email <- 'to.email_example' # character | Sub-account email
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.page <- 1 # integer | Default 1
#' var.limit <- 1 # integer | Default 1
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Spot Asset Transfer History (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountSubTransferHistoryGet(from.email=var.from.email, to.email=var.to.email, start.time=var.start.time, end.time=var.end.time, page=var.page, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountTransferSubToMasterPost  ####################
#'
#' library(binanceRapi)
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Transfer to Master (For Sub-account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountTransferSubToMasterPost(var.asset, var.amount, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountTransferSubToSubPost  ####################
#'
#' library(binanceRapi)
#' var.to.email <- 'to.email_example' # character | Recipient email
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Transfer to Sub-account of Same Master (For Sub-account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountTransferSubToSubPost(var.to.email, var.asset, var.amount, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountTransferSubUserHistoryGet  ####################
#'
#' library(binanceRapi)
#' var.asset <- 'BNB' # character | 
#' var.type <- 56 # integer | * `1` - transfer in * `2` - transfer out
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.limit <- 500 # integer | Default 500; max 1000.
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Transfer History (For Sub-account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountTransferSubUserHistoryGet(asset=var.asset, type=var.type, start.time=var.start.time, end.time=var.end.time, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountUniversalTransferGet  ####################
#'
#' library(binanceRapi)
#' var.from.email <- 'from.email_example' # character | Sub-account email
#' var.to.email <- 'to.email_example' # character | Sub-account email
#' var.client.tran.id <- 'client.tran.id_example' # character | 
#' var.start.time <- 56 # integer | UTC timestamp in ms
#' var.end.time <- 56 # integer | UTC timestamp in ms
#' var.page <- 1 # integer | Default 1
#' var.limit <- 56 # integer | Default 500, Max 500
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Universal Transfer History (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountUniversalTransferGet(var.timestamp, var.signature, from.email=var.from.email, to.email=var.to.email, client.tran.id=var.client.tran.id, start.time=var.start.time, end.time=var.end.time, page=var.page, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountUniversalTransferPost  ####################
#'
#' library(binanceRapi)
#' var.from.account.type <- 'from.account.type_example' # character | 
#' var.to.account.type <- 'to.account.type_example' # character | 
#' var.asset <- 'BTC' # character | 
#' var.amount <- 1.01 # numeric | 
#' var.from.email <- 'from.email_example' # character | Sub-account email
#' var.to.email <- 'to.email_example' # character | Sub-account email
#' var.client.tran.id <- 'client.tran.id_example' # character | 
#' var.symbol <- 'BNBUSDT' # character | Only supported under ISOLATED_MARGIN type
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Universal Transfer (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountUniversalTransferPost(var.from.account.type, var.to.account.type, var.asset, var.amount, var.timestamp, var.signature, from.email=var.from.email, to.email=var.to.email, client.tran.id=var.client.tran.id, symbol=var.symbol, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV1SubAccountVirtualSubAccountPost  ####################
#'
#' library(binanceRapi)
#' var.sub.account.string <- 'sub.account.string_example' # character | Please input a string. We will create a virtual email using that string for you to register
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Create a Virtual Sub-account(For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV1SubAccountVirtualSubAccountPost(var.sub.account.string, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV2SubAccountFuturesAccountGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.futures.type <- 56 # integer | * `1` - USDT Margined Futures * `2` - COIN Margined Futures
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Detail on Sub-account's Futures Account V2 (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV2SubAccountFuturesAccountGet(var.email, var.futures.type, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV2SubAccountFuturesAccountSummaryGet  ####################
#'
#' library(binanceRapi)
#' var.futures.type <- 56 # integer | * `1` - USDT Margined Futures * `2` - COIN Margined Futures
#' var.page <- 1 # integer | Default 1
#' var.limit <- 56 # integer | Default 10, Max 20
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Summary of Sub-account's Futures Account V2 (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV2SubAccountFuturesAccountSummaryGet(var.futures.type, page=var.page, limit=var.limit, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV2SubAccountFuturesPositionRiskGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.futures.type <- 56 # integer | * `1` - USDT Margined Futures * `2` - COIN Margined Futures
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Futures Position-Risk of Sub-account V2 (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV2SubAccountFuturesPositionRiskGet(var.email, var.futures.type, recv.window=var.recv.window)
#'
#'
#' ####################  SapiV3SubAccountAssetsGet  ####################
#'
#' library(binanceRapi)
#' var.email <- 'email_example' # character | Sub-account email
#' var.recv.window <- 5000 # integer | The value cannot be greater than 60000
#'
#' #Sub-account Assets (For Master Account)
#' api.instance <- SubAccountApi$new()
#'
#' result <- api.instance$SapiV3SubAccountAssetsGet(var.email, recv.window=var.recv.window)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
SubAccountApi <- R6::R6Class(
  'SubAccountApi',
  public = list(
    apiClient = NULL,
    initialize = function(apiClient){
      if (!missing(apiClient)) {
        self$apiClient <- apiClient
      }
      else {
        self$apiClient <- ApiClient$new()
      }
    },
    SapiV1CapitalDepositSubAddressGet = function(email, coin, network=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalDepositSubAddressGetWithHttpInfo(email, 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
      }
    },

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

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

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

      queryParams['email'] <- email

      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/subAddress"
      # 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, "InlineResponse20058", 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)
      }
    },
    SapiV1CapitalDepositSubHisrecGet = function(email, coin=NULL, status=NULL, start.time=NULL, end.time=NULL, limit=NULL, offset=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1CapitalDepositSubHisrecGetWithHttpInfo(email, coin, status, start.time, end.time, limit, offset, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['coin'] <- coin

      queryParams['status'] <- status

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['limit'] <- limit

      queryParams['offset'] <- offset

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/capital/deposit/subHisrec"
      # 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[InlineResponse20059]", 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)
      }
    },
    SapiV1ManagedSubaccountAccountSnapshotGet = function(email, type, start.time=NULL, end.time=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1ManagedSubaccountAccountSnapshotGetWithHttpInfo(email, 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
      }
    },
    
    SapiV1ManagedSubaccountAccountSnapshotGetWithHttpInfo = function(email, type, start.time=NULL, end.time=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()
      
      if (missing(`email`)) {
        stop("Missing required parameter `email`.")
      }
      
      if (missing(`type`)) {
        stop("Missing required parameter `type`.")
      }
      
      queryParams['email'] <- email
      
      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/managed-subaccount/accountSnapshot"
      
      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(          
          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)
      }
    },
    SapiV1ManagedSubaccountAssetGet = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV1ManagedSubaccountAssetGetWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/managed-subaccount/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 = "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[InlineResponse20074]", 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)
      }
    },
    SapiV1ManagedSubaccountDepositPost = function(to.email, asset, amount, recv.window=NULL, ...){
      apiResponse <- self$SapiV1ManagedSubaccountDepositPostWithHttpInfo(to.email, asset, amount, 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
      }
    },

    SapiV1ManagedSubaccountDepositPostWithHttpInfo = function(to.email, asset, amount, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

      queryParams['toEmail'] <- to.email

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/managed-subaccount/deposit"
      # 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, "InlineResponse20073", 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)
      }
    },
    SapiV1ManagedSubaccountWithdrawPost = function(from.email, asset, amount, transfer.date=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1ManagedSubaccountWithdrawPostWithHttpInfo(from.email, asset, amount, transfer.date, 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
      }
    },

    SapiV1ManagedSubaccountWithdrawPostWithHttpInfo = function(from.email, asset, amount, transfer.date=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

      queryParams['fromEmail'] <- from.email

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['transferDate'] <- transfer.date

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/managed-subaccount/withdraw"
      # 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, "InlineResponse20073", 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)
      }
    },
    SapiV1SubAccountBlvtEnablePost = function(email, enable.blvt, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountBlvtEnablePostWithHttpInfo(email, enable.blvt, 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
      }
    },

    SapiV1SubAccountBlvtEnablePostWithHttpInfo = function(email, enable.blvt, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      queryParams['email'] <- email

      queryParams['enableBlvt'] <- enable.blvt

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/blvt/enable"
      # 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, "InlineResponse20072", 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)
      }
    },
    SapiV1SubAccountFuturesAccountGet = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesAccountGetWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/futures/account"
      # 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, "InlineResponse20065", 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)
      }
    },
    SapiV1SubAccountFuturesAccountSummaryGet = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesAccountSummaryGetWithHttpInfo(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
      }
    },

    SapiV1SubAccountFuturesAccountSummaryGetWithHttpInfo = 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/sub-account/futures/accountSummary"
      # 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, "InlineResponse20066", 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)
      }
    },
    SapiV1SubAccountFuturesEnablePost = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesEnablePostWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/futures/enable"
      # 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, "InlineResponse20064", 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)
      }
    },
    SapiV1SubAccountFuturesInternalTransferGet = function(email, futures.type, start.time=NULL, end.time=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesInternalTransferGetWithHttpInfo(email, futures.type, start.time, end.time, page, 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
      }
    },

    SapiV1SubAccountFuturesInternalTransferGetWithHttpInfo = function(email, futures.type, start.time=NULL, end.time=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      queryParams['email'] <- email

      queryParams['futuresType'] <- futures.type

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['page'] <- page

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/futures/internalTransfer"
      # 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, "InlineResponse20054", 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)
      }
    },
    SapiV1SubAccountFuturesInternalTransferPost = function(from.email, to.email, futures.type, asset, 
                                                           amount, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesInternalTransferPostWithHttpInfo(from.email, to.email, 
                                                                                  futures.type, asset, amount, 
                                                                                  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
      }
    },

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

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

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

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

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

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

      queryParams['fromEmail'] <- from.email

      queryParams['toEmail'] <- to.email

      queryParams['futuresType'] <- futures.type

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/futures/internalTransfer"
      # 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, "InlineResponse20055", 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)
      }
    },
    SapiV1SubAccountFuturesPositionRiskGet = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesPositionRiskGetWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/futures/positionRisk"
      # 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[InlineResponse20067]", 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)
      }
    },
    SapiV1SubAccountFuturesTransferPost = function(email, asset, amount, type, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountFuturesTransferPostWithHttpInfo(email, asset, amount, 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
      }
    },

    SapiV1SubAccountFuturesTransferPostWithHttpInfo = function(email, asset, amount, type, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

      queryParams['email'] <- email

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['type'] <- type

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/futures/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, "InlineResponse20068", 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)
      }
    },
    SapiV1SubAccountListGet = function(email=NULL, is.freeze=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountListGetWithHttpInfo(email, is.freeze, page, 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
      }
    },

    SapiV1SubAccountListGetWithHttpInfo = function(email=NULL, is.freeze=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['email'] <- email

      queryParams['isFreeze'] <- is.freeze

      queryParams['page'] <- page

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/list"
      # 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, "InlineResponse20052", 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)
      }
    },
    SapiV1SubAccountMarginAccountGet = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountMarginAccountGetWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/margin/account"
      # 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, "InlineResponse20062", 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)
      }
    },
    SapiV1SubAccountMarginAccountSummaryGet = function(recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountMarginAccountSummaryGetWithHttpInfo(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
      }
    },

    SapiV1SubAccountMarginAccountSummaryGetWithHttpInfo = 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/sub-account/margin/accountSummary"
      # 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, "InlineResponse20063", 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)
      }
    },
    SapiV1SubAccountMarginEnablePost = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountMarginEnablePostWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/margin/enable"
      # 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, "InlineResponse20061", 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)
      }
    },
    SapiV1SubAccountMarginTransferPost = function(email, asset, amount, type, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountMarginTransferPostWithHttpInfo(email, asset, amount, 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
      }
    },

    SapiV1SubAccountMarginTransferPostWithHttpInfo = function(email, asset, amount, type, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

      queryParams['email'] <- email

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['type'] <- type

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/margin/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, "InlineResponse20068", 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)
      }
    },
    SapiV1SubAccountSpotSummaryGet = function(email=NULL, page=NULL, size=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountSpotSummaryGetWithHttpInfo(email, page, size, 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
      }
    },

    SapiV1SubAccountSpotSummaryGetWithHttpInfo = function(email=NULL, page=NULL, size=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['email'] <- email

      queryParams['page'] <- page

      queryParams['size'] <- size

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/spotSummary"
      # 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, "InlineResponse20057", 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)
      }
    },
    SapiV1SubAccountStatusGet = function(email=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountStatusGetWithHttpInfo(email, 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
      }
    },

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-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, "array[InlineResponse20060]", 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)
      }
    },
    SapiV1SubAccountSubAccountApiIpRestrictionGet = function(email, sub.account.api.key, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountSubAccountApiIpRestrictionGetWithHttpInfo(email, sub.account.api.key, 
                                                                                    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
      }
    },
    
    SapiV1SubAccountSubAccountApiIpRestrictionGetWithHttpInfo = function(email, sub.account.api.key, 
                                                                         recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()
      
      if (missing(`email`)) {
        stop("Missing required parameter `email`.")
      }
      
      if (missing(`sub.account.api.key`)) {
        stop("Missing required parameter `sub.account.api.key`.")
      }
      
      queryParams['email'] <- email
      
      queryParams['subAccountApiKey'] <- sub.account.api.key
      
      queryParams['recvWindow'] <- recv.window
      
      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)
      
      body <- NULL
      urlPath <- "/sapi/v1/sub-account/subAccountApi/ipRestriction"
      # 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, "InlineResponse20076", 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)
      }
    },
    SapiV1SubAccountSubAccountApiIpRestrictionIpListDelete = function(email, sub.account.api.key, ip.address, 
                                                                      recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountSubAccountApiIpRestrictionIpListDeleteWithHttpInfo(email, sub.account.api.key, 
                                                                                             ip.address, 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
      }
    },
    
    SapiV1SubAccountSubAccountApiIpRestrictionIpListDeleteWithHttpInfo = function(email, sub.account.api.key, ip.address, 
                                                                                  recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()
      
      if (missing(`email`)) {
        stop("Missing required parameter `email`.")
      }
      
      if (missing(`sub.account.api.key`)) {
        stop("Missing required parameter `sub.account.api.key`.")
      }
      
      if (missing(`ip.address`)) {
        stop("Missing required parameter `ip.address`.")
      }
      
      queryParams['email'] <- email
      
      queryParams['subAccountApiKey'] <- sub.account.api.key
      
      queryParams['ipAddress'] <- ip.address
      
      queryParams['recvWindow'] <- recv.window
      
      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)
      
      body <- NULL
      urlPath <- "/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList"
      # 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 = "DELETE",
                                     queryParams = queryParams,
                                     headerParams = headerParams,
                                     body = body,
                                     ...)
      
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "InlineResponse20079", 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)
      }
    },
    
    SapiV1SubAccountSubAccountApiIpRestrictionIpListPost = function(email, sub.account.api.key, ip.address, 
                                                                    recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountSubAccountApiIpRestrictionIpListPostWithHttpInfo(email, 
                                                                                           sub.account.api.key, 
                                                                                           ip.address, 
                                                                                           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
      }
    },
    
    SapiV1SubAccountSubAccountApiIpRestrictionIpListPostWithHttpInfo = function(email, sub.account.api.key, ip.address, 
                                                                                recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()
      
      if (missing(`email`)) {
        stop("Missing required parameter `email`.")
      }
      
      if (missing(`sub.account.api.key`)) {
        stop("Missing required parameter `sub.account.api.key`.")
      }
      
      if (missing(`ip.address`)) {
        stop("Missing required parameter `ip.address`.")
      }
      
      queryParams['email'] <- email
      
      queryParams['subAccountApiKey'] <- sub.account.api.key
      
      queryParams['ipAddress'] <- ip.address
      
      queryParams['recvWindow'] <- recv.window
      
      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)
      
      body <- NULL
      urlPath <- "/sapi/v1/sub-account/subAccountApi/ipRestriction/ipList"
      # 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, "InlineResponse20078", 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)
      }
    },
    
    SapiV1SubAccountSubAccountApiIpRestrictionPost = function(email, sub.account.api.key, ip.restrict,
                                                              recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountSubAccountApiIpRestrictionPostWithHttpInfo(email, sub.account.api.key, 
                                                                                     ip.restrict, 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
      }
    },
    
    SapiV1SubAccountSubAccountApiIpRestrictionPostWithHttpInfo = function(email, sub.account.api.key, ip.restrict, 
                                                                          recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()
      
      if (missing(`email`)) {
        stop("Missing required parameter `email`.")
      }
      
      if (missing(`sub.account.api.key`)) {
        stop("Missing required parameter `sub.account.api.key`.")
      }
      
      if (missing(`ip.restrict`)) {
        stop("Missing required parameter `ip.restrict`.")
      }
      
      queryParams['email'] <- email
      
      queryParams['subAccountApiKey'] <- sub.account.api.key
      
      queryParams['ipRestrict'] <- ip.restrict
      
      queryParams['recvWindow'] <- recv.window
      
      queryParams['timestamp'] <- self$apiClient$Timestamp
      
      queryParams['signature'] <- self$apiClient$credentials$sign(queryParams)
      
      body <- NULL
      urlPath <- "/sapi/v1/sub-account/subAccountApi/ipRestriction"
      # 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, "InlineResponse20077", 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)
      }
    },
    
    SapiV1SubAccountSubTransferHistoryGet = function(from.email=NULL, to.email=NULL, start.time=NULL, end.time=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountSubTransferHistoryGetWithHttpInfo(from.email, to.email, start.time, end.time, page, 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
      }
    },

    SapiV1SubAccountSubTransferHistoryGetWithHttpInfo = function(from.email=NULL, to.email=NULL, start.time=NULL, end.time=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['fromEmail'] <- from.email

      queryParams['toEmail'] <- to.email

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['page'] <- page

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/sub/transfer/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[InlineResponse20053]", 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)
      }
    },
    SapiV1SubAccountTransferSubToMasterPost = function(asset, amount, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountTransferSubToMasterPostWithHttpInfo(asset, amount, 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
      }
    },

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

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

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

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/transfer/subToMaster"
      # 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, "InlineResponse20068", 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)
      }
    },
    SapiV1SubAccountTransferSubToSubPost = function(to.email, asset, amount, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountTransferSubToSubPostWithHttpInfo(to.email, asset, amount, 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
      }
    },

    SapiV1SubAccountTransferSubToSubPostWithHttpInfo = function(to.email, asset, amount, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

      queryParams['toEmail'] <- to.email

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/transfer/subToSub"
      # 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, "InlineResponse20068", 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)
      }
    },
    SapiV1SubAccountTransferSubUserHistoryGet = function(asset=NULL, type=NULL, start.time=NULL, end.time=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountTransferSubUserHistoryGetWithHttpInfo(asset, 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
      }
    },

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

      queryParams['asset'] <- asset

      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/sub-account/transfer/subUserHistory"
      # 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[InlineResponse20069]", 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)
      }
    },
    SapiV1SubAccountUniversalTransferGet = function(from.email=NULL, to.email=NULL, client.tran.id=NULL, start.time=NULL, end.time=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountUniversalTransferGetWithHttpInfo(from.email, to.email, client.tran.id, start.time, end.time, page, 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
      }
    },

    SapiV1SubAccountUniversalTransferGetWithHttpInfo = function(from.email=NULL, to.email=NULL, client.tran.id=NULL, start.time=NULL, end.time=NULL, page=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      queryParams['fromEmail'] <- from.email

      queryParams['toEmail'] <- to.email
      
      queryParams['clientTranId'] <- client.tran.id

      queryParams['startTime'] <- start.time

      queryParams['endTime'] <- end.time

      queryParams['page'] <- page

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/universalTransfer"
      # 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[InlineResponse20070]", 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)
      }
    },
    SapiV1SubAccountUniversalTransferPost = function(from.account.type, to.account.type, asset, amount, 
                                                     from.email=NULL, to.email=NULL, 
                                                     client.tran.id=NULL, symbol=NULL, 
                                                     recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountUniversalTransferPostWithHttpInfo(from.account.type, to.account.type, 
                                                                            asset, amount, from.email, to.email, 
                                                                            client.tran.id, 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
      }
    },

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

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

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

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

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

      queryParams['fromEmail'] <- from.email

      queryParams['toEmail'] <- to.email

      queryParams['fromAccountType'] <- from.account.type

      queryParams['toAccountType'] <- to.account.type
      
      queryParams['clientTranId'] <- client.tran.id
      
      queryParams['symbol'] <- symbol

      queryParams['asset'] <- asset

      queryParams['amount'] <- amount

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/universalTransfer"
      # 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, "InlineResponse20071", 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)
      }
    },
    SapiV1SubAccountVirtualSubAccountPost = function(sub.account.string, recv.window=NULL, ...){
      apiResponse <- self$SapiV1SubAccountVirtualSubAccountPostWithHttpInfo(sub.account.string, 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
      }
    },

    SapiV1SubAccountVirtualSubAccountPostWithHttpInfo = function(sub.account.string, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      if (missing(`sub.account.string`)) {
        stop("Missing required parameter `sub.account.string`.")
      }

      queryParams['subAccountString'] <- sub.account.string

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v1/sub-account/virtualSubAccount"
      # 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, "InlineResponse20051", 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)
      }
    },
    SapiV2SubAccountFuturesAccountGet = function(email, futures.type, recv.window=NULL, ...){
      apiResponse <- self$SapiV2SubAccountFuturesAccountGetWithHttpInfo(email, futures.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
      }
    },

    SapiV2SubAccountFuturesAccountGetWithHttpInfo = function(email, futures.type, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      queryParams['email'] <- email

      queryParams['futuresType'] <- futures.type

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v2/sub-account/futures/account"
      # 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, "OneOfsubAccountUSDTFuturesDetailssubAccountCOINFuturesDetails", 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)
      }
    },
    SapiV2SubAccountFuturesAccountSummaryGet = function(futures.type, page=NULL, limit=NULL, recv.window=NULL, ...){
      apiResponse <- self$SapiV2SubAccountFuturesAccountSummaryGetWithHttpInfo(futures.type, page, 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
      }
    },

    SapiV2SubAccountFuturesAccountSummaryGetWithHttpInfo = function(futures.type, page=NULL, limit=NULL, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

      queryParams['futuresType'] <- futures.type

      queryParams['page'] <- page

      queryParams['limit'] <- limit

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v2/sub-account/futures/accountSummary"
      # 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, "OneOfsubAccountUSDTFuturesSummarysubAccountCOINFuturesSummary", 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)
      }
    },
    SapiV2SubAccountFuturesPositionRiskGet = function(email, futures.type, recv.window=NULL, ...){
      apiResponse <- self$SapiV2SubAccountFuturesPositionRiskGetWithHttpInfo(email, futures.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
      }
    },

    SapiV2SubAccountFuturesPositionRiskGetWithHttpInfo = function(email, futures.type, recv.window=NULL, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      queryParams['email'] <- email

      queryParams['futuresType'] <- futures.type

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v2/sub-account/futures/positionRisk"
      # 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, "OneOfsubAccountUSDTFuturesPositionRisksubAccountCOINFuturesPositionRisk", 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)
      }
    },
    SapiV3SubAccountAssetsGet = function(email, recv.window=NULL, ...){
      apiResponse <- self$SapiV3SubAccountAssetsGetWithHttpInfo(email, 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
      }
    },

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

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

      queryParams['email'] <- email

      queryParams['recvWindow'] <- recv.window

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

      body <- NULL
      urlPath <- "/sapi/v3/sub-account/assets"
      # 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, "InlineResponse20056", 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.