Class: StocksExchangeApiClient::PublicApiV3

Inherits:
Object
  • Object
show all
Defined in:
lib/stocks_exchange_api_client/public_v3.rb

Class Method Summary collapse

Class Method Details

.chart(currency_pair_id, time_start, time_end, params, candles_type) ⇒ Object



89
90
91
92
93
94
95
96
97
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 89

def chart(currency_pair_id, time_start, time_end, params, candles_type)
  url = "/public/chart/#{currency_pair_id}/#{candles_type.nil? ? '1' : candles_type}"
  params['timeStart'] = time_start
  params['timeEnd'] = time_end
  StocksExchangeApiClient.make_api_request_v3(url, params,
                                              :get,
                                              :url,
                                              false)
end

.currenciesObject



12
13
14
15
16
17
18
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 12

def currencies
  StocksExchangeApiClient.make_api_request_v3('/public/currencies',
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.currencies_by_id(currency_id) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 20

def currencies_by_id(currency_id)
  url = "/public/currencies/#{currency_id}"
  StocksExchangeApiClient.make_api_request_v3(url,
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.marketsObject



29
30
31
32
33
34
35
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 29

def markets
  StocksExchangeApiClient.make_api_request_v3('/public/markets',
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.orderbook_by_pair_id(id, params) ⇒ Object



81
82
83
84
85
86
87
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 81

def orderbook_by_pair_id(id, params)
  url = "/public/orderbook/#{id}"
  StocksExchangeApiClient.make_api_request_v3(url, params,
                                              :get,
                                              :url,
                                              false)
end

.pairs_list_by_code(code = 'ALL') ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 37

def pairs_list_by_code(code = 'ALL')
  url = "/public/currency_pairs/list/#{code}"
  StocksExchangeApiClient.make_api_request_v3(url,
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.pairs_list_by_id(id) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 46

def pairs_list_by_id(id)
  url = "/public/currency_pairs/#{id}"
  StocksExchangeApiClient.make_api_request_v3(url,
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.pingObject



4
5
6
7
8
9
10
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 4

def ping
  StocksExchangeApiClient.make_api_request_v3('/public/ping',
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.tickerObject



55
56
57
58
59
60
61
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 55

def ticker
  StocksExchangeApiClient.make_api_request_v3('/public/ticker',
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.ticker_by_pair_id(id) ⇒ Object



63
64
65
66
67
68
69
70
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 63

def ticker_by_pair_id(id)
  url = "/public/ticker/#{id}"
  StocksExchangeApiClient.make_api_request_v3(url,
                                              {},
                                              :get,
                                              :url,
                                              false)
end

.trades(currency_pair_id, params) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/stocks_exchange_api_client/public_v3.rb', line 72

def trades(currency_pair_id, params)
  url = "/public/trades/#{currency_pair_id}"
  StocksExchangeApiClient.make_api_request_v3(url,
                                              params,
                                              :get,
                                              :url,
                                              false)
end