Class: Fcoin::API

Inherits:
Object
  • Object
show all
Includes:
Connection, Endpoint, Request
Defined in:
lib/fcoin/api.rb

Direct Known Subclasses

Client

Instance Method Summary collapse

Methods included from Endpoint::Orders

#cancel_order, #create_order_limit, #order_list, #order_match_results, #reference_order

Methods included from Endpoint::Accounts

#accounts_balance

Methods included from Endpoint::Market

#market_candles, #market_depth, #market_ticker, #market_trades

Methods included from Endpoint::Public

#public_currencies, #public_server_time, #public_symbols

Methods included from Request

#delete, #get, #post, #put

Constructor Details

#initialize(options = {}) ⇒ API

Returns a new instance of API.

Options Hash (options):

  • :adapter(Faraday.default_adapter) (String)
  • :endpoint(https://api.fcoin.com/v2/) (String)

    REST API endpoint

  • :wss_endpoint(wss://api.fcoin.com/v2/ws) (String)

    Websocket endpoint

  • :user_agent (String)
  • :proxy(nil) (String)
  • :ca_path (String)
  • :ca_file (String)
  • :middlewares (Array<Faraday::Middleware>)

    request faraday middlewares

  • :api_key (String)
  • :secret_key (String)
  • :skip_validation(true) (Boolean)
  • :validation_setting_path (String)

    configuration file path for validation



28
29
30
31
32
33
# File 'lib/fcoin/api.rb', line 28

def initialize(options={})
  self.merged_options = Fcoin.options.merge(options)
  Configuration::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", merged_options[key])
  end
end

Instance Method Details

#realtimeFcoin::RealTime::Client

Build realtime client

See Also:



39
40
41
# File 'lib/fcoin/api.rb', line 39

def realtime
  RealTime::Client.new(merged_options)
end