=begin
#BitMEX API

### REST API for the BitMEX Trading Platform  _If you are building automated tools, please subscribe to the_ _[BitMEX API RSS Feed](https://blog.bitmex.com/api_announcement/feed/) for changes. The feed will be updated_ _regularly and is the most reliable way to get downtime and update announcements._  [View Changelog](/app/apiChangelog)  -  #### Getting Started  Base URI: [https://www.bitmex.com/api/v1](/api/v1)  ##### Fetching Data  All REST endpoints are documented below. You can try out any query right from this interface.  Most table queries accept `count`, `start`, and `reverse` params. Set `reverse=true` to get rows newest-first.  Additional documentation regarding filters, timestamps, and authentication is available in [the main API documentation](/app/restAPI).  _All_ table data is available via the [Websocket](/app/wsAPI). We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits.  ##### Return Types  By default, all data is returned as JSON. Send `?_format=csv` to get CSV data or `?_format=xml` to get XML data.  ##### Trade Data Queries  _This is only a small subset of what is available, to get you started._  Fill in the parameters and click the `Try it out!` button to try any of these queries.  - [Pricing Data](#!/Quote/Quote_get)  - [Trade Data](#!/Trade/Trade_get)  - [OrderBook Data](#!/OrderBook/OrderBook_getL2)  - [Settlement Data](#!/Settlement/Settlement_get)  - [Exchange Statistics](#!/Stats/Stats_history)  Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available.  ##### Swagger Specification  [⇩ Download Swagger JSON](swagger.json)  -  ## All API Endpoints  Click to expand a section. 

OpenAPI spec version: 1.2.0
Contact: support@bitmex.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.42-SNAPSHOT

=end

require 'uri'

module SwaggerClient
  class UserApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Cancel pending withdrawal
    # @param transact_id 
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def user_cancel_pending_withdrawal(transact_id, opts = {})
      data, _status_code, _headers = user_cancel_pending_withdrawal_with_http_info(transact_id, opts)
      data
    end

    # Cancel pending withdrawal
    # @param transact_id 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def user_cancel_pending_withdrawal_with_http_info(transact_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_cancel_pending_withdrawal ...'
      end
      # verify the required parameter 'transact_id' is set
      if @api_client.config.client_side_validation && transact_id.nil?
        fail ArgumentError, "Missing the required parameter 'transact_id' when calling UserApi.user_cancel_pending_withdrawal"
      end
      # resource path
      local_var_path = '/user/withdrawal'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['transactID'] = transact_id

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Object')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_cancel_pending_withdrawal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Cancel a withdrawal.
    # @param token 
    # @param [Hash] opts the optional parameters
    # @return [Transaction]
    def user_cancel_withdrawal(token, opts = {})
      data, _status_code, _headers = user_cancel_withdrawal_with_http_info(token, opts)
      data
    end

    # Cancel a withdrawal.
    # @param token 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Transaction, Fixnum, Hash)>] Transaction data, response status code and response headers
    def user_cancel_withdrawal_with_http_info(token, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_cancel_withdrawal ...'
      end
      # verify the required parameter 'token' is set
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling UserApi.user_cancel_withdrawal"
      end
      # resource path
      local_var_path = '/user/cancelWithdrawal'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['token'] = token

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Transaction')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_cancel_withdrawal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Check if a referral code is valid.
    # If the code is valid, responds with the referral code's discount (e.g. `0.1` for 10%). Otherwise, will return a 404 or 451 if invalid.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :referral_code 
    # @return [Object]
    def user_check_referral_code(opts = {})
      data, _status_code, _headers = user_check_referral_code_with_http_info(opts)
      data
    end

    # Check if a referral code is valid.
    # If the code is valid, responds with the referral code&#39;s discount (e.g. &#x60;0.1&#x60; for 10%). Otherwise, will return a 404 or 451 if invalid.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :referral_code 
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def user_check_referral_code_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_check_referral_code ...'
      end
      # resource path
      local_var_path = '/user/checkReferralCode'

      # query parameters
      query_params = {}
      query_params[:'referralCode'] = opts[:'referral_code'] if !opts[:'referral_code'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Object')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_check_referral_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Register your communication token for mobile clients
    # @param token 
    # @param platform_agent 
    # @param [Hash] opts the optional parameters
    # @return [Array<CommunicationToken>]
    def user_communication_token(token, platform_agent, opts = {})
      data, _status_code, _headers = user_communication_token_with_http_info(token, platform_agent, opts)
      data
    end

    # Register your communication token for mobile clients
    # @param token 
    # @param platform_agent 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<CommunicationToken>, Fixnum, Hash)>] Array<CommunicationToken> data, response status code and response headers
    def user_communication_token_with_http_info(token, platform_agent, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_communication_token ...'
      end
      # verify the required parameter 'token' is set
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling UserApi.user_communication_token"
      end
      # verify the required parameter 'platform_agent' is set
      if @api_client.config.client_side_validation && platform_agent.nil?
        fail ArgumentError, "Missing the required parameter 'platform_agent' when calling UserApi.user_communication_token"
      end
      # resource path
      local_var_path = '/user/communicationToken'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['token'] = token
      form_params['platformAgent'] = platform_agent

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<CommunicationToken>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_communication_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Confirm your email address with a token.
    # @param token 
    # @param [Hash] opts the optional parameters
    # @return [AccessToken]
    def user_confirm(token, opts = {})
      data, _status_code, _headers = user_confirm_with_http_info(token, opts)
      data
    end

    # Confirm your email address with a token.
    # @param token 
    # @param [Hash] opts the optional parameters
    # @return [Array<(AccessToken, Fixnum, Hash)>] AccessToken data, response status code and response headers
    def user_confirm_with_http_info(token, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_confirm ...'
      end
      # verify the required parameter 'token' is set
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling UserApi.user_confirm"
      end
      # resource path
      local_var_path = '/user/confirmEmail'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['token'] = token

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'AccessToken')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Confirm a withdrawal.
    # @param token 
    # @param [Hash] opts the optional parameters
    # @return [Transaction]
    def user_confirm_withdrawal(token, opts = {})
      data, _status_code, _headers = user_confirm_withdrawal_with_http_info(token, opts)
      data
    end

    # Confirm a withdrawal.
    # @param token 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Transaction, Fixnum, Hash)>] Transaction data, response status code and response headers
    def user_confirm_withdrawal_with_http_info(token, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_confirm_withdrawal ...'
      end
      # verify the required parameter 'token' is set
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling UserApi.user_confirm_withdrawal"
      end
      # resource path
      local_var_path = '/user/confirmWithdrawal'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['token'] = token

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Transaction')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_confirm_withdrawal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Creates a new sub-account.
    # @param account_name 
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def user_create_sub_account(account_name, opts = {})
      data, _status_code, _headers = user_create_sub_account_with_http_info(account_name, opts)
      data
    end

    # Creates a new sub-account.
    # @param account_name 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def user_create_sub_account_with_http_info(account_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_create_sub_account ...'
      end
      # verify the required parameter 'account_name' is set
      if @api_client.config.client_side_validation && account_name.nil?
        fail ArgumentError, "Missing the required parameter 'account_name' when calling UserApi.user_create_sub_account"
      end
      # resource path
      local_var_path = '/user/addSubaccount'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['accountName'] = account_name

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Object')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_create_sub_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create unstaking request
    # @param symbol 
    # @param amount 
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def user_create_unstaking_requests(symbol, amount, opts = {})
      data, _status_code, _headers = user_create_unstaking_requests_with_http_info(symbol, amount, opts)
      data
    end

    # Create unstaking request
    # @param symbol 
    # @param amount 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def user_create_unstaking_requests_with_http_info(symbol, amount, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_create_unstaking_requests ...'
      end
      # verify the required parameter 'symbol' is set
      if @api_client.config.client_side_validation && symbol.nil?
        fail ArgumentError, "Missing the required parameter 'symbol' when calling UserApi.user_create_unstaking_requests"
      end
      # verify the required parameter 'amount' is set
      if @api_client.config.client_side_validation && amount.nil?
        fail ArgumentError, "Missing the required parameter 'amount' when calling UserApi.user_create_unstaking_requests"
      end
      # resource path
      local_var_path = '/user/unstakingRequests'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['symbol'] = symbol
      form_params['amount'] = amount

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Object')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_create_unstaking_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Cancel unstaking request
    # @param redemption_id 
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def user_delete_unstaking_requests(redemption_id, opts = {})
      data, _status_code, _headers = user_delete_unstaking_requests_with_http_info(redemption_id, opts)
      data
    end

    # Cancel unstaking request
    # @param redemption_id 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def user_delete_unstaking_requests_with_http_info(redemption_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_delete_unstaking_requests ...'
      end
      # verify the required parameter 'redemption_id' is set
      if @api_client.config.client_side_validation && redemption_id.nil?
        fail ArgumentError, "Missing the required parameter 'redemption_id' when calling UserApi.user_delete_unstaking_requests"
      end
      # resource path
      local_var_path = '/user/unstakingRequests'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['redemptionID'] = redemption_id

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Object')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_delete_unstaking_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your user model.
    # @param [Hash] opts the optional parameters
    # @return [User]
    def user_get(opts = {})
      data, _status_code, _headers = user_get_with_http_info(opts)
      data
    end

    # Get your user model.
    # @param [Hash] opts the optional parameters
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def user_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get ...'
      end
      # resource path
      local_var_path = '/user'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'User')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your current affiliate/referral status.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot; (default to XBt)
    # @return [Affiliate]
    def user_get_affiliate_status(opts = {})
      data, _status_code, _headers = user_get_affiliate_status_with_http_info(opts)
      data
    end

    # Get your current affiliate/referral status.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot;
    # @return [Array<(Affiliate, Fixnum, Hash)>] Affiliate data, response status code and response headers
    def user_get_affiliate_status_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_affiliate_status ...'
      end
      # resource path
      local_var_path = '/user/affiliateStatus'

      # query parameters
      query_params = {}
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Affiliate')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_affiliate_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your account's commission status.
    # @param [Hash] opts the optional parameters
    # @return [UserCommissionsBySymbol]
    def user_get_commission(opts = {})
      data, _status_code, _headers = user_get_commission_with_http_info(opts)
      data
    end

    # Get your account&#39;s commission status.
    # @param [Hash] opts the optional parameters
    # @return [Array<(UserCommissionsBySymbol, Fixnum, Hash)>] UserCommissionsBySymbol data, response status code and response headers
    def user_get_commission_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_commission ...'
      end
      # resource path
      local_var_path = '/user/commission'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'UserCommissionsBySymbol')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_commission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your account's CSA status.
    # @param [Hash] opts the optional parameters
    # @return [CollateralSupportAgreement]
    def user_get_csa(opts = {})
      data, _status_code, _headers = user_get_csa_with_http_info(opts)
      data
    end

    # Get your account&#39;s CSA status.
    # @param [Hash] opts the optional parameters
    # @return [Array<(CollateralSupportAgreement, Fixnum, Hash)>] CollateralSupportAgreement data, response status code and response headers
    def user_get_csa_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_csa ...'
      end
      # resource path
      local_var_path = '/user/csa'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'CollateralSupportAgreement')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_csa\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get a deposit address.
    # @param currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param network The &#x60;network&#x60; parameter is used to indicate which blockchain you would like to deposit from. The acceptable value in the &#x60;network&#x60; parameter for each currency can be found from &#x60;networks.asset&#x60; from &#x60;GET /wallet/assets&#x60;.
    # @param [Hash] opts the optional parameters
    # @return [String]
    def user_get_deposit_address(currency, network, opts = {})
      data, _status_code, _headers = user_get_deposit_address_with_http_info(currency, network, opts)
      data
    end

    # Get a deposit address.
    # @param currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param network The &#x60;network&#x60; parameter is used to indicate which blockchain you would like to deposit from. The acceptable value in the &#x60;network&#x60; parameter for each currency can be found from &#x60;networks.asset&#x60; from &#x60;GET /wallet/assets&#x60;.
    # @param [Hash] opts the optional parameters
    # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
    def user_get_deposit_address_with_http_info(currency, network, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_deposit_address ...'
      end
      # verify the required parameter 'currency' is set
      if @api_client.config.client_side_validation && currency.nil?
        fail ArgumentError, "Missing the required parameter 'currency' when calling UserApi.user_get_deposit_address"
      end
      # verify the required parameter 'network' is set
      if @api_client.config.client_side_validation && network.nil?
        fail ArgumentError, "Missing the required parameter 'network' when calling UserApi.user_get_deposit_address"
      end
      # resource path
      local_var_path = '/user/depositAddress'

      # query parameters
      query_params = {}
      query_params[:'currency'] = currency
      query_params[:'network'] = network

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'String')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_deposit_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get a deposit address.
    # @param currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param network The &#x60;network&#x60; parameter is used to indicate which blockchain you would like to deposit from. The acceptable value in the &#x60;network&#x60; parameter for each currency can be found from &#x60;networks.asset&#x60; from &#x60;GET /wallet/assets&#x60;.
    # @param [Hash] opts the optional parameters
    # @return [DepositAddress]
    def user_get_deposit_address_information(currency, network, opts = {})
      data, _status_code, _headers = user_get_deposit_address_information_with_http_info(currency, network, opts)
      data
    end

    # Get a deposit address.
    # @param currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param network The &#x60;network&#x60; parameter is used to indicate which blockchain you would like to deposit from. The acceptable value in the &#x60;network&#x60; parameter for each currency can be found from &#x60;networks.asset&#x60; from &#x60;GET /wallet/assets&#x60;.
    # @param [Hash] opts the optional parameters
    # @return [Array<(DepositAddress, Fixnum, Hash)>] DepositAddress data, response status code and response headers
    def user_get_deposit_address_information_with_http_info(currency, network, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_deposit_address_information ...'
      end
      # verify the required parameter 'currency' is set
      if @api_client.config.client_side_validation && currency.nil?
        fail ArgumentError, "Missing the required parameter 'currency' when calling UserApi.user_get_deposit_address_information"
      end
      # verify the required parameter 'network' is set
      if @api_client.config.client_side_validation && network.nil?
        fail ArgumentError, "Missing the required parameter 'network' when calling UserApi.user_get_deposit_address_information"
      end
      # resource path
      local_var_path = '/user/depositAddressInformation'

      # query parameters
      query_params = {}
      query_params[:'currency'] = currency
      query_params[:'network'] = network

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'DepositAddress')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_deposit_address_information\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the execution history by day.
    # @param symbol 
    # @param timestamp 
    # @param [Hash] opts the optional parameters
    # @return [Array<Execution>]
    def user_get_execution_history(symbol, timestamp, opts = {})
      data, _status_code, _headers = user_get_execution_history_with_http_info(symbol, timestamp, opts)
      data
    end

    # Get the execution history by day.
    # @param symbol 
    # @param timestamp 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<Execution>, Fixnum, Hash)>] Array<Execution> data, response status code and response headers
    def user_get_execution_history_with_http_info(symbol, timestamp, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_execution_history ...'
      end
      # verify the required parameter 'symbol' is set
      if @api_client.config.client_side_validation && symbol.nil?
        fail ArgumentError, "Missing the required parameter 'symbol' when calling UserApi.user_get_execution_history"
      end
      # verify the required parameter 'timestamp' is set
      if @api_client.config.client_side_validation && timestamp.nil?
        fail ArgumentError, "Missing the required parameter 'timestamp' when calling UserApi.user_get_execution_history"
      end
      # resource path
      local_var_path = '/user/executionHistory'

      # query parameters
      query_params = {}
      query_params[:'symbol'] = symbol
      query_params[:'timestamp'] = timestamp

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<Execution>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_execution_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your account's margin status. Send a currency of \"all\" to receive an array of all supported currencies.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot; (default to XBt)
    # @return [Margin]
    def user_get_margin(opts = {})
      data, _status_code, _headers = user_get_margin_with_http_info(opts)
      data
    end

    # Get your account&#39;s margin status. Send a currency of \&quot;all\&quot; to receive an array of all supported currencies.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot;
    # @return [Array<(Margin, Fixnum, Hash)>] Margin data, response status code and response headers
    def user_get_margin_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_margin ...'
      end
      # resource path
      local_var_path = '/user/margin'

      # query parameters
      query_params = {}
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Margin')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_margin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get 7 days worth of Quote Fill Ratio statistics.
    # @param [Hash] opts the optional parameters
    # @option opts [Float] :target_account_id AccountId to get quote fill ratio for, must be a paired account with main user. Can be wildcard * to get all accounts linked to the authenticated user
    # @return [QuoteFillRatio]
    def user_get_quote_fill_ratio(opts = {})
      data, _status_code, _headers = user_get_quote_fill_ratio_with_http_info(opts)
      data
    end

    # Get 7 days worth of Quote Fill Ratio statistics.
    # @param [Hash] opts the optional parameters
    # @option opts [Float] :target_account_id AccountId to get quote fill ratio for, must be a paired account with main user. Can be wildcard * to get all accounts linked to the authenticated user
    # @return [Array<(QuoteFillRatio, Fixnum, Hash)>] QuoteFillRatio data, response status code and response headers
    def user_get_quote_fill_ratio_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_quote_fill_ratio ...'
      end
      # resource path
      local_var_path = '/user/quoteFillRatio'

      # query parameters
      query_params = {}
      query_params[:'targetAccountId'] = opts[:'target_account_id'] if !opts[:'target_account_id'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'QuoteFillRatio')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_quote_fill_ratio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get Quote Value Ratio statistics over the last 3 days
    # @param [Hash] opts the optional parameters
    # @option opts [Float] :target_account_id AccountId to get quote value ratio for, must be a paired account with main user. Can be wildcard * to get all accounts linked to the authenticated user
    # @return [QuoteValueRatio]
    def user_get_quote_value_ratio(opts = {})
      data, _status_code, _headers = user_get_quote_value_ratio_with_http_info(opts)
      data
    end

    # Get Quote Value Ratio statistics over the last 3 days
    # @param [Hash] opts the optional parameters
    # @option opts [Float] :target_account_id AccountId to get quote value ratio for, must be a paired account with main user. Can be wildcard * to get all accounts linked to the authenticated user
    # @return [Array<(QuoteValueRatio, Fixnum, Hash)>] QuoteValueRatio data, response status code and response headers
    def user_get_quote_value_ratio_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_quote_value_ratio ...'
      end
      # resource path
      local_var_path = '/user/quoteValueRatio'

      # query parameters
      query_params = {}
      query_params[:'targetAccountId'] = opts[:'target_account_id'] if !opts[:'target_account_id'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'QuoteValueRatio')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_quote_value_ratio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the current user staking amount.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency 
    # @return [Array<StakingRecord>]
    def user_get_staking(opts = {})
      data, _status_code, _headers = user_get_staking_with_http_info(opts)
      data
    end

    # Get the current user staking amount.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency 
    # @return [Array<(Array<StakingRecord>, Fixnum, Hash)>] Array<StakingRecord> data, response status code and response headers
    def user_get_staking_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_staking ...'
      end
      # resource path
      local_var_path = '/user/staking'

      # query parameters
      query_params = {}
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<StakingRecord>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_staking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # List staking instruments
    # @param [Hash] opts the optional parameters
    # @option opts [String] :symbol 
    # @option opts [String] :currency 
    # @return [Array<XAny>]
    def user_get_staking_instruments(opts = {})
      data, _status_code, _headers = user_get_staking_instruments_with_http_info(opts)
      data
    end

    # List staking instruments
    # @param [Hash] opts the optional parameters
    # @option opts [String] :symbol 
    # @option opts [String] :currency 
    # @return [Array<(Array<XAny>, Fixnum, Hash)>] Array<XAny> data, response status code and response headers
    def user_get_staking_instruments_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_staking_instruments ...'
      end
      # resource path
      local_var_path = '/user/staking/instruments'

      # query parameters
      query_params = {}
      query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<XAny>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_staking_instruments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # List staking tiers for a given currency
    # @param currency 
    # @param [Hash] opts the optional parameters
    # @return [Array<XAny>]
    def user_get_staking_tiers(currency, opts = {})
      data, _status_code, _headers = user_get_staking_tiers_with_http_info(currency, opts)
      data
    end

    # List staking tiers for a given currency
    # @param currency 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<XAny>, Fixnum, Hash)>] Array<XAny> data, response status code and response headers
    def user_get_staking_tiers_with_http_info(currency, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_staking_tiers ...'
      end
      # verify the required parameter 'currency' is set
      if @api_client.config.client_side_validation && currency.nil?
        fail ArgumentError, "Missing the required parameter 'currency' when calling UserApi.user_get_staking_tiers"
      end
      # resource path
      local_var_path = '/user/staking/tiers'

      # query parameters
      query_params = {}
      query_params[:'currency'] = currency

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<XAny>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_staking_tiers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your 30 days USD average trading volume
    # @param [Hash] opts the optional parameters
    # @return [Array<TradingVolume>]
    def user_get_trading_volume(opts = {})
      data, _status_code, _headers = user_get_trading_volume_with_http_info(opts)
      data
    end

    # Get your 30 days USD average trading volume
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<TradingVolume>, Fixnum, Hash)>] Array<TradingVolume> data, response status code and response headers
    def user_get_trading_volume_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_trading_volume ...'
      end
      # resource path
      local_var_path = '/user/tradingVolume'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<TradingVolume>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_trading_volume\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the current user unstaking requests
    # @param status 
    # @param [Hash] opts the optional parameters
    # @return [Array<StakingRecord>]
    def user_get_unstaking_requests(status, opts = {})
      data, _status_code, _headers = user_get_unstaking_requests_with_http_info(status, opts)
      data
    end

    # Get the current user unstaking requests
    # @param status 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<StakingRecord>, Fixnum, Hash)>] Array<StakingRecord> data, response status code and response headers
    def user_get_unstaking_requests_with_http_info(status, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_unstaking_requests ...'
      end
      # verify the required parameter 'status' is set
      if @api_client.config.client_side_validation && status.nil?
        fail ArgumentError, "Missing the required parameter 'status' when calling UserApi.user_get_unstaking_requests"
      end
      # resource path
      local_var_path = '/user/unstakingRequests'

      # query parameters
      query_params = {}
      query_params[:'status'] = status

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<StakingRecord>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_unstaking_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get your current wallet information.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot; (default to XBt)
    # @return [Wallet]
    def user_get_wallet(opts = {})
      data, _status_code, _headers = user_get_wallet_with_http_info(opts)
      data
    end

    # Get your current wallet information.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot;
    # @return [Array<(Wallet, Fixnum, Hash)>] Wallet data, response status code and response headers
    def user_get_wallet_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_wallet ...'
      end
      # resource path
      local_var_path = '/user/wallet'

      # query parameters
      query_params = {}
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Wallet')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot; (default to XBt)
    # @option opts [Float] :count Number of results to fetch. Fetch results from start to start + count. Max: 10,000 rows. (default to 10000)
    # @option opts [Float] :start Starting point for results, integer. Default 0. (default to 0)
    # @option opts [Float] :target_account_id AccountId to view the history of, must be a paired account with the authorised user requesting the history.
    # @option opts [BOOLEAN] :reverse Start from the latest transaction record. Default true. (default to true)
    # @return [Array<Transaction>]
    def user_get_wallet_history(opts = {})
      data, _status_code, _headers = user_get_wallet_history_with_http_info(opts)
      data
    end

    # Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot;
    # @option opts [Float] :count Number of results to fetch. Fetch results from start to start + count. Max: 10,000 rows.
    # @option opts [Float] :start Starting point for results, integer. Default 0.
    # @option opts [Float] :target_account_id AccountId to view the history of, must be a paired account with the authorised user requesting the history.
    # @option opts [BOOLEAN] :reverse Start from the latest transaction record. Default true.
    # @return [Array<(Array<Transaction>, Fixnum, Hash)>] Array<Transaction> data, response status code and response headers
    def user_get_wallet_history_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_wallet_history ...'
      end
      # resource path
      local_var_path = '/user/walletHistory'

      # query parameters
      query_params = {}
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
      query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
      query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
      query_params[:'targetAccountId'] = opts[:'target_account_id'] if !opts[:'target_account_id'].nil?
      query_params[:'reverse'] = opts[:'reverse'] if !opts[:'reverse'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<Transaction>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_wallet_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
    # Provides an aggregated view of transactions, by transaction type, over a specific time period.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot; (default to XBt)
    # @option opts [DateTime] :start_time Start time for the summary
    # @option opts [DateTime] :end_time End time for the summary
    # @return [Array<WalletSummaryRecord>]
    def user_get_wallet_summary(opts = {})
      data, _status_code, _headers = user_get_wallet_summary_with_http_info(opts)
      data
    end

    # Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
    # Provides an aggregated view of transactions, by transaction type, over a specific time period.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :currency Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;. For all currencies specify \&quot;all\&quot;
    # @option opts [DateTime] :start_time Start time for the summary
    # @option opts [DateTime] :end_time End time for the summary
    # @return [Array<(Array<WalletSummaryRecord>, Fixnum, Hash)>] Array<WalletSummaryRecord> data, response status code and response headers
    def user_get_wallet_summary_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_wallet_summary ...'
      end
      # resource path
      local_var_path = '/user/walletSummary'

      # query parameters
      query_params = {}
      query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
      query_params[:'startTime'] = opts[:'start_time'] if !opts[:'start_time'].nil?
      query_params[:'endTime'] = opts[:'end_time'] if !opts[:'end_time'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<WalletSummaryRecord>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_wallet_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get the list of accounts you can transfer funds between.
    # @param [Hash] opts the optional parameters
    # @return [Array<XAny>]
    def user_get_wallet_transfer_accounts(opts = {})
      data, _status_code, _headers = user_get_wallet_transfer_accounts_with_http_info(opts)
      data
    end

    # Get the list of accounts you can transfer funds between.
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<XAny>, Fixnum, Hash)>] Array<XAny> data, response status code and response headers
    def user_get_wallet_transfer_accounts_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_get_wallet_transfer_accounts ...'
      end
      # resource path
      local_var_path = '/user/getWalletTransferAccounts'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<XAny>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_get_wallet_transfer_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Log out of BitMEX.
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def user_logout(opts = {})
      user_logout_with_http_info(opts)
      nil
    end

    # Log out of BitMEX.
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def user_logout_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_logout ...'
      end
      # resource path
      local_var_path = '/user/logout'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Request a withdrawal to an external wallet.
    # This will send a confirmation email to the email address on record.
    # @param currency Currency you&#39;re withdrawing. Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param network The &#x60;network&#x60; parameter is used to indicate which blockchain you would like to withdraw from. The acceptable value in the &#x60;network&#x60; parameter for each currency can be found from &#x60;networks.asset&#x60; from &#x60;GET /wallet/assets&#x60;.
    # @param amount Amount of withdrawal currency.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :otp_token 2FA token. Required for all external withdrawals unless the address has skip2FA in addressbook.
    # @option opts [String] :address Destination Address. One of &#x60;address&#x60;, &#x60;addressId&#x60;, &#x60;targetUserId&#x60; has to be specified.
    # @option opts [String] :memo Destination Memo. If &#x60;address&#x60;, is specified, Destination Memo can also be specified
    # @option opts [Float] :address_id ID of the Destination Address. One of &#x60;address&#x60;, &#x60;addressId&#x60;, &#x60;targetUserId&#x60; has to be specified.
    # @option opts [Float] :target_user_id ID of the Target User. One of &#x60;address&#x60;, &#x60;addressId&#x60;, &#x60;targetUserId&#x60; has to be specified.
    # @option opts [Float] :fee Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email.
    # @option opts [String] :text Optional annotation, e.g. &#39;Transfer to home wallet&#39;.
    # @return [Transaction]
    def user_request_withdrawal(currency, network, amount, opts = {})
      data, _status_code, _headers = user_request_withdrawal_with_http_info(currency, network, amount, opts)
      data
    end

    # Request a withdrawal to an external wallet.
    # This will send a confirmation email to the email address on record.
    # @param currency Currency you&#39;re withdrawing. Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param network The &#x60;network&#x60; parameter is used to indicate which blockchain you would like to withdraw from. The acceptable value in the &#x60;network&#x60; parameter for each currency can be found from &#x60;networks.asset&#x60; from &#x60;GET /wallet/assets&#x60;.
    # @param amount Amount of withdrawal currency.
    # @param [Hash] opts the optional parameters
    # @option opts [String] :otp_token 2FA token. Required for all external withdrawals unless the address has skip2FA in addressbook.
    # @option opts [String] :address Destination Address. One of &#x60;address&#x60;, &#x60;addressId&#x60;, &#x60;targetUserId&#x60; has to be specified.
    # @option opts [String] :memo Destination Memo. If &#x60;address&#x60;, is specified, Destination Memo can also be specified
    # @option opts [Float] :address_id ID of the Destination Address. One of &#x60;address&#x60;, &#x60;addressId&#x60;, &#x60;targetUserId&#x60; has to be specified.
    # @option opts [Float] :target_user_id ID of the Target User. One of &#x60;address&#x60;, &#x60;addressId&#x60;, &#x60;targetUserId&#x60; has to be specified.
    # @option opts [Float] :fee Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email.
    # @option opts [String] :text Optional annotation, e.g. &#39;Transfer to home wallet&#39;.
    # @return [Array<(Transaction, Fixnum, Hash)>] Transaction data, response status code and response headers
    def user_request_withdrawal_with_http_info(currency, network, amount, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_request_withdrawal ...'
      end
      # verify the required parameter 'currency' is set
      if @api_client.config.client_side_validation && currency.nil?
        fail ArgumentError, "Missing the required parameter 'currency' when calling UserApi.user_request_withdrawal"
      end
      # verify the required parameter 'network' is set
      if @api_client.config.client_side_validation && network.nil?
        fail ArgumentError, "Missing the required parameter 'network' when calling UserApi.user_request_withdrawal"
      end
      # verify the required parameter 'amount' is set
      if @api_client.config.client_side_validation && amount.nil?
        fail ArgumentError, "Missing the required parameter 'amount' when calling UserApi.user_request_withdrawal"
      end
      # resource path
      local_var_path = '/user/requestWithdrawal'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['currency'] = currency
      form_params['network'] = network
      form_params['amount'] = amount
      form_params['otpToken'] = opts[:'otp_token'] if !opts[:'otp_token'].nil?
      form_params['address'] = opts[:'address'] if !opts[:'address'].nil?
      form_params['memo'] = opts[:'memo'] if !opts[:'memo'].nil?
      form_params['addressId'] = opts[:'address_id'] if !opts[:'address_id'].nil?
      form_params['targetUserId'] = opts[:'target_user_id'] if !opts[:'target_user_id'].nil?
      form_params['fee'] = opts[:'fee'] if !opts[:'fee'].nil?
      form_params['text'] = opts[:'text'] if !opts[:'text'].nil?

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Transaction')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_request_withdrawal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Save user preferences.
    # @param prefs 
    # @param [Hash] opts the optional parameters
    # @option opts [BOOLEAN] :overwrite If true, will overwrite all existing preferences. (default to false)
    # @return [User]
    def user_save_preferences(prefs, opts = {})
      data, _status_code, _headers = user_save_preferences_with_http_info(prefs, opts)
      data
    end

    # Save user preferences.
    # @param prefs 
    # @param [Hash] opts the optional parameters
    # @option opts [BOOLEAN] :overwrite If true, will overwrite all existing preferences.
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def user_save_preferences_with_http_info(prefs, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_save_preferences ...'
      end
      # verify the required parameter 'prefs' is set
      if @api_client.config.client_side_validation && prefs.nil?
        fail ArgumentError, "Missing the required parameter 'prefs' when calling UserApi.user_save_preferences"
      end
      # resource path
      local_var_path = '/user/preferences'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['prefs'] = prefs
      form_params['overwrite'] = opts[:'overwrite'] if !opts[:'overwrite'].nil?

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'User')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_save_preferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Updates the sub-account name.
    # @param target_account_id 
    # @param account_name 
    # @param [Hash] opts the optional parameters
    # @return [Object]
    def user_update_sub_account(target_account_id, account_name, opts = {})
      data, _status_code, _headers = user_update_sub_account_with_http_info(target_account_id, account_name, opts)
      data
    end

    # Updates the sub-account name.
    # @param target_account_id 
    # @param account_name 
    # @param [Hash] opts the optional parameters
    # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
    def user_update_sub_account_with_http_info(target_account_id, account_name, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_update_sub_account ...'
      end
      # verify the required parameter 'target_account_id' is set
      if @api_client.config.client_side_validation && target_account_id.nil?
        fail ArgumentError, "Missing the required parameter 'target_account_id' when calling UserApi.user_update_sub_account"
      end
      # verify the required parameter 'account_name' is set
      if @api_client.config.client_side_validation && account_name.nil?
        fail ArgumentError, "Missing the required parameter 'account_name' when calling UserApi.user_update_sub_account"
      end
      # resource path
      local_var_path = '/user/updateSubaccount'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['targetAccountId'] = target_account_id
      form_params['accountName'] = account_name

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Object')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_update_sub_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Execute a transfer to a paired account.
    # This will send a confirmation email to the email address on record.
    # @param currency Currency you&#39;re transfering. Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param amount Amount of transfer.
    # @param target_account_id AccountId to send the transfer to, must be a paired account with the user sending the transfer.
    # @param [Hash] opts the optional parameters
    # @option opts [Float] :from_account_id AccountID to send the transfer from. Must be paired account with the authenticated user.
    # @return [Transaction]
    def user_wallet_transfer(currency, amount, target_account_id, opts = {})
      data, _status_code, _headers = user_wallet_transfer_with_http_info(currency, amount, target_account_id, opts)
      data
    end

    # Execute a transfer to a paired account.
    # This will send a confirmation email to the email address on record.
    # @param currency Currency you&#39;re transfering. Any currency. For all currencies, see &lt;a href&#x3D;\&quot;#!/Wallet/Wallet_getAssetsConfig\&quot;&gt;asset config endpoint&lt;/a&gt;
    # @param amount Amount of transfer.
    # @param target_account_id AccountId to send the transfer to, must be a paired account with the user sending the transfer.
    # @param [Hash] opts the optional parameters
    # @option opts [Float] :from_account_id AccountID to send the transfer from. Must be paired account with the authenticated user.
    # @return [Array<(Transaction, Fixnum, Hash)>] Transaction data, response status code and response headers
    def user_wallet_transfer_with_http_info(currency, amount, target_account_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: UserApi.user_wallet_transfer ...'
      end
      # verify the required parameter 'currency' is set
      if @api_client.config.client_side_validation && currency.nil?
        fail ArgumentError, "Missing the required parameter 'currency' when calling UserApi.user_wallet_transfer"
      end
      # verify the required parameter 'amount' is set
      if @api_client.config.client_side_validation && amount.nil?
        fail ArgumentError, "Missing the required parameter 'amount' when calling UserApi.user_wallet_transfer"
      end
      # verify the required parameter 'target_account_id' is set
      if @api_client.config.client_side_validation && target_account_id.nil?
        fail ArgumentError, "Missing the required parameter 'target_account_id' when calling UserApi.user_wallet_transfer"
      end
      # resource path
      local_var_path = '/user/walletTransfer'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

      # form parameters
      form_params = {}
      form_params['currency'] = currency
      form_params['amount'] = amount
      form_params['targetAccountId'] = target_account_id
      form_params['fromAccountId'] = opts[:'from_account_id'] if !opts[:'from_account_id'].nil?

      # http body (model)
      post_body = nil
      auth_names = ['apiExpires', 'apiKey', 'apiSignature']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Transaction')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: UserApi#user_wallet_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
