Class: MBTC::API

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mbtc/api.rb

Class Method Summary collapse

Class Method Details

.orderbook(type = :btc) ⇒ HTTParty::Response

GET Orderbook request

Parameters:

  • type (Symbol) (defaults to: :btc)

    Tipo de request ‘:btc` ou `:ltc`

Returns:

  • (HTTParty::Response)

    Retorna as ofertas de compra e venda



31
32
33
34
35
36
37
38
39
40
# File 'lib/mbtc/api.rb', line 31

def self.orderbook( type = :btc )
  case type
  when :btc
    endpoint = '/orderbook/'
  when :ltc
    endpoint = '/orderbook_litecoin/'
  end

  get( endpoint )
end

.ticker(type = :btc) ⇒ HTTParty::Response

GET Ticker request

Parameters:

  • type (Symbol) (defaults to: :btc)

    Tipo de request ‘:btc` ou `:ltc`

Returns:

  • (HTTParty::Response)

    Retorna o ticker de preço



14
15
16
17
18
19
20
21
22
23
# File 'lib/mbtc/api.rb', line 14

def self.ticker( type = :btc )
  case type
  when :btc
    endpoint = '/ticker/'
  when :ltc
    endpoint = '/ticker_litecoin/'
  end

  get( endpoint )
end

.trades(type = :btc) ⇒ HTTParty::Response

GET Trades request

Parameters:

  • type (Symbol) (defaults to: :btc)

    Tipo de request ‘:btc` ou `:ltc`

Returns:

  • (HTTParty::Response)

    Retorna as negociações ou operações realizadas



48
49
50
51
52
53
54
55
56
57
# File 'lib/mbtc/api.rb', line 48

def self.trades( type = :btc )
  case type
  when :btc
    endpoint = '/trades/'
  when :ltc
    endpoint = '/trades_litecoin/'
  end

  get( endpoint )
end