Module: BitX

Extended by:
PrivateApi, PublicApi
Defined in:
lib/bitx.rb,
lib/version.rb

Defined Under Namespace

Modules: VERSION Classes: Configuration, Connection, Error

Class Method Summary collapse

Methods included from PublicApi

get, orderbook, ticker, tickers, trades

Methods included from PrivateApi

api_auth, authed_request, balance, balance_for, cancel_withdrawal, create_quote, discard_quote, exercise_quote, extract_quote_from_body, format_order_hash, funding_address, get_order, list_orders, new_receive_address, post_order, receive_address_request, received_by_address, send, stop_order, view_quote, withdraw, withdrawal, withdrawals

Class Method Details

.configurationObject



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

def self.configuration
  @configuration ||=  Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/bitx.rb', line 17

def self.configure
  yield(configuration) if block_given?
end

.connObject



31
32
33
34
35
36
# File 'lib/bitx.rb', line 31

def self.conn
  return @conn if @conn
  @conn = Faraday.new(url: 'https://api.mybitx.com')
  @conn.headers[:user_agent] = "bitx-ruby/#{BitX::VERSION::STRING}"
  @conn
end

.set_conn(conn = nil) ⇒ Object



27
28
29
# File 'lib/bitx.rb', line 27

def self.set_conn(conn=nil)
  @conn = conn || BitX.conn
end