cryptocompare 0.10.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,97 @@
1
+ require 'faraday'
2
+ require 'json'
3
+
4
+ module Cryptocompare
5
+ module News
6
+ NEWS_API_URL = 'https://min-api.cryptocompare.com/data/news/'
7
+ NEWS_PROVIDERS_API_URL = 'https://min-api.cryptocompare.com/data/news/providers'
8
+
9
+ # Returns news articles from the providers that CryptoCompare has integrated
10
+ # with.
11
+ #
12
+ # ==== Returns
13
+ #
14
+ # [Array] Array of news article objects.
15
+ #
16
+ # ==== Example
17
+ #
18
+ # Get news articles from the providers that CryptoCompare has integrated
19
+ # with.
20
+ #
21
+ # Cryptocompare::News.all
22
+ #
23
+ # Sample response
24
+ #
25
+ # [
26
+ # {
27
+ # "id" => "85721",
28
+ # "guid" => "https://news.bitcoin.com/?p=127153",
29
+ # "published_on" => 1520834400,
30
+ # "imageurl" => "https://images.cryptocompare.com/news/bitcoin.com/b9MBw3g640c.jpeg",
31
+ # "title" => "Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades",
32
+ # "url" => "https://news.bitcoin.com/study-finds-3b-worth-of-faked-cryptocurrency-volumes-and-wash-trades/",
33
+ # "source" => "bitcoin.com",
34
+ # "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.",
35
+ # "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",
36
+ # "categories" => "BTC|Exchange|Trading",
37
+ # "lang" => "EN",
38
+ # "source_info" => {
39
+ # "name" => "Bitcoin.com",
40
+ # "lang" => "EN",
41
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoincom.png"
42
+ # }
43
+ # },
44
+ # ...
45
+ # ]
46
+ def self.all
47
+ api_resp = Faraday.get(NEWS_API_URL)
48
+ JSON.parse(api_resp.body)
49
+ end
50
+
51
+ # Returns all the news providers that CryptoCompare has integrated with.
52
+ #
53
+ # ==== Returns
54
+ #
55
+ # [Array] Array of news provider objects.
56
+ #
57
+ # ==== Example
58
+ #
59
+ # Get all the news providers that CryptoCompare has integrated with.
60
+ #
61
+ # Cryptocompare::News.providers
62
+ #
63
+ # Sample response
64
+ #
65
+ # [
66
+ # {
67
+ # "key" => "cryptocompare",
68
+ # "name" => "CryptoCompare",
69
+ # "lang" => "EN",
70
+ # "img" => "https://images.cryptocompare.com/news/default/cryptocompare.png"
71
+ # },
72
+ # {
73
+ # "key" => "coindesk",
74
+ # "name" => "CoinDesk",
75
+ # "lang" => "EN",
76
+ # "img" => "https://images.cryptocompare.com/news/default/coindesk.png"
77
+ # },
78
+ # {
79
+ # "key" => "bitcoinmagazine",
80
+ # "name" => "Bitcoin Magazine",
81
+ # "lang" => "EN",
82
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoinmagazine.png"
83
+ # },
84
+ # {
85
+ # "key" => "yahoofinance",
86
+ # "name" => "Yahoo Finance Bitcoin",
87
+ # "lang" => "EN",
88
+ # "img" => "https://images.cryptocompare.com/news/default/yahoofinance.png"
89
+ # },
90
+ # ...
91
+ # ]
92
+ def self.providers
93
+ api_resp = Faraday.get(NEWS_PROVIDERS_API_URL)
94
+ JSON.parse(api_resp.body)
95
+ end
96
+ end
97
+ end
@@ -174,7 +174,7 @@ module Cryptocompare
174
174
  #
175
175
  # * +from_sym+ [String] - (required) currency symbols (ex: 'BTC', 'ETH', 'LTC', 'USD', 'EUR', 'CNY')
176
176
  # * +to_sym+ [String] - (required) currency symbols (ex: 'USD', 'EUR', 'CNY', 'USD', 'EUR', 'CNY')
177
- # * +markets+ [String, Array] - (required) Name of exchanges. Supports multiple. (ex: 'Coinbase','Poloniex')
177
+ # * +e+ [String, Array] - (required) Name of exchanges. Supports multiple. (ex: 'Coinbase','Poloniex')
178
178
  # * +opts+ [Hash] - (optional) options hash
179
179
  #
180
180
  # ==== Options
@@ -196,49 +196,49 @@ module Cryptocompare
196
196
  # Sample response
197
197
  #
198
198
  # {
199
- # RAW: {
200
- # MARKET: "CUSTOMAGG",
201
- # FROMSYMBOL: "BTC",
202
- # TOSYMBOL: "USD",
203
- # FLAGS: 0,
204
- # PRICE: 4137.43,
205
- # LASTUPDATE: 1503454563,
206
- # LASTVOLUME: 2,
207
- # LASTVOLUMETO: 8271.98,
208
- # LASTTRADEID: 19656029,
209
- # VOLUME24HOUR: 71728.71957884016,
210
- # VOLUME24HOURTO: 279374718.3442189,
211
- # OPEN24HOUR: 3885.85,
212
- # HIGH24HOUR: 4145,
213
- # LOW24HOUR: 3583.46,
214
- # LASTMARKET: "Coinbase",
215
- # CHANGE24HOUR: 251.58000000000038,
216
- # CHANGEPCT24HOUR: 6.474259171095137
199
+ # "RAW" => {
200
+ # "MARKET" => "CUSTOMAGG",
201
+ # "FROMSYMBOL" => "BTC",
202
+ # "TOSYMBOL" => "USD",
203
+ # "FLAGS" => 0,
204
+ # "PRICE" => 4137.43,
205
+ # "LASTUPDATE" => 1503454563,
206
+ # "LASTVOLUME" => 2,
207
+ # "LASTVOLUMETO" => 8271.98,
208
+ # "LASTTRADEID" => 19656029,
209
+ # "VOLUME24HOUR" => 71728.71957884016,
210
+ # "VOLUME24HOURTO" => 279374718.3442189,
211
+ # "OPEN24HOUR" => 3885.85,
212
+ # "HIGH24HOUR" => 4145,
213
+ # "LOW24HOUR" => 3583.46,
214
+ # "LASTMARKET" => "Coinbase",
215
+ # "CHANGE24HOUR" => 251.58000000000038,
216
+ # "CHANGEPCT24HOUR" => 6.474259171095137
217
217
  # },
218
- # DISPLAY: {
219
- # FROMSYMBOL: "Ƀ",
220
- # TOSYMBOL: "$",
221
- # MARKET: "CUSTOMAGG",
222
- # PRICE: "$ 4,137.43",
223
- # LASTUPDATE: "Just now",
224
- # LASTVOLUME: "Ƀ 2",
225
- # LASTVOLUMETO: "$ 8,271.98",
226
- # LASTTRADEID: 19656029,
227
- # VOLUME24HOUR: "Ƀ 71,728.7",
228
- # VOLUME24HOURTO: "$ 279,374,718.3",
229
- # OPEN24HOUR: "$ 3,885.85",
230
- # HIGH24HOUR: "$ 4,145",
231
- # LOW24HOUR: "$ 3,583.46",
232
- # LASTMARKET: "Coinbase",
233
- # CHANGE24HOUR: "$ 251.58",
234
- # CHANGEPCT24HOUR: "6.47"
218
+ # "DISPLAY" => {
219
+ # "FROMSYMBOL" => "Ƀ",
220
+ # "TOSYMBOL" => "$",
221
+ # "MARKET" => "CUSTOMAGG",
222
+ # "PRICE" => "$ 4,137.43",
223
+ # "LASTUPDATE" => "Just now",
224
+ # "LASTVOLUME" => "Ƀ 2",
225
+ # "LASTVOLUMETO" => "$ 8,271.98",
226
+ # "LASTTRADEID" => 19656029,
227
+ # "VOLUME24HOUR" => "Ƀ 71,728.7",
228
+ # "VOLUME24HOURTO" => "$ 279,374,718.3",
229
+ # "OPEN24HOUR" => "$ 3,885.85",
230
+ # "HIGH24HOUR" => "$ 4,145",
231
+ # "LOW24HOUR" => "$ 3,583.46",
232
+ # "LASTMARKET" => "Coinbase",
233
+ # "CHANGE24HOUR" => "$ 251.58",
234
+ # "CHANGEPCT24HOUR" => "6.47"
235
235
  # }
236
236
  # }
237
- def self.generate_avg(from_sym, to_sym, markets, opts = {})
237
+ def self.generate_avg(from_sym, to_sym, e, opts = {})
238
238
  params = {
239
239
  'from_sym' => from_sym,
240
240
  'to_sym' => to_sym,
241
- 'markets' => Array(markets).join(',')
241
+ 'e' => Array(e).join(',')
242
242
  }.merge!(opts)
243
243
 
244
244
  full_path = QueryParamHelper.set_query_params(GENERATE_AVG_API_URL, params)
@@ -32,21 +32,21 @@ module Cryptocompare
32
32
  # Sample response
33
33
  #
34
34
  # {
35
- # Response: "Success",
36
- # Data: [
35
+ # "Response" => "Success",
36
+ # "Data" => [
37
37
  # {
38
- # exchange: "CCCAGG",
39
- # fromSymbol: "ETH",
40
- # toSymbol: "USD",
41
- # volume24h: 1310705.3005027298,
42
- # volume24hTo: 288031723.3503975
38
+ # "exchange" => "CCCAGG",
39
+ # "fromSymbol" => "ETH",
40
+ # "toSymbol" => "USD",
41
+ # "volume24h" => 1310705.3005027298,
42
+ # "volume24hTo" => 288031723.3503975
43
43
  # },
44
44
  # {
45
- # exchange: "CCCAGG",
46
- # fromSymbol: "ETH",
47
- # toSymbol: "BTC",
48
- # volume24h: 978200.2198323006,
49
- # volume24hTo: 77883.06190085363
45
+ # "exchange" => "CCCAGG",
46
+ # "fromSymbol" => "ETH",
47
+ # "toSymbol" => "BTC",
48
+ # "volume24h" => 978200.2198323006,
49
+ # "volume24hTo" => 77883.06190085363
50
50
  # },
51
51
  # ...
52
52
  # ]
@@ -1,3 +1,3 @@
1
1
  module Cryptocompare
2
- VERSION = "0.10.0"
2
+ VERSION = "0.15.0"
3
3
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptocompare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.15.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: 2017-09-11 00:00:00.000000000 Z
11
+ date: 2020-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: 2.1.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.1.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
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '5.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: vcr
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: faraday
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: json
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: A Ruby gem for communicating with the CryptoCompare API
@@ -115,8 +115,8 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
119
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".travis.yml"
120
120
  - CODE_OF_CONDUCT.md
121
121
  - Gemfile
122
122
  - LICENSE.txt
@@ -124,16 +124,17 @@ files:
124
124
  - Rakefile
125
125
  - bin/console
126
126
  - bin/setup
127
- - config/exchanges.yml
128
127
  - config/query_param_mapping.yml
129
128
  - cryptocompare.gemspec
130
129
  - lib/cryptocompare.rb
130
+ - lib/cryptocompare/coin_list.rb
131
131
  - lib/cryptocompare/coin_snapshot.rb
132
- - lib/cryptocompare/helpers/exchange_name_helper.rb
132
+ - lib/cryptocompare/exchanges.rb
133
133
  - lib/cryptocompare/helpers/query_param_helper.rb
134
134
  - lib/cryptocompare/histo_day.rb
135
135
  - lib/cryptocompare/histo_hour.rb
136
136
  - lib/cryptocompare/histo_minute.rb
137
+ - lib/cryptocompare/news.rb
137
138
  - lib/cryptocompare/price.rb
138
139
  - lib/cryptocompare/price_historical.rb
139
140
  - lib/cryptocompare/top_pairs.rb
@@ -143,24 +144,23 @@ licenses:
143
144
  - MIT
144
145
  metadata:
145
146
  allowed_push_host: https://rubygems.org
146
- post_install_message:
147
+ post_install_message:
147
148
  rdoc_options: []
148
149
  require_paths:
149
150
  - lib
150
151
  required_ruby_version: !ruby/object:Gem::Requirement
151
152
  requirements:
152
- - - '>='
153
+ - - ">="
153
154
  - !ruby/object:Gem::Version
154
- version: 2.0.0
155
+ version: 2.3.0
155
156
  required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - '>='
158
+ - - ">="
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.0.14.1
163
- signing_key:
162
+ rubygems_version: 3.1.2
163
+ signing_key:
164
164
  specification_version: 4
165
165
  summary: A Ruby gem for communicating with the CryptoCompare API
166
166
  test_files: []
@@ -1,55 +0,0 @@
1
- BTC38: BTC38
2
- BTCC: BTCC
3
- BTCE: BTCE
4
- BTCMARKETS: BTCMarkets
5
- BTCXINDIA: BTCXIndia
6
- BTER: BTER
7
- BIT2C: Bit2C
8
- BITBAY: BitBay
9
- BITFLYER: bitFlyer
10
- BITFLYERFX: bitFlyerFX
11
- BITMARKET: BitMarket
12
- BITSQUARE: BitSquare
13
- BITFINEX: Bitfinex
14
- BITSO: Bitso
15
- BITSTAMP: Bitstamp
16
- BITTREX: Bittrex
17
- BLEUTRADE: Bleutrade
18
- CCEDK: CCEDK
19
- CEXIO: Cexio
20
- COINCHECK: CoinCheck
21
- COINBASE: Coinbase
22
- COINFLOOR: Coinfloor
23
- COINONE: Coinone
24
- COINSE: Coinse
25
- COINSETTER: Coinsetter
26
- CRYPTOPIA: Cryptopia
27
- CRYPTSY: Cryptsy
28
- ETHERDELTA: EtherDelta
29
- ETHEXINDIA: EthexIndia
30
- GATECOIN: Gatecoin
31
- GEMINI: Gemini
32
- HITBTC: HitBTC
33
- HUOBI: Huobi
34
- ITBIT: itBit
35
- KORBIT: Korbit
36
- KRAKEN: Kraken
37
- LAKEBTC: LakeBTC
38
- LIQUI: Liqui
39
- LIVECOIN: LiveCoin
40
- LOCALBITCOINS: LocalBitcoins
41
- LUNO: Luno
42
- MERCADOBITCOIN: MercadoBitcoin
43
- MONETAGO: MonetaGo
44
- OKCOIN: OKCoin
45
- PAYMIUM: Paymium
46
- POLONIEX: Poloniex
47
- QUADRIGACX: QuadrigaCX
48
- QUOINE: Quoine
49
- THEROCKTRADING: TheRockTrading
50
- TIDEX: Tidex
51
- UNOCOIN: Unocoin
52
- VAULTORO: Vaultoro
53
- YACUNA: Yacuna
54
- YOBIT: Yobit
55
- YUNBI: Yunbi