Class: MtGox::Me

Inherits:
Client show all
Defined in:
lib/mtgox/me.rb

Instance Method Summary collapse

Methods inherited from Client

#depth, #ticker

Methods included from Request

#get, #post

Instance Method Details

#add(type, amount_int, price_int, currency = :usd) ⇒ Object

add a order



24
25
26
27
28
# File 'lib/mtgox/me.rb', line 24

def add(type, amount_int, price_int, currency=:usd)
  currency = currency_name(currency) 
  query = {type: type, amount_int: amount_int, price_int: price_int}
  post("https://mtgox.com/api/1/#{currency}/private/order/add", query)
end

#id_keyObject



7
8
9
# File 'lib/mtgox/me.rb', line 7

def id_key
  post("/api/1/generic/private/idkey")["return"]
end

#infoObject



3
4
5
# File 'lib/mtgox/me.rb', line 3

def info
  post("/api/1/generic/private/info?raw")
end

#ordersObject



11
12
13
14
15
# File 'lib/mtgox/me.rb', line 11

def orders
  post("https://mtgox.com/api/1/generic/private/orders?raw").map {|data|
    Order.new(data)
  }
end

#tradesObject



17
18
19
20
21
# File 'lib/mtgox/me.rb', line 17

def trades
  post("https://mtgox.com/api/1/generic/private/trades?raw").map { |data|
    Trade.new(data)
  }
end