Skip to content

Commit

Permalink
Merge branch 'depth_chart' of github.com:colinreidbrown/bitstamp into…
Browse files Browse the repository at this point in the history
… depth_chart
  • Loading branch information
colinreidbrown committed Sep 30, 2013
2 parents 7846fc2 + 72bd33c commit bbe6ad9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/bitstamp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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!

Expand Down
10 changes: 10 additions & 0 deletions lib/bitstamp/transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bbe6ad9

Please sign in to comment.