Module: Bitopro::Order

Included in:
Client
Defined in:
lib/bitopro/api/order.rb

Instance Method Summary collapse

Instance Method Details

#cancel_order(pair: "", order_id: "") ⇒ Object

Example: client = Bitopro::Client.new client.cancel_order(pair: “bito_eth”, order_id: “3135725012”)



17
18
19
# File 'lib/bitopro/api/order.rb', line 17

def cancel_order(pair: "", order_id: "")
  authenticated_delete("/orders/#{pair}/#{order_id}")
end

#create_order(pair: "", action: "", amount: 0, price: 0, type: "limit") ⇒ Object

Example: client = Bitopro::Client.new client.create_order(pair: “bito_eth”, action: “buy”, amount: “600”, price: “0.000001”, type: “limit”)



6
7
8
9
10
11
12
# File 'lib/bitopro/api/order.rb', line 6

def create_order(pair: "", action: "", amount: 0, price: 0, type: "limit")
  authenticated_post("/orders/#{pair}", { body: { action: action,
                                                  amount: amount,
                                                  price: price,
                                                  timestamp: timestamp,
                                                  type: type }})
end

#get_order(pair: "", order_id: "") ⇒ Object



21
22
23
# File 'lib/bitopro/api/order.rb', line 21

def get_order(pair: "", order_id: "")
  authenticated_get("/orders/#{pair}/#{order_id}")
end