Class: ItBitSDK::Trading::FundingHistory

Inherits:
Base
  • Object
show all
Defined in:
lib/it_bit_sdk/trading/funding_history.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL

Instance Method Summary collapse

Methods inherited from Base

#next_nonce, #send_request, #timestamp

Instance Method Details

#history(wallet_id, opts = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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