class HexTokenBot::ChannelClient::BterClient

Attributes

client[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/hex_token_bot/channel_client/bter_client.rb, line 6
def initialize(options = {})
  @client = HexTokenBot::ChannelApi::Bter::Public.new
end

Public Instance Methods

get_market_order_book(market_code, asks_limit = nil , bids_limit = nil) click to toggle source
# File lib/hex_token_bot/channel_client/bter_client.rb, line 11
def get_market_order_book(market_code, asks_limit = nil , bids_limit = nil)
  rep = @client.order_book(market_code)
  rep
end
get_order_newest(market_code) click to toggle source
# File lib/hex_token_bot/channel_client/bter_client.rb, line 16
def get_order_newest(market_code)
  rep = @client.trade_history(market_code)
  if !rep.empty? and !rep[:data].nil?
    count = rep[:data].size
    rep[:data][count - 1]
  else
    []
  end
end