class ItBitSDK::Trading::FundingHistory

Public Instance Methods

history(wallet_id, opts = {}) click to toggle source
# File lib/it_bit_sdk/trading/funding_history.rb, line 7
def history(wallet_id, opts = {})
  params = {}
  %w(page per_page).each do |a|
    params[a.camelize(:lower)] = opts[a.to_sym].to_i if opts[a.to_sym]
  end

  response = send_request(:get, "/wallets/#{wallet_id}/funding_history", params)

  {
    total_number_of_records:  response['totalNumberOfRecords'].to_i,
    current_page_number:      response['currentPageNumber'].to_i,
    records_per_page:         response['recordsPerPage'].to_i,
    funding_history:          response['fundingHistory'].collect{|x| ::ItBitSDK::Trades::FundingHistory::new(params: x) }
  }
end