Sha256: 83fcc956aaa049e356cc15f0660d6c77341d9cdd6470b0ad5413f857e3296c8e

Contents?: true

Size: 841 Bytes

Versions: 7

Compression:

Stored size: 841 Bytes

Contents

module Bitstamp
  class UserTransactions < Bitstamp::Collection
    def all(options = {})
      Bitstamp::Helper.parse_objects! Bitstamp::Net.post("/user_transactions", options).body, self.model
    end

    def find(trans_id)
      all = self.all
      index = all.index {|trans| trans.id.to_i == trans_id}

      return all[index] if index
    end

    def create(options = {})
    end

    def update(options = {})
    end
  end

  class UserTransaction < Bitstamp::Model
    attr_accessor :datetime, :id, :type, :usd, :btc, :fee, :order_id, :btc_usd, :nonce
  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, self
    end

  end


end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bitstamp-2-0.7.1 lib/bitstamp/transactions.rb
bitstamp-2-0.7.0 lib/bitstamp/transactions.rb
bitstamp-2-0.6.0 lib/bitstamp/transactions.rb
bitstamp-2-0.5.0 lib/bitstamp/transactions.rb
bitstamp-2-0.4.4 lib/bitstamp/transactions.rb
bitstamp-2-0.4.2 lib/bitstamp/transactions.rb
bitstamp-2-0.4.1 lib/bitstamp/transactions.rb