From 72bd33c43c6fa23c8d4845fa6032d8c3531fa0ae Mon Sep 17 00:00:00 2001 From: colinreidbrown Date: Thu, 26 Sep 2013 22:23:02 -0500 Subject: [PATCH] added the transactions api depth chart --- lib/bitstamp.rb | 4 ++++ lib/bitstamp/transactions.rb | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/bitstamp.rb b/lib/bitstamp.rb index 37e15e3..1101b38 100644 --- a/lib/bitstamp.rb +++ b/lib/bitstamp.rb @@ -37,6 +37,10 @@ def self.user_transactions @@transactions ||= Bitstamp::UserTransactions.new end + def self.transactions + return Bitstamp::Transactions.from_api + end + def self.balance self.sanity_check! diff --git a/lib/bitstamp/transactions.rb b/lib/bitstamp/transactions.rb index 6c563db..7e9dbf2 100644 --- a/lib/bitstamp/transactions.rb +++ b/lib/bitstamp/transactions.rb @@ -24,4 +24,14 @@ def update(options={}) class UserTransaction < Bitstamp::Model attr_accessor :datetime, :id, :type, :usd, :btc, :fee, :order_id, :btc_usd end + + # adding in methods to pull the last public trades list + class Transactions < Bitstamp::Model + attr_accessor :date, :price, :tid, :amount + + def self.from_api + Bitstamp::Helper.parse_objects! Bitstamp::Net::get("/transactions").body_str, self + end + + end end