Class: Peatio::MemberAPIv2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/peatio/member_api_v2/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(root_url, jwt) ⇒ Client

Returns a new instance of Client.



6
7
8
9
# File 'lib/peatio/member_api_v2/client.rb', line 6

def initialize(root_url, jwt)
  @root_api_url = root_url
  @jwt = jwt
end

Instance Method Details

#clear_orders(side) ⇒ Object



34
35
36
# File 'lib/peatio/member_api_v2/client.rb', line 34

def clear_orders(side)
  request(:post, "orders/clear?side=#{side}")
end

#delete_order(id) ⇒ Object



42
43
44
45
46
47
# File 'lib/peatio/member_api_v2/client.rb', line 42

def delete_order(id)
  body = {
    id: id
  }
  request(:post, 'order/delete', body)
end

#get_currency(currency) ⇒ Object



11
12
13
# File 'lib/peatio/member_api_v2/client.rb', line 11

def get_currency(currency)
  request(:get, "currencies/#{currency}")
end

#get_ticker(ticker) ⇒ Object



15
16
17
# File 'lib/peatio/member_api_v2/client.rb', line 15

def get_ticker(ticker)
  request(:get, "tickers/#{ticker}")
end

#new_order(market, side, volume, price, ord_type) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/peatio/member_api_v2/client.rb', line 23

def new_order(market, side, volume, price, ord_type)
  body = {
    market: market,
    side: side,
    volume: volume,
    price: price,
    ord_type: ord_type
  }
  request(:post, 'orders', body)
end

#orders(market) ⇒ Object



38
39
40
# File 'lib/peatio/member_api_v2/client.rb', line 38

def orders(market)
  request(:get, "orders?market=#{market}")
end

#profileObject



19
20
21
# File 'lib/peatio/member_api_v2/client.rb', line 19

def profile
  request(:get, 'members/me')
end