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,89 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# EventsController
|
8
|
+
class EventsController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Get events, paginated by 100
|
14
|
+
# @param [String] country_code Optional parameter: country_code of event
|
15
|
+
# (eg. 'US'). use <b>/api/v3/events/countries</b> for list of
|
16
|
+
# country_codes
|
17
|
+
# @param [String] type Optional parameter: type of event (eg. 'Conference').
|
18
|
+
# use <b>/api/v3/events/types</b> for list of types
|
19
|
+
# @param [String] page Optional parameter: page of results (paginated by
|
20
|
+
# 100)
|
21
|
+
# @param [String] upcoming_events_only Optional parameter: lists only
|
22
|
+
# upcoming events. <br>true, false</br> (defaults to true, set to false to
|
23
|
+
# list all events)
|
24
|
+
# @param [String] from_date Optional parameter: lists events after this date
|
25
|
+
# yyyy-mm-dd
|
26
|
+
# @param [String] to_date Optional parameter: lists events before this date
|
27
|
+
# yyyy-mm-dd (set upcoming_events_only to false if fetching past events)
|
28
|
+
# @return [void] response from the API call
|
29
|
+
def getevents_paginatedby100(country_code: nil,
|
30
|
+
type: nil,
|
31
|
+
page: nil,
|
32
|
+
upcoming_events_only: nil,
|
33
|
+
from_date: nil,
|
34
|
+
to_date: nil)
|
35
|
+
# Prepare query url.
|
36
|
+
_query_builder = config.get_base_uri
|
37
|
+
_query_builder << '/events'
|
38
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
39
|
+
_query_builder,
|
40
|
+
'country_code' => country_code,
|
41
|
+
'type' => type,
|
42
|
+
'page' => page,
|
43
|
+
'upcoming_events_only' => upcoming_events_only,
|
44
|
+
'from_date' => from_date,
|
45
|
+
'to_date' => to_date
|
46
|
+
)
|
47
|
+
_query_url = APIHelper.clean_url _query_builder
|
48
|
+
|
49
|
+
# Prepare and execute HttpRequest.
|
50
|
+
_request = config.http_client.get(
|
51
|
+
_query_url
|
52
|
+
)
|
53
|
+
_response = execute_request(_request)
|
54
|
+
validate_response(_response)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Get list of event countries
|
58
|
+
# @return [void] response from the API call
|
59
|
+
def getlistofeventcountries
|
60
|
+
# Prepare query url.
|
61
|
+
_query_builder = config.get_base_uri
|
62
|
+
_query_builder << '/events/countries'
|
63
|
+
_query_url = APIHelper.clean_url _query_builder
|
64
|
+
|
65
|
+
# Prepare and execute HttpRequest.
|
66
|
+
_request = config.http_client.get(
|
67
|
+
_query_url
|
68
|
+
)
|
69
|
+
_response = execute_request(_request)
|
70
|
+
validate_response(_response)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Get list of event types
|
74
|
+
# @return [void] response from the API call
|
75
|
+
def getlistofeventstypes
|
76
|
+
# Prepare query url.
|
77
|
+
_query_builder = config.get_base_uri
|
78
|
+
_query_builder << '/events/types'
|
79
|
+
_query_url = APIHelper.clean_url _query_builder
|
80
|
+
|
81
|
+
# Prepare and execute HttpRequest.
|
82
|
+
_request = config.http_client.get(
|
83
|
+
_query_url
|
84
|
+
)
|
85
|
+
_response = execute_request(_request)
|
86
|
+
validate_response(_response)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# ExchangeRatesController
|
8
|
+
class ExchangeRatesController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Get BTC-to-Currency exchange rates
|
14
|
+
# @return [void] response from the API call
|
15
|
+
def get_btc_to_currencyexchangerates
|
16
|
+
# Prepare query url.
|
17
|
+
_query_builder = config.get_base_uri
|
18
|
+
_query_builder << '/exchange_rates'
|
19
|
+
_query_url = APIHelper.clean_url _query_builder
|
20
|
+
|
21
|
+
# Prepare and execute HttpRequest.
|
22
|
+
_request = config.http_client.get(
|
23
|
+
_query_url
|
24
|
+
)
|
25
|
+
_response = execute_request(_request)
|
26
|
+
validate_response(_response)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,192 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# ExchangesController
|
8
|
+
class ExchangesController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# List all exchanges
|
14
|
+
# @param [Integer] per_page Optional parameter: Valid values: 1...250 Total
|
15
|
+
# results per page Default value:: 100
|
16
|
+
# @param [String] page Optional parameter: page through results
|
17
|
+
# @return [void] response from the API call
|
18
|
+
def listallexchanges(per_page: nil,
|
19
|
+
page: nil)
|
20
|
+
# Prepare query url.
|
21
|
+
_query_builder = config.get_base_uri
|
22
|
+
_query_builder << '/exchanges'
|
23
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
24
|
+
_query_builder,
|
25
|
+
'per_page' => per_page,
|
26
|
+
'page' => page
|
27
|
+
)
|
28
|
+
_query_url = APIHelper.clean_url _query_builder
|
29
|
+
|
30
|
+
# Prepare and execute HttpRequest.
|
31
|
+
_request = config.http_client.get(
|
32
|
+
_query_url
|
33
|
+
)
|
34
|
+
_response = execute_request(_request)
|
35
|
+
validate_response(_response)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Use this to obtain all the markets' id in order to make API calls
|
39
|
+
# @return [void] response from the API call
|
40
|
+
def listallsupportedmarketsidandname_nopaginationrequired
|
41
|
+
# Prepare query url.
|
42
|
+
_query_builder = config.get_base_uri
|
43
|
+
_query_builder << '/exchanges/list'
|
44
|
+
_query_url = APIHelper.clean_url _query_builder
|
45
|
+
|
46
|
+
# Prepare and execute HttpRequest.
|
47
|
+
_request = config.http_client.get(
|
48
|
+
_query_url
|
49
|
+
)
|
50
|
+
_response = execute_request(_request)
|
51
|
+
validate_response(_response)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Get exchange volume in BTC and tickers<br><br> **IMPORTANT**:
|
55
|
+
# Ticker object is limited to 100 items, to get more tickers, use
|
56
|
+
# `/exchanges/{id}/tickers`
|
57
|
+
# Ticker `is_stale` is true when ticker that has not been updated/unchanged
|
58
|
+
# from the exchange for a while.
|
59
|
+
# Ticker `is_anomaly` is true if ticker's price is outliered by our system.
|
60
|
+
# You are responsible for managing how you want to display these
|
61
|
+
# information (e.g. footnote, different background, change opacity, hide)
|
62
|
+
# @param [String] id Required parameter: pass the exchange id (can be
|
63
|
+
# obtained from /exchanges/list) eg. binance
|
64
|
+
# @return [void] response from the API call
|
65
|
+
def getexchangevolumein_bt_candtop100tickersonly(id)
|
66
|
+
# Prepare query url.
|
67
|
+
_query_builder = config.get_base_uri
|
68
|
+
_query_builder << '/exchanges/{id}'
|
69
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
70
|
+
_query_builder,
|
71
|
+
'id' => { 'value' => id, 'encode' => true }
|
72
|
+
)
|
73
|
+
_query_url = APIHelper.clean_url _query_builder
|
74
|
+
|
75
|
+
# Prepare and execute HttpRequest.
|
76
|
+
_request = config.http_client.get(
|
77
|
+
_query_url
|
78
|
+
)
|
79
|
+
_response = execute_request(_request)
|
80
|
+
validate_response(_response)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Get exchange tickers (paginated)<br><br> **IMPORTANT**:
|
84
|
+
# Ticker `is_stale` is true when ticker that has not been updated/unchanged
|
85
|
+
# from the exchange for a while.
|
86
|
+
# Ticker `is_anomaly` is true if ticker's price is outliered by our system.
|
87
|
+
# You are responsible for managing how you want to display these
|
88
|
+
# information (e.g. footnote, different background, change opacity, hide)
|
89
|
+
# @param [String] id Required parameter: pass the exchange id (can be
|
90
|
+
# obtained from /exchanges/list) eg. binance
|
91
|
+
# @param [String] coin_ids Optional parameter: filter tickers by coin_ids
|
92
|
+
# (ref: v3/coins/list)
|
93
|
+
# @param [String] include_exchange_logo Optional parameter: flag to show
|
94
|
+
# exchange_logo
|
95
|
+
# @param [Integer] page Optional parameter: Page through results
|
96
|
+
# @param [String] depth Optional parameter: flag to show 2% orderbook depth
|
97
|
+
# i.e., cost_to_move_up_usd and cost_to_move_down_usd
|
98
|
+
# @param [String] order Optional parameter: valid values:
|
99
|
+
# <b>trust_score_desc (default), trust_score_asc and volume_desc</b>
|
100
|
+
# @return [void] response from the API call
|
101
|
+
def getexchangetickers_paginated_100tickersperpage(id,
|
102
|
+
coin_ids: nil,
|
103
|
+
include_exchange_logo: nil,
|
104
|
+
page: nil,
|
105
|
+
depth: nil,
|
106
|
+
order: nil)
|
107
|
+
# Prepare query url.
|
108
|
+
_query_builder = config.get_base_uri
|
109
|
+
_query_builder << '/exchanges/{id}/tickers'
|
110
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
111
|
+
_query_builder,
|
112
|
+
'id' => { 'value' => id, 'encode' => true }
|
113
|
+
)
|
114
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
115
|
+
_query_builder,
|
116
|
+
'coin_ids' => coin_ids,
|
117
|
+
'include_exchange_logo' => include_exchange_logo,
|
118
|
+
'page' => page,
|
119
|
+
'depth' => depth,
|
120
|
+
'order' => order
|
121
|
+
)
|
122
|
+
_query_url = APIHelper.clean_url _query_builder
|
123
|
+
|
124
|
+
# Prepare and execute HttpRequest.
|
125
|
+
_request = config.http_client.get(
|
126
|
+
_query_url
|
127
|
+
)
|
128
|
+
_response = execute_request(_request)
|
129
|
+
validate_response(_response)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Get status updates for a given exchange
|
133
|
+
# @param [String] id Required parameter: pass the exchange id (can be
|
134
|
+
# obtained from /exchanges/list) eg. binance
|
135
|
+
# @param [Integer] per_page Optional parameter: Total results per page
|
136
|
+
# @param [Integer] page Optional parameter: Page through results
|
137
|
+
# @return [void] response from the API call
|
138
|
+
def getstatusupdatesforagivenexchange(id,
|
139
|
+
per_page: nil,
|
140
|
+
page: nil)
|
141
|
+
# Prepare query url.
|
142
|
+
_query_builder = config.get_base_uri
|
143
|
+
_query_builder << '/exchanges/{id}/status_updates'
|
144
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
145
|
+
_query_builder,
|
146
|
+
'id' => { 'value' => id, 'encode' => true }
|
147
|
+
)
|
148
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
149
|
+
_query_builder,
|
150
|
+
'per_page' => per_page,
|
151
|
+
'page' => page
|
152
|
+
)
|
153
|
+
_query_url = APIHelper.clean_url _query_builder
|
154
|
+
|
155
|
+
# Prepare and execute HttpRequest.
|
156
|
+
_request = config.http_client.get(
|
157
|
+
_query_url
|
158
|
+
)
|
159
|
+
_response = execute_request(_request)
|
160
|
+
validate_response(_response)
|
161
|
+
end
|
162
|
+
|
163
|
+
# Get volume_chart data for a given exchange
|
164
|
+
# @param [String] id Required parameter: pass the exchange id (can be
|
165
|
+
# obtained from /exchanges/list) eg. binance
|
166
|
+
# @param [Integer] days Required parameter: Data up to number of days ago
|
167
|
+
# (eg. 1,14,30)
|
168
|
+
# @return [void] response from the API call
|
169
|
+
def getvolume_chartdataforagivenexchange(id,
|
170
|
+
days)
|
171
|
+
# Prepare query url.
|
172
|
+
_query_builder = config.get_base_uri
|
173
|
+
_query_builder << '/exchanges/{id}/volume_chart'
|
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
|
+
'days' => days
|
181
|
+
)
|
182
|
+
_query_url = APIHelper.clean_url _query_builder
|
183
|
+
|
184
|
+
# Prepare and execute HttpRequest.
|
185
|
+
_request = config.http_client.get(
|
186
|
+
_query_url
|
187
|
+
)
|
188
|
+
_response = execute_request(_request)
|
189
|
+
validate_response(_response)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# FinanceController
|
8
|
+
class FinanceController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# List all finance platforms
|
14
|
+
# @param [Integer] per_page Optional parameter: Total results per page
|
15
|
+
# @param [String] page Optional parameter: page of results (paginated to 100
|
16
|
+
# by default)
|
17
|
+
# @return [void] response from the API call
|
18
|
+
def listallfinanceplatforms(per_page: nil,
|
19
|
+
page: nil)
|
20
|
+
# Prepare query url.
|
21
|
+
_query_builder = config.get_base_uri
|
22
|
+
_query_builder << '/finance_platforms'
|
23
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
24
|
+
_query_builder,
|
25
|
+
'per_page' => per_page,
|
26
|
+
'page' => page
|
27
|
+
)
|
28
|
+
_query_url = APIHelper.clean_url _query_builder
|
29
|
+
|
30
|
+
# Prepare and execute HttpRequest.
|
31
|
+
_request = config.http_client.get(
|
32
|
+
_query_url
|
33
|
+
)
|
34
|
+
_response = execute_request(_request)
|
35
|
+
validate_response(_response)
|
36
|
+
end
|
37
|
+
|
38
|
+
# List all finance products
|
39
|
+
# @param [Integer] per_page Optional parameter: Total results per page
|
40
|
+
# @param [String] page Optional parameter: page of results (paginated to 100
|
41
|
+
# by default)
|
42
|
+
# @param [String] start_at Optional parameter: start date of the financial
|
43
|
+
# products
|
44
|
+
# @param [String] end_at Optional parameter: end date of the financial
|
45
|
+
# products
|
46
|
+
# @return [void] response from the API call
|
47
|
+
def listallfinanceproducts(per_page: nil,
|
48
|
+
page: nil,
|
49
|
+
start_at: nil,
|
50
|
+
end_at: nil)
|
51
|
+
# Prepare query url.
|
52
|
+
_query_builder = config.get_base_uri
|
53
|
+
_query_builder << '/finance_products'
|
54
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
55
|
+
_query_builder,
|
56
|
+
'per_page' => per_page,
|
57
|
+
'page' => page,
|
58
|
+
'start_at' => start_at,
|
59
|
+
'end_at' => end_at
|
60
|
+
)
|
61
|
+
_query_url = APIHelper.clean_url _query_builder
|
62
|
+
|
63
|
+
# Prepare and execute HttpRequest.
|
64
|
+
_request = config.http_client.get(
|
65
|
+
_query_url
|
66
|
+
)
|
67
|
+
_response = execute_request(_request)
|
68
|
+
validate_response(_response)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# GlobalController
|
8
|
+
class GlobalController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Get cryptocurrency global data
|
14
|
+
# @return [void] response from the API call
|
15
|
+
def getcryptocurrencyglobaldata
|
16
|
+
# Prepare query url.
|
17
|
+
_query_builder = config.get_base_uri
|
18
|
+
_query_builder << '/global'
|
19
|
+
_query_url = APIHelper.clean_url _query_builder
|
20
|
+
|
21
|
+
# Prepare and execute HttpRequest.
|
22
|
+
_request = config.http_client.get(
|
23
|
+
_query_url
|
24
|
+
)
|
25
|
+
_response = execute_request(_request)
|
26
|
+
validate_response(_response)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# IndexesController
|
8
|
+
class IndexesController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# List all market indexes
|
14
|
+
# @param [Integer] per_page Optional parameter: Total results per page
|
15
|
+
# @param [Integer] page Optional parameter: Page through results
|
16
|
+
# @return [void] response from the API call
|
17
|
+
def listallmarketindexes(per_page: nil,
|
18
|
+
page: nil)
|
19
|
+
# Prepare query url.
|
20
|
+
_query_builder = config.get_base_uri
|
21
|
+
_query_builder << '/indexes'
|
22
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
23
|
+
_query_builder,
|
24
|
+
'per_page' => per_page,
|
25
|
+
'page' => page
|
26
|
+
)
|
27
|
+
_query_url = APIHelper.clean_url _query_builder
|
28
|
+
|
29
|
+
# Prepare and execute HttpRequest.
|
30
|
+
_request = config.http_client.get(
|
31
|
+
_query_url
|
32
|
+
)
|
33
|
+
_response = execute_request(_request)
|
34
|
+
validate_response(_response)
|
35
|
+
end
|
36
|
+
|
37
|
+
# get market index by market id and index id
|
38
|
+
# @param [String] market_id Required parameter: pass the market id (can be
|
39
|
+
# obtained from /exchanges/list)
|
40
|
+
# @param [String] id Required parameter: pass the index id (can be obtained
|
41
|
+
# from /indexes/list)
|
42
|
+
# @return [void] response from the API call
|
43
|
+
def getmarketindexbymarketidandindexid(market_id,
|
44
|
+
id)
|
45
|
+
# Prepare query url.
|
46
|
+
_query_builder = config.get_base_uri
|
47
|
+
_query_builder << '/indexes/{market_id}/{id}'
|
48
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
49
|
+
_query_builder,
|
50
|
+
'market_id' => { 'value' => market_id, 'encode' => true },
|
51
|
+
'id' => { 'value' => id, 'encode' => true }
|
52
|
+
)
|
53
|
+
_query_url = APIHelper.clean_url _query_builder
|
54
|
+
|
55
|
+
# Prepare and execute HttpRequest.
|
56
|
+
_request = config.http_client.get(
|
57
|
+
_query_url
|
58
|
+
)
|
59
|
+
_response = execute_request(_request)
|
60
|
+
validate_response(_response)
|
61
|
+
end
|
62
|
+
|
63
|
+
# list market indexes id and name
|
64
|
+
# @return [void] response from the API call
|
65
|
+
def listmarketindexesidandname
|
66
|
+
# Prepare query url.
|
67
|
+
_query_builder = config.get_base_uri
|
68
|
+
_query_builder << '/indexes/list'
|
69
|
+
_query_url = APIHelper.clean_url _query_builder
|
70
|
+
|
71
|
+
# Prepare and execute HttpRequest.
|
72
|
+
_request = config.http_client.get(
|
73
|
+
_query_url
|
74
|
+
)
|
75
|
+
_response = execute_request(_request)
|
76
|
+
validate_response(_response)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# PingController
|
8
|
+
class PingController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Check API server status
|
14
|
+
# @return [void] response from the API call
|
15
|
+
def check_ap_iserverstatus
|
16
|
+
# Prepare query url.
|
17
|
+
_query_builder = config.get_base_uri
|
18
|
+
_query_builder << '/ping'
|
19
|
+
_query_url = APIHelper.clean_url _query_builder
|
20
|
+
|
21
|
+
# Prepare and execute HttpRequest.
|
22
|
+
_request = config.http_client.get(
|
23
|
+
_query_url
|
24
|
+
)
|
25
|
+
_response = execute_request(_request)
|
26
|
+
validate_response(_response)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# coin_gecko_apiv3
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module CoinGeckoApiv3
|
7
|
+
# SimpleController
|
8
|
+
class SimpleController < BaseController
|
9
|
+
def initialize(config, http_call_back: nil)
|
10
|
+
super(config, http_call_back: http_call_back)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Get the current price of any cryptocurrencies in any other supported
|
14
|
+
# currencies that you need.
|
15
|
+
# @param [String] ids Required parameter: id of coins, comma-separated if
|
16
|
+
# querying more than 1 coin *refers to <b>`coins/list`</b>
|
17
|
+
# @param [String] vs_currencies Required parameter: vs_currency of coins,
|
18
|
+
# comma-separated if querying more than 1 vs_currency *refers to
|
19
|
+
# <b>`simple/supported_vs_currencies`</b>
|
20
|
+
# @param [String] include_market_cap Optional parameter: <b>true/false</b>
|
21
|
+
# to include market_cap, <b>default: false</b>
|
22
|
+
# @param [String] include_24hr_vol Optional parameter: <b>true/false</b> to
|
23
|
+
# include 24hr_vol, <b>default: false</b>
|
24
|
+
# @param [String] include_24hr_change Optional parameter: <b>true/false</b>
|
25
|
+
# to include 24hr_change, <b>default: false</b>
|
26
|
+
# @param [String] include_last_updated_at Optional parameter:
|
27
|
+
# <b>true/false</b> to include last_updated_at of price, <b>default:
|
28
|
+
# false</b>
|
29
|
+
# @return [void] response from the API call
|
30
|
+
def getthecurrentpriceofanycryptocurrenciesinanyothersupportedcurrenciesthatyouneed(ids,
|
31
|
+
vs_currencies,
|
32
|
+
include_market_cap: nil,
|
33
|
+
include_24hr_vol: nil,
|
34
|
+
include_24hr_change: nil,
|
35
|
+
include_last_updated_at: nil)
|
36
|
+
# Prepare query url.
|
37
|
+
_query_builder = config.get_base_uri
|
38
|
+
_query_builder << '/simple/price'
|
39
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
40
|
+
_query_builder,
|
41
|
+
'ids' => ids,
|
42
|
+
'vs_currencies' => vs_currencies,
|
43
|
+
'include_market_cap' => include_market_cap,
|
44
|
+
'include_24hr_vol' => include_24hr_vol,
|
45
|
+
'include_24hr_change' => include_24hr_change,
|
46
|
+
'include_last_updated_at' => include_last_updated_at
|
47
|
+
)
|
48
|
+
_query_url = APIHelper.clean_url _query_builder
|
49
|
+
|
50
|
+
# Prepare and execute HttpRequest.
|
51
|
+
_request = config.http_client.get(
|
52
|
+
_query_url
|
53
|
+
)
|
54
|
+
_response = execute_request(_request)
|
55
|
+
validate_response(_response)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Get current price of tokens (using contract addresses) for a given
|
59
|
+
# platform in any other currency that you need.
|
60
|
+
# @param [String] id Required parameter: The id of the platform issuing
|
61
|
+
# tokens (See asset_platforms endpoint for list of options)
|
62
|
+
# @param [String] contract_addresses Required parameter: The contract
|
63
|
+
# address of tokens, comma separated
|
64
|
+
# @param [String] vs_currencies Required parameter: vs_currency of coins,
|
65
|
+
# comma-separated if querying more than 1 vs_currency *refers to
|
66
|
+
# <b>`simple/supported_vs_currencies`</b>
|
67
|
+
# @param [String] include_market_cap Optional parameter: <b>true/false</b>
|
68
|
+
# to include market_cap, <b>default: false</b>
|
69
|
+
# @param [String] include_24hr_vol Optional parameter: <b>true/false</b> to
|
70
|
+
# include 24hr_vol, <b>default: false</b>
|
71
|
+
# @param [String] include_24hr_change Optional parameter: <b>true/false</b>
|
72
|
+
# to include 24hr_change, <b>default: false</b>
|
73
|
+
# @param [String] include_last_updated_at Optional parameter:
|
74
|
+
# <b>true/false</b> to include last_updated_at of price, <b>default:
|
75
|
+
# false</b>
|
76
|
+
# @return [void] response from the API call
|
77
|
+
def getcurrentpriceoftokens_usingcontractaddresses_foragivenplatforminanyothercurrencythatyouneed(id,
|
78
|
+
contract_addresses,
|
79
|
+
vs_currencies,
|
80
|
+
include_market_cap: nil,
|
81
|
+
include_24hr_vol: nil,
|
82
|
+
include_24hr_change: nil,
|
83
|
+
include_last_updated_at: nil)
|
84
|
+
# Prepare query url.
|
85
|
+
_query_builder = config.get_base_uri
|
86
|
+
_query_builder << '/simple/token_price/{id}'
|
87
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
88
|
+
_query_builder,
|
89
|
+
'id' => { 'value' => id, 'encode' => true }
|
90
|
+
)
|
91
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
92
|
+
_query_builder,
|
93
|
+
'contract_addresses' => contract_addresses,
|
94
|
+
'vs_currencies' => vs_currencies,
|
95
|
+
'include_market_cap' => include_market_cap,
|
96
|
+
'include_24hr_vol' => include_24hr_vol,
|
97
|
+
'include_24hr_change' => include_24hr_change,
|
98
|
+
'include_last_updated_at' => include_last_updated_at
|
99
|
+
)
|
100
|
+
_query_url = APIHelper.clean_url _query_builder
|
101
|
+
|
102
|
+
# Prepare and execute HttpRequest.
|
103
|
+
_request = config.http_client.get(
|
104
|
+
_query_url
|
105
|
+
)
|
106
|
+
_response = execute_request(_request)
|
107
|
+
validate_response(_response)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Get list of supported_vs_currencies.
|
111
|
+
# @return [void] response from the API call
|
112
|
+
def getlistofsupported_vs_currencies
|
113
|
+
# Prepare query url.
|
114
|
+
_query_builder = config.get_base_uri
|
115
|
+
_query_builder << '/simple/supported_vs_currencies'
|
116
|
+
_query_url = APIHelper.clean_url _query_builder
|
117
|
+
|
118
|
+
# Prepare and execute HttpRequest.
|
119
|
+
_request = config.http_client.get(
|
120
|
+
_query_url
|
121
|
+
)
|
122
|
+
_response = execute_request(_request)
|
123
|
+
validate_response(_response)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|