coinmarketcap_free 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42031b26596411c5f8adefeb582aeafeeddbb31c0d1260d66923a666677a5b7d
4
- data.tar.gz: 2463999e77f6e0ea0717b9c5bfba002eab0e99ba8a959210688d6645d257d848
3
+ metadata.gz: 9d2f0b9d06cb2aa30965c8c67c23fe6694628466364a16b0cdad46ccf96dbd39
4
+ data.tar.gz: caef79e1398c48c30e246ca336388ba5986f5f5ad0391f33e0825f48547f8bac
5
5
  SHA512:
6
- metadata.gz: 9be21f8a5a170e26697c3bb56a5ea6fadc597754c8b565acb4a14717a03a9570fc5d4688cadf58ce38f67ee1c693cb8bf36857f95bbcde96d700f9fd29f4b377
7
- data.tar.gz: 847a0ce2f8faf598f5703fd3378e67cc6d3b74f901e0fbb1cebb243a57b21fadce7a4d44e7f7a42df5e0dbd4c653f6b89677921f0c9215d9ef8e7846c3b0846d
6
+ metadata.gz: 41ac065298e6cbe7daf6c57f64afb9eae284b1589447260f1a166854f5e7ce1201c2f514c9fa645c9095de3b7890223593d38c1a971a10fc601f82d2aacf6511
7
+ data.tar.gz: 677eb71065cd99bc1d7cc9524e4f785684522272c98ab2c52f2de09b9e40b47e671f7af02dcee902b342a9ad77b5fb3842268476bd512a0fb44235fe2afd8539
data/README.md CHANGED
@@ -13,7 +13,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
13
13
  $ gem install coinmarketcap_free
14
14
 
15
15
  ## Usage
16
- You can use the objects classes also single methods like this.
16
+ You can use the class ```CoinmarketcapFree::Cryptocurrencies``` or single method ```CoinmarketcapFree.coins``` like this.
17
17
 
18
18
  ``` Ruby
19
19
  list = CoinmarketcapFree::Cryptocurrencies.new(limit: 100, start: 1)
@@ -112,7 +112,7 @@ Result:
112
112
  }
113
113
  ```
114
114
 
115
- ### If you want to sort in ascending, just write parameter:
115
+ If you want to sort in ascending, just write parameter:
116
116
 
117
117
  ``` Ruby
118
118
  list = CoinmarketcapFree::Cryptocurrencies.new(limit: 100, start: 1, sort_type:'asc')
@@ -125,27 +125,27 @@ list.sort_type = 'asc'
125
125
 
126
126
  Also other parameters for Cryptocurrencies:
127
127
 
128
- | Name | Type | Description | For example |
129
- |:--------------------------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------|
128
+ | Name | Type | Description | Examples |
129
+ |:--------------------------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------|
130
130
  | ```limit:``` | Integer. | Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size. ||
131
131
  | ```start:``` | Integer. | Optionally offset the start (1-based index) of the paginated list of items to return. ||
132
132
  | ```sort_by:``` | String. | Default: ```market_cap```. (```rank```, ```name```, ```symbol```, ```date_added```, ```market_cap```, ```market_cap_strict```, ```price```, ```circulating_supply```, ```total_supply```, ```max_supply```, ```num_market_pairs```, ```volume_24h```, ```percent_change_1h```, ```percent_change_24h```, ```percent_change_7d```, ```market_cap_by_total_supply_strict```, ```volume_7d```, ```volume_30d```). What field to sort the list of cryptocurrencies by. ||
133
133
  | ```sort_type:``` | String. | Default: ```desc```. (```asc``` or ```desc```). The direction in which to order cryptocurrencies against the specified sort. ||
134
- | ```convert:``` | String. | Default: ```USD```. Select cryptocurrencies to exchange (```AUD```, ```BRL```, ```CAD```, ```CHF```, ```CLP```, ```CNY```, ```CZK```, ```DKK```, ```EUR```, ```GBP```, ```HKD```, ```HUF```, ```IDR```, ```ILS```, ```INR```, ```JPY```, ```KRW```, ```MXN```, ```MYR```, ```NOK```, ```NZD```, ```PHP```, ```PKR```, ```PLN```, ```RUB```, ```SEK```, ```SGD```, ```THB```, ```TRY```, ```TWD```, ```ZAR```). | You can type many ```USD,BTC,ETH``` to convert or only one ```USD``` |
134
+ | ```convert:``` | String. | Default: ```USD,BTC,ETH``` . Select cryptocurrencies to exchange (```AUD```, ```BRL```, ```CAD```, ```CHF```, ```CLP```, ```CNY```, ```CZK```, ```DKK```, ```EUR```, ```GBP```, ```HKD```, ```HUF```, ```IDR```, ```ILS```, ```INR```, ```JPY```, ```KRW```, ```MXN```, ```MYR```, ```NOK```, ```NZD```, ```PHP```, ```PKR```, ```PLN```, ```RUB```, ```SEK```, ```SGD```, ```THB```, ```TRY```, ```TWD```, ```ZAR```). | ```USD``` or ```USD,BTC,ETH``` |
135
135
  | ```crypto_type:``` | String. | Default: ```all```. (```all```, ```coins```, ```tokens```). The type of cryptocurrency to include. ||
136
136
  | ```tag_type:``` | String. | Default: ```all```. (```all```, ```defi```, ```filesharing```). The tag of cryptocurrency to include. ||
137
137
  | ```audited:``` | Boolean. | Show audited (true) or not (false) ||
138
- | ```aux:``` | String. | Optionally specify a comma-separated list of supplemental data fields to return. Pass ```ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap``` to include all auxiliary fields. | You can type one ```ath``` or many fields ```ath, atl, high24h, low24h``` |
139
- | ```tags:``` | String. | Default: ```mineable```. | Usually used ```mineable```. But you can use any tags: ```mineable```, ```sha-256``` or together ```mineable, sha-256, pow``` etc. |
140
- | ```volume_24h_range:``` | String. | Optionally specify a threshold 24 hour USD volume to filter results by. | ```0~100000000000000000``` |
141
- | ```percent_change_24h_range:``` | String. | Optionally specify a threshold 24 hour percent change to filter results by. | ```0~100``` or ```-10~100``` |
142
- | ```circulating_supply_range:``` | String. | Optionally specify a threshold circulating supply to filter results by. | ```0~100000000000000000``` |
143
- | ```price_range:``` | String. | Optionally specify a threshold USD price to filter results by. | ```0~100000000000000000``` |
144
- | ```market_cap_range:``` | String. | Optionally specify a threshold market cap to filter results by. | ```0~100000000000000000``` |
138
+ | ```aux:``` | String. | Optionally specify a comma-separated list of supplemental data fields to return. Pass ```ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap``` to include all auxiliary fields. | ```ath``` or ```ath, atl, high24h, low24h``` |
139
+ | ```tags:``` | string. | If you want to see cryptocurrencies that can be mined, just type ```mineable```. ||
140
+ | ```volume_24h_range:``` | String. | Optionally specify a threshold 24 hour USD volume to filter results by. | ```0~100000000000000000``` |
141
+ | ```percent_change_24h_range:``` | String. | Optionally specify a threshold 24 hour percent change to filter results by. | ```0~100``` or ```-10~100``` |
142
+ | ```circulating_supply_range:``` | String. | Optionally specify a threshold circulating supply to filter results by. | ```0~100000000000000000``` |
143
+ | ```price_range:``` | String. | Optionally specify a threshold USD price to filter results by. | ```0~100000000000000000``` |
144
+ | ```market_cap_range:``` | String. | Optionally specify a threshold market cap to filter results by. | ```0~100000000000000000``` |
145
145
 
146
146
  ### Returns an interval of historic market quotes:
147
147
 
148
- You can use the objects classes also single methods like this.
148
+ You can use the class ```CoinmarketcapFree::Coin``` or single method ```CoinmarketcapFree.coin_history``` like this.
149
149
 
150
150
  ``` Ruby
151
151
  coin = CoinmarketcapFree::Coin.new(1, '1D')
@@ -156,7 +156,7 @@ coin.get_data
156
156
  or
157
157
 
158
158
  ``` Ruby
159
- coin = CoinmarketcapFree.coin(1, '1D')
159
+ coin = CoinmarketcapFree.coin_history(1, '1D')
160
160
  ```
161
161
 
162
162
  Result:
@@ -194,7 +194,7 @@ Result:
194
194
 
195
195
  Parameters for Coin:
196
196
 
197
- | Name | Type | Description | For example |
197
+ | Name | Type | Description | Examples |
198
198
  |:-----------------|:---------|:----------------------------------------------|:-------------------------------------------------------------------------------------------------------------------|
199
199
  | ```id``` | Integer. | Cryptocurrency identifier from coinmarketcap. | Bitcoin has the number 1 |
200
200
  | ```range_time``` | String. | Range time. | ```1D```, ```7D```, ```1M```, ```3M```, ```1Y```, ```YTD```, ```ALL``` or custom range ```1668981600~1671659999``` |
@@ -6,7 +6,7 @@ require 'coinmarketcap_free/base'
6
6
  module CoinmarketcapFree
7
7
  # Returns an interval of historic market quotes for any cryptocurrency based on time and interval parameters.
8
8
  #
9
- # For example, result json:
9
+ # Result json:
10
10
  #
11
11
  # {
12
12
  # "data": {
@@ -46,7 +46,7 @@ module CoinmarketcapFree
46
46
 
47
47
  attr_accessor :id,
48
48
  :range_time
49
-
49
+ # Returns the CoinmarketcapFree::Coin.
50
50
  # @param id [Integer] Cryptocurrency identifier from coinmarketcap. For example, Bitcoin has the number 1
51
51
  # @param range_time [String] Range time. For example, '1D', '7D', '1M', '3M', '1Y', 'YTD', 'ALL' or custom range '1668981600~1671659999'
52
52
  def initialize(id = 1, range_time = '1D')
@@ -6,7 +6,11 @@ require 'coinmarketcap_free/base'
6
6
  module CoinmarketcapFree
7
7
  # Get a list of cryptocurrencies.
8
8
  #
9
- # For example, result json:
9
+ # list = CoinmarketcapFree::Cryptocurrencies.new(limit: 100, start: 1)
10
+ # list.update
11
+ # list.get_data
12
+ #
13
+ # Result json:
10
14
  #
11
15
  # {
12
16
  # "data": {
@@ -94,28 +98,48 @@ module CoinmarketcapFree
94
98
  # 'cryptoCurrencyList' - Array of cryptocurrency objects matching the list options.
95
99
  # 'totalCount' - Total number of cryptocurrencies
96
100
  # 'status' - Standardized status object for API calls.
101
+ #
102
+ # If you want to sort in ascending, just write parameter:
103
+ #
104
+ # list = CoinmarketcapFree::Cryptocurrencies.new(limit: 100, start: 1, sort_type:'asc')
105
+ #
106
+ # or
107
+ #
108
+ # list = CoinmarketcapFree::Cryptocurrencies.new(limit: 100, start: 1)
109
+ # list.sort_type = 'asc'
110
+ #
111
+ # Also see other parameters.
97
112
  class Cryptocurrencies < BASE
98
113
 
99
114
  URL_API = 'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing'.freeze
100
115
  private_constant :URL_API
101
116
 
102
- # Parameters: limit, start, sort_by, sort_type, convert, crypto_type, tag_type, audited, aux, tags, volume_24h_range, percent_change_24h_range, circulating_supply_range, price_range, market_cap_range
117
+ # Returns the CoinmarketcapFree::Cryptocurrencies that's dictated by the options hash. The primary options are:
118
+ #
119
+ # * <tt> start: </tt> - [Integer] Default: 1. Optionally offset the start (1-based index) of the paginated list of items to return.
120
+ # * <tt> limit: </tt> - [Integer] Default: 100. Optionally specify the number of results to return.
121
+ # Use this parameter and the "start" parameter to determine your own pagination size.
122
+ # * <tt> sort_by: </tt> - [String] Default: "market_cap". ("rank", "name", "symbol", "date_added", "market_cap", "market_cap_strict", "price", "circulating_supply", "total_supply", "max_supply", "num_market_pairs", "volume_24h", "percent_change_1h", "percent_change_24h", "percent_change_7d", "market_cap_by_total_supply_strict", "volume_7d", "volume_30d").
123
+ # What field to sort the list of cryptocurrencies by.
124
+ # * <tt> sort_type: </tt> - [String] Default: "desc". ("asc" or "desc"). The direction in which to order cryptocurrencies against the specified sort.
125
+ # * <tt> convert: </tt> - [String] Default: 'USD'. Default: 'USD'. Select cryptocurrencies to exchange
126
+ # ("AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR").
127
+ # For example, many 'USD,BTC,ETH' to convert or only one 'USD'
128
+ # * <tt> crypto_typ: </tt> - [String] Default: "all". ("all", "coins", "tokens"). The type of cryptocurrency to include.
129
+ # * <tt> tag_type: </tt> - [String] Default: "all". ("all", "defi", "filesharing"). The tag of cryptocurrency to include.
130
+ # * <tt> audited: </tt> - [FalseClass, TrueClass] Show audited (true) or not (false)
131
+ # * <tt> aux: </tt> - [String] Optionally specify a comma-separated list of supplemental data fields to return.
132
+ # Pass 'ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap' to include all auxiliary fields.
133
+ # * <tt> tags: </tt> - [String] If you want to see cryptocurrencies that can be mined, just type 'mineable'.
134
+ # * <tt> volume_24h_range: </tt> - [String] Optionally specify a threshold 24 hour USD volume to filter results by.
135
+ # For example, For example, '0~100000000000000000'
136
+ # * <tt> percent_change_24h_range: </tt> - [String] Optionally specify a threshold 24 hour percent change to filter results by.
137
+ # For example, '0~100' or '-10~100'
138
+ # * <tt> circulating_supply_range: </tt> - [String] Optionally specify a threshold circulating supply to filter results by. For example, '0~100000000000000000'
139
+ # * <tt> price_range: </tt> - [String] Optionally specify a threshold USD price to filter results by. For example, '0~100000000000000000'
140
+ # * <tt> market_cap_range: </tt> - [String] Optionally specify a threshold market cap to filter results by. For example, '0~100000000000000000'
103
141
  #
104
- # @param start [Integer] Default: 1. Optionally offset the start (1-based index) of the paginated list of items to return.
105
- # @param limit [Integer] Default: 100. Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size.
106
- # @param sort_by [String] Default: "market_cap". ("rank", "name", "symbol", "date_added", "market_cap", "market_cap_strict", "price", "circulating_supply", "total_supply", "max_supply", "num_market_pairs", "volume_24h", "percent_change_1h", "percent_change_24h", "percent_change_7d", "market_cap_by_total_supply_strict", "volume_7d", "volume_30d"). What field to sort the list of cryptocurrencies by.
107
- # @param sort_type [String] Default: "desc". ("asc" or "desc"). The direction in which to order cryptocurrencies against the specified sort.
108
- # @param convert [String] Default: 'USD'. Default: 'USD'. Select cryptocurrencies to exchange ("AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"). For example, many 'USD,BTC,ETH' to convert or only one 'USD'
109
- # @param crypto_type [String] Default: "all". ("all", "coins", "tokens"). The type of cryptocurrency to include.
110
- # @param tag_type [String] Default: "all". ("all", "defi", "filesharing"). The tag of cryptocurrency to include.
111
- # @param audited [FalseClass, TrueClass] false or true
112
- # @param aux [String] Optionally specify a comma-separated list of supplemental data fields to return. Pass 'ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap' to include all auxiliary fields.
113
- # @param tags [String] Usually used 'mineable'.
114
- # @param volume_24h_range [String] Optionally specify a threshold 24 hour USD volume to filter results by. For example, For example, '0~100000000000000000'
115
- # @param percent_change_24h_range [String] Optionally specify a threshold 24 hour percent change to filter results by. For example, '0~100' or '-10~100'
116
- # @param circulating_supply_range [String] Optionally specify a threshold circulating supply to filter results by. For example, '0~100000000000000000'
117
- # @param price_range [String] Optionally specify a threshold USD price to filter results by. For example, '0~100000000000000000'
118
- # @param market_cap_range [String] Optionally specify a threshold market cap to filter results by. For example, '0~100000000000000000'
142
+ # @param [Hash] options
119
143
  def initialize(**options)
120
144
  @limit = options[:limit].nil? ? 100 : options[:limit] # Integer
121
145
  @start = options[:start].nil? ? 1 : options[:start] # Integer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoinmarketcapFree
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -12,7 +12,9 @@ module CoinmarketcapFree
12
12
 
13
13
  # Returns an interval of historic market quotes for any cryptocurrency based on time and interval parameters.
14
14
  #
15
- # For example, result json:
15
+ # history = CoinmarketcapFree.coins(1, '1D')
16
+ #
17
+ # Result json:
16
18
  #
17
19
  # {
18
20
  # "data": {
@@ -58,7 +60,9 @@ module CoinmarketcapFree
58
60
 
59
61
  # Get a list of cryptocurrencies
60
62
  #
61
- # For example, result json:
63
+ # list = CoinmarketcapFree.coins(limit: 100, start: 1)
64
+ #
65
+ # Result json:
62
66
  #
63
67
  # {
64
68
  # "data": {
@@ -147,22 +151,36 @@ module CoinmarketcapFree
147
151
  # 'totalCount' - Total number of cryptocurrencies
148
152
  # 'status' - Standardized status object for API calls.
149
153
  #
150
- # @param start [Integer] Default: 1. Optionally offset the start (1-based index) of the paginated list of items to return.
151
- # @param limit [Integer] Default: 100. Optionally specify the number of results to return. Use this parameter and the "start" parameter to determine your own pagination size.
152
- # @param sort_by [String] Default: "market_cap". ("rank", "name", "symbol", "date_added", "market_cap", "market_cap_strict", "price", "circulating_supply", "total_supply", "max_supply", "num_market_pairs", "volume_24h", "percent_change_1h", "percent_change_24h", "percent_change_7d", "market_cap_by_total_supply_strict", "volume_7d", "volume_30d"). What field to sort the list of cryptocurrencies by.
153
- # @param sort_type [String] Default: "desc". ("asc" or "desc"). The direction in which to order cryptocurrencies against the specified sort.
154
- # @param convert [String] Default: 'USD'. Default: 'USD'. Select cryptocurrencies to exchange ("AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"). For example, many 'USD,BTC,ETH' to convert or only one 'USD'
155
- # @param crypto_type [String] Default: "all". ("all", "coins", "tokens"). The type of cryptocurrency to include.
156
- # @param tag_type [String] Default: "all". ("all", "defi", "filesharing"). The tag of cryptocurrency to include.
157
- # @param audited [FalseClass, TrueClass] false or true
158
- # @param aux [String] Optionally specify a comma-separated list of supplemental data fields to return. Pass 'ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap' to include all auxiliary fields.
159
- # @param tags [String] Usually used 'mineable'.
160
- # @param volume_24h_range [String] Optionally specify a threshold 24 hour USD volume to filter results by. For example, For example, '0~100000000000000000'
161
- # @param percent_change_24h_range [String] Optionally specify a threshold 24 hour percent change to filter results by. For example, '0~100' or '-10~100'
162
- # @param circulating_supply_range [String] Optionally specify a threshold circulating supply to filter results by. For example, '0~100000000000000000'
163
- # @param price_range [String] Optionally specify a threshold USD price to filter results by. For example, '0~100000000000000000'
164
- # @param market_cap_range [String] Optionally specify a threshold market cap to filter results by. For example, '0~100000000000000000'
154
+ # If you want to sort in ascending, just write parameter:
155
+ #
156
+ # list = CoinmarketcapFree.coins(limit: 100, start: 1, sort_type:'asc')
157
+ #
158
+ # Also see other parameters:
159
+ #
160
+ # * <tt> start: </tt> - [Integer] Default: 1. Optionally offset the start (1-based index) of the paginated list of items to return.
161
+ # * <tt> limit: </tt> - [Integer] Default: 100. Optionally specify the number of results to return.
162
+ # Use this parameter and the "start" parameter to determine your own pagination size.
163
+ # * <tt> sort_by: </tt> - [String] Default: "market_cap". ("rank", "name", "symbol", "date_added", "market_cap", "market_cap_strict", "price", "circulating_supply", "total_supply", "max_supply", "num_market_pairs", "volume_24h", "percent_change_1h", "percent_change_24h", "percent_change_7d", "market_cap_by_total_supply_strict", "volume_7d", "volume_30d").
164
+ # What field to sort the list of cryptocurrencies by.
165
+ # * <tt> sort_type: </tt> - [String] Default: "desc". ("asc" or "desc"). The direction in which to order cryptocurrencies against the specified sort.
166
+ # * <tt> convert: </tt> - [String] Default: 'USD'. Default: 'USD'. Select cryptocurrencies to exchange
167
+ # ("AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR").
168
+ # For example, many 'USD,BTC,ETH' to convert or only one 'USD'
169
+ # * <tt> crypto_typ: </tt> - [String] Default: "all". ("all", "coins", "tokens"). The type of cryptocurrency to include.
170
+ # * <tt> tag_type: </tt> - [String] Default: "all". ("all", "defi", "filesharing"). The tag of cryptocurrency to include.
171
+ # * <tt> audited: </tt> - [FalseClass, TrueClass] Show audited (true) or not (false)
172
+ # * <tt> aux: </tt> - [String] Optionally specify a comma-separated list of supplemental data fields to return.
173
+ # Pass 'ath, atl, high24h, low24h, num_market_pairs, cmc_rank, date_added, max_supply, circulating_supply, total_supply, volume_7d, volume_30d, self_reported_circulating_supply, self_reported_market_cap' to include all auxiliary fields.
174
+ # * <tt> tags: </tt> - [String] If you want to see cryptocurrencies that can be mined, just type 'mineable'.
175
+ # * <tt> volume_24h_range: </tt> - [String] Optionally specify a threshold 24 hour USD volume to filter results by.
176
+ # For example, For example, '0~100000000000000000'
177
+ # * <tt> percent_change_24h_range: </tt> - [String] Optionally specify a threshold 24 hour percent change to filter results by.
178
+ # For example, '0~100' or '-10~100'
179
+ # * <tt> circulating_supply_range: </tt> - [String] Optionally specify a threshold circulating supply to filter results by. For example, '0~100000000000000000'
180
+ # * <tt> price_range: </tt> - [String] Optionally specify a threshold USD price to filter results by. For example, '0~100000000000000000'
181
+ # * <tt> market_cap_range: </tt> - [String] Optionally specify a threshold market cap to filter results by. For example, '0~100000000000000000'
165
182
  #
183
+ # @param [Hash] options
166
184
  # @return [String, nil]
167
185
  def coins(**options)
168
186
  @@cryptocurrencies.instance_variables.each do |var_name|
@@ -172,5 +190,19 @@ module CoinmarketcapFree
172
190
 
173
191
  @@cryptocurrencies.update ? @@cryptocurrencies.get_data : nil
174
192
  end
193
+
194
+ # Get coin logo URL from coinmarketcap
195
+ #
196
+ # logo = CoinmarketcapFree.img_coin(1, '64x64')
197
+ #
198
+ # Result:
199
+ # "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png"
200
+ #
201
+ # @return [String] Return URL from coinmarketcap
202
+ # @param [Integer] id_coin Identify coin. For example, bitcoin has 1
203
+ # @param [String] size Choose one size: 64x64, 128x128, 200x200
204
+ def img_coin(id_coin, size)
205
+ "https://s2.coinmarketcap.com/static/img/coins/#{size}/#{id_coin}.png"
206
+ end
175
207
  end
176
208
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinmarketcap_free
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - cosmic-1
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-18 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Cryptocurrency information from the Coinmarketcap site without a key.
14
14
  email: