diff --git a/lib/kraken_ruby/client.rb b/lib/kraken_ruby/client.rb index 4f2f37c..e3a978f 100644 --- a/lib/kraken_ruby/client.rb +++ b/lib/kraken_ruby/client.rb @@ -41,6 +41,11 @@ def order_book(pair, opts={}) get_public 'Depth', opts end + def ohlc(pair, opts={}) + opts['pair'] = pair + get_public2 'OHLC', opts + end + def trades(pair, opts={}) opts['pair'] = pair get_public 'Trades', opts @@ -58,6 +63,12 @@ def get_public(method, opts={}) hash[:result] end + def get_public2(method, opts={}) + url = @base_uri + '/' + @api_version + '/public/' + method + r = self.class.get(url, query: opts) + hash = JSON.parse(r.body) + end + ###################### ##### Private Data ### ######################