cryptocompare 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +72 -27
- data/lib/cryptocompare/coin_list.rb +2 -1
- data/lib/cryptocompare/coin_snapshot.rb +2 -1
- data/lib/cryptocompare/exchanges.rb +2 -1
- data/lib/cryptocompare/histo_day.rb +2 -1
- data/lib/cryptocompare/histo_hour.rb +2 -1
- data/lib/cryptocompare/histo_minute.rb +2 -1
- data/lib/cryptocompare/news.rb +5 -2
- data/lib/cryptocompare/price.rb +11 -4
- data/lib/cryptocompare/price_historical.rb +2 -1
- data/lib/cryptocompare/top_pairs.rb +2 -1
- data/lib/cryptocompare/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dc3b6e818e7359bfb184aaeaa90b5ed266bfb1ec066118e6807ef69c3efb230
|
4
|
+
data.tar.gz: 685610211a9e5206e19fcabb390b45ca878ab316e1bdeb6393051ed40be40bdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a33539e38d4273641843d0408bc564dc2e5b9c19963cc4fd40efc89821740abf99aebef80066d32671ba286307ec052f62bbd9b9097ad538d953f7da940d8be4
|
7
|
+
data.tar.gz: 895afafe21754125324f8f7ef00c09e026cd30e845489a0305bf8d05266cc7565b90774b1d2752cfdff323d61bff7de6570151987543d29a929214e549ff3915
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -302,33 +302,78 @@ Get data for a currency pair. It returns general block explorer information, agg
|
|
302
302
|
```ruby
|
303
303
|
Cryptocompare::CoinSnapshot.find('BTC', 'USD')
|
304
304
|
# => {
|
305
|
-
#
|
306
|
-
#
|
307
|
-
#
|
308
|
-
#
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
320
|
-
#
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
329
|
-
#
|
330
|
-
# "
|
331
|
-
# "
|
305
|
+
# "Response":"Success",
|
306
|
+
# "Message":"Total available exchanges - 107",
|
307
|
+
# "Type":100,
|
308
|
+
# "Data": {
|
309
|
+
# "CoinInfo"=> {
|
310
|
+
# "Id"=>"1182",
|
311
|
+
# "Name"=>"BTC",
|
312
|
+
# "FullName"=>"Bitcoin",
|
313
|
+
# "Internal"=>"BTC",
|
314
|
+
# "ImageUrl"=>"/media/37746251/btc.png",
|
315
|
+
# "Url"=>"/coins/btc/overview",
|
316
|
+
# "Algorithm"=>"SHA-256",
|
317
|
+
# "ProofType"=>"PoW",
|
318
|
+
# "TotalCoinsMined"=>18873906,
|
319
|
+
# "BlockNumber"=>710736,
|
320
|
+
# "NetHashesPerSecond"=>152163633011463750000,
|
321
|
+
# "BlockReward"=>6.25,
|
322
|
+
# "BlockTime"=>637,
|
323
|
+
# "AssetLaunchDate"=>"2009-01-03",
|
324
|
+
# "MaxSupply"=>20999999.9769,
|
325
|
+
# "MktCapPenalty"=>0,
|
326
|
+
# "TotalVolume24H"=>119421.69853408838,
|
327
|
+
# "TotalTopTierVolume24H"=>119164.10371469974
|
328
|
+
# },
|
329
|
+
# "AggregatedData" => {
|
330
|
+
# "TYPE"=>"5",
|
331
|
+
# "MARKET"=>"CCCAGG",
|
332
|
+
# "FROMSYMBOL"=>"BTC",
|
333
|
+
# "TOSYMBOL"=>"USD",
|
334
|
+
# "FLAGS"=>"1026",
|
335
|
+
# "PRICE"=>59405.32,
|
336
|
+
# "LASTUPDATE"=>1637524770,
|
337
|
+
# "MEDIAN"=>59406,
|
338
|
+
# "LASTVOLUME"=>0.0214,
|
339
|
+
# "LASTVOLUMETO"=>1271.689008,
|
340
|
+
# "LASTTRADEID"=>"aa1gpl99200btcfe",
|
341
|
+
# "VOLUMEDAY"=>12490.619219841396,
|
342
|
+
# "VOLUMEDAYTO"=>739844937.9215171,
|
343
|
+
# "VOLUME24HOUR"=>14980.50732139,
|
344
|
+
# "VOLUME24HOURTO"=>888337522.224627,
|
345
|
+
# "OPENDAY"=>59770.02,
|
346
|
+
# "HIGHDAY"=>60058.65,
|
347
|
+
# "LOWDAY"=>58575.6,
|
348
|
+
# "OPEN24HOUR"=>59502.04,
|
349
|
+
# "HIGH24HOUR"=>60075.96,
|
350
|
+
# "LOW24HOUR"=>58554.42,
|
351
|
+
# "LASTMARKET"=>"coinfield",
|
352
|
+
# "VOLUMEHOUR"=>522.9115465200042,
|
353
|
+
# "VOLUMEHOURTO"=>31084371.054275494,
|
354
|
+
# "OPENHOUR"=>59528.37,
|
355
|
+
# "HIGHHOUR"=>59629.67,
|
356
|
+
# "LOWHOUR"=>59298.19,
|
357
|
+
# "TOPTIERVOLUME24HOUR"=>14980.50630839,
|
358
|
+
# "TOPTIERVOLUME24HOURTO"=>888337462.2300239,
|
359
|
+
# "CHANGE24HOUR"=>-96.72000000000116,
|
360
|
+
# "CHANGEPCT24HOUR"=>-0.16254904873849899,
|
361
|
+
# "CHANGEDAY"=>-364.6999999999971,
|
362
|
+
# "CHANGEPCTDAY"=>-0.6101721230810984,
|
363
|
+
# "CHANGEHOUR"=>-123.05000000000291,
|
364
|
+
# "CHANGEPCTHOUR"=>-0.20670816284740018,
|
365
|
+
# "CONVERSIONTYPE"=>"direct",
|
366
|
+
# "CONVERSIONSYMBOL"=>"",
|
367
|
+
# "SUPPLY"=>18873906,
|
368
|
+
# "MKTCAP"=>1121210425579.92,
|
369
|
+
# "MKTCAPPENALTY"=>0,
|
370
|
+
# "CIRCULATINGSUPPLY"=>18873906,
|
371
|
+
# "CIRCULATINGSUPPLYMKTCAP"=>1121210425579.92,
|
372
|
+
# "TOTALVOLUME24H"=>119421.69853408838,
|
373
|
+
# "TOTALVOLUME24HTO"=>7092699907.396162,
|
374
|
+
# "TOTALTOPTIERVOLUME24H"=>119164.10371469974,
|
375
|
+
# "TOTALTOPTIERVOLUME24HTO"=>7077397404.903025,
|
376
|
+
# "IMAGEURL"=>"/media/37746251/btc.png"
|
332
377
|
# },
|
333
378
|
# "Exchanges":[
|
334
379
|
# {
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module CoinList
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/all/coinlist'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/all/coinlist'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get general info for all the coins available on Cryptocompare's API.
|
9
10
|
#
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module CoinSnapshot
|
6
|
-
API_URL = 'https://
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/top/exchanges/full'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get data for a currency pair. It returns general block explorer
|
9
10
|
# information, aggregated data and individual data for each exchange
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module Exchanges
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/all/exchanges'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/all/exchanges'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get exchange data, such as cryptocurrencies that each exchange offers, and
|
9
10
|
# the supported conversion cryptocurrencies.
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module HistoDay
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/histoday'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/histoday'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get open, high, low, close, volumefrom and volumeto daily historical data.
|
9
10
|
# The values are based on 00:00 GMT time. It uses BTC conversion if data is
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module HistoHour
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/histohour'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/histohour'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get open, high, low, close, volumefrom and volumeto from the each hour
|
9
10
|
# historical data. It uses BTC conversion if data is not available because
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module HistoMinute
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/histominute'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/histominute'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get open, high, low, close, volumefrom and volumeto for each minute of
|
9
10
|
# historical data. This data is only stored for 7 days, if you need more,
|
data/lib/cryptocompare/news.rb
CHANGED
@@ -3,8 +3,11 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module News
|
6
|
-
NEWS_API_URL = 'https://min-api.cryptocompare.com/data/news/'
|
7
|
-
|
6
|
+
NEWS_API_URL = 'https://min-api.cryptocompare.com/data/news/'.freeze
|
7
|
+
private_constant :NEWS_API_URL
|
8
|
+
|
9
|
+
NEWS_PROVIDERS_API_URL = 'https://min-api.cryptocompare.com/data/news/providers'.freeze
|
10
|
+
private_constant :NEWS_PROVIDERS_API_URL
|
8
11
|
|
9
12
|
# Returns news articles from the providers that CryptoCompare has integrated
|
10
13
|
# with.
|
data/lib/cryptocompare/price.rb
CHANGED
@@ -3,10 +3,17 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module Price
|
6
|
-
PRICE_API_URL = 'https://min-api.cryptocompare.com/data/pricemulti'
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
PRICE_API_URL = 'https://min-api.cryptocompare.com/data/pricemulti'.freeze
|
7
|
+
private_constant :PRICE_API_URL
|
8
|
+
|
9
|
+
PRICE_FULL_API_URL = 'https://min-api.cryptocompare.com/data/pricemultifull'.freeze
|
10
|
+
private_constant :PRICE_FULL_API_URL
|
11
|
+
|
12
|
+
GENERATE_AVG_API_URL = 'https://min-api.cryptocompare.com/data/generateAvg'.freeze
|
13
|
+
private_constant :GENERATE_AVG_API_URL
|
14
|
+
|
15
|
+
DAY_AVG_API_URL = 'https://min-api.cryptocompare.com/data/dayAvg'.freeze
|
16
|
+
private_constant :DAY_AVG_API_URL
|
10
17
|
|
11
18
|
# Finds the currency price(s) of a given currency symbol. Really fast,
|
12
19
|
# 20-60 ms. Cached each 10 seconds.
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module PriceHistorical
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/pricehistorical'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/pricehistorical'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Finds the price of any cryptocurrency in any other currency that you need
|
9
10
|
# at a given timestamp. The price comes from the daily info - so it would be
|
@@ -3,7 +3,8 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Cryptocompare
|
5
5
|
module TopPairs
|
6
|
-
API_URL = 'https://min-api.cryptocompare.com/data/top/pairs'
|
6
|
+
API_URL = 'https://min-api.cryptocompare.com/data/top/pairs'.freeze
|
7
|
+
private_constant :API_URL
|
7
8
|
|
8
9
|
# Get top pairs by volume for a currency (always uses aggregated data).
|
9
10
|
# The number of pairs you get is the minimum of the limit you set
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptocompare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander David Pan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|