automation-test 1.16 → 1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -29
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/api_helper.rb +2 -2
- data/lib/apimatic_calculator_test/client.rb +35 -0
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/configuration.rb +4 -3
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/controllers/base_controller.rb +2 -2
- data/lib/apimatic_calculator_test/controllers/simple_calculator_controller.rb +53 -0
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/exceptions/api_exception.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/http/faraday_client.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/http/http_call_back.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/http/http_client.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/http/http_method_enum.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/http/http_request.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/http/http_response.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/models/base_model.rb +2 -2
- data/lib/apimatic_calculator_test/models/operation_type_enum.rb +23 -0
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/utilities/date_time_helper.rb +2 -2
- data/lib/{coin_gecko_apiv3 → apimatic_calculator_test}/utilities/file_wrapper.rb +2 -2
- data/lib/apimatic_calculator_test.rb +39 -0
- metadata +20 -85
- data/lib/coin_gecko_apiv3/client.rb +0 -125
- data/lib/coin_gecko_apiv3/controllers/asset_platforms_controller.rb +0 -29
- data/lib/coin_gecko_apiv3/controllers/categories_controller.rb +0 -52
- data/lib/coin_gecko_apiv3/controllers/coins_controller.rb +0 -389
- data/lib/coin_gecko_apiv3/controllers/companies_beta_controller.rb +0 -35
- data/lib/coin_gecko_apiv3/controllers/contract_controller.rb +0 -119
- data/lib/coin_gecko_apiv3/controllers/derivatives_controller.rb +0 -112
- data/lib/coin_gecko_apiv3/controllers/events_controller.rb +0 -89
- data/lib/coin_gecko_apiv3/controllers/exchange_rates_controller.rb +0 -29
- data/lib/coin_gecko_apiv3/controllers/exchanges_controller.rb +0 -192
- data/lib/coin_gecko_apiv3/controllers/finance_controller.rb +0 -71
- data/lib/coin_gecko_apiv3/controllers/global_controller.rb +0 -29
- data/lib/coin_gecko_apiv3/controllers/indexes_controller.rb +0 -79
- data/lib/coin_gecko_apiv3/controllers/ping_controller.rb +0 -29
- data/lib/coin_gecko_apiv3/controllers/simple_controller.rb +0 -126
- data/lib/coin_gecko_apiv3/controllers/status_updates_controller.rb +0 -48
- data/lib/coin_gecko_apiv3/controllers/trending_controller.rb +0 -30
- data/lib/coin_gecko_apiv3.rb +0 -52
- data/test/controllers/controller_test_base.rb +0 -21
- data/test/controllers/test_asset_platforms_controller.rb +0 -25
- data/test/controllers/test_categories_controller.rb +0 -37
- data/test/controllers/test_coins_controller.rb +0 -27
- data/test/controllers/test_derivatives_controller.rb +0 -51
- data/test/controllers/test_events_controller.rb +0 -55
- data/test/controllers/test_exchange_rates_controller.rb +0 -26
- data/test/controllers/test_exchanges_controller.rb +0 -38
- data/test/controllers/test_finance_controller.rb +0 -43
- data/test/controllers/test_global_controller.rb +0 -26
- data/test/controllers/test_indexes_controller.rb +0 -38
- data/test/controllers/test_ping_controller.rb +0 -26
- data/test/controllers/test_simple_controller.rb +0 -25
- data/test/controllers/test_status_updates_controller.rb +0 -31
- data/test/controllers/test_trending_controller.rb +0 -25
- data/test/http_response_catcher.rb +0 -19
- data/test/test_helper.rb +0 -94
@@ -1,125 +0,0 @@
|
|
1
|
-
# coin_gecko_apiv3
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module CoinGeckoApiv3
|
7
|
-
# coin_gecko_apiv3 client class.
|
8
|
-
class Client
|
9
|
-
attr_reader :config
|
10
|
-
|
11
|
-
# Access to ping controller.
|
12
|
-
# @return [PingController] Returns the controller instance.
|
13
|
-
def ping
|
14
|
-
@ping ||= PingController.new config
|
15
|
-
end
|
16
|
-
|
17
|
-
# Access to simple controller.
|
18
|
-
# @return [SimpleController] Returns the controller instance.
|
19
|
-
def simple
|
20
|
-
@simple ||= SimpleController.new config
|
21
|
-
end
|
22
|
-
|
23
|
-
# Access to coins controller.
|
24
|
-
# @return [CoinsController] Returns the controller instance.
|
25
|
-
def coins
|
26
|
-
@coins ||= CoinsController.new config
|
27
|
-
end
|
28
|
-
|
29
|
-
# Access to contract controller.
|
30
|
-
# @return [ContractController] Returns the controller instance.
|
31
|
-
def contract
|
32
|
-
@contract ||= ContractController.new config
|
33
|
-
end
|
34
|
-
|
35
|
-
# Access to asset_platforms controller.
|
36
|
-
# @return [AssetPlatformsController] Returns the controller instance.
|
37
|
-
def asset_platforms
|
38
|
-
@asset_platforms ||= AssetPlatformsController.new config
|
39
|
-
end
|
40
|
-
|
41
|
-
# Access to categories controller.
|
42
|
-
# @return [CategoriesController] Returns the controller instance.
|
43
|
-
def categories
|
44
|
-
@categories ||= CategoriesController.new config
|
45
|
-
end
|
46
|
-
|
47
|
-
# Access to exchanges controller.
|
48
|
-
# @return [ExchangesController] Returns the controller instance.
|
49
|
-
def exchanges
|
50
|
-
@exchanges ||= ExchangesController.new config
|
51
|
-
end
|
52
|
-
|
53
|
-
# Access to finance controller.
|
54
|
-
# @return [FinanceController] Returns the controller instance.
|
55
|
-
def finance
|
56
|
-
@finance ||= FinanceController.new config
|
57
|
-
end
|
58
|
-
|
59
|
-
# Access to indexes controller.
|
60
|
-
# @return [IndexesController] Returns the controller instance.
|
61
|
-
def indexes
|
62
|
-
@indexes ||= IndexesController.new config
|
63
|
-
end
|
64
|
-
|
65
|
-
# Access to derivatives controller.
|
66
|
-
# @return [DerivativesController] Returns the controller instance.
|
67
|
-
def derivatives
|
68
|
-
@derivatives ||= DerivativesController.new config
|
69
|
-
end
|
70
|
-
|
71
|
-
# Access to status_updates controller.
|
72
|
-
# @return [StatusUpdatesController] Returns the controller instance.
|
73
|
-
def status_updates
|
74
|
-
@status_updates ||= StatusUpdatesController.new config
|
75
|
-
end
|
76
|
-
|
77
|
-
# Access to events controller.
|
78
|
-
# @return [EventsController] Returns the controller instance.
|
79
|
-
def events
|
80
|
-
@events ||= EventsController.new config
|
81
|
-
end
|
82
|
-
|
83
|
-
# Access to exchange_rates controller.
|
84
|
-
# @return [ExchangeRatesController] Returns the controller instance.
|
85
|
-
def exchange_rates
|
86
|
-
@exchange_rates ||= ExchangeRatesController.new config
|
87
|
-
end
|
88
|
-
|
89
|
-
# Access to trending controller.
|
90
|
-
# @return [TrendingController] Returns the controller instance.
|
91
|
-
def trending
|
92
|
-
@trending ||= TrendingController.new config
|
93
|
-
end
|
94
|
-
|
95
|
-
# Access to global controller.
|
96
|
-
# @return [GlobalController] Returns the controller instance.
|
97
|
-
def global
|
98
|
-
@global ||= GlobalController.new config
|
99
|
-
end
|
100
|
-
|
101
|
-
# Access to companies_beta controller.
|
102
|
-
# @return [CompaniesBetaController] Returns the controller instance.
|
103
|
-
def companies_beta
|
104
|
-
@companies_beta ||= CompaniesBetaController.new config
|
105
|
-
end
|
106
|
-
|
107
|
-
def initialize(http_client_instance: nil, timeout: 60, max_retries: 0,
|
108
|
-
retry_interval: 1, backoff_factor: 2,
|
109
|
-
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
110
|
-
retry_methods: %i[get put],
|
111
|
-
environment: Environment::PRODUCTION, config: nil)
|
112
|
-
@config = if config.nil?
|
113
|
-
Configuration.new(http_client_instance: http_client_instance,
|
114
|
-
timeout: timeout, max_retries: max_retries,
|
115
|
-
retry_interval: retry_interval,
|
116
|
-
backoff_factor: backoff_factor,
|
117
|
-
retry_statuses: retry_statuses,
|
118
|
-
retry_methods: retry_methods,
|
119
|
-
environment: environment)
|
120
|
-
else
|
121
|
-
config
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# coin_gecko_apiv3
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module CoinGeckoApiv3
|
7
|
-
# AssetPlatformsController
|
8
|
-
class AssetPlatformsController < BaseController
|
9
|
-
def initialize(config, http_call_back: nil)
|
10
|
-
super(config, http_call_back: http_call_back)
|
11
|
-
end
|
12
|
-
|
13
|
-
# List all asset platforms
|
14
|
-
# @return [void] response from the API call
|
15
|
-
def listallassetplatforms_blockchainnetworks
|
16
|
-
# Prepare query url.
|
17
|
-
_query_builder = config.get_base_uri
|
18
|
-
_query_builder << '/asset_platforms'
|
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
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# coin_gecko_apiv3
|
2
|
-
#
|
3
|
-
# This file was automatically generated by APIMATIC v2.0
|
4
|
-
# ( https://apimatic.io ).
|
5
|
-
|
6
|
-
module CoinGeckoApiv3
|
7
|
-
# CategoriesController
|
8
|
-
class CategoriesController < BaseController
|
9
|
-
def initialize(config, http_call_back: nil)
|
10
|
-
super(config, http_call_back: http_call_back)
|
11
|
-
end
|
12
|
-
|
13
|
-
# List all categories
|
14
|
-
# @return [void] response from the API call
|
15
|
-
def listallcategories
|
16
|
-
# Prepare query url.
|
17
|
-
_query_builder = config.get_base_uri
|
18
|
-
_query_builder << '/coins/categories/list'
|
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
|
-
|
29
|
-
# List all categories with market data
|
30
|
-
# @param [String] order Optional parameter: valid values: <b>market_cap_desc
|
31
|
-
# (default), market_cap_asc, name_desc, name_asc, market_cap_change_24h_desc
|
32
|
-
# and market_cap_change_24h_asc</b>
|
33
|
-
# @return [void] response from the API call
|
34
|
-
def listallcategorieswithmarketdata(order: nil)
|
35
|
-
# Prepare query url.
|
36
|
-
_query_builder = config.get_base_uri
|
37
|
-
_query_builder << '/coins/categories'
|
38
|
-
_query_builder = APIHelper.append_url_with_query_parameters(
|
39
|
-
_query_builder,
|
40
|
-
'order' => order
|
41
|
-
)
|
42
|
-
_query_url = APIHelper.clean_url _query_builder
|
43
|
-
|
44
|
-
# Prepare and execute HttpRequest.
|
45
|
-
_request = config.http_client.get(
|
46
|
-
_query_url
|
47
|
-
)
|
48
|
-
_response = execute_request(_request)
|
49
|
-
validate_response(_response)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,389 +0,0 @@
|
|
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
|
@@ -1,35 +0,0 @@
|
|
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
|