Sha256: 8e31868f05959a1a88aabdbce9f53ca524efde3f5a4730fea28b4b66563a499c

Contents?: true

Size: 948 Bytes

Versions: 9

Compression:

Stored size: 948 Bytes

Contents

module Bitstamp
  class UserTransactions < Bitstamp::Collection
    def all(options = {})
      # Default time delta to an hour
      options[:timedelta] = "3600" unless options[:timedelta]

      Bitstamp::Helper.parse_objects! Bitstamp::Net::post("/user_transactions", options).body_str, self.model
    end

    def find(order_id)
      all = self.all
      index = all.index {|order| order.id.to_i == order_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_str, self
    end

  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
bitstamp-rbtc-arbitrage-0.4.0 lib/bitstamp/transactions.rb
rbtc_arbitrage-2.3.0 bitstamp/lib/bitstamp/transactions.rb
rbtc_arbitrage-2.2.1 bitstamp/lib/bitstamp/transactions.rb
rbtc_arbitrage-2.2.0 bitstamp/lib/bitstamp/transactions.rb
rbtc_arbitrage-2.1.2 bitstamp/lib/bitstamp/transactions.rb
rbtc_arbitrage-2.1.1 bitstamp/lib/bitstamp/transactions.rb
rbtc_arbitrage-2.1.0 bitstamp/lib/bitstamp/transactions.rb
cgore-bitstamp-0.3.1 lib/bitstamp/transactions.rb
bitstamp-0.3.0 lib/bitstamp/transactions.rb