coinmarketcap_client 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -9
- data/docs/{Info.md → CryptocurrencyInfo.md} +2 -2
- data/docs/{InfoUrls.md → CryptocurrencyInfoUrls.md} +1 -1
- data/docs/{MarketData.md → CryptocurrencyListings.md} +1 -1
- data/docs/{Map.md → CryptocurrencyMap.md} +1 -1
- data/docs/DefaultApi.md +146 -22
- data/docs/GlobalMetricsHistoricalQuote.md +10 -0
- data/docs/GlobalMetricsQuote.md +10 -0
- data/docs/GlobalMetricsQuotesHistorical.md +10 -0
- data/docs/GlobalMetricsQuotesLatest.md +14 -0
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2004Data.md +8 -0
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +9 -0
- data/docs/InlineResponse2007.md +9 -0
- data/docs/InlineResponse2008.md +9 -0
- data/docs/InlineResponse2009.md +9 -0
- data/docs/Quote.md +1 -1
- data/lib/coinmarketcap_client.rb +13 -4
- data/lib/coinmarketcap_client/api/default_api.rb +150 -26
- data/lib/coinmarketcap_client/models/{info.rb → cryptocurrency_info.rb} +2 -2
- data/lib/coinmarketcap_client/models/{info_urls.rb → cryptocurrency_info_urls.rb} +1 -1
- data/lib/coinmarketcap_client/models/{market_data.rb → cryptocurrency_listings.rb} +1 -1
- data/lib/coinmarketcap_client/models/{map.rb → cryptocurrency_map.rb} +1 -1
- data/lib/coinmarketcap_client/models/global_metrics_historical_quote.rb +202 -0
- data/lib/coinmarketcap_client/models/global_metrics_quote.rb +202 -0
- data/lib/{coinmarketcap_api/models/inline_response_200_3.rb → coinmarketcap_client/models/global_metrics_quotes_historical.rb} +30 -11
- data/lib/{coinmarketcap_api/models/map.rb → coinmarketcap_client/models/global_metrics_quotes_latest.rb} +49 -55
- data/lib/coinmarketcap_client/models/inline_response_200.rb +1 -1
- data/lib/coinmarketcap_client/models/inline_response_200_1.rb +1 -1
- data/lib/coinmarketcap_client/models/inline_response_200_2.rb +1 -1
- data/lib/coinmarketcap_client/models/inline_response_200_3.rb +2 -4
- data/lib/coinmarketcap_client/models/inline_response_200_4.rb +2 -4
- data/lib/{coinmarketcap_api/models/inline_response_200_1.rb → coinmarketcap_client/models/inline_response_200_4_data.rb} +11 -11
- data/lib/coinmarketcap_client/models/inline_response_200_5.rb +1 -1
- data/lib/{coinmarketcap_api/models/inline_response_200_2.rb → coinmarketcap_client/models/inline_response_200_6.rb} +5 -5
- data/lib/{coinmarketcap_api/models/inline_response_200.rb → coinmarketcap_client/models/inline_response_200_7.rb} +4 -4
- data/lib/{coinmarketcap_api/models/inline_response_default_1.rb → coinmarketcap_client/models/inline_response_200_8.rb} +13 -4
- data/lib/{coinmarketcap_api/models/inline_response_default.rb → coinmarketcap_client/models/inline_response_200_9.rb} +13 -4
- data/lib/coinmarketcap_client/models/quote.rb +1 -1
- data/lib/coinmarketcap_client/version.rb +1 -1
- data/spec/api/default_api_spec.rb +71 -6
- data/spec/api_client_spec.rb +29 -29
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/{info_spec.rb → cryptocurrency_info_spec.rb} +6 -6
- data/spec/models/{info_urls_spec.rb → cryptocurrency_info_urls_spec.rb} +6 -6
- data/spec/models/{market_data_spec.rb → cryptocurrency_listings_spec.rb} +6 -6
- data/spec/models/{map_spec.rb → cryptocurrency_map_spec.rb} +6 -6
- data/spec/models/global_metrics_historical_quote_spec.rb +53 -0
- data/spec/models/global_metrics_quote_spec.rb +53 -0
- data/spec/models/global_metrics_quotes_historical_spec.rb +53 -0
- data/spec/models/global_metrics_quotes_latest_spec.rb +77 -0
- data/spec/models/inline_response_200_1_spec.rb +9 -3
- data/spec/models/inline_response_200_2_spec.rb +3 -3
- data/spec/models/inline_response_200_3_spec.rb +9 -3
- data/spec/models/inline_response_200_4_data_spec.rb +41 -0
- data/spec/models/inline_response_200_4_spec.rb +3 -3
- data/spec/models/inline_response_200_5_spec.rb +3 -3
- data/spec/models/inline_response_200_6_spec.rb +47 -0
- data/spec/models/inline_response_200_7_spec.rb +47 -0
- data/spec/models/inline_response_200_8_spec.rb +47 -0
- data/spec/models/inline_response_200_9_spec.rb +47 -0
- data/spec/models/inline_response_200_spec.rb +3 -3
- data/spec/models/inline_response_default_1_spec.rb +3 -3
- data/spec/models/inline_response_default_spec.rb +3 -3
- data/spec/models/platform_spec.rb +3 -3
- data/spec/models/quote_spec.rb +3 -3
- data/spec/models/status_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +54 -34
- data/lib/coinmarketcap_api.rb +0 -50
- data/lib/coinmarketcap_api/api/default_api.rb +0 -145
- data/lib/coinmarketcap_api/api_client.rb +0 -389
- data/lib/coinmarketcap_api/api_error.rb +0 -38
- data/lib/coinmarketcap_api/configuration.rb +0 -209
- data/lib/coinmarketcap_api/models/info.rb +0 -276
- data/lib/coinmarketcap_api/models/info_urls.rb +0 -263
- data/lib/coinmarketcap_api/models/status.rb +0 -219
- data/lib/coinmarketcap_api/version.rb +0 -15
data/docs/InlineResponse2003.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
-
**data** | [**
|
6
|
+
**data** | [**GlobalMetricsQuotesLatest**](GlobalMetricsQuotesLatest.md) | | [optional]
|
7
7
|
**status** | [**Status**](Status.md) | | [optional]
|
8
8
|
|
9
9
|
|
data/docs/InlineResponse2004.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
-
**data** | [**
|
6
|
+
**data** | [**InlineResponse2004Data**](InlineResponse2004Data.md) | | [optional]
|
7
7
|
**status** | [**Status**](Status.md) | | [optional]
|
8
8
|
|
9
9
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# CoinmarketcapClient::InlineResponse2004Data
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**quote** | [**Array<GlobalMetricsQuotesHistorical>**](GlobalMetricsQuotesHistorical.md) | | [optional]
|
7
|
+
|
8
|
+
|
data/docs/InlineResponse2005.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
-
**data** | [**Array<
|
6
|
+
**data** | [**Array<CryptocurrencyMap>**](CryptocurrencyMap.md) | | [optional]
|
7
7
|
**status** | [**Status**](Status.md) | | [optional]
|
8
8
|
|
9
9
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapClient::InlineResponse2006
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Hash<String, CryptocurrencyInfo>**](CryptocurrencyInfo.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapClient::InlineResponse2007
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Array<CryptocurrencyListings>**](CryptocurrencyListings.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapClient::InlineResponse2008
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**GlobalMetricsQuotesLatest**](GlobalMetricsQuotesLatest.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapClient::InlineResponse2009
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**InlineResponse2004Data**](InlineResponse2004Data.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
data/docs/Quote.md
CHANGED
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
|
|
8
8
|
**percent_change_1h** | **Float** | | [optional]
|
9
9
|
**percent_change_24h** | **Float** | | [optional]
|
10
10
|
**percent_change_7d** | **Float** | | [optional]
|
11
|
-
**market_cap** | **
|
11
|
+
**market_cap** | **Float** | | [optional]
|
12
12
|
**last_updated** | **DateTime** | | [optional]
|
13
13
|
|
14
14
|
|
data/lib/coinmarketcap_client.rb
CHANGED
@@ -17,18 +17,27 @@ require 'coinmarketcap_client/version'
|
|
17
17
|
require 'coinmarketcap_client/configuration'
|
18
18
|
|
19
19
|
# Models
|
20
|
-
require 'coinmarketcap_client/models/
|
21
|
-
require 'coinmarketcap_client/models/
|
20
|
+
require 'coinmarketcap_client/models/cryptocurrency_info'
|
21
|
+
require 'coinmarketcap_client/models/cryptocurrency_info_urls'
|
22
|
+
require 'coinmarketcap_client/models/cryptocurrency_listings'
|
23
|
+
require 'coinmarketcap_client/models/cryptocurrency_map'
|
24
|
+
require 'coinmarketcap_client/models/global_metrics_historical_quote'
|
25
|
+
require 'coinmarketcap_client/models/global_metrics_quote'
|
26
|
+
require 'coinmarketcap_client/models/global_metrics_quotes_historical'
|
27
|
+
require 'coinmarketcap_client/models/global_metrics_quotes_latest'
|
22
28
|
require 'coinmarketcap_client/models/inline_response_200'
|
23
29
|
require 'coinmarketcap_client/models/inline_response_200_1'
|
24
30
|
require 'coinmarketcap_client/models/inline_response_200_2'
|
25
31
|
require 'coinmarketcap_client/models/inline_response_200_3'
|
26
32
|
require 'coinmarketcap_client/models/inline_response_200_4'
|
33
|
+
require 'coinmarketcap_client/models/inline_response_200_4_data'
|
27
34
|
require 'coinmarketcap_client/models/inline_response_200_5'
|
35
|
+
require 'coinmarketcap_client/models/inline_response_200_6'
|
36
|
+
require 'coinmarketcap_client/models/inline_response_200_7'
|
37
|
+
require 'coinmarketcap_client/models/inline_response_200_8'
|
38
|
+
require 'coinmarketcap_client/models/inline_response_200_9'
|
28
39
|
require 'coinmarketcap_client/models/inline_response_default'
|
29
40
|
require 'coinmarketcap_client/models/inline_response_default_1'
|
30
|
-
require 'coinmarketcap_client/models/map'
|
31
|
-
require 'coinmarketcap_client/models/market_data'
|
32
41
|
require 'coinmarketcap_client/models/platform'
|
33
42
|
require 'coinmarketcap_client/models/quote'
|
34
43
|
require 'coinmarketcap_client/models/status'
|
@@ -22,9 +22,9 @@ module CoinmarketcapClient
|
|
22
22
|
# Get metadata
|
23
23
|
# Returns all static metadata for one or more cryptocurrencies including name, symbol, logo, and its various registered URLs.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @option opts [String] :id One or more comma-separated CoinMarketCap cryptocurrency IDs. Example
|
25
|
+
# @option opts [String] :id One or more comma-separated CoinMarketCap cryptocurrency IDs. Example \"1,2\"
|
26
26
|
# @option opts [String] :symbol Alternatively pass one or more comma-separated cryptocurrency symbols. Example: \"BTC,ETH\". At least one \"id\" or \"symbol\" is required.
|
27
|
-
# @return [
|
27
|
+
# @return [InlineResponse2006]
|
28
28
|
def cryptocurrency_info_get(opts = {})
|
29
29
|
data, _status_code, _headers = cryptocurrency_info_get_with_http_info(opts)
|
30
30
|
data
|
@@ -33,9 +33,9 @@ module CoinmarketcapClient
|
|
33
33
|
# Get metadata
|
34
34
|
# Returns all static metadata for one or more cryptocurrencies including name, symbol, logo, and its various registered URLs.
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
|
-
# @option opts [String] :id One or more comma-separated CoinMarketCap cryptocurrency IDs. Example
|
36
|
+
# @option opts [String] :id One or more comma-separated CoinMarketCap cryptocurrency IDs. Example \"1,2\"
|
37
37
|
# @option opts [String] :symbol Alternatively pass one or more comma-separated cryptocurrency symbols. Example: \"BTC,ETH\". At least one \"id\" or \"symbol\" is required.
|
38
|
-
# @return [Array<(
|
38
|
+
# @return [Array<(InlineResponse2006, Fixnum, Hash)>] InlineResponse2006 data, response status code and response headers
|
39
39
|
def cryptocurrency_info_get_with_http_info(opts = {})
|
40
40
|
if @api_client.config.debugging
|
41
41
|
@api_client.config.logger.debug 'Calling API: DefaultApi.cryptocurrency_info_get ...'
|
@@ -65,7 +65,7 @@ module CoinmarketcapClient
|
|
65
65
|
:form_params => form_params,
|
66
66
|
:body => post_body,
|
67
67
|
:auth_names => auth_names,
|
68
|
-
:return_type => '
|
68
|
+
:return_type => 'InlineResponse2006')
|
69
69
|
if @api_client.config.debugging
|
70
70
|
@api_client.config.logger.debug "API called: DefaultApi#cryptocurrency_info_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
71
|
end
|
@@ -78,10 +78,10 @@ module CoinmarketcapClient
|
|
78
78
|
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return. (default to 1)
|
79
79
|
# @option opts [Integer] :limit Optionally specify the number of results to return. Use this parameter and the \"start\" parameter to determine your own pagination size. (default to 100)
|
80
80
|
# @option opts [String] :convert Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own \"quote\" object. (default to USD)
|
81
|
-
# @option opts [String] :sort Valid values
|
82
|
-
# @option opts [String] :sort_dir Valid values
|
83
|
-
# @option opts [String] :cryptocurrency_type Valid values
|
84
|
-
# @return [
|
81
|
+
# @option opts [String] :sort Valid values `name` `symbol` `date_added` `market_cap` `price` `circulating_supply` `total_supply` `max_supply` `num_market_pairs` `volume_24h` `percent_change_1h` `percent_change_24h` `percent_change_7d` What field to sort the list of cryptocurrencies by. (default to market_cap)
|
82
|
+
# @option opts [String] :sort_dir Valid values `asc` `desc`. The direction in which to order cryptocurrencies against the specified sort.
|
83
|
+
# @option opts [String] :cryptocurrency_type Valid values `all` `coins` `tokens` The type of cryptocurrency to include.
|
84
|
+
# @return [InlineResponse2007]
|
85
85
|
def cryptocurrency_listings_historical_get(opts = {})
|
86
86
|
data, _status_code, _headers = cryptocurrency_listings_historical_get_with_http_info(opts)
|
87
87
|
data
|
@@ -94,10 +94,10 @@ module CoinmarketcapClient
|
|
94
94
|
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return.
|
95
95
|
# @option opts [Integer] :limit Optionally specify the number of results to return. Use this parameter and the \"start\" parameter to determine your own pagination size.
|
96
96
|
# @option opts [String] :convert Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own \"quote\" object.
|
97
|
-
# @option opts [String] :sort Valid values
|
98
|
-
# @option opts [String] :sort_dir Valid values
|
99
|
-
# @option opts [String] :cryptocurrency_type Valid values
|
100
|
-
# @return [Array<(
|
97
|
+
# @option opts [String] :sort Valid values `name` `symbol` `date_added` `market_cap` `price` `circulating_supply` `total_supply` `max_supply` `num_market_pairs` `volume_24h` `percent_change_1h` `percent_change_24h` `percent_change_7d` What field to sort the list of cryptocurrencies by.
|
98
|
+
# @option opts [String] :sort_dir Valid values `asc` `desc`. The direction in which to order cryptocurrencies against the specified sort.
|
99
|
+
# @option opts [String] :cryptocurrency_type Valid values `all` `coins` `tokens` The type of cryptocurrency to include.
|
100
|
+
# @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers
|
101
101
|
def cryptocurrency_listings_historical_get_with_http_info(opts = {})
|
102
102
|
if @api_client.config.debugging
|
103
103
|
@api_client.config.logger.debug 'Calling API: DefaultApi.cryptocurrency_listings_historical_get ...'
|
@@ -144,7 +144,7 @@ module CoinmarketcapClient
|
|
144
144
|
:form_params => form_params,
|
145
145
|
:body => post_body,
|
146
146
|
:auth_names => auth_names,
|
147
|
-
:return_type => '
|
147
|
+
:return_type => 'InlineResponse2007')
|
148
148
|
if @api_client.config.debugging
|
149
149
|
@api_client.config.logger.debug "API called: DefaultApi#cryptocurrency_listings_historical_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
150
150
|
end
|
@@ -156,10 +156,10 @@ module CoinmarketcapClient
|
|
156
156
|
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return. (default to 1)
|
157
157
|
# @option opts [Integer] :limit Optionally specify the number of results to return. Use this parameter and the \"start\" parameter to determine your own pagination size. (default to 100)
|
158
158
|
# @option opts [String] :convert Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own \"quote\" object. (default to USD)
|
159
|
-
# @option opts [String] :sort Valid values
|
160
|
-
# @option opts [String] :sort_dir Valid values
|
161
|
-
# @option opts [String] :cryptocurrency_type Valid values
|
162
|
-
# @return [
|
159
|
+
# @option opts [String] :sort Valid values `name` `symbol` `date_added` `market_cap` `price` `circulating_supply` `total_supply` `max_supply` `num_market_pairs` `volume_24h` `percent_change_1h` `percent_change_24h` `percent_change_7d` What field to sort the list of cryptocurrencies by. (default to market_cap)
|
160
|
+
# @option opts [String] :sort_dir Valid values `asc` `desc`. The direction in which to order cryptocurrencies against the specified sort.
|
161
|
+
# @option opts [String] :cryptocurrency_type Valid values `all` `coins` `tokens` The type of cryptocurrency to include.
|
162
|
+
# @return [InlineResponse2007]
|
163
163
|
def cryptocurrency_listings_latest_get(opts = {})
|
164
164
|
data, _status_code, _headers = cryptocurrency_listings_latest_get_with_http_info(opts)
|
165
165
|
data
|
@@ -171,10 +171,10 @@ module CoinmarketcapClient
|
|
171
171
|
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return.
|
172
172
|
# @option opts [Integer] :limit Optionally specify the number of results to return. Use this parameter and the \"start\" parameter to determine your own pagination size.
|
173
173
|
# @option opts [String] :convert Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own \"quote\" object.
|
174
|
-
# @option opts [String] :sort Valid values
|
175
|
-
# @option opts [String] :sort_dir Valid values
|
176
|
-
# @option opts [String] :cryptocurrency_type Valid values
|
177
|
-
# @return [Array<(
|
174
|
+
# @option opts [String] :sort Valid values `name` `symbol` `date_added` `market_cap` `price` `circulating_supply` `total_supply` `max_supply` `num_market_pairs` `volume_24h` `percent_change_1h` `percent_change_24h` `percent_change_7d` What field to sort the list of cryptocurrencies by.
|
175
|
+
# @option opts [String] :sort_dir Valid values `asc` `desc`. The direction in which to order cryptocurrencies against the specified sort.
|
176
|
+
# @option opts [String] :cryptocurrency_type Valid values `all` `coins` `tokens` The type of cryptocurrency to include.
|
177
|
+
# @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers
|
178
178
|
def cryptocurrency_listings_latest_get_with_http_info(opts = {})
|
179
179
|
if @api_client.config.debugging
|
180
180
|
@api_client.config.logger.debug 'Calling API: DefaultApi.cryptocurrency_listings_latest_get ...'
|
@@ -220,7 +220,7 @@ module CoinmarketcapClient
|
|
220
220
|
:form_params => form_params,
|
221
221
|
:body => post_body,
|
222
222
|
:auth_names => auth_names,
|
223
|
-
:return_type => '
|
223
|
+
:return_type => 'InlineResponse2007')
|
224
224
|
if @api_client.config.debugging
|
225
225
|
@api_client.config.logger.debug "API called: DefaultApi#cryptocurrency_listings_latest_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
226
226
|
end
|
@@ -233,7 +233,7 @@ module CoinmarketcapClient
|
|
233
233
|
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return. (default to 1)
|
234
234
|
# @option opts [Integer] :limit Optionally specify the number of results to return. Use this parameter and the \"start\" parameter to determine your own pagination size.
|
235
235
|
# @option opts [String] :symbol Optionally pass a comma-separated list of cryptocurrency symbols to return CoinMarketCap IDs for. If this option is passed, other options will be ignored.
|
236
|
-
# @return [
|
236
|
+
# @return [InlineResponse2005]
|
237
237
|
def cryptocurrency_map_get(opts = {})
|
238
238
|
data, _status_code, _headers = cryptocurrency_map_get_with_http_info(opts)
|
239
239
|
data
|
@@ -246,7 +246,7 @@ module CoinmarketcapClient
|
|
246
246
|
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return.
|
247
247
|
# @option opts [Integer] :limit Optionally specify the number of results to return. Use this parameter and the \"start\" parameter to determine your own pagination size.
|
248
248
|
# @option opts [String] :symbol Optionally pass a comma-separated list of cryptocurrency symbols to return CoinMarketCap IDs for. If this option is passed, other options will be ignored.
|
249
|
-
# @return [Array<(
|
249
|
+
# @return [Array<(InlineResponse2005, Fixnum, Hash)>] InlineResponse2005 data, response status code and response headers
|
250
250
|
def cryptocurrency_map_get_with_http_info(opts = {})
|
251
251
|
if @api_client.config.debugging
|
252
252
|
@api_client.config.logger.debug 'Calling API: DefaultApi.cryptocurrency_map_get ...'
|
@@ -290,11 +290,135 @@ module CoinmarketcapClient
|
|
290
290
|
:form_params => form_params,
|
291
291
|
:body => post_body,
|
292
292
|
:auth_names => auth_names,
|
293
|
-
:return_type => '
|
293
|
+
:return_type => 'InlineResponse2005')
|
294
294
|
if @api_client.config.debugging
|
295
295
|
@api_client.config.logger.debug "API called: DefaultApi#cryptocurrency_map_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
296
296
|
end
|
297
297
|
return data, status_code, headers
|
298
298
|
end
|
299
|
+
# List all cryptocurrencies (latest)
|
300
|
+
# Get a paginated list of all cryptocurrencies with latest market data. You can configure this call to sort by market cap or another market ranking field. Use the \"convert\" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
|
301
|
+
# @param [Hash] opts the optional parameters
|
302
|
+
# @option opts [String] :time_start Timestamp (Unix or ISO 8601) to start returning quotes for. Optional, if not passed, we'll return quotes calculated in reverse from \"time_end\".
|
303
|
+
# @option opts [String] :time_end Timestamp (Unix or ISO 8601) to stop returning quotes for (inclusive). Optional, if not passed, we'll default to the current time. If no \"time_start\" is passed, we return quotes in reverse order starting from this time.
|
304
|
+
# @option opts [Integer] :count The number of interval periods to return results for. Optional, required if both \"time_start\" and \"time_end\" aren't supplied. The default is 10 items. The current query limit is 10000. (default to 10)
|
305
|
+
# @option opts [String] :interval Valid values \"yearly\" \"monthly\" \"weekly\" \"daily\" \"hourly\" \"5m\" \"10m\" \"15m\" \"30m\" \"45m\" \"1h\" \"2h\" \"3h\" \"6h\" \"12h\" \"24h\" \"1d\" \"2d\" \"3d\" \"7d\" \"14d\" \"15d\" \"30d\" \"60d\" \"90d\" \"365d\" Interval of time to return data points for. See details in endpoint description. (default to 1d)
|
306
|
+
# @option opts [String] :convert_id One or more comma-separated cryptocurrency CoinMarketCap IDs. Example 1,2
|
307
|
+
# @option opts [String] :convert By default market quotes are returned in USD. Optionally calculate market quotes in up to 3 other fiat currencies or cryptocurrencies.
|
308
|
+
# @return [InlineResponse2009]
|
309
|
+
def global_metrics_quotes_historical_get(opts = {})
|
310
|
+
data, _status_code, _headers = global_metrics_quotes_historical_get_with_http_info(opts)
|
311
|
+
data
|
312
|
+
end
|
313
|
+
|
314
|
+
# List all cryptocurrencies (latest)
|
315
|
+
# Get a paginated list of all cryptocurrencies with latest market data. You can configure this call to sort by market cap or another market ranking field. Use the \"convert\" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
|
316
|
+
# @param [Hash] opts the optional parameters
|
317
|
+
# @option opts [String] :time_start Timestamp (Unix or ISO 8601) to start returning quotes for. Optional, if not passed, we'll return quotes calculated in reverse from \"time_end\".
|
318
|
+
# @option opts [String] :time_end Timestamp (Unix or ISO 8601) to stop returning quotes for (inclusive). Optional, if not passed, we'll default to the current time. If no \"time_start\" is passed, we return quotes in reverse order starting from this time.
|
319
|
+
# @option opts [Integer] :count The number of interval periods to return results for. Optional, required if both \"time_start\" and \"time_end\" aren't supplied. The default is 10 items. The current query limit is 10000.
|
320
|
+
# @option opts [String] :interval Valid values \"yearly\" \"monthly\" \"weekly\" \"daily\" \"hourly\" \"5m\" \"10m\" \"15m\" \"30m\" \"45m\" \"1h\" \"2h\" \"3h\" \"6h\" \"12h\" \"24h\" \"1d\" \"2d\" \"3d\" \"7d\" \"14d\" \"15d\" \"30d\" \"60d\" \"90d\" \"365d\" Interval of time to return data points for. See details in endpoint description.
|
321
|
+
# @option opts [String] :convert_id One or more comma-separated cryptocurrency CoinMarketCap IDs. Example 1,2
|
322
|
+
# @option opts [String] :convert By default market quotes are returned in USD. Optionally calculate market quotes in up to 3 other fiat currencies or cryptocurrencies.
|
323
|
+
# @return [Array<(InlineResponse2009, Fixnum, Hash)>] InlineResponse2009 data, response status code and response headers
|
324
|
+
def global_metrics_quotes_historical_get_with_http_info(opts = {})
|
325
|
+
if @api_client.config.debugging
|
326
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.global_metrics_quotes_historical_get ...'
|
327
|
+
end
|
328
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 10000
|
329
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling DefaultApi.global_metrics_quotes_historical_get, must be smaller than or equal to 10000.'
|
330
|
+
end
|
331
|
+
|
332
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
333
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling DefaultApi.global_metrics_quotes_historical_get, must be greater than or equal to 1.'
|
334
|
+
end
|
335
|
+
|
336
|
+
# resource path
|
337
|
+
local_var_path = '/global-metrics/quotes/historical'
|
338
|
+
|
339
|
+
# query parameters
|
340
|
+
query_params = {}
|
341
|
+
query_params[:'time_start'] = opts[:'time_start'] if !opts[:'time_start'].nil?
|
342
|
+
query_params[:'time_end'] = opts[:'time_end'] if !opts[:'time_end'].nil?
|
343
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
344
|
+
query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].nil?
|
345
|
+
query_params[:'convert_id'] = opts[:'convert_id'] if !opts[:'convert_id'].nil?
|
346
|
+
query_params[:'convert'] = opts[:'convert'] if !opts[:'convert'].nil?
|
347
|
+
|
348
|
+
# header parameters
|
349
|
+
header_params = {}
|
350
|
+
# HTTP header 'Accept' (if needed)
|
351
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
352
|
+
|
353
|
+
# form parameters
|
354
|
+
form_params = {}
|
355
|
+
|
356
|
+
# http body (model)
|
357
|
+
post_body = nil
|
358
|
+
auth_names = ['ApiKeyAuth']
|
359
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
360
|
+
:header_params => header_params,
|
361
|
+
:query_params => query_params,
|
362
|
+
:form_params => form_params,
|
363
|
+
:body => post_body,
|
364
|
+
:auth_names => auth_names,
|
365
|
+
:return_type => 'InlineResponse2009')
|
366
|
+
if @api_client.config.debugging
|
367
|
+
@api_client.config.logger.debug "API called: DefaultApi#global_metrics_quotes_historical_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
368
|
+
end
|
369
|
+
return data, status_code, headers
|
370
|
+
end
|
371
|
+
# Get aggregate market metrics (latest)
|
372
|
+
# Get the latest quote of aggregate market metrics. Use the \"convert\" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
|
373
|
+
# @param [Hash] opts the optional parameters
|
374
|
+
# @option opts [String] :convert_id One or more comma-separated cryptocurrency CoinMarketCap IDs. Example 1,2
|
375
|
+
# @option opts [String] :convert Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own \"quote\" object.
|
376
|
+
# @return [InlineResponse2008]
|
377
|
+
def global_metrics_quotes_latest_get(opts = {})
|
378
|
+
data, _status_code, _headers = global_metrics_quotes_latest_get_with_http_info(opts)
|
379
|
+
data
|
380
|
+
end
|
381
|
+
|
382
|
+
# Get aggregate market metrics (latest)
|
383
|
+
# Get the latest quote of aggregate market metrics. Use the \"convert\" option to return market values in multiple fiat and cryptocurrency conversions in the same call.
|
384
|
+
# @param [Hash] opts the optional parameters
|
385
|
+
# @option opts [String] :convert_id One or more comma-separated cryptocurrency CoinMarketCap IDs. Example 1,2
|
386
|
+
# @option opts [String] :convert Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found here. Each conversion is returned in its own \"quote\" object.
|
387
|
+
# @return [Array<(InlineResponse2008, Fixnum, Hash)>] InlineResponse2008 data, response status code and response headers
|
388
|
+
def global_metrics_quotes_latest_get_with_http_info(opts = {})
|
389
|
+
if @api_client.config.debugging
|
390
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.global_metrics_quotes_latest_get ...'
|
391
|
+
end
|
392
|
+
# resource path
|
393
|
+
local_var_path = '/global-metrics/quotes/latest'
|
394
|
+
|
395
|
+
# query parameters
|
396
|
+
query_params = {}
|
397
|
+
query_params[:'convert_id'] = opts[:'convert_id'] if !opts[:'convert_id'].nil?
|
398
|
+
query_params[:'convert'] = opts[:'convert'] if !opts[:'convert'].nil?
|
399
|
+
|
400
|
+
# header parameters
|
401
|
+
header_params = {}
|
402
|
+
# HTTP header 'Accept' (if needed)
|
403
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
404
|
+
|
405
|
+
# form parameters
|
406
|
+
form_params = {}
|
407
|
+
|
408
|
+
# http body (model)
|
409
|
+
post_body = nil
|
410
|
+
auth_names = ['ApiKeyAuth']
|
411
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
412
|
+
:header_params => header_params,
|
413
|
+
:query_params => query_params,
|
414
|
+
:form_params => form_params,
|
415
|
+
:body => post_body,
|
416
|
+
:auth_names => auth_names,
|
417
|
+
:return_type => 'InlineResponse2008')
|
418
|
+
if @api_client.config.debugging
|
419
|
+
@api_client.config.logger.debug "API called: DefaultApi#global_metrics_quotes_latest_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
420
|
+
end
|
421
|
+
return data, status_code, headers
|
422
|
+
end
|
299
423
|
end
|
300
424
|
end
|
@@ -13,7 +13,7 @@ Swagger Codegen version: 2.4.4
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module CoinmarketcapClient
|
16
|
-
class
|
16
|
+
class CryptocurrencyInfo
|
17
17
|
attr_accessor :id
|
18
18
|
|
19
19
|
attr_accessor :name
|
@@ -67,7 +67,7 @@ module CoinmarketcapClient
|
|
67
67
|
:'description' => :'String',
|
68
68
|
:'date_added' => :'DateTime',
|
69
69
|
:'platform' => :'Platform',
|
70
|
-
:'urls' => :'
|
70
|
+
:'urls' => :'CryptocurrencyInfoUrls'
|
71
71
|
}
|
72
72
|
end
|
73
73
|
|
@@ -0,0 +1,202 @@
|
|
1
|
+
=begin
|
2
|
+
#Coinmarketcap API Swagger Implementation
|
3
|
+
|
4
|
+
#Define coinmarketcap's api in swagger 2.0 openapi standard
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.4
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CoinmarketcapClient
|
16
|
+
# Global metrics historical object
|
17
|
+
class GlobalMetricsHistoricalQuote
|
18
|
+
attr_accessor :total_market_cap
|
19
|
+
|
20
|
+
attr_accessor :total_volume_24h
|
21
|
+
|
22
|
+
attr_accessor :timestamp
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'total_market_cap' => :'total_market_cap',
|
28
|
+
:'total_volume_24h' => :'total_volume_24h',
|
29
|
+
:'timestamp' => :'timestamp'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.swagger_types
|
35
|
+
{
|
36
|
+
:'total_market_cap' => :'Float',
|
37
|
+
:'total_volume_24h' => :'Float',
|
38
|
+
:'timestamp' => :'DateTime'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Initializes the object
|
43
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
44
|
+
def initialize(attributes = {})
|
45
|
+
return unless attributes.is_a?(Hash)
|
46
|
+
|
47
|
+
# convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
49
|
+
|
50
|
+
if attributes.has_key?(:'total_market_cap')
|
51
|
+
self.total_market_cap = attributes[:'total_market_cap']
|
52
|
+
end
|
53
|
+
|
54
|
+
if attributes.has_key?(:'total_volume_24h')
|
55
|
+
self.total_volume_24h = attributes[:'total_volume_24h']
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes.has_key?(:'timestamp')
|
59
|
+
self.timestamp = attributes[:'timestamp']
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
64
|
+
# @return Array for valid properties with the reasons
|
65
|
+
def list_invalid_properties
|
66
|
+
invalid_properties = Array.new
|
67
|
+
invalid_properties
|
68
|
+
end
|
69
|
+
|
70
|
+
# Check to see if the all the properties in the model are valid
|
71
|
+
# @return true if the model is valid
|
72
|
+
def valid?
|
73
|
+
true
|
74
|
+
end
|
75
|
+
|
76
|
+
# Checks equality by comparing each attribute.
|
77
|
+
# @param [Object] Object to be compared
|
78
|
+
def ==(o)
|
79
|
+
return true if self.equal?(o)
|
80
|
+
self.class == o.class &&
|
81
|
+
total_market_cap == o.total_market_cap &&
|
82
|
+
total_volume_24h == o.total_volume_24h &&
|
83
|
+
timestamp == o.timestamp
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Fixnum] Hash code
|
94
|
+
def hash
|
95
|
+
[total_market_cap, total_volume_24h, timestamp].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def build_from_hash(attributes)
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
103
|
+
self.class.swagger_types.each_pair do |key, type|
|
104
|
+
if type =~ /\AArray<(.*)>/i
|
105
|
+
# check to ensure the input is an array given that the the attribute
|
106
|
+
# is documented as an array but the input is not
|
107
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
108
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
109
|
+
end
|
110
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
111
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
112
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
|
118
|
+
# Deserializes the data based on type
|
119
|
+
# @param string type Data type
|
120
|
+
# @param string value Value to be deserialized
|
121
|
+
# @return [Object] Deserialized data
|
122
|
+
def _deserialize(type, value)
|
123
|
+
case type.to_sym
|
124
|
+
when :DateTime
|
125
|
+
DateTime.parse(value)
|
126
|
+
when :Date
|
127
|
+
Date.parse(value)
|
128
|
+
when :String
|
129
|
+
value.to_s
|
130
|
+
when :Integer
|
131
|
+
value.to_i
|
132
|
+
when :Float
|
133
|
+
value.to_f
|
134
|
+
when :BOOLEAN
|
135
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
136
|
+
true
|
137
|
+
else
|
138
|
+
false
|
139
|
+
end
|
140
|
+
when :Object
|
141
|
+
# generic object (usually a Hash), return directly
|
142
|
+
value
|
143
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
+
inner_type = Regexp.last_match[:inner_type]
|
145
|
+
value.map { |v| _deserialize(inner_type, v) }
|
146
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
+
k_type = Regexp.last_match[:k_type]
|
148
|
+
v_type = Regexp.last_match[:v_type]
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each do |k, v|
|
151
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
else # model
|
155
|
+
temp_model = CoinmarketcapClient.const_get(type).new
|
156
|
+
temp_model.build_from_hash(value)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the string representation of the object
|
161
|
+
# @return [String] String presentation of the object
|
162
|
+
def to_s
|
163
|
+
to_hash.to_s
|
164
|
+
end
|
165
|
+
|
166
|
+
# to_body is an alias to to_hash (backward compatibility)
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
168
|
+
def to_body
|
169
|
+
to_hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Returns the object in the form of hash
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_hash
|
175
|
+
hash = {}
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
177
|
+
value = self.send(attr)
|
178
|
+
next if value.nil?
|
179
|
+
hash[param] = _to_hash(value)
|
180
|
+
end
|
181
|
+
hash
|
182
|
+
end
|
183
|
+
|
184
|
+
# Outputs non-array value in the form of hash
|
185
|
+
# For object, use to_hash. Otherwise, just return the value
|
186
|
+
# @param [Object] value Any valid value
|
187
|
+
# @return [Hash] Returns the value in the form of hash
|
188
|
+
def _to_hash(value)
|
189
|
+
if value.is_a?(Array)
|
190
|
+
value.compact.map { |v| _to_hash(v) }
|
191
|
+
elsif value.is_a?(Hash)
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
194
|
+
end
|
195
|
+
elsif value.respond_to? :to_hash
|
196
|
+
value.to_hash
|
197
|
+
else
|
198
|
+
value
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|