Module: BittrexApi

Defined in:
lib/bittrex_api.rb,
lib/bittrex_api/version.rb

Defined Under Namespace

Classes: Configuration

Constant Summary collapse

VERSION =
"1.0.4"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



8
9
10
# File 'lib/bittrex_api.rb', line 8

def configuration
  @configuration
end

Class Method Details

.balance(currency) ⇒ Object



73
74
75
# File 'lib/bittrex_api.rb', line 73

def self.balance( currency )
   'getbalance', currency: currency
end

.balancesObject



69
70
71
# File 'lib/bittrex_api.rb', line 69

def self.balances
   'getbalances'
end

.buy_limit(currency_pair, quantity, rate) ⇒ Object



53
54
55
# File 'lib/bittrex_api.rb', line 53

def self.buy_limit( currency_pair, quantity, rate )
  get_market 'buylimit', market: currency_pair, quantity: quantity, rate: rate
end

.cancel(uuid) ⇒ Object



61
62
63
# File 'lib/bittrex_api.rb', line 61

def self.cancel( uuid )
  get_market 'cancel', uuid: uuid
end

.currenciesObject



29
30
31
# File 'lib/bittrex_api.rb', line 29

def self.currencies
  get_public 'getcurrencies'
end

.deposit_address(currency) ⇒ Object



77
78
79
# File 'lib/bittrex_api.rb', line 77

def self.deposit_address( currency )
   'getdepositaddress', currency: currency
end

.deposit_history(currency = nil) ⇒ Object



98
99
100
# File 'lib/bittrex_api.rb', line 98

def self.deposit_history( currency = nil )
   'getdeposithistory', currency: currency
end

.market_history(currency_pair) ⇒ Object



49
50
51
# File 'lib/bittrex_api.rb', line 49

def self.market_history( currency_pair )
  get_public 'getmarkethistory', market: currency_pair
end

.market_summariesObject



37
38
39
# File 'lib/bittrex_api.rb', line 37

def self.market_summaries
  get_public 'getmarketsummaries'
end

.market_summary(currency_pair) ⇒ Object



41
42
43
# File 'lib/bittrex_api.rb', line 41

def self.market_summary( currency_pair )
  get_public 'getmarketsummary', market: currency_pair
end

.marketsObject



25
26
27
# File 'lib/bittrex_api.rb', line 25

def self.markets
  get_public 'getmarkets'
end

.open_orders(currency_pair = nil) ⇒ Object



65
66
67
# File 'lib/bittrex_api.rb', line 65

def self.open_orders( currency_pair = nil )
  get_market 'getopenorders', market: currency_pair
end

.order(uuid) ⇒ Object



86
87
88
# File 'lib/bittrex_api.rb', line 86

def self.order( uuid )
   'getorder', uuid: uuid
end

.order_book(currency_pair, type = 'both', depth = 10) ⇒ Object



45
46
47
# File 'lib/bittrex_api.rb', line 45

def self.order_book( currency_pair, type = 'both', depth = 10 )
  get_public 'getorderbook', market: currency_pair, type: type, depth: depth
end

.order_history(currency_pair = nil) ⇒ Object



90
91
92
# File 'lib/bittrex_api.rb', line 90

def self.order_history( currency_pair = nil )
   'getorderhistory', market: currency_pair
end

.sell_limit(currency_pair, quantity, rate) ⇒ Object



57
58
59
# File 'lib/bittrex_api.rb', line 57

def self.sell_limit( currency_pair, quantity, rate )
  get_market 'selllimit', market: currency_pair, quantity: quantity, rate: rate
end

.setup {|@configuration| ... } ⇒ Object

Yields:



11
12
13
14
# File 'lib/bittrex_api.rb', line 11

def self.setup
  @configuration ||= Configuration.new
  yield( @configuration )
end

.ticker(currency_pair) ⇒ Object



33
34
35
# File 'lib/bittrex_api.rb', line 33

def self.ticker( currency_pair )
  get_public 'getticker', market: currency_pair
end

.withdraw(currency, quantity, address) ⇒ Object



81
82
83
84
# File 'lib/bittrex_api.rb', line 81

def self.withdraw( currency, quantity, address )
   'withdraw', currency: currency, quantity: quantity,
    address: address
end

.withdrawal_history(currency = nil) ⇒ Object



94
95
96
# File 'lib/bittrex_api.rb', line 94

def self.withdrawal_history( currency = nil )
   'getwithdrawalhistory', currency: currency
end