Method: CoinSync::Importers::KucoinAPI::HistoryEntry#initialize

Defined in:
lib/coinsync/importers/kucoin_api.rb

#initialize(hash) ⇒ HistoryEntry

Returns a new instance of HistoryEntry.



24
25
26
27
28
29
30
31
32
# File 'lib/coinsync/importers/kucoin_api.rb', line 24

def initialize(hash)
  @created_at = Time.at(hash['createdAt'] / 1000)
  @amount = BigDecimal.new(hash['amount'], 0)
  @direction = hash['direction']
  @coin_type = CryptoCurrency.new(hash['coinType'])
  @coin_type_pair = CryptoCurrency.new(hash['coinTypePair'])
  @deal_value = BigDecimal.new(hash['dealValue'], 0)
  @fee = BigDecimal.new(hash['fee'], 0)
end