Class: Bitfinex::RESTv2

Inherits:
Object
  • Object
show all
Includes:
RESTClient, RESTv2Margin, RESTv2Personal, RESTv2Stats, RESTv2Ticker, RESTv2Trading, RESTv2Utils
Defined in:
lib/rest/v2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RESTv2Utils

#calc_avg_price

Methods included from RESTv2Trading

#active_positions, #books, #candles, #order_trades, #orders, #trades

Methods included from RESTv2Ticker

#ticker

Methods included from RESTv2Stats

#stats

Methods included from RESTv2Personal

#alert, #alerts, #available_balance, #delete_alert, #performance, #wallets

Methods included from RESTv2Margin

#funding_info, #margin_info, #offers

Methods included from RESTClient

#check_params

Constructor Details

#initialize(args = {}) ⇒ RESTv2

Returns a new instance of RESTv2.



23
24
25
26
27
28
29
30
31
32
# File 'lib/rest/v2.rb', line 23

def initialize(args = {})
  self.api_endpoint = args[:url] ? "#{args[:url]}/v2/" : "https://api.bitfinex.com/v2/"
  self.proxy = args[:proxy] || nil
  self.debug_connection = false
  self.api_version = 2
  self.rest_timeout = 30
  self.rest_open_timeout = 30
  self.api_key = args[:api_key]
  self.api_secret = args[:api_secret]
end

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



11
12
13
# File 'lib/rest/v2.rb', line 11

def api_endpoint
  @api_endpoint
end

#api_keyObject

Returns the value of attribute api_key.



13
14
15
# File 'lib/rest/v2.rb', line 13

def api_key
  @api_key
end

#api_secretObject

Returns the value of attribute api_secret.



13
14
15
# File 'lib/rest/v2.rb', line 13

def api_secret
  @api_secret
end

#api_versionObject

Returns the value of attribute api_version.



11
12
13
# File 'lib/rest/v2.rb', line 11

def api_version
  @api_version
end

#debugObject

Returns the value of attribute debug.



11
12
13
# File 'lib/rest/v2.rb', line 11

def debug
  @debug
end

#debug_connectionObject

Returns the value of attribute debug_connection.



11
12
13
# File 'lib/rest/v2.rb', line 11

def debug_connection
  @debug_connection
end

#proxyObject

Returns the value of attribute proxy.



12
13
14
# File 'lib/rest/v2.rb', line 12

def proxy
  @proxy
end

#rest_open_timeoutObject

Returns the value of attribute rest_open_timeout.



12
13
14
# File 'lib/rest/v2.rb', line 12

def rest_open_timeout
  @rest_open_timeout
end

#rest_timeoutObject

Returns the value of attribute rest_timeout.



12
13
14
# File 'lib/rest/v2.rb', line 12

def rest_timeout
  @rest_timeout
end

Instance Method Details

#configObject



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rest/v2.rb', line 34

def config
  {
    :api_endpoint => self.api_endpoint,
    :debug_connection => self.debug_connection,
    :api_version => self.api_version,
    :rest_timeout => self.rest_timeout,
    :rest_open_timeout => self.rest_open_timeout,
    :proxy => self.proxy,
    :api_key => self.api_key,
    :api_secret => self.api_secret
  }
end