Class: HexTokenBot::ChannelClient::BterClient
- Inherits:
-
Object
- Object
- HexTokenBot::ChannelClient::BterClient
- Defined in:
- lib/hex_token_bot/channel_client/bter_client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #get_market_order_book(market_code, asks_limit = nil, bids_limit = nil) ⇒ Object
- #get_order_newest(market_code) ⇒ Object
-
#initialize(options = {}) ⇒ BterClient
constructor
A new instance of BterClient.
Constructor Details
#initialize(options = {}) ⇒ BterClient
Returns a new instance of BterClient.
6 7 8 |
# File 'lib/hex_token_bot/channel_client/bter_client.rb', line 6 def initialize( = {}) @client = HexTokenBot::ChannelApi::Bter::Public.new end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/hex_token_bot/channel_client/bter_client.rb', line 4 def client @client end |
Instance Method Details
#get_market_order_book(market_code, asks_limit = nil, bids_limit = nil) ⇒ Object
11 12 13 14 |
# 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) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# 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 |