Module: Bitfinex::RESTv1HistoricalData

Included in:
RESTv1
Defined in:
lib/rest/v1/historical_data.rb

Instance Method Summary collapse

Instance Method Details

#history(currency = "usd", params = {}) ⇒ Array

View all of your balance ledger entries.

@example:

client.history

Parameters:

  • currency (string) (defaults to: "usd")

    (optional) Specify the currency, default “USD”

  • params (defaults to: {})

    :since [time] (optional) Return only the history after this timestamp.

  • params (defaults to: {})

    :until [time] (optional) Return only the history before this timestamp.

  • params (defaults to: {})

    :limit [int] (optional) Limit the number of entries to return. Default is 500.

  • params (defaults to: {})

    :wallet [string] (optional) Return only entries that took place in this wallet. Accepted inputs are: “trading”, “exchange”, “deposit”

Returns:

  • (Array)


14
15
16
17
18
# File 'lib/rest/v1/historical_data.rb', line 14

def history(currency="usd", params = {})
  check_params(params, %i{since until limit wallet})
  params.merge!({currency: currency})
  authenticated_post("history", params: params).body
end

#movements(currency = "usd", params = {}) ⇒ Array

View your past deposits/withdrawals.

@example:

client.movements

Parameters:

  • currency (string) (defaults to: "usd")

    (optional) Specify the currency, default “USD”

  • params (defaults to: {})

    :method (optional) The method of the deposit/withdrawal (can be “bitcoin”, “litecoin”, “darkcoin”, “wire”)

  • params (defaults to: {})

    :since (optional) Return only the history after this timestamp

  • params (defaults to: {})

    :until [time] (optional) Return only the history before this timestamp.

  • params (defaults to: {})

    :limit [int] (optional) Limit the number of entries to return. Default is 500.

Returns:

  • (Array)


30
31
32
33
34
# File 'lib/rest/v1/historical_data.rb', line 30

def movements(currency="usd", params = {})
  check_params(params, %i{method since until limit since_movement until_movement})
  params.merge!({currency: currency})
  authenticated_post("history/movements", params: params).body
end

#mytrades(symbol, params = {}) ⇒ Array

View your past trades.

@example:

client.mytrades

Parameters:

  • symbol

    The pair traded (BTCUSD, LTCUSD, LTCBTC)

  • params (defaults to: {})

    :until [time] (optional) Return only the history before this timestamp.

  • params (defaults to: {})

    :timestamp [time] (optional) Trades made before this timestamp won’t be returned

  • params (defaults to: {})

    :until [time] (optional) Trades made after this timestamp won’t be returned

  • params (defaults to: {})

    :limit_trades [int] Limit the number of trades returned. Default is 50.

  • params (defaults to: {})

    :reverse [int] Return trades in reverse order (the oldest comes first). Default is returning newest trades first.

Returns:

  • (Array)


47
48
49
50
51
# File 'lib/rest/v1/historical_data.rb', line 47

def mytrades(symbol, params = {})
  check_params(params, %i{until limit_trades reverse timestamp})
  params.merge!({symbol: symbol})
  authenticated_post("mytrades", params: params).body
end