Module: Bitfinex::RESTv2Personal

Included in:
RESTv2
Defined in:
lib/rest/v2/personal.rb

Instance Method Summary collapse

Instance Method Details

#alert(price, symbol = "tBTCUSD", type = "price") ⇒ Object

Set a new alert

@example:

client.alert(3000, "tBTCUSD")

Parameters:

  • price
  • symbol (defaults to: "tBTCUSD")
  • type (defaults to: "price")


27
28
29
30
31
32
33
34
# File 'lib/rest/v2/personal.rb', line 27

def alert(price, symbol = "tBTCUSD", type = "price")
  params = {
    type: type,
    price: price,
    symbol: symbol
  }
  authenticated_post("auth/w/alert/set", params: params).body
end

#alerts(type = 'price') ⇒ Object

Get the list of alerts

@example:

client.alerts


15
16
17
# File 'lib/rest/v2/personal.rb', line 15

def alerts(type = 'price')
  authenticated_post("auth/r/alerts", params: {type: type}).body
end

#available_balance(rate, dir, type, symbol) ⇒ Object

@example:

client.available_balance(800, 1, 'EXCHANGE', 'tBTCUSD')


59
60
61
62
63
64
65
66
67
# File 'lib/rest/v2/personal.rb', line 59

def available_balance(rate, dir, type, symbol)
  params = {
    symbol: symbol,
    dir: dir,
    type: type,
    rate: rate
  }
  authenticated_post("auth/calc/order/avail", params: params).body
end

#delete_alert(price, symbol = "tBTCUSD") ⇒ Object

Delete an existing alert

@example:

client.delete_alert(3000, "tBTCUSD")

Parameters:

  • price
  • symbol (defaults to: "tBTCUSD")


43
44
45
# File 'lib/rest/v2/personal.rb', line 43

def delete_alert(price, symbol = "tBTCUSD")
  authenticated_post("auth/w/alert/price:#{symbol}:#{price}/del").body
end

#performanceObject

Get account historical daily performance

@example:

client.performance


7
8
9
# File 'lib/rest/v2/personal.rb', line 7

def performance
  authenticated_post("auth/r/stats/perf::1D/hist")
end