cryptocompare 0.13.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: aa21dd8a62b76ee16cc74571716557f97929fbf0
4
- data.tar.gz: ef06d7fee31527c7786c809098fde9976194081f
2
+ SHA256:
3
+ metadata.gz: 1dc3b6e818e7359bfb184aaeaa90b5ed266bfb1ec066118e6807ef69c3efb230
4
+ data.tar.gz: 685610211a9e5206e19fcabb390b45ca878ab316e1bdeb6393051ed40be40bdf
5
5
  SHA512:
6
- metadata.gz: 41b88ba0309ffbba536dbbdfa590f759acb72dbb178af838faf00f845b2bfad0a02c9635fcd1e4db7e5249ea5813f76f12ea4f78f08f73405e54d39c587334e7
7
- data.tar.gz: ef93438e5d9ff1c2f239ae5e2c5d960b80af4305c21d05dfbc7bbd299597d709ced0dd7bc3d490721d9f8572b09e345508e167626cc4ad4a4c14675b5780d155
6
+ metadata.gz: a33539e38d4273641843d0408bc564dc2e5b9c19963cc4fd40efc89821740abf99aebef80066d32671ba286307ec052f62bbd9b9097ad538d953f7da940d8be4
7
+ data.tar.gz: 895afafe21754125324f8f7ef00c09e026cd30e845489a0305bf8d05266cc7565b90774b1d2752cfdff323d61bff7de6570151987543d29a929214e549ff3915
@@ -0,0 +1,33 @@
1
+ # Use the latest 2.1 version of CircleCI pipeline process engine.
2
+ # See: https://circleci.com/docs/2.0/configuration-reference
3
+ version: 2.1
4
+
5
+ # Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
6
+ # See: https://circleci.com/docs/2.0/orb-intro/
7
+ orbs:
8
+ ruby: circleci/ruby@1.2.0
9
+
10
+ # Define a job to be invoked later in a workflow.
11
+ # See: https://circleci.com/docs/2.0/configuration-reference/#jobs
12
+ jobs:
13
+ build:
14
+ docker:
15
+ - image: 'cimg/base:stable'
16
+ steps:
17
+ - checkout
18
+ - ruby/install:
19
+ version: '2.7'
20
+ - run: echo "Ruby 2.7 has been installed"
21
+ - ruby/install-deps:
22
+ bundler-version: '2.2.31'
23
+ with-cache: false
24
+ - run:
25
+ command: 'bundle exec rake test'
26
+ name: Run Tests
27
+ # Invoke jobs via workflows
28
+ # See: https://circleci.com/docs/2.0/configuration-reference/#workflows
29
+ workflows:
30
+ sample: # This is the name of the workflow, feel free to change it to better match your workflow.
31
+ # Inside the workflow, you define the jobs you want to run.
32
+ jobs:
33
+ - build
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
data/Gemfile.lock ADDED
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cryptocompare (0.17.0)
5
+ faraday
6
+ json
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.8.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ codeclimate-test-reporter (1.0.9)
14
+ simplecov (<= 0.13)
15
+ crack (0.4.5)
16
+ rexml
17
+ docile (1.1.5)
18
+ faraday (1.8.0)
19
+ faraday-em_http (~> 1.0)
20
+ faraday-em_synchrony (~> 1.0)
21
+ faraday-excon (~> 1.1)
22
+ faraday-httpclient (~> 1.0.1)
23
+ faraday-net_http (~> 1.0)
24
+ faraday-net_http_persistent (~> 1.1)
25
+ faraday-patron (~> 1.0)
26
+ faraday-rack (~> 1.0)
27
+ multipart-post (>= 1.2, < 3)
28
+ ruby2_keywords (>= 0.0.4)
29
+ faraday-em_http (1.0.0)
30
+ faraday-em_synchrony (1.0.0)
31
+ faraday-excon (1.1.0)
32
+ faraday-httpclient (1.0.1)
33
+ faraday-net_http (1.0.1)
34
+ faraday-net_http_persistent (1.2.0)
35
+ faraday-patron (1.0.0)
36
+ faraday-rack (1.0.0)
37
+ hashdiff (1.0.1)
38
+ json (2.6.1)
39
+ minitest (5.14.4)
40
+ multipart-post (2.1.1)
41
+ public_suffix (4.0.6)
42
+ rake (13.0.6)
43
+ rexml (3.2.5)
44
+ ruby2_keywords (0.0.5)
45
+ simplecov (0.13.0)
46
+ docile (~> 1.1.0)
47
+ json (>= 1.8, < 3)
48
+ simplecov-html (~> 0.10.0)
49
+ simplecov-html (0.10.2)
50
+ vcr (6.0.0)
51
+ webmock (3.14.0)
52
+ addressable (>= 2.8.0)
53
+ crack (>= 0.3.2)
54
+ hashdiff (>= 0.4.0, < 2.0.0)
55
+
56
+ PLATFORMS
57
+ x86_64-darwin-19
58
+ x86_64-linux
59
+
60
+ DEPENDENCIES
61
+ bundler (~> 2.2.0)
62
+ codeclimate-test-reporter (~> 1.0.0)
63
+ cryptocompare!
64
+ minitest (~> 5.0)
65
+ rake (>= 12.3.3)
66
+ simplecov
67
+ vcr
68
+ webmock
69
+
70
+ BUNDLED WITH
71
+ 2.2.31
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cryptocompare
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/cryptocompare.svg)](http://badge.fury.io/rb/cryptocompare) [![Build Status](https://travis-ci.org/alexanderdavidpan/cryptocompare.svg)](https://travis-ci.org/alexanderdavidpan/cryptocompare)
3
+ [![Gem Version](https://badge.fury.io/rb/cryptocompare.svg)](http://badge.fury.io/rb/cryptocompare) [![CircleCI](https://circleci.com/gh/alexanderdavidpan/cryptocompare.svg?style=shield)](https://circleci.com/gh/alexanderdavidpan/cryptocompare)
4
4
  [![Test Coverage](https://codeclimate.com/github/alexanderdavidpan/cryptocompare/badges/coverage.svg)](https://codeclimate.com/github/alexanderdavidpan/cryptocompare/coverage)
5
5
 
6
6
  This is a Ruby gem that utilizes the CryptoCompare API to fetch data related to cryptocurrencies.
@@ -29,6 +29,15 @@ To use cryptocompare, just require it like so:
29
29
  require 'cryptocompare'
30
30
  ```
31
31
 
32
+ ### API Keys
33
+
34
+ Some requests will require an API key. In order to obtain an API key, you will need to request one from Cryptocompare. You can then pass it in as an optional parameter in the any Cryptocompare module method like so:
35
+
36
+ ```ruby
37
+ Cryptocompare::Price.find('ETH', 'USD', { api_key: 'API_KEY' })
38
+ # => {"ETH"=>{"USD"=>4714.16}}
39
+ ```
40
+
32
41
  ### Price
33
42
 
34
43
  Finds the currency price(s) of a given currency symbol. Really fast, 20-60 ms. Cached each 10 seconds.
@@ -293,33 +302,78 @@ Get data for a currency pair. It returns general block explorer information, agg
293
302
  ```ruby
294
303
  Cryptocompare::CoinSnapshot.find('BTC', 'USD')
295
304
  # => {
296
- # "Response":"Success",
297
- # "Message":"Coin snapshot succesfully returned",
298
- # "Type":100,
299
- # "Data":{
300
- # "Algorithm":"SHA256",
301
- # "ProofType":"PoW",
302
- # "BlockNumber":378345,
303
- # "NetHashesPerSecond":465548431.66333866,
304
- # "TotalCoinsMined":14707625.0,
305
- # "BlockReward":25.0,
306
- # "AggregatedData":{
307
- # "TYPE":"5",
308
- # "MARKET":"CCCAGG",
309
- # "FROMSYMBOL":"BTC",
310
- # "TOSYMBOL":"USD",
311
- # "FLAGS":"4",
312
- # "PRICE":"245.41",
313
- # "LASTUPDATE":"1444520460",
314
- # "LASTVOLUME":"0.0086",
315
- # "LASTVOLUMETO":"2.110268",
316
- # "LASTTRADEID":"1444520460357",
317
- # "VOLUME24HOUR":"49591.48108707269",
318
- # "VOLUME24HOURTO":"12139110.189163648",
319
- # "OPEN24HOUR":"244.41",
320
- # "HIGH24HOUR":"258.37",
321
- # "LOW24HOUR":"239.01000004",
322
- # "LASTMARKET":"Huobi"
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"
323
377
  # },
324
378
  # "Exchanges":[
325
379
  # {
@@ -512,6 +566,73 @@ Cryptocompare::HistoDay.find('BTC', 'USD')
512
566
  # }
513
567
  ```
514
568
 
569
+ ## News
570
+ Get news articles from the providers that CryptoCompare has integrated with as well as news provider data.
571
+
572
+ **Example:**
573
+
574
+ Get news articles from the providers that CryptoCompare has integrated with.
575
+
576
+ ```ruby
577
+ Cryptocompare::News.all
578
+ # => [
579
+ # {
580
+ # "id" => "85721",
581
+ # "guid" => "https://news.bitcoin.com/?p=127153",
582
+ # "published_on" => 1520834400,
583
+ # "imageurl" => "https://images.cryptocompare.com/news/bitcoin.com/b9MBw3g640c.jpeg",
584
+ # "title" => "Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades",
585
+ # "url" => "https://news.bitcoin.com/study-finds-3b-worth-of-faked-cryptocurrency-volumes-and-wash-trades/",
586
+ # "source" => "bitcoin.com",
587
+ # "body" => "On March 10 a cryptocurrency trader and researcher published a report on how he believes $3 billion worth of cryptocurrency trade volumes, primarily from a couple of exchanges, are concocted. The author of the study, Sylvain Ribes, alleges that the exchange Okcoin has been fabricating up to 93 percent of its trade volumes. Also read: Thailand [&#8 230;]The post Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades appeared first on Bitcoin News.",
588
+ # "tags" => "News|95%|altcoin exchange|Binance|Bitcoin|BTC|Coinmarketcap|Fake Trades|GDAX|Huobi|illiquid assets|Kraken|Liquidity|Livecoinwatch|N-Featured|OKcoin|Okex|Poloniex|Sylvain Ribes|trading|Volumes|Wash Trades|Zhao Changpeng",
589
+ # "categories" => "BTC|Exchange|Trading",
590
+ # "lang" => "EN",
591
+ # "source_info" => {
592
+ # "name" => "Bitcoin.com",
593
+ # "lang" => "EN",
594
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoincom.png"
595
+ # }
596
+ # },
597
+ # ...
598
+ # ]
599
+ ```
600
+
601
+ **Example:**
602
+
603
+ Get all the news providers that CryptoCompare has integrated with.
604
+
605
+ ```ruby
606
+ Cryptocompare::News.providers
607
+ # => [
608
+ # {
609
+ # "key" => "cryptocompare",
610
+ # "name" => "CryptoCompare",
611
+ # "lang" => "EN",
612
+ # "img" => "https://images.cryptocompare.com/news/default/cryptocompare.png"
613
+ # },
614
+ # {
615
+ # "key" => "coindesk",
616
+ # "name" => "CoinDesk",
617
+ # "lang" => "EN",
618
+ # "img" => "https://images.cryptocompare.com/news/default/coindesk.png"
619
+ # },
620
+ # {
621
+ # "key" => "bitcoinmagazine",
622
+ # "name" => "Bitcoin Magazine",
623
+ # "lang" => "EN",
624
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoinmagazine.png"
625
+ # },
626
+ # {
627
+ # "key" => "yahoofinance",
628
+ # "name" => "Yahoo Finance Bitcoin",
629
+ # "lang" => "EN",
630
+ # "img" => "https://images.cryptocompare.com/news/default/yahoofinance.png"
631
+ # },
632
+ # ...
633
+ # ]
634
+ ```
635
+
515
636
  ### Exchanges
516
637
  Get exchange data, such as cryptocurrencies that each exchange offers, and the supported conversion cryptocurrencies.
517
638
 
@@ -551,89 +672,315 @@ Cryptocompare::Exchanges.all
551
672
 
552
673
  ## Supported Exchanges
553
674
 
675
+ * aax
676
+ * ABCC
554
677
  * Abucoins
555
- * ANXBTC
678
+ * ACX
679
+ * AidosMarket
680
+ * aliexchange
681
+ * alphaex
682
+ * altilly
683
+ * ataix
684
+ * bcbitcoin
685
+ * BCEX
686
+ * beldex
687
+ * bequant
688
+ * betconix
689
+ * Bgogo
690
+ * bhex
691
+ * Bibox
692
+ * BigONE
693
+ * biki
694
+ * bilaxy
556
695
  * Binance
696
+ * binancedex
697
+ * Binanceje
698
+ * binanceusa
699
+ * bingcoins
557
700
  * Bit2C
701
+ * bitasset
702
+ * BitBank
558
703
  * BitBay
559
- * BitcoinDE
704
+ * bitbuy
705
+ * bitci
706
+ * bitcoincom
707
+ * BitexBook
708
+ * bitfex
560
709
  * Bitfinex
710
+ * BitFlip
561
711
  * bitFlyer
712
+ * bitflyereu
562
713
  * bitFlyerFX
714
+ * bitflyerus
715
+ * Bitforex
716
+ * BitGrail
563
717
  * Bithumb
718
+ * bithumbglobal
719
+ * Bitinfi
720
+ * Bitkub
721
+ * Bitlish
564
722
  * BitMarket
723
+ * BitMart
724
+ * bitmax
725
+ * Bitmex
726
+ * bitpanda
727
+ * Bitpoint
728
+ * Bitsane
729
+ * Bitshares
565
730
  * Bitso
731
+ * bitspark
566
732
  * BitSquare
567
733
  * Bitstamp
568
- * Bittrex
734
+ * BitTrex
735
+ * BitZ
736
+ * bkex
737
+ * Blackturtle
569
738
  * Bleutrade
739
+ * blockchaincom
740
+ * Bluebelt
741
+ * Braziliex
570
742
  * BTC38
743
+ * BTCAlpha
744
+ * BTCBOX
571
745
  * BTCChina
572
746
  * BTCE
747
+ * BTCExchange
573
748
  * BTCMarkets
749
+ * btcmex
750
+ * BTCTurk
574
751
  * btcXchange
575
752
  * BTCXIndia
576
753
  * BTER
754
+ * btse
755
+ * Buda
756
+ * bw
577
757
  * BXinth
758
+ * bybit
759
+ * Catex
760
+ * CBX
761
+ * CCCAGG
578
762
  * CCEDK
579
763
  * CCEX
580
764
  * Cexio
765
+ * chainrift
766
+ * chainx
767
+ * chaoex
581
768
  * CHBTC
769
+ * ChileBit
770
+ * cobinhood
771
+ * Codex
772
+ * coinall
582
773
  * Coinbase
583
- * CoinCheck
584
- * CoinExchange
774
+ * CoinBene
775
+ * Coincap
776
+ * Coincheck
777
+ * CoinCorner
778
+ * CoinDeal
779
+ * coineal
780
+ * coinegg
781
+ * CoinEx
782
+ * CoinFalcon
783
+ * coinfield
585
784
  * Coinfloor
785
+ * CoinHub
786
+ * CoinJar
787
+ * Coinmate
788
+ * Coinnest
586
789
  * Coinone
790
+ * CoinPulse
587
791
  * Coinroom
792
+ * CoinsBank
793
+ * Coinsbit
588
794
  * Coinse
589
795
  * Coinsetter
796
+ * coinspro
797
+ * coinsuper
798
+ * CoinTiger
799
+ * coinzest
800
+ * compound
801
+ * coss
802
+ * crex24
803
+ * crosstower
804
+ * Cryptagio
805
+ * CryptoBulls
806
+ * CryptoCarbon
807
+ * cryptodotcom
808
+ * CryptoExchangeWS
809
+ * cryptofacilities
810
+ * cryptonex
811
+ * Cryptonit
590
812
  * Cryptopia
591
813
  * CryptoX
592
814
  * Cryptsy
815
+ * currency
816
+ * curve
817
+ * darbfinance
818
+ * dcoin
819
+ * DDEX
820
+ * decoin
821
+ * deribit
822
+ * DEx
823
+ * DigiFinex
824
+ * DSX
825
+ * e55com
826
+ * eidoo
827
+ * equos
828
+ * erisx
593
829
  * EtherDelta
830
+ * Ethermium
594
831
  * EthexIndia
832
+ * Ethfinex
833
+ * etoro
834
+ * Everbloom
835
+ * Exenium
595
836
  * Exmo
837
+ * EXRATES
838
+ * exscudo
839
+ * ExtStock
596
840
  * EXX
841
+ * fatbtc
842
+ * FCCE
843
+ * FCoin
844
+ * Foxbit
845
+ * ftx
846
+ * ftxus
597
847
  * Gatecoin
598
848
  * Gateio
599
849
  * Gemini
850
+ * Globitex
851
+ * Gneiss
852
+ * Gnosis
853
+ * gopax
854
+ * Graviex
855
+ * HADAX
856
+ * hbus
857
+ * Hikenex
600
858
  * HitBTC
601
859
  * Huobi
860
+ * huobifutures
861
+ * huobijapan
862
+ * huobikorea
602
863
  * HuobiPro
864
+ * iCoinbay
865
+ * IDAX
866
+ * idevex
867
+ * IDEX
868
+ * Incorex
869
+ * IndependentReserve
870
+ * indodax
871
+ * InstantBitex
872
+ * IQFinex
873
+ * Ironex
603
874
  * itBit
604
875
  * Jubi
605
876
  * Korbit
606
877
  * Kraken
607
878
  * Kucoin
879
+ * Kuna
608
880
  * LakeBTC
881
+ * LAToken
882
+ * LBank
883
+ * Liqnet
609
884
  * Liqui
885
+ * Liquid
610
886
  * LiveCoin
887
+ * lmax
611
888
  * LocalBitcoins
612
889
  * Luno
613
890
  * Lykke
614
891
  * MercadoBitcoin
892
+ * Minebit
615
893
  * MonetaGo
616
894
  * MtGox
895
+ * NDAX
896
+ * Nebula
897
+ * Neraex
898
+ * Nexchange
899
+ * Nlexch
900
+ * nominex
617
901
  * Novaexchange
902
+ * Nuex
903
+ * oex
618
904
  * OKCoin
619
905
  * OKEX
906
+ * onederx
907
+ * oneinch
908
+ * OpenLedger
909
+ * Ore
910
+ * P2PB2B
911
+ * pancakeswap
912
+ * paribu
620
913
  * Paymium
621
914
  * Poloniex
915
+ * primexbt
916
+ * probit
917
+ * Qryptos
622
918
  * QuadrigaCX
919
+ * quickswap
623
920
  * Quoine
921
+ * raidofinance
624
922
  * Remitano
923
+ * RightBTC
924
+ * SafeCoin
925
+ * safetrade
926
+ * seedcx
927
+ * sigenp2p
928
+ * sigenpro
929
+ * Simex
930
+ * SingularityX
931
+ * sistemkoin
932
+ * slicex
933
+ * smartrade
934
+ * StocksExchange
935
+ * StocksExchangeio
936
+ * Surbitcoin
937
+ * sushiswap
938
+ * Switcheo
939
+ * tchapp
940
+ * TDAX
625
941
  * TheRockTrading
942
+ * thore
943
+ * Threexbit
626
944
  * Tidex
945
+ * timex
946
+ * Tokenomy
947
+ * tokensnet
948
+ * TokenStore
949
+ * tokok
950
+ * TradeSatoshi
627
951
  * TrustDEX
952
+ * trxmarket
628
953
  * TuxExchange
954
+ * uniswap
955
+ * uniswapv2
956
+ * uniswapv3
957
+ * unnamed
629
958
  * Unocoin
959
+ * Upbit
960
+ * utorg
961
+ * valr
630
962
  * Vaultoro
963
+ * VBTC
964
+ * Velox
631
965
  * ViaBTC
632
966
  * WavesDEX
967
+ * wbb
968
+ * WEX
969
+ * WorldCryptoCap
970
+ * xbtpro
971
+ * xcoex
972
+ * xena
973
+ * XS2
974
+ * xtpub
633
975
  * Yacuna
634
976
  * Yobit
635
977
  * Yunbi
636
978
  * Zaif
979
+ * ZB
980
+ * ZBG
981
+ * zebitex
982
+ * Zecoex
983
+ * zloadr
637
984
 
638
985
  If no exchange option is specified, then the default 'CCCAGG' is used. This is cryptocompare's aggregated data.
639
986
 
@@ -12,3 +12,4 @@ to_syms: tsyms
12
12
  to_ts: toTs
13
13
  ts: ts
14
14
  utc_offset: UTCHourDiff
15
+ api_key: api_key
@@ -13,8 +13,8 @@ Gem::Specification.new do |spec|
13
13
  spec.description = %q{A Ruby gem for communicating with the CryptoCompare API}
14
14
  spec.homepage = "https://github.com/alexanderdavidpan/cryptocompare"
15
15
  spec.license = "MIT"
16
-
17
- spec.required_ruby_version = '>= 2.0.0'
16
+
17
+ spec.required_ruby_version = '>= 2.3.0'
18
18
 
19
19
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
20
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_development_dependency "bundler", "~> 1.12"
33
- spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "bundler", "~> 2.2.0"
33
+ spec.add_development_dependency "rake", ">= 12.3.3"
34
34
  spec.add_development_dependency "minitest", "~> 5.0"
35
35
  spec.add_development_dependency "vcr"
36
36
  spec.add_development_dependency "webmock"
@@ -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://www.cryptocompare.com/api/data/coinsnapshot/'
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,
@@ -0,0 +1,100 @@
1
+ require 'faraday'
2
+ require 'json'
3
+
4
+ module Cryptocompare
5
+ module News
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
11
+
12
+ # Returns news articles from the providers that CryptoCompare has integrated
13
+ # with.
14
+ #
15
+ # ==== Returns
16
+ #
17
+ # [Array] Array of news article objects.
18
+ #
19
+ # ==== Example
20
+ #
21
+ # Get news articles from the providers that CryptoCompare has integrated
22
+ # with.
23
+ #
24
+ # Cryptocompare::News.all
25
+ #
26
+ # Sample response
27
+ #
28
+ # [
29
+ # {
30
+ # "id" => "85721",
31
+ # "guid" => "https://news.bitcoin.com/?p=127153",
32
+ # "published_on" => 1520834400,
33
+ # "imageurl" => "https://images.cryptocompare.com/news/bitcoin.com/b9MBw3g640c.jpeg",
34
+ # "title" => "Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades",
35
+ # "url" => "https://news.bitcoin.com/study-finds-3b-worth-of-faked-cryptocurrency-volumes-and-wash-trades/",
36
+ # "source" => "bitcoin.com",
37
+ # "body" => "On March 10 a cryptocurrency trader and researcher published a report on how he believes $3 billion worth of cryptocurrency trade volumes, primarily from a couple of exchanges, are concocted. The author of the study, Sylvain Ribes, alleges that the exchange Okcoin has been fabricating up to 93 percent of its trade volumes. Also read: Thailand [&#8 230;]The post Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades appeared first on Bitcoin News.",
38
+ # "tags" => "News|95%|altcoin exchange|Binance|Bitcoin|BTC|Coinmarketcap|Fake Trades|GDAX|Huobi|illiquid assets|Kraken|Liquidity|Livecoinwatch|N-Featured|OKcoin|Okex|Poloniex|Sylvain Ribes|trading|Volumes|Wash Trades|Zhao Changpeng",
39
+ # "categories" => "BTC|Exchange|Trading",
40
+ # "lang" => "EN",
41
+ # "source_info" => {
42
+ # "name" => "Bitcoin.com",
43
+ # "lang" => "EN",
44
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoincom.png"
45
+ # }
46
+ # },
47
+ # ...
48
+ # ]
49
+ def self.all
50
+ api_resp = Faraday.get(NEWS_API_URL)
51
+ JSON.parse(api_resp.body)
52
+ end
53
+
54
+ # Returns all the news providers that CryptoCompare has integrated with.
55
+ #
56
+ # ==== Returns
57
+ #
58
+ # [Array] Array of news provider objects.
59
+ #
60
+ # ==== Example
61
+ #
62
+ # Get all the news providers that CryptoCompare has integrated with.
63
+ #
64
+ # Cryptocompare::News.providers
65
+ #
66
+ # Sample response
67
+ #
68
+ # [
69
+ # {
70
+ # "key" => "cryptocompare",
71
+ # "name" => "CryptoCompare",
72
+ # "lang" => "EN",
73
+ # "img" => "https://images.cryptocompare.com/news/default/cryptocompare.png"
74
+ # },
75
+ # {
76
+ # "key" => "coindesk",
77
+ # "name" => "CoinDesk",
78
+ # "lang" => "EN",
79
+ # "img" => "https://images.cryptocompare.com/news/default/coindesk.png"
80
+ # },
81
+ # {
82
+ # "key" => "bitcoinmagazine",
83
+ # "name" => "Bitcoin Magazine",
84
+ # "lang" => "EN",
85
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoinmagazine.png"
86
+ # },
87
+ # {
88
+ # "key" => "yahoofinance",
89
+ # "name" => "Yahoo Finance Bitcoin",
90
+ # "lang" => "EN",
91
+ # "img" => "https://images.cryptocompare.com/news/default/yahoofinance.png"
92
+ # },
93
+ # ...
94
+ # ]
95
+ def self.providers
96
+ api_resp = Faraday.get(NEWS_PROVIDERS_API_URL)
97
+ JSON.parse(api_resp.body)
98
+ end
99
+ end
100
+ end
@@ -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
- PRICE_FULL_API_URL = 'https://min-api.cryptocompare.com/data/pricemultifull'
8
- GENERATE_AVG_API_URL = 'https://min-api.cryptocompare.com/data/generateAvg'
9
- DAY_AVG_API_URL = 'https://min-api.cryptocompare.com/data/dayAvg'
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
@@ -1,3 +1,3 @@
1
1
  module Cryptocompare
2
- VERSION = "0.13.0"
2
+ VERSION = "0.17.0".freeze
3
3
  end
data/lib/cryptocompare.rb CHANGED
@@ -5,6 +5,7 @@ require_relative "cryptocompare/exchanges"
5
5
  require_relative "cryptocompare/histo_day"
6
6
  require_relative "cryptocompare/histo_hour"
7
7
  require_relative "cryptocompare/histo_minute"
8
+ require_relative "cryptocompare/news"
8
9
  require_relative "cryptocompare/price"
9
10
  require_relative "cryptocompare/price_historical"
10
11
  require_relative "cryptocompare/helpers/query_param_helper"
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.13.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander David Pan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-08 00:00:00.000000000 Z
11
+ date: 2021-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: 2.2.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: 2.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -115,10 +115,11 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".circleci/config.yml"
118
119
  - ".gitignore"
119
- - ".travis.yml"
120
120
  - CODE_OF_CONDUCT.md
121
121
  - Gemfile
122
+ - Gemfile.lock
122
123
  - LICENSE.txt
123
124
  - README.md
124
125
  - Rakefile
@@ -134,6 +135,7 @@ files:
134
135
  - lib/cryptocompare/histo_day.rb
135
136
  - lib/cryptocompare/histo_hour.rb
136
137
  - lib/cryptocompare/histo_minute.rb
138
+ - lib/cryptocompare/news.rb
137
139
  - lib/cryptocompare/price.rb
138
140
  - lib/cryptocompare/price_historical.rb
139
141
  - lib/cryptocompare/top_pairs.rb
@@ -143,7 +145,7 @@ licenses:
143
145
  - MIT
144
146
  metadata:
145
147
  allowed_push_host: https://rubygems.org
146
- post_install_message:
148
+ post_install_message:
147
149
  rdoc_options: []
148
150
  require_paths:
149
151
  - lib
@@ -151,16 +153,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
153
  requirements:
152
154
  - - ">="
153
155
  - !ruby/object:Gem::Version
154
- version: 2.0.0
156
+ version: 2.3.0
155
157
  required_rubygems_version: !ruby/object:Gem::Requirement
156
158
  requirements:
157
159
  - - ">="
158
160
  - !ruby/object:Gem::Version
159
161
  version: '0'
160
162
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.6.14
163
- signing_key:
163
+ rubygems_version: 3.1.2
164
+ signing_key:
164
165
  specification_version: 4
165
166
  summary: A Ruby gem for communicating with the CryptoCompare API
166
167
  test_files: []
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.0.0
5
- before_install: gem install bundler -v 1.12.5
6
- addons:
7
- code_climate:
8
- repo_token:
9
- secure: "NAjO10wrSWlyrTC+hj+4Mk3ORZqr7yoD4Or8HIj7YkpKX4l9neqiaOCmNi34wImpJttEsbH/ICIfqphjp1w7VEdS/HnVcJEv3mO9fJ3uLYXJY9uTlwlotdHQ5xCIpyQQJswRw1ef2kH55ACZOWcfC/Sp7sZ9L/xb/3Gb9o1hC6pH0Kd87gx4X8v/THfynR5tPoXUjWCN1RZDcshdTBqOLIyMBdlueZQ2bmiqPQEtCorixCSF2z0oxBXlNoklkPVGOqPXiER/KFaUmDTupSnWw9CGO/00CA1ErU2pk4LTSQwDTZbMQ6ciIl3JTaM9YtJhaKVw2qrSAEKBFjUVmSlqblwAr/A47MaNxD7B6gWe5aKjt1aPsWddNJDf43SSb4B4yh8FfA++c+ydB3XN1yEgg4eoKrqezIgffzbETGGIrlKkbEVqYzXeS3d8N2Zn/ads7Ie1QQsGaH858r+2Taser/saYqF/KIJwMOIiOAAriGJxIk70hHM5ocJVNVtyJpWOTZ1Tzoqtgayfk3lLLixzenh+HRoOLtXg4lCXOZJ+R78w9NCIG/y5ltJJqW9lXlajJHGlIvdkGKD9Q3MKAuH4UbUw6Ni12T8HigEcf1DdDGahNcL2vUdDeIF+mAGTl0blBiLnjmaj+KsfpwC0LcIVBHeLVPV48r2eld6LaNgFeT4="
10
- # regular test configuration
11
- after_success:
12
- - bundle exec codeclimate-test-reporter