coinmarketcap_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +121 -0
- data/Rakefile +8 -0
- data/coinmarketcap_api.gemspec +45 -0
- data/coinmarketcap_client.gemspec +45 -0
- data/docs/DefaultApi.md +262 -0
- data/docs/Info.md +18 -0
- data/docs/InfoUrls.md +15 -0
- data/docs/InlineResponse200.md +9 -0
- data/docs/InlineResponse2001.md +9 -0
- data/docs/InlineResponse2002.md +9 -0
- data/docs/InlineResponse2003.md +9 -0
- data/docs/InlineResponse2004.md +9 -0
- data/docs/InlineResponse2005.md +9 -0
- data/docs/InlineResponseDefault.md +8 -0
- data/docs/InlineResponseDefault1.md +8 -0
- data/docs/Map.md +15 -0
- data/docs/MarketData.md +21 -0
- data/docs/Platform.md +12 -0
- data/docs/Quote.md +14 -0
- data/docs/Status.md +12 -0
- data/git_push.sh +55 -0
- data/lib/coinmarketcap_api.rb +50 -0
- data/lib/coinmarketcap_api/api/default_api.rb +145 -0
- data/lib/coinmarketcap_api/api_client.rb +389 -0
- data/lib/coinmarketcap_api/api_error.rb +38 -0
- data/lib/coinmarketcap_api/configuration.rb +209 -0
- data/lib/coinmarketcap_api/models/info.rb +276 -0
- data/lib/coinmarketcap_api/models/info_urls.rb +263 -0
- data/lib/coinmarketcap_api/models/inline_response_200.rb +194 -0
- data/lib/coinmarketcap_api/models/inline_response_200_1.rb +185 -0
- data/lib/coinmarketcap_api/models/inline_response_200_2.rb +194 -0
- data/lib/coinmarketcap_api/models/inline_response_200_3.rb +185 -0
- data/lib/coinmarketcap_api/models/inline_response_default.rb +183 -0
- data/lib/coinmarketcap_api/models/inline_response_default_1.rb +183 -0
- data/lib/coinmarketcap_api/models/map.rb +246 -0
- data/lib/coinmarketcap_api/models/status.rb +219 -0
- data/lib/coinmarketcap_api/version.rb +15 -0
- data/lib/coinmarketcap_client.rb +55 -0
- data/lib/coinmarketcap_client/api/default_api.rb +300 -0
- data/lib/coinmarketcap_client/api_client.rb +389 -0
- data/lib/coinmarketcap_client/api_error.rb +38 -0
- data/lib/coinmarketcap_client/configuration.rb +209 -0
- data/lib/coinmarketcap_client/models/info.rb +276 -0
- data/lib/coinmarketcap_client/models/info_urls.rb +263 -0
- data/lib/coinmarketcap_client/models/inline_response_200.rb +194 -0
- data/lib/coinmarketcap_client/models/inline_response_200_1.rb +194 -0
- data/lib/coinmarketcap_client/models/inline_response_200_2.rb +194 -0
- data/lib/coinmarketcap_client/models/inline_response_200_3.rb +194 -0
- data/lib/coinmarketcap_client/models/inline_response_200_4.rb +194 -0
- data/lib/coinmarketcap_client/models/inline_response_200_5.rb +194 -0
- data/lib/coinmarketcap_client/models/inline_response_default.rb +183 -0
- data/lib/coinmarketcap_client/models/inline_response_default_1.rb +183 -0
- data/lib/coinmarketcap_client/models/map.rb +246 -0
- data/lib/coinmarketcap_client/models/market_data.rb +304 -0
- data/lib/coinmarketcap_client/models/platform.rb +220 -0
- data/lib/coinmarketcap_client/models/quote.rb +237 -0
- data/lib/coinmarketcap_client/models/status.rb +219 -0
- data/lib/coinmarketcap_client/version.rb +15 -0
- data/spec/api/default_api_spec.rb +63 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/info_spec.rb +101 -0
- data/spec/models/info_urls_spec.rb +83 -0
- data/spec/models/inline_response_200_1_spec.rb +41 -0
- data/spec/models/inline_response_200_2_spec.rb +47 -0
- data/spec/models/inline_response_200_3_spec.rb +41 -0
- data/spec/models/inline_response_200_4_spec.rb +47 -0
- data/spec/models/inline_response_200_5_spec.rb +47 -0
- data/spec/models/inline_response_200_spec.rb +47 -0
- data/spec/models/inline_response_default_1_spec.rb +41 -0
- data/spec/models/inline_response_default_spec.rb +41 -0
- data/spec/models/map_spec.rb +83 -0
- data/spec/models/market_data_spec.rb +119 -0
- data/spec/models/platform_spec.rb +65 -0
- data/spec/models/quote_spec.rb +77 -0
- data/spec/models/status_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +320 -0
data/docs/Info.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# CoinmarketcapAPI::Info
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**name** | **String** | | [optional]
|
8
|
+
**symbol** | **String** | | [optional]
|
9
|
+
**category** | **String** | | [optional]
|
10
|
+
**slug** | **String** | | [optional]
|
11
|
+
**logo** | **String** | | [optional]
|
12
|
+
**tags** | **Array<String>** | coin tags | [optional]
|
13
|
+
**description** | **String** | | [optional]
|
14
|
+
**date_added** | **DateTime** | | [optional]
|
15
|
+
**platform** | [**Platform**](Platform.md) | | [optional]
|
16
|
+
**urls** | [**InfoUrls**](InfoUrls.md) | | [optional]
|
17
|
+
|
18
|
+
|
data/docs/InfoUrls.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# CoinmarketcapAPI::InfoUrls
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**website** | **Array<String>** | | [optional]
|
7
|
+
**explorer** | **Array<String>** | | [optional]
|
8
|
+
**source_code** | **Array<String>** | | [optional]
|
9
|
+
**message_board** | **Array<String>** | | [optional]
|
10
|
+
**chat** | **Array<String>** | | [optional]
|
11
|
+
**announcement** | **Array<String>** | | [optional]
|
12
|
+
**reddit** | **Array<String>** | | [optional]
|
13
|
+
**twitter** | **Array<String>** | | [optional]
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapAPI::InlineResponse200
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Array<Map>**](Map.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapAPI::InlineResponse2001
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Hash<String, Info>**](Info.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapAPI::InlineResponse2002
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Array<MarketData>**](MarketData.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapAPI::InlineResponse2003
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Array<Map>**](Map.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapAPI::InlineResponse2004
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Hash<String, Info>**](Info.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# CoinmarketcapAPI::InlineResponse2005
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**data** | [**Array<MarketData>**](MarketData.md) | | [optional]
|
7
|
+
**status** | [**Status**](Status.md) | | [optional]
|
8
|
+
|
9
|
+
|
data/docs/Map.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# CoinmarketcapAPI::Map
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**name** | **String** | | [optional]
|
8
|
+
**symbol** | **String** | | [optional]
|
9
|
+
**slug** | **String** | | [optional]
|
10
|
+
**is_active** | **Integer** | | [optional]
|
11
|
+
**first_historical_data** | **DateTime** | | [optional]
|
12
|
+
**last_historical_data** | **DateTime** | | [optional]
|
13
|
+
**platform** | [**Platform**](Platform.md) | | [optional]
|
14
|
+
|
15
|
+
|
data/docs/MarketData.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# CoinmarketcapAPI::MarketData
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**name** | **String** | | [optional]
|
8
|
+
**symbol** | **String** | | [optional]
|
9
|
+
**slug** | **String** | | [optional]
|
10
|
+
**cmc_rank** | **Integer** | | [optional]
|
11
|
+
**num_market_pairs** | **Integer** | | [optional]
|
12
|
+
**circulating_supply** | **Integer** | | [optional]
|
13
|
+
**total_supply** | **Integer** | | [optional]
|
14
|
+
**max_supply** | **Integer** | | [optional]
|
15
|
+
**last_updated** | **DateTime** | | [optional]
|
16
|
+
**date_added** | **DateTime** | | [optional]
|
17
|
+
**tags** | **Array<String>** | | [optional]
|
18
|
+
**platform** | [**Platform**](Platform.md) | | [optional]
|
19
|
+
**quote** | [**Hash<String, Quote>**](Quote.md) | | [optional]
|
20
|
+
|
21
|
+
|
data/docs/Platform.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# CoinmarketcapAPI::Platform
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **Integer** | | [optional]
|
7
|
+
**name** | **String** | | [optional]
|
8
|
+
**symbol** | **String** | | [optional]
|
9
|
+
**slug** | **String** | | [optional]
|
10
|
+
**token_address** | **String** | | [optional]
|
11
|
+
|
12
|
+
|
data/docs/Quote.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# CoinmarketcapAPI::Quote
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**price** | **Float** | | [optional]
|
7
|
+
**volume_24h** | **Integer** | | [optional]
|
8
|
+
**percent_change_1h** | **Float** | | [optional]
|
9
|
+
**percent_change_24h** | **Float** | | [optional]
|
10
|
+
**percent_change_7d** | **Float** | | [optional]
|
11
|
+
**market_cap** | **Integer** | | [optional]
|
12
|
+
**last_updated** | **DateTime** | | [optional]
|
13
|
+
|
14
|
+
|
data/docs/Status.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# CoinmarketcapAPI::Status
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**timestamp** | **DateTime** | | [optional]
|
7
|
+
**error_code** | **Integer** | | [optional]
|
8
|
+
**error_message** | **String** | | [optional]
|
9
|
+
**elapsed** | **Integer** | | [optional]
|
10
|
+
**credit_count** | **Integer** | | [optional]
|
11
|
+
|
12
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
4
|
+
#
|
5
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
6
|
+
#
|
7
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
8
|
+
|
9
|
+
git_user_id=$1
|
10
|
+
git_repo_id=$2
|
11
|
+
release_note=$3
|
12
|
+
|
13
|
+
if [ "$git_user_id" = "" ]; then
|
14
|
+
git_user_id="GIT_USER_ID"
|
15
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
16
|
+
fi
|
17
|
+
|
18
|
+
if [ "$git_repo_id" = "" ]; then
|
19
|
+
git_repo_id="GIT_REPO_ID"
|
20
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
21
|
+
fi
|
22
|
+
|
23
|
+
if [ "$release_note" = "" ]; then
|
24
|
+
release_note="Minor update"
|
25
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
26
|
+
fi
|
27
|
+
|
28
|
+
# Initialize the local directory as a Git repository
|
29
|
+
git init
|
30
|
+
|
31
|
+
# Adds the files in the local repository and stages them for commit.
|
32
|
+
git add .
|
33
|
+
|
34
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
35
|
+
git commit -m "$release_note"
|
36
|
+
|
37
|
+
# Sets the new remote
|
38
|
+
git_remote=`git remote`
|
39
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
40
|
+
|
41
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
42
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
43
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
44
|
+
else
|
45
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
46
|
+
fi
|
47
|
+
|
48
|
+
fi
|
49
|
+
|
50
|
+
git pull origin master
|
51
|
+
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
53
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
55
|
+
|
@@ -0,0 +1,50 @@
|
|
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
|
+
# Common files
|
14
|
+
require 'coinmarketcap_api/api_client'
|
15
|
+
require 'coinmarketcap_api/api_error'
|
16
|
+
require 'coinmarketcap_api/version'
|
17
|
+
require 'coinmarketcap_api/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'coinmarketcap_api/models/info'
|
21
|
+
require 'coinmarketcap_api/models/info_urls'
|
22
|
+
require 'coinmarketcap_api/models/inline_response_200'
|
23
|
+
require 'coinmarketcap_api/models/inline_response_200_1'
|
24
|
+
require 'coinmarketcap_api/models/inline_response_200_2'
|
25
|
+
require 'coinmarketcap_api/models/inline_response_200_3'
|
26
|
+
require 'coinmarketcap_api/models/inline_response_default'
|
27
|
+
require 'coinmarketcap_api/models/inline_response_default_1'
|
28
|
+
require 'coinmarketcap_api/models/map'
|
29
|
+
require 'coinmarketcap_api/models/status'
|
30
|
+
|
31
|
+
# APIs
|
32
|
+
require 'coinmarketcap_api/api/default_api'
|
33
|
+
|
34
|
+
module CoinmarketcapAPI
|
35
|
+
class << self
|
36
|
+
# Customize default settings for the SDK using block.
|
37
|
+
# CoinmarketcapAPI.configure do |config|
|
38
|
+
# config.username = "xxx"
|
39
|
+
# config.password = "xxx"
|
40
|
+
# end
|
41
|
+
# If no block given, return the default Configuration object.
|
42
|
+
def configure
|
43
|
+
if block_given?
|
44
|
+
yield(Configuration.default)
|
45
|
+
else
|
46
|
+
Configuration.default
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,145 @@
|
|
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 'uri'
|
14
|
+
|
15
|
+
module CoinmarketcapAPI
|
16
|
+
class DefaultApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get metadata
|
23
|
+
# Returns all static metadata for one or more cryptocurrencies including name, symbol, logo, and its various registered URLs.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :id One or more comma-separated CoinMarketCap cryptocurrency IDs. Example: \"1,2\"
|
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 [InlineResponse2003]
|
28
|
+
def cryptocurrency_info_get(opts = {})
|
29
|
+
data, _status_code, _headers = cryptocurrency_info_get_with_http_info(opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Get metadata
|
34
|
+
# Returns all static metadata for one or more cryptocurrencies including name, symbol, logo, and its various registered URLs.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [String] :id One or more comma-separated CoinMarketCap cryptocurrency IDs. Example: \"1,2\"
|
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<(InlineResponse2003, Fixnum, Hash)>] InlineResponse2003 data, response status code and response headers
|
39
|
+
def cryptocurrency_info_get_with_http_info(opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.cryptocurrency_info_get ...'
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/cryptocurrency/info'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = {}
|
48
|
+
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
|
49
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = nil
|
61
|
+
auth_names = ['ApiKeyAuth']
|
62
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => 'InlineResponse2003')
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug "API called: DefaultApi#cryptocurrency_info_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
|
+
end
|
72
|
+
return data, status_code, headers
|
73
|
+
end
|
74
|
+
# Get CoinMarketCap ID map
|
75
|
+
# Returns a paginated list of all cryptocurrencies by CoinMarketCap ID. We recommend using this convenience endpoint to lookup and utilize our unique cryptocurrency id across all endpoints as typical identifiers like ticker symbols can match multiple cryptocurrencies and change over time. As a convenience you may pass a comma-separated list of cryptocurrency symbols as symbol to filter this list to only those you require.
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @option opts [String] :listing_status Only active coins are returned by default. Pass 'inactive' to get a list of coins that are no longer active. (default to active)
|
78
|
+
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return. (default to 1)
|
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.
|
80
|
+
# @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.
|
81
|
+
# @return [InlineResponse2002]
|
82
|
+
def cryptocurrency_map_get(opts = {})
|
83
|
+
data, _status_code, _headers = cryptocurrency_map_get_with_http_info(opts)
|
84
|
+
data
|
85
|
+
end
|
86
|
+
|
87
|
+
# Get CoinMarketCap ID map
|
88
|
+
# Returns a paginated list of all cryptocurrencies by CoinMarketCap ID. We recommend using this convenience endpoint to lookup and utilize our unique cryptocurrency id across all endpoints as typical identifiers like ticker symbols can match multiple cryptocurrencies and change over time. As a convenience you may pass a comma-separated list of cryptocurrency symbols as symbol to filter this list to only those you require.
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @option opts [String] :listing_status Only active coins are returned by default. Pass 'inactive' to get a list of coins that are no longer active.
|
91
|
+
# @option opts [Integer] :start Optionally offset the start (1-based index) of the paginated list of items to return.
|
92
|
+
# @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.
|
93
|
+
# @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.
|
94
|
+
# @return [Array<(InlineResponse2002, Fixnum, Hash)>] InlineResponse2002 data, response status code and response headers
|
95
|
+
def cryptocurrency_map_get_with_http_info(opts = {})
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.cryptocurrency_map_get ...'
|
98
|
+
end
|
99
|
+
if @api_client.config.client_side_validation && !opts[:'start'].nil? && opts[:'start'] < 1
|
100
|
+
fail ArgumentError, 'invalid value for "opts[:"start"]" when calling DefaultApi.cryptocurrency_map_get, must be greater than or equal to 1.'
|
101
|
+
end
|
102
|
+
|
103
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
|
104
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.cryptocurrency_map_get, must be smaller than or equal to 5000.'
|
105
|
+
end
|
106
|
+
|
107
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
108
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DefaultApi.cryptocurrency_map_get, must be greater than or equal to 1.'
|
109
|
+
end
|
110
|
+
|
111
|
+
# resource path
|
112
|
+
local_var_path = '/cryptocurrency/map'
|
113
|
+
|
114
|
+
# query parameters
|
115
|
+
query_params = {}
|
116
|
+
query_params[:'listing_status'] = opts[:'listing_status'] if !opts[:'listing_status'].nil?
|
117
|
+
query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
|
118
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
119
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
120
|
+
|
121
|
+
# header parameters
|
122
|
+
header_params = {}
|
123
|
+
# HTTP header 'Accept' (if needed)
|
124
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
125
|
+
|
126
|
+
# form parameters
|
127
|
+
form_params = {}
|
128
|
+
|
129
|
+
# http body (model)
|
130
|
+
post_body = nil
|
131
|
+
auth_names = ['ApiKeyAuth']
|
132
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
133
|
+
:header_params => header_params,
|
134
|
+
:query_params => query_params,
|
135
|
+
:form_params => form_params,
|
136
|
+
:body => post_body,
|
137
|
+
:auth_names => auth_names,
|
138
|
+
:return_type => 'InlineResponse2002')
|
139
|
+
if @api_client.config.debugging
|
140
|
+
@api_client.config.logger.debug "API called: DefaultApi#cryptocurrency_map_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
141
|
+
end
|
142
|
+
return data, status_code, headers
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|