Class: Coinigy::Client

Inherits:
Object
  • Object
show all
Includes:
AccountData, AccountFunctions, MarketData
Defined in:
lib/coinigy/client.rb,
lib/coinigy/client/market_data.rb,
lib/coinigy/client/account_data.rb,
lib/coinigy/client/account_functions.rb

Overview

Client to connect to the specified coinigy api

Defined Under Namespace

Modules: AccountData, AccountFunctions, MarketData

Instance Method Summary collapse

Methods included from MarketData

#data, #exchanges, #markets, #ticker

Methods included from AccountFunctions

#activate_api_key, #activate_trading_key, #add_alert, #add_api_key, #add_order, #cancel_order, #delete_alert, #delete_api_key, #order_types, #refresh_balance, #save_notifications_preferences, #update_tickers, #update_user

Methods included from AccountData

#accounts, #activity, #alerts, #balance_history, #balances, #news_feed, #notifications, #orders, #user_info, #watch_list

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client



18
19
20
21
22
23
24
25
26
# File 'lib/coinigy/client.rb', line 18

def initialize(options = {})
  @headers = {
    'Content-Type': 'application/json',
    'X-API-KEY': options[:key] || '',
    'X-API-SECRET': options[:secret] || ''
  }
  @root = options[:root] || 'https://api.coinigy.com/api/v1'
  @last_request_timestamp = Time.now
end