automation-test 1.1 → 1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -12
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/api_helper.rb +2 -2
- data/lib/coin_gecko_apiv3/client.rb +125 -0
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/configuration.rb +5 -6
- data/lib/coin_gecko_apiv3/controllers/asset_platforms_controller.rb +29 -0
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/controllers/base_controller.rb +2 -2
- data/lib/coin_gecko_apiv3/controllers/categories_controller.rb +52 -0
- data/lib/coin_gecko_apiv3/controllers/coins_controller.rb +389 -0
- data/lib/coin_gecko_apiv3/controllers/companies_beta_controller.rb +35 -0
- data/lib/coin_gecko_apiv3/controllers/contract_controller.rb +119 -0
- data/lib/coin_gecko_apiv3/controllers/derivatives_controller.rb +112 -0
- data/lib/coin_gecko_apiv3/controllers/events_controller.rb +89 -0
- data/lib/coin_gecko_apiv3/controllers/exchange_rates_controller.rb +29 -0
- data/lib/coin_gecko_apiv3/controllers/exchanges_controller.rb +192 -0
- data/lib/coin_gecko_apiv3/controllers/finance_controller.rb +71 -0
- data/lib/coin_gecko_apiv3/controllers/global_controller.rb +29 -0
- data/lib/coin_gecko_apiv3/controllers/indexes_controller.rb +79 -0
- data/lib/coin_gecko_apiv3/controllers/ping_controller.rb +29 -0
- data/lib/coin_gecko_apiv3/controllers/simple_controller.rb +126 -0
- data/lib/coin_gecko_apiv3/controllers/status_updates_controller.rb +48 -0
- data/lib/coin_gecko_apiv3/controllers/trending_controller.rb +30 -0
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/exceptions/api_exception.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/faraday_client.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_call_back.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_client.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_method_enum.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_request.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/http/http_response.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/models/base_model.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/utilities/date_time_helper.rb +2 -2
- data/lib/{apimatic_calculator → coin_gecko_apiv3}/utilities/file_wrapper.rb +2 -2
- data/lib/coin_gecko_apiv3.rb +52 -0
- data/test/controllers/controller_test_base.rb +3 -3
- data/test/controllers/test_asset_platforms_controller.rb +25 -0
- data/test/controllers/test_categories_controller.rb +37 -0
- data/test/controllers/test_coins_controller.rb +27 -0
- data/test/controllers/test_derivatives_controller.rb +51 -0
- data/test/controllers/test_events_controller.rb +55 -0
- data/test/controllers/test_exchange_rates_controller.rb +26 -0
- data/test/controllers/test_exchanges_controller.rb +38 -0
- data/test/controllers/test_finance_controller.rb +43 -0
- data/test/controllers/test_global_controller.rb +26 -0
- data/test/controllers/test_indexes_controller.rb +38 -0
- data/test/controllers/test_ping_controller.rb +26 -0
- data/test/controllers/test_simple_controller.rb +25 -0
- data/test/controllers/test_status_updates_controller.rb +31 -0
- data/test/controllers/test_trending_controller.rb +25 -0
- data/test/http_response_catcher.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +49 -22
- data/lib/apimatic_calculator/client.rb +0 -35
- data/lib/apimatic_calculator/controllers/simple_calculator_controller.rb +0 -45
- data/lib/apimatic_calculator/models/operation_type_enum.rb +0 -23
- data/lib/apimatic_calculator.rb +0 -38
- data/test/controllers/test_simple_calculator_controller.rb +0 -34
@@ -0,0 +1,389 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# CoinsController
|
8
|
+
class CoinsController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Use this to obtain all the coins' id in order to make API calls
|
14
|
+
# @param [Boolean] include_platform Optional parameter: flag to include
|
15
|
+
# platform contract addresses (eg. 0x.... for Ethereum based tokens).
|
16
|
+
# valid values: true, false
|
17
|
+
# @return [void] response from the API call
|
18
|
+
def listallsupportedcoinsid_nameandsymbol_nopaginationrequired(include_platform: nil)
|
19
|
+
# Prepare query url.
|
20
|
+
_query_builder = config.get_base_uri
|
21
|
+
_query_builder << '/coins/list'
|
22
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
23
|
+
_query_builder,
|
24
|
+
'include_platform' => include_platform
|
25
|
+
)
|
26
|
+
_query_url = APIHelper.clean_url _query_builder
|
27
|
+
|
28
|
+
# Prepare and execute HttpRequest.
|
29
|
+
_request = config.http_client.get(
|
30
|
+
_query_url
|
31
|
+
)
|
32
|
+
_response = execute_request(_request)
|
33
|
+
validate_response(_response)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Use this to obtain all the coins market data (price, market cap, volume)
|
37
|
+
# @param [String] vs_currency Required parameter: The target currency of
|
38
|
+
# market data (usd, eur, jpy, etc.)
|
39
|
+
# @param [String] ids Optional parameter: The ids of the coin, comma
|
40
|
+
# separated crytocurrency symbols (base). refers to `/coins/list`. <b>When
|
41
|
+
# left empty, returns numbers the coins observing the params `limit` and
|
42
|
+
# `start`</b>
|
43
|
+
# @param [String] category Optional parameter: filter by coin category.
|
44
|
+
# Refer to /coin/categories/list
|
45
|
+
# @param [String] order Optional parameter: valid values:
|
46
|
+
# <b>market_cap_desc, gecko_desc, gecko_asc, market_cap_asc,
|
47
|
+
# market_cap_desc, volume_asc, volume_desc, id_asc, id_desc</b> sort results
|
48
|
+
# by field.
|
49
|
+
# @param [Integer] per_page Optional parameter: valid values: 1..250 Total
|
50
|
+
# results per page
|
51
|
+
# @param [Integer] page Optional parameter: Page through results
|
52
|
+
# @param [Boolean] sparkline Optional parameter: Include sparkline 7 days
|
53
|
+
# data (eg. true, false)
|
54
|
+
# @param [String] price_change_percentage Optional parameter: Include price
|
55
|
+
# change percentage in <b>1h, 24h, 7d, 14d, 30d, 200d, 1y</b> (eg.
|
56
|
+
# '`1h,24h,7d`' comma-separated, invalid values will be discarded)
|
57
|
+
# @return [void] response from the API call
|
58
|
+
def listallsupportedcoinsprice_marketcap_volume_andmarketrelateddata(vs_currency,
|
59
|
+
ids: nil,
|
60
|
+
category: nil,
|
61
|
+
order: 'market_cap_desc',
|
62
|
+
per_page: 100,
|
63
|
+
page: 1,
|
64
|
+
sparkline: false,
|
65
|
+
price_change_percentage: nil)
|
66
|
+
# Prepare query url.
|
67
|
+
_query_builder = config.get_base_uri
|
68
|
+
_query_builder << '/coins/markets'
|
69
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
70
|
+
_query_builder,
|
71
|
+
'vs_currency' => vs_currency,
|
72
|
+
'ids' => ids,
|
73
|
+
'category' => category,
|
74
|
+
'order' => order,
|
75
|
+
'per_page' => per_page,
|
76
|
+
'page' => page,
|
77
|
+
'sparkline' => sparkline,
|
78
|
+
'price_change_percentage' => price_change_percentage
|
79
|
+
)
|
80
|
+
_query_url = APIHelper.clean_url _query_builder
|
81
|
+
|
82
|
+
# Prepare and execute HttpRequest.
|
83
|
+
_request = config.http_client.get(
|
84
|
+
_query_url
|
85
|
+
)
|
86
|
+
_response = execute_request(_request)
|
87
|
+
validate_response(_response)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Get current data (name, price, market, ... including exchange tickers) for
|
91
|
+
# a coin.<br><br> **IMPORTANT**:
|
92
|
+
# Ticker object is limited to 100 items, to get more tickers, use
|
93
|
+
# `/coins/{id}/tickers`
|
94
|
+
# Ticker `is_stale` is true when ticker that has not been updated/unchanged
|
95
|
+
# from the exchange for a while.
|
96
|
+
# Ticker `is_anomaly` is true if ticker's price is outliered by our system.
|
97
|
+
# You are responsible for managing how you want to display these
|
98
|
+
# information (e.g. footnote, different background, change opacity, hide)
|
99
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
100
|
+
# from /coins) eg. bitcoin
|
101
|
+
# @param [String] localization Optional parameter: Include all localized
|
102
|
+
# languages in response (true/false) <b>[default: true]</b>
|
103
|
+
# @param [Boolean] tickers Optional parameter: Include tickers data
|
104
|
+
# (true/false) <b>[default: true]</b>
|
105
|
+
# @param [Boolean] market_data Optional parameter: Include market_data
|
106
|
+
# (true/false) <b>[default: true]</b>
|
107
|
+
# @param [Boolean] community_data Optional parameter: Include community_data
|
108
|
+
# data (true/false) <b>[default: true]</b>
|
109
|
+
# @param [Boolean] developer_data Optional parameter: Include developer_data
|
110
|
+
# data (true/false) <b>[default: true]</b>
|
111
|
+
# @param [Boolean] sparkline Optional parameter: Include sparkline 7 days
|
112
|
+
# data (eg. true, false) <b>[default: false]</b>
|
113
|
+
# @return [void] response from the API call
|
114
|
+
def getcurrentdata_name_price_market_includingexchangetickers_foracoin(id,
|
115
|
+
localization: nil,
|
116
|
+
tickers: nil,
|
117
|
+
market_data: nil,
|
118
|
+
community_data: nil,
|
119
|
+
developer_data: nil,
|
120
|
+
sparkline: nil)
|
121
|
+
# Prepare query url.
|
122
|
+
_query_builder = config.get_base_uri
|
123
|
+
_query_builder << '/coins/{id}'
|
124
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
125
|
+
_query_builder,
|
126
|
+
'id' => { 'value' => id, 'encode' => true }
|
127
|
+
)
|
128
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
129
|
+
_query_builder,
|
130
|
+
'localization' => localization,
|
131
|
+
'tickers' => tickers,
|
132
|
+
'market_data' => market_data,
|
133
|
+
'community_data' => community_data,
|
134
|
+
'developer_data' => developer_data,
|
135
|
+
'sparkline' => sparkline
|
136
|
+
)
|
137
|
+
_query_url = APIHelper.clean_url _query_builder
|
138
|
+
|
139
|
+
# Prepare and execute HttpRequest.
|
140
|
+
_request = config.http_client.get(
|
141
|
+
_query_url
|
142
|
+
)
|
143
|
+
_response = execute_request(_request)
|
144
|
+
validate_response(_response)
|
145
|
+
end
|
146
|
+
|
147
|
+
# Get coin tickers (paginated to 100 items)<br><br> **IMPORTANT**:
|
148
|
+
# Ticker `is_stale` is true when ticker that has not been updated/unchanged
|
149
|
+
# from the exchange for a while.
|
150
|
+
# Ticker `is_anomaly` is true if ticker's price is outliered by our system.
|
151
|
+
# You are responsible for managing how you want to display these
|
152
|
+
# information (e.g. footnote, different background, change opacity, hide)
|
153
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
154
|
+
# from /coins/list) eg. bitcoin
|
155
|
+
# @param [String] exchange_ids Optional parameter: filter results by
|
156
|
+
# exchange_ids (ref: v3/exchanges/list)
|
157
|
+
# @param [String] include_exchange_logo Optional parameter: flag to show
|
158
|
+
# exchange_logo
|
159
|
+
# @param [Integer] page Optional parameter: Page through results
|
160
|
+
# @param [String] order Optional parameter: valid values:
|
161
|
+
# <b>trust_score_desc (default), trust_score_asc and volume_desc</b>
|
162
|
+
# @param [String] depth Optional parameter: flag to show 2% orderbook depth.
|
163
|
+
# valid values: true, false
|
164
|
+
# @return [void] response from the API call
|
165
|
+
def getcointickers_paginatedto100items(id,
|
166
|
+
exchange_ids: nil,
|
167
|
+
include_exchange_logo: nil,
|
168
|
+
page: nil,
|
169
|
+
order: nil,
|
170
|
+
depth: nil)
|
171
|
+
# Prepare query url.
|
172
|
+
_query_builder = config.get_base_uri
|
173
|
+
_query_builder << '/coins/{id}/tickers'
|
174
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
175
|
+
_query_builder,
|
176
|
+
'id' => { 'value' => id, 'encode' => true }
|
177
|
+
)
|
178
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
179
|
+
_query_builder,
|
180
|
+
'exchange_ids' => exchange_ids,
|
181
|
+
'include_exchange_logo' => include_exchange_logo,
|
182
|
+
'page' => page,
|
183
|
+
'order' => order,
|
184
|
+
'depth' => depth
|
185
|
+
)
|
186
|
+
_query_url = APIHelper.clean_url _query_builder
|
187
|
+
|
188
|
+
# Prepare and execute HttpRequest.
|
189
|
+
_request = config.http_client.get(
|
190
|
+
_query_url
|
191
|
+
)
|
192
|
+
_response = execute_request(_request)
|
193
|
+
validate_response(_response)
|
194
|
+
end
|
195
|
+
|
196
|
+
# Get historical data (name, price, market, stats) at a given date for a
|
197
|
+
# coin
|
198
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
199
|
+
# from /coins) eg. bitcoin
|
200
|
+
# @param [String] date Required parameter: The date of data snapshot in
|
201
|
+
# dd-mm-yyyy eg. 30-12-2017
|
202
|
+
# @param [String] localization Optional parameter: Set to false to exclude
|
203
|
+
# localized languages in response
|
204
|
+
# @return [void] response from the API call
|
205
|
+
def gethistoricaldata_name_price_market_stats_atagivendateforacoin(id,
|
206
|
+
date,
|
207
|
+
localization: nil)
|
208
|
+
# Prepare query url.
|
209
|
+
_query_builder = config.get_base_uri
|
210
|
+
_query_builder << '/coins/{id}/history'
|
211
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
212
|
+
_query_builder,
|
213
|
+
'id' => { 'value' => id, 'encode' => true }
|
214
|
+
)
|
215
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
216
|
+
_query_builder,
|
217
|
+
'date' => date,
|
218
|
+
'localization' => localization
|
219
|
+
)
|
220
|
+
_query_url = APIHelper.clean_url _query_builder
|
221
|
+
|
222
|
+
# Prepare and execute HttpRequest.
|
223
|
+
_request = config.http_client.get(
|
224
|
+
_query_url
|
225
|
+
)
|
226
|
+
_response = execute_request(_request)
|
227
|
+
validate_response(_response)
|
228
|
+
end
|
229
|
+
|
230
|
+
# Get historical market data include price, market cap, and 24h volume
|
231
|
+
# (granularity auto)
|
232
|
+
# <b>Minutely data will be used for duration within 1 day, Hourly data will
|
233
|
+
# be used for duration between 1 day and 90 days, Daily data will be used
|
234
|
+
# for duration above 90 days.</b>
|
235
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
236
|
+
# from /coins) eg. bitcoin
|
237
|
+
# @param [String] vs_currency Required parameter: The target currency of
|
238
|
+
# market data (usd, eur, jpy, etc.)
|
239
|
+
# @param [String] days Required parameter: Data up to number of days ago
|
240
|
+
# (eg. 1,14,30,max)
|
241
|
+
# @param [String] interval Optional parameter: Data interval. Possible
|
242
|
+
# value: daily
|
243
|
+
# @return [void] response from the API call
|
244
|
+
def gethistoricalmarketdataincludeprice_marketcap_and24hvolume_granularityauto(id,
|
245
|
+
vs_currency,
|
246
|
+
days,
|
247
|
+
interval: nil)
|
248
|
+
# Prepare query url.
|
249
|
+
_query_builder = config.get_base_uri
|
250
|
+
_query_builder << '/coins/{id}/market_chart'
|
251
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
252
|
+
_query_builder,
|
253
|
+
'id' => { 'value' => id, 'encode' => true }
|
254
|
+
)
|
255
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
256
|
+
_query_builder,
|
257
|
+
'vs_currency' => vs_currency,
|
258
|
+
'days' => days,
|
259
|
+
'interval' => interval
|
260
|
+
)
|
261
|
+
_query_url = APIHelper.clean_url _query_builder
|
262
|
+
|
263
|
+
# Prepare and execute HttpRequest.
|
264
|
+
_request = config.http_client.get(
|
265
|
+
_query_url
|
266
|
+
)
|
267
|
+
_response = execute_request(_request)
|
268
|
+
validate_response(_response)
|
269
|
+
end
|
270
|
+
|
271
|
+
# Get historical market data include price, market cap, and 24h volume
|
272
|
+
# within a range of timestamp (granularity auto)
|
273
|
+
# <b><ul><li>Data granularity is automatic (cannot be adjusted)</li><li>1
|
274
|
+
# day from query time = 5 minute interval data</li><li>1 - 90 days from
|
275
|
+
# query time = hourly data</li><li>above 90 days from query time = daily
|
276
|
+
# data (00:00 UTC)</li></ul> </b>
|
277
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
278
|
+
# from /coins) eg. bitcoin
|
279
|
+
# @param [String] vs_currency Required parameter: The target currency of
|
280
|
+
# market data (usd, eur, jpy, etc.)
|
281
|
+
# @param [String] from Required parameter: From date in UNIX Timestamp (eg.
|
282
|
+
# 1392577232)
|
283
|
+
# @param [String] to Required parameter: To date in UNIX Timestamp (eg.
|
284
|
+
# 1422577232)
|
285
|
+
# @return [void] response from the API call
|
286
|
+
def gethistoricalmarketdataincludeprice_marketcap_and24hvolumewithinarangeoftimestamp_granularityauto(id,
|
287
|
+
vs_currency,
|
288
|
+
from,
|
289
|
+
to)
|
290
|
+
# Prepare query url.
|
291
|
+
_query_builder = config.get_base_uri
|
292
|
+
_query_builder << '/coins/{id}/market_chart/range'
|
293
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
294
|
+
_query_builder,
|
295
|
+
'id' => { 'value' => id, 'encode' => true }
|
296
|
+
)
|
297
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
298
|
+
_query_builder,
|
299
|
+
'vs_currency' => vs_currency,
|
300
|
+
'from' => from,
|
301
|
+
'to' => to
|
302
|
+
)
|
303
|
+
_query_url = APIHelper.clean_url _query_builder
|
304
|
+
|
305
|
+
# Prepare and execute HttpRequest.
|
306
|
+
_request = config.http_client.get(
|
307
|
+
_query_url
|
308
|
+
)
|
309
|
+
_response = execute_request(_request)
|
310
|
+
validate_response(_response)
|
311
|
+
end
|
312
|
+
|
313
|
+
# Get status updates for a given coin
|
314
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
315
|
+
# from /coins) eg. bitcoin
|
316
|
+
# @param [Integer] per_page Optional parameter: Total results per page
|
317
|
+
# @param [Integer] page Optional parameter: Page through results
|
318
|
+
# @return [void] response from the API call
|
319
|
+
def getstatusupdatesforagivencoin(id,
|
320
|
+
per_page: nil,
|
321
|
+
page: nil)
|
322
|
+
# Prepare query url.
|
323
|
+
_query_builder = config.get_base_uri
|
324
|
+
_query_builder << '/coins/{id}/status_updates'
|
325
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
326
|
+
_query_builder,
|
327
|
+
'id' => { 'value' => id, 'encode' => true }
|
328
|
+
)
|
329
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
330
|
+
_query_builder,
|
331
|
+
'per_page' => per_page,
|
332
|
+
'page' => page
|
333
|
+
)
|
334
|
+
_query_url = APIHelper.clean_url _query_builder
|
335
|
+
|
336
|
+
# Prepare and execute HttpRequest.
|
337
|
+
_request = config.http_client.get(
|
338
|
+
_query_url
|
339
|
+
)
|
340
|
+
_response = execute_request(_request)
|
341
|
+
validate_response(_response)
|
342
|
+
end
|
343
|
+
|
344
|
+
# Candle's body:
|
345
|
+
# 1 - 2 days: 30 minutes
|
346
|
+
# 3 - 30 days: 4 hours
|
347
|
+
# 31 and before: 4 days
|
348
|
+
# @param [String] id Required parameter: pass the coin id (can be obtained
|
349
|
+
# from /coins/list) eg. bitcoin
|
350
|
+
# @param [String] vs_currency Required parameter: The target currency of
|
351
|
+
# market data (usd, eur, jpy, etc.)
|
352
|
+
# @param [Integer] days Required parameter: Data up to number of days ago
|
353
|
+
# (1/7/14/30/90/180/365/max)
|
354
|
+
# @return [List of Float] response from the API call
|
355
|
+
def getcoin_s_ohlc(id,
|
356
|
+
vs_currency,
|
357
|
+
days)
|
358
|
+
# Prepare query url.
|
359
|
+
_query_builder = config.get_base_uri
|
360
|
+
_query_builder << '/coins/{id}/ohlc'
|
361
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
362
|
+
_query_builder,
|
363
|
+
'id' => { 'value' => id, 'encode' => true }
|
364
|
+
)
|
365
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
366
|
+
_query_builder,
|
367
|
+
'vs_currency' => vs_currency,
|
368
|
+
'days' => days
|
369
|
+
)
|
370
|
+
_query_url = APIHelper.clean_url _query_builder
|
371
|
+
|
372
|
+
# Prepare headers.
|
373
|
+
_headers = {
|
374
|
+
'accept' => 'application/json'
|
375
|
+
}
|
376
|
+
|
377
|
+
# Prepare and execute HttpRequest.
|
378
|
+
_request = config.http_client.get(
|
379
|
+
_query_url,
|
380
|
+
headers: _headers
|
381
|
+
)
|
382
|
+
_response = execute_request(_request)
|
383
|
+
validate_response(_response)
|
384
|
+
|
385
|
+
# Return appropriate response type.
|
386
|
+
APIHelper.json_deserialize(_response.raw_body)
|
387
|
+
end
|
388
|
+
end
|
389
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# CompaniesBetaController
|
8
|
+
class CompaniesBetaController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Get public companies bitcoin or ethereum holdings (Ordered by total
|
14
|
+
# holdings descending)
|
15
|
+
# @param [String] coin_id Required parameter: bitcoin or ethereum
|
16
|
+
# @return [void] response from the API call
|
17
|
+
def getpubliccompaniesdata(coin_id)
|
18
|
+
# Prepare query url.
|
19
|
+
_query_builder = config.get_base_uri
|
20
|
+
_query_builder << '/companies/public_treasury/{coin_id}'
|
21
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
22
|
+
_query_builder,
|
23
|
+
'coin_id' => { 'value' => coin_id, 'encode' => true }
|
24
|
+
)
|
25
|
+
_query_url = APIHelper.clean_url _query_builder
|
26
|
+
|
27
|
+
# Prepare and execute HttpRequest.
|
28
|
+
_request = config.http_client.get(
|
29
|
+
_query_url
|
30
|
+
)
|
31
|
+
_response = execute_request(_request)
|
32
|
+
validate_response(_response)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# ContractController
|
8
|
+
class ContractController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Get coin info from contract address
|
14
|
+
# @param [String] id Required parameter: Asset platform (See asset_platforms
|
15
|
+
# endpoint for list of options)
|
16
|
+
# @param [String] contract_address Required parameter: Token's contract
|
17
|
+
# address
|
18
|
+
# @return [void] response from the API call
|
19
|
+
def getcoininfofromcontractaddress(id,
|
20
|
+
contract_address)
|
21
|
+
# Prepare query url.
|
22
|
+
_query_builder = config.get_base_uri
|
23
|
+
_query_builder << '/coins/{id}/contract/{contract_address}'
|
24
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
25
|
+
_query_builder,
|
26
|
+
'id' => { 'value' => id, 'encode' => true },
|
27
|
+
'contract_address' => { 'value' => contract_address, 'encode' => true }
|
28
|
+
)
|
29
|
+
_query_url = APIHelper.clean_url _query_builder
|
30
|
+
|
31
|
+
# Prepare and execute HttpRequest.
|
32
|
+
_request = config.http_client.get(
|
33
|
+
_query_url
|
34
|
+
)
|
35
|
+
_response = execute_request(_request)
|
36
|
+
validate_response(_response)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Get historical market data include price, market cap, and 24h volume
|
40
|
+
# (granularity auto)
|
41
|
+
# @param [String] id Required parameter: The id of the platform issuing
|
42
|
+
# tokens (See asset_platforms endpoint for list of options)
|
43
|
+
# @param [String] contract_address Required parameter: Token's contract
|
44
|
+
# address
|
45
|
+
# @param [String] vs_currency Required parameter: The target currency of
|
46
|
+
# market data (usd, eur, jpy, etc.)
|
47
|
+
# @param [String] days Required parameter: Data up to number of days ago
|
48
|
+
# (eg. 1,14,30,max)
|
49
|
+
# @return [void] response from the API call
|
50
|
+
def gethistoricalmarketdataincludeprice_marketcap_and24hvolume_granularityauto_fromacontractaddress(id,
|
51
|
+
contract_address,
|
52
|
+
vs_currency,
|
53
|
+
days)
|
54
|
+
# Prepare query url.
|
55
|
+
_query_builder = config.get_base_uri
|
56
|
+
_query_builder << '/coins/{id}/contract/{contract_address}/market_chart/'
|
57
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
58
|
+
_query_builder,
|
59
|
+
'id' => { 'value' => id, 'encode' => true },
|
60
|
+
'contract_address' => { 'value' => contract_address, 'encode' => true }
|
61
|
+
)
|
62
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
63
|
+
_query_builder,
|
64
|
+
'vs_currency' => vs_currency,
|
65
|
+
'days' => days
|
66
|
+
)
|
67
|
+
_query_url = APIHelper.clean_url _query_builder
|
68
|
+
|
69
|
+
# Prepare and execute HttpRequest.
|
70
|
+
_request = config.http_client.get(
|
71
|
+
_query_url
|
72
|
+
)
|
73
|
+
_response = execute_request(_request)
|
74
|
+
validate_response(_response)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Get historical market data include price, market cap, and 24h volume
|
78
|
+
# within a range of timestamp (granularity auto)
|
79
|
+
# @param [String] id Required parameter: The id of the platform issuing
|
80
|
+
# tokens (See asset_platforms endpoint for list of options)
|
81
|
+
# @param [String] contract_address Required parameter: Token's contract
|
82
|
+
# address
|
83
|
+
# @param [String] vs_currency Required parameter: The target currency of
|
84
|
+
# market data (usd, eur, jpy, etc.)
|
85
|
+
# @param [String] from Required parameter: From date in UNIX Timestamp (eg.
|
86
|
+
# 1392577232)
|
87
|
+
# @param [String] to Required parameter: To date in UNIX Timestamp (eg.
|
88
|
+
# 1422577232)
|
89
|
+
# @return [void] response from the API call
|
90
|
+
def gethistoricalmarketdataincludeprice_marketcap_and24hvolumewithinarangeoftimestamp_granularityauto_fromacontractaddress(id,
|
91
|
+
contract_address,
|
92
|
+
vs_currency,
|
93
|
+
from,
|
94
|
+
to)
|
95
|
+
# Prepare query url.
|
96
|
+
_query_builder = config.get_base_uri
|
97
|
+
_query_builder << '/coins/{id}/contract/{contract_address}/market_chart/range'
|
98
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
99
|
+
_query_builder,
|
100
|
+
'id' => { 'value' => id, 'encode' => true },
|
101
|
+
'contract_address' => { 'value' => contract_address, 'encode' => true }
|
102
|
+
)
|
103
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
104
|
+
_query_builder,
|
105
|
+
'vs_currency' => vs_currency,
|
106
|
+
'from' => from,
|
107
|
+
'to' => to
|
108
|
+
)
|
109
|
+
_query_url = APIHelper.clean_url _query_builder
|
110
|
+
|
111
|
+
# Prepare and execute HttpRequest.
|
112
|
+
_request = config.http_client.get(
|
113
|
+
_query_url
|
114
|
+
)
|
115
|
+
_response = execute_request(_request)
|
116
|
+
validate_response(_response)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# DerivativesController
|
8
|
+
class DerivativesController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# List all derivative tickers
|
14
|
+
# @param [String] include_tickers Optional parameter: ['all', 'unexpired'] -
|
15
|
+
# expired to show unexpired tickers, all to list all tickers, defaults to
|
16
|
+
# unexpired
|
17
|
+
# @return [void] response from the API call
|
18
|
+
def listallderivativetickers(include_tickers: nil)
|
19
|
+
# Prepare query url.
|
20
|
+
_query_builder = config.get_base_uri
|
21
|
+
_query_builder << '/derivatives'
|
22
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
23
|
+
_query_builder,
|
24
|
+
'include_tickers' => include_tickers
|
25
|
+
)
|
26
|
+
_query_url = APIHelper.clean_url _query_builder
|
27
|
+
|
28
|
+
# Prepare and execute HttpRequest.
|
29
|
+
_request = config.http_client.get(
|
30
|
+
_query_url
|
31
|
+
)
|
32
|
+
_response = execute_request(_request)
|
33
|
+
validate_response(_response)
|
34
|
+
end
|
35
|
+
|
36
|
+
# List all derivative exchanges
|
37
|
+
# @param [String] order Optional parameter: order results using following
|
38
|
+
# params
|
39
|
+
# name_asc,name_desc,open_interest_btc_asc,open_interest_btc_desc,trade_volu
|
40
|
+
# me_24h_btc_asc,trade_volume_24h_btc_desc
|
41
|
+
# @param [Integer] per_page Optional parameter: Total results per page
|
42
|
+
# @param [Integer] page Optional parameter: Page through results
|
43
|
+
# @return [void] response from the API call
|
44
|
+
def listallderivativeexchanges(order: nil,
|
45
|
+
per_page: nil,
|
46
|
+
page: nil)
|
47
|
+
# Prepare query url.
|
48
|
+
_query_builder = config.get_base_uri
|
49
|
+
_query_builder << '/derivatives/exchanges'
|
50
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
51
|
+
_query_builder,
|
52
|
+
'order' => order,
|
53
|
+
'per_page' => per_page,
|
54
|
+
'page' => page
|
55
|
+
)
|
56
|
+
_query_url = APIHelper.clean_url _query_builder
|
57
|
+
|
58
|
+
# Prepare and execute HttpRequest.
|
59
|
+
_request = config.http_client.get(
|
60
|
+
_query_url
|
61
|
+
)
|
62
|
+
_response = execute_request(_request)
|
63
|
+
validate_response(_response)
|
64
|
+
end
|
65
|
+
|
66
|
+
# show derivative exchange data
|
67
|
+
# @param [String] id Required parameter: pass the exchange id (can be
|
68
|
+
# obtained from derivatives/exchanges/list) eg. bitmex
|
69
|
+
# @param [String] include_tickers Optional parameter: ['all', 'unexpired'] -
|
70
|
+
# expired to show unexpired tickers, all to list all tickers, leave blank to
|
71
|
+
# omit tickers data in response
|
72
|
+
# @return [void] response from the API call
|
73
|
+
def showderivativeexchangedata(id,
|
74
|
+
include_tickers: nil)
|
75
|
+
# Prepare query url.
|
76
|
+
_query_builder = config.get_base_uri
|
77
|
+
_query_builder << '/derivatives/exchanges/{id}'
|
78
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
79
|
+
_query_builder,
|
80
|
+
'id' => { 'value' => id, 'encode' => true }
|
81
|
+
)
|
82
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
83
|
+
_query_builder,
|
84
|
+
'include_tickers' => include_tickers
|
85
|
+
)
|
86
|
+
_query_url = APIHelper.clean_url _query_builder
|
87
|
+
|
88
|
+
# Prepare and execute HttpRequest.
|
89
|
+
_request = config.http_client.get(
|
90
|
+
_query_url
|
91
|
+
)
|
92
|
+
_response = execute_request(_request)
|
93
|
+
validate_response(_response)
|
94
|
+
end
|
95
|
+
|
96
|
+
# List all derivative exchanges name and identifier
|
97
|
+
# @return [void] response from the API call
|
98
|
+
def listallderivativeexchangesnameandidentifier
|
99
|
+
# Prepare query url.
|
100
|
+
_query_builder = config.get_base_uri
|
101
|
+
_query_builder << '/derivatives/exchanges/list'
|
102
|
+
_query_url = APIHelper.clean_url _query_builder
|
103
|
+
|
104
|
+
# Prepare and execute HttpRequest.
|
105
|
+
_request = config.http_client.get(
|
106
|
+
_query_url
|
107
|
+
)
|
108
|
+
_response = execute_request(_request)
|
109
|
+
validate_response(_response)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|