coingecko_ruby 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +6 -6
- data/lib/coingecko_ruby/client/coins.rb +4 -4
- data/lib/coingecko_ruby/client/derivatives.rb +3 -3
- data/lib/coingecko_ruby/client/events.rb +1 -1
- data/lib/coingecko_ruby/client/exchanges.rb +4 -4
- data/lib/coingecko_ruby/client/finance.rb +2 -2
- data/lib/coingecko_ruby/client/indexes.rb +2 -2
- data/lib/coingecko_ruby/client/infos.rb +1 -1
- data/lib/coingecko_ruby/client/prices.rb +6 -6
- data/lib/coingecko_ruby/connection.rb +1 -1
- data/lib/coingecko_ruby/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7bba257d165b4feee8f9680aabd6a49b93c14ca20ae1058dbb4dae9faefab80
|
4
|
+
data.tar.gz: 7f7134bf41da5c9c7204f357d7e72129af030cf576a22c9e7726bd792e1f17f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4471834f358adbbcbc50774f0a2260ca5e1eccc557fd8f6d6a116efd9e799dd64a76d7b013d6e4cecb60b833d8e23d9903f6db085547f7f3884805517141623
|
7
|
+
data.tar.gz: 33a2d52f07e93c10b5291df1fe170d1b1dc61432f0105fdeb385f9f043d50b2fe15254d374c7582655bd4d573ad3f4cc3054edb3906bd12724e75582a73d05e0
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -8,8 +8,8 @@ CoingeckoRuby is an easy-to-use client/wrapper for CoinGecko's awesome cryptocur
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
```
|
12
|
-
gem 'coingecko_ruby'
|
11
|
+
```
|
12
|
+
gem 'coingecko_ruby'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -24,26 +24,26 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
1. Require the gem if you're not using Rails or if your environment does not autoload libraries.
|
26
26
|
|
27
|
-
```
|
27
|
+
```
|
28
28
|
require 'coingecko_ruby'
|
29
29
|
```
|
30
30
|
|
31
31
|
2. Create a client instance.
|
32
32
|
|
33
|
-
```
|
33
|
+
```
|
34
34
|
client = CoingeckoRuby::Client.new
|
35
35
|
```
|
36
36
|
|
37
37
|
3. Use the client to fetch your desired data.
|
38
38
|
|
39
|
-
```
|
39
|
+
```
|
40
40
|
# Example: Fetching the current price of Bitcoin.
|
41
41
|
client.price('bitcoin')
|
42
42
|
```
|
43
43
|
|
44
44
|
## Documentation
|
45
45
|
|
46
|
-
[Read the API documentation here: ](https://
|
46
|
+
[Read the API documentation here: ](https://rubydoc.info/gems/coingecko_ruby)
|
47
47
|
|
48
48
|
## Contributing
|
49
49
|
|
@@ -22,7 +22,7 @@ module CoingeckoRuby
|
|
22
22
|
# }, {
|
23
23
|
# ]
|
24
24
|
def coins_list(**options)
|
25
|
-
get 'coins/list', options
|
25
|
+
get 'coins/list', **options
|
26
26
|
end
|
27
27
|
|
28
28
|
# Fetches detailed current data for a coin.
|
@@ -38,7 +38,7 @@ module CoingeckoRuby
|
|
38
38
|
# @example Fetch Bitcoin's current data.
|
39
39
|
# client.coin('bitcoin')
|
40
40
|
def coin(id, **options)
|
41
|
-
get "coins/#{id}", options
|
41
|
+
get "coins/#{id}", **options
|
42
42
|
end
|
43
43
|
|
44
44
|
# @deprecated Use {#coin} instead
|
@@ -128,7 +128,7 @@ module CoingeckoRuby
|
|
128
128
|
# }],
|
129
129
|
# }
|
130
130
|
def tickers(id, **options)
|
131
|
-
get "coins/#{id}/tickers", options
|
131
|
+
get "coins/#{id}/tickers", **options
|
132
132
|
end
|
133
133
|
|
134
134
|
# @deprecated Use {#tickers} instead
|
@@ -216,7 +216,7 @@ module CoingeckoRuby
|
|
216
216
|
# }
|
217
217
|
# ]
|
218
218
|
def markets(ids, **options)
|
219
|
-
get 'coins/markets',
|
219
|
+
get 'coins/markets', ids: ids, **options
|
220
220
|
end
|
221
221
|
|
222
222
|
# @deprecated Use {#markets} instead
|
@@ -45,7 +45,7 @@ module CoingeckoRuby
|
|
45
45
|
# },
|
46
46
|
# ]
|
47
47
|
def derivatives(**options)
|
48
|
-
get 'derivatives', options
|
48
|
+
get 'derivatives', **options
|
49
49
|
end
|
50
50
|
|
51
51
|
# @deprecated Use {#derivatives} instead
|
@@ -79,7 +79,7 @@ module CoingeckoRuby
|
|
79
79
|
# "url" => "https://www.binance.com/"
|
80
80
|
# }]
|
81
81
|
def derivative_exchanges(**options)
|
82
|
-
get 'derivatives/exchanges', options
|
82
|
+
get 'derivatives/exchanges', **options
|
83
83
|
end
|
84
84
|
|
85
85
|
# @deprecated Use {#derivative_exchanges} instead
|
@@ -112,7 +112,7 @@ module CoingeckoRuby
|
|
112
112
|
# "url" => "https://www.binance.com/"
|
113
113
|
# }
|
114
114
|
def derivative_exchange(id, **options)
|
115
|
-
get "derivatives/exchanges/#{id}", options
|
115
|
+
get "derivatives/exchanges/#{id}", **options
|
116
116
|
end
|
117
117
|
|
118
118
|
# @deprecated Use {#derivative_exchange} instead
|
@@ -26,7 +26,7 @@ module CoingeckoRuby
|
|
26
26
|
# "trade_volume_24h_btc_normalized" => 982949.3975723931
|
27
27
|
# }]
|
28
28
|
def exchanges(**options)
|
29
|
-
get 'exchanges', options
|
29
|
+
get 'exchanges', **options
|
30
30
|
end
|
31
31
|
|
32
32
|
# @deprecated Use {#exchanges} instead
|
@@ -121,7 +121,7 @@ module CoingeckoRuby
|
|
121
121
|
# }]
|
122
122
|
# }
|
123
123
|
def exchange_tickers(id, **options)
|
124
|
-
get "exchanges/#{id}/tickers", options
|
124
|
+
get "exchanges/#{id}/tickers", **options
|
125
125
|
end
|
126
126
|
|
127
127
|
# @deprecated Use {#exchange_tickers} instead
|
@@ -157,7 +157,7 @@ module CoingeckoRuby
|
|
157
157
|
# }]
|
158
158
|
# }
|
159
159
|
def exchange_status(id, **options)
|
160
|
-
get "exchanges/#{id}/status_updates", options
|
160
|
+
get "exchanges/#{id}/status_updates", **options
|
161
161
|
end
|
162
162
|
|
163
163
|
# @deprecated Use {#exchange_status} instead
|
@@ -181,7 +181,7 @@ module CoingeckoRuby
|
|
181
181
|
# [1620557400000.0, "1042158.4333253484568599192332614201045319574863305612009609211497295171074087677404153278624"]
|
182
182
|
# ]
|
183
183
|
def exchange_volume(id, days: 7, **options)
|
184
|
-
get "exchanges/#{id}/volume_chart",
|
184
|
+
get "exchanges/#{id}/volume_chart", days: days, **options
|
185
185
|
end
|
186
186
|
|
187
187
|
# @deprecated Use {#exchange_volume} instead
|
@@ -35,7 +35,7 @@ module CoingeckoRuby
|
|
35
35
|
# }
|
36
36
|
# ]
|
37
37
|
def finance_platforms(**options)
|
38
|
-
get 'finance_platforms', options
|
38
|
+
get 'finance_platforms', **options
|
39
39
|
end
|
40
40
|
|
41
41
|
# @deprecated Use {#finance_platforms} instead
|
@@ -88,7 +88,7 @@ module CoingeckoRuby
|
|
88
88
|
# "redeem_at"=>0}
|
89
89
|
# ]
|
90
90
|
def finance_products(**options)
|
91
|
-
get 'finance_products', options
|
91
|
+
get 'finance_products', **options
|
92
92
|
end
|
93
93
|
|
94
94
|
# @deprecated Use {#finance_products} instead
|
@@ -29,7 +29,7 @@ module CoingeckoRuby
|
|
29
29
|
# "is_multi_asset_composite"=>false}
|
30
30
|
# ]
|
31
31
|
def indexes(**options)
|
32
|
-
get 'indexes', options
|
32
|
+
get 'indexes', **options
|
33
33
|
end
|
34
34
|
|
35
35
|
# @deprecated Use {#indexes} instead
|
@@ -76,7 +76,7 @@ module CoingeckoRuby
|
|
76
76
|
# "is_multi_asset_composite"=>false
|
77
77
|
# }
|
78
78
|
def indexes_by_market_and_coin(market_id, coin_id, **options)
|
79
|
-
get "indexes/#{market_id}/#{coin_id}", options
|
79
|
+
get "indexes/#{market_id}/#{coin_id}", **options
|
80
80
|
end
|
81
81
|
|
82
82
|
# @deprecated Use {#indexes_by_market_and_coin} instead
|
@@ -34,7 +34,7 @@ module CoingeckoRuby
|
|
34
34
|
def price(ids, currency: 'usd', **options)
|
35
35
|
ids = ids.join(',') if ids.is_a? Array
|
36
36
|
currency = currency.join(',') if currency.is_a? Array
|
37
|
-
get 'simple/price',
|
37
|
+
get 'simple/price', ids: ids, vs_currencies: currency, **options
|
38
38
|
end
|
39
39
|
|
40
40
|
# @see Alias for {#price}
|
@@ -122,7 +122,7 @@ module CoingeckoRuby
|
|
122
122
|
def historical_price(id, date:, **options)
|
123
123
|
date = Time.now.strftime('%d-%m-%Y') if date.nil?
|
124
124
|
|
125
|
-
get "coins/#{id}/history",
|
125
|
+
get "coins/#{id}/history", date: date, **options
|
126
126
|
end
|
127
127
|
|
128
128
|
# @deprecated Use {#historical_price} instead
|
@@ -158,7 +158,7 @@ module CoingeckoRuby
|
|
158
158
|
# ]
|
159
159
|
# }
|
160
160
|
def minutely_historical_price(id, currency: 'usd', **options)
|
161
|
-
get "coins/#{id}/market_chart",
|
161
|
+
get "coins/#{id}/market_chart", vs_currency: currency, days: 1, **options
|
162
162
|
end
|
163
163
|
|
164
164
|
# @deprecated Use {#minutely_historical_price} instead
|
@@ -195,7 +195,7 @@ module CoingeckoRuby
|
|
195
195
|
def hourly_historical_price(id, currency: 'usd', days: 7, **options)
|
196
196
|
return daily_historical_price(id, currrency: currency, days: days) if days > 90
|
197
197
|
|
198
|
-
get "coins/#{id}/market_chart",
|
198
|
+
get "coins/#{id}/market_chart", vs_currency: currency, days: days, **options
|
199
199
|
end
|
200
200
|
|
201
201
|
# @deprecated Use {#hourly_historical_price} instead
|
@@ -229,7 +229,7 @@ module CoingeckoRuby
|
|
229
229
|
# ]
|
230
230
|
# }
|
231
231
|
def daily_historical_price(id, currency: 'usd', days: 7, **options)
|
232
|
-
get "coins/#{id}/market_chart",
|
232
|
+
get "coins/#{id}/market_chart", vs_currency: currency, days: days, interval: 'daily', **options
|
233
233
|
end
|
234
234
|
|
235
235
|
# @deprecated Use {#daily_historical_price} instead
|
@@ -256,7 +256,7 @@ module CoingeckoRuby
|
|
256
256
|
# [1620576000000, 57956.7, 57956.7, 56636.68, 57302.22],
|
257
257
|
# ]
|
258
258
|
def ohlc(id, currency: 'usd', days: 7, **options)
|
259
|
-
get "coins/#{id}/ohlc",
|
259
|
+
get "coins/#{id}/ohlc", vs_currency: currency, days: days, **options
|
260
260
|
end
|
261
261
|
|
262
262
|
# @deprecated Use {#ohlc} instead
|
@@ -6,7 +6,7 @@ module CoingeckoRuby
|
|
6
6
|
module Connection
|
7
7
|
BASE_URL = 'https://api.coingecko.com/api/v3/'.freeze
|
8
8
|
|
9
|
-
def get(endpoint, params
|
9
|
+
def get(endpoint, **params)
|
10
10
|
url = BASE_URL + endpoint
|
11
11
|
uri = URI(url)
|
12
12
|
uri = build_request(uri, params) unless params.empty?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coingecko_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Foo Siang Sen
|
@@ -20,6 +20,7 @@ extra_rdoc_files: []
|
|
20
20
|
files:
|
21
21
|
- ".github/workflows/ruby.yml"
|
22
22
|
- ".gitignore"
|
23
|
+
- ".ruby-version"
|
23
24
|
- ".travis.yml"
|
24
25
|
- CHANGELOG.md
|
25
26
|
- Gemfile
|