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")


36
37
38
39
40
41
42
43
# File 'lib/rest/v2/personal.rb', line 36

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


24
25
26
# File 'lib/rest/v2/personal.rb', line 24

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')


68
69
70
71
72
73
74
75
76
# File 'lib/rest/v2/personal.rb', line 68

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")


52
53
54
# File 'lib/rest/v2/personal.rb', line 52

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


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

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

#walletsObject

Get account wallets

@example:

client.wallets


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

def wallets
  authenticated_post("auth/r/wallets").body
end