cryptoexchange 0.5.2 → 0.6.0
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 +4 -4
- data/README.md +3 -3
- data/lib/cryptoexchange/exchanges/chbtc/chbtc.yml +16 -0
- data/lib/cryptoexchange/exchanges/chbtc/market.rb +8 -0
- data/lib/cryptoexchange/exchanges/chbtc/services/market.rb +41 -0
- data/lib/cryptoexchange/exchanges/chbtc/services/pairs.rb +25 -0
- data/lib/cryptoexchange/exchanges/jubi/market.rb +8 -0
- data/lib/cryptoexchange/exchanges/jubi/services/market.rb +51 -0
- data/lib/cryptoexchange/exchanges/jubi/services/pairs.rb +25 -0
- data/lib/cryptoexchange/models/market_pair.rb +2 -2
- data/lib/cryptoexchange/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a41f865eb28d874977c2fca50d3793699903573
|
4
|
+
data.tar.gz: d1c11a43c53feeb6db9f1e3cdcc91420d65eae7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 160cc7215c3cb9c7a92a9d92714f80272982d4c61577ed61cdcb0de8708e211b862fa6d1b10090e802429cbc3f124d476943eb3b8bfa7b95768cb7e26c23f890
|
7
|
+
data.tar.gz: 9f2f14134e5f43452a269ed55634c22a279bcd3f2783212ee842c1ea8148675c353afa390e683038d8405fdaf101113b9ed666d8a4e6397f5d383d85565cba56
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
|
|
32
32
|
| Huobi | | | | | |
|
33
33
|
| Yunbi | Y | | | | Y |
|
34
34
|
| BTC38 | | | | | |
|
35
|
-
| CHBTC |
|
35
|
+
| CHBTC | Y | | | | User-Defined|
|
36
36
|
| Bitstamp | Y | | | | User-Defined|
|
37
37
|
| Bittrex | Y | | | | Y |
|
38
38
|
| GDAX | Y | | | | Y |
|
@@ -41,7 +41,7 @@ Or install it yourself as:
|
|
41
41
|
| Kraken | Y | | | | Y |
|
42
42
|
| Coincheck | Y | | | | User-Defined|
|
43
43
|
| Bitflyer | Y | | | | Y |
|
44
|
-
| Quoine |
|
44
|
+
| Quoine | Y | | | | Y |
|
45
45
|
| QuadrigaCX | | | | | |
|
46
46
|
| Unocoin | | | | | |
|
47
47
|
| Coinone | Y | | | | Y |
|
@@ -67,7 +67,7 @@ Or install it yourself as:
|
|
67
67
|
| BTCChina | | | | | |
|
68
68
|
| Coinmate | | | | | |
|
69
69
|
| Itbit | | | | | |
|
70
|
-
| Jubi |
|
70
|
+
| Jubi | Y | | | | Y |
|
71
71
|
| MercadoBitcoin | | | | | |
|
72
72
|
| Viabtc | Y | | | | User-Defined|
|
73
73
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Cryptoexchange::Exchanges
|
2
|
+
module Chbtc
|
3
|
+
module Services
|
4
|
+
class Market < Cryptoexchange::Services::Market
|
5
|
+
class << self
|
6
|
+
def supports_individual_ticker_query?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def fetch(market_pair)
|
12
|
+
output = super(ticker_url(market_pair))
|
13
|
+
adapt(output, market_pair)
|
14
|
+
end
|
15
|
+
|
16
|
+
def ticker_url(market_pair)
|
17
|
+
base = market_pair.base.downcase
|
18
|
+
target = market_pair.target.downcase
|
19
|
+
"#{Cryptoexchange::Exchanges::Chbtc::Market::API_URL}/ticker?currency=#{base}_#{target}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def adapt(output, market_pair)
|
23
|
+
ticker_data = output['ticker']
|
24
|
+
ticker = Cryptoexchange::Models::Ticker.new
|
25
|
+
ticker.base = market_pair.base
|
26
|
+
ticker.target = market_pair.target
|
27
|
+
ticker.market = Chbtc::Market::NAME
|
28
|
+
ticker.ask = NumericHelper.to_d(ticker_data['sell'])
|
29
|
+
ticker.bid = NumericHelper.to_d(ticker_data['buy'])
|
30
|
+
ticker.last = NumericHelper.to_d(ticker_data['last'])
|
31
|
+
ticker.high = NumericHelper.to_d(ticker_data['high'])
|
32
|
+
ticker.low = NumericHelper.to_d(ticker_data['low'])
|
33
|
+
ticker.volume = NumericHelper.to_d(ticker_data['vol'])
|
34
|
+
ticker.timestamp = output['date'].to_i
|
35
|
+
ticker.payload = output
|
36
|
+
ticker
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Cryptoexchange::Exchanges
|
2
|
+
module Chbtc
|
3
|
+
module Services
|
4
|
+
class Pairs < Cryptoexchange::Services::Pairs
|
5
|
+
|
6
|
+
def fetch
|
7
|
+
output = super
|
8
|
+
adapt(output)
|
9
|
+
end
|
10
|
+
|
11
|
+
def adapt(output)
|
12
|
+
market_pairs = []
|
13
|
+
output.each do |pair|
|
14
|
+
market_pairs << Cryptoexchange::Models::MarketPair.new(
|
15
|
+
base: pair[:base],
|
16
|
+
target: pair[:target],
|
17
|
+
market: Chbtc::Market::NAME
|
18
|
+
)
|
19
|
+
end
|
20
|
+
market_pairs
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Cryptoexchange::Exchanges
|
2
|
+
module Jubi
|
3
|
+
module Services
|
4
|
+
class Market < Cryptoexchange::Services::Market
|
5
|
+
class << self
|
6
|
+
def supports_individual_ticker_query?
|
7
|
+
false
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def fetch
|
12
|
+
output = super(self.ticker_url)
|
13
|
+
adapt_all(output)
|
14
|
+
end
|
15
|
+
|
16
|
+
def ticker_url
|
17
|
+
"#{Cryptoexchange::Exchanges::Jubi::Market::API_URL}/allticker"
|
18
|
+
end
|
19
|
+
|
20
|
+
def adapt_all(output)
|
21
|
+
default_target = 'CNY'
|
22
|
+
output.map do |base, ticker|
|
23
|
+
market_pair = Cryptoexchange::Models::MarketPair.new(
|
24
|
+
base: base,
|
25
|
+
target: default_target,
|
26
|
+
market: Jubi::Market::NAME
|
27
|
+
)
|
28
|
+
|
29
|
+
adapt(ticker, market_pair)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def adapt(output, market_pair)
|
34
|
+
ticker = Cryptoexchange::Models::Ticker.new
|
35
|
+
ticker.base = market_pair.base
|
36
|
+
ticker.target = market_pair.target
|
37
|
+
ticker.market = Jubi::Market::NAME
|
38
|
+
ticker.last = NumericHelper.to_d(output['last'])
|
39
|
+
ticker.bid = NumericHelper.to_d(output['buy'])
|
40
|
+
ticker.ask = NumericHelper.to_d(output['sell'])
|
41
|
+
ticker.high = NumericHelper.to_d(output['high'])
|
42
|
+
ticker.low = NumericHelper.to_d(output['low'])
|
43
|
+
ticker.volume = NumericHelper.to_d(output['vol'])
|
44
|
+
ticker.timestamp = DateTime.now.to_time.to_i
|
45
|
+
ticker.payload = output
|
46
|
+
ticker
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Cryptoexchange::Exchanges
|
2
|
+
module Jubi
|
3
|
+
module Services
|
4
|
+
class Pairs < Cryptoexchange::Services::Pairs
|
5
|
+
PAIRS_URL = "#{Cryptoexchange::Exchanges::Jubi::Market::API_URL}/allticker"
|
6
|
+
|
7
|
+
def fetch
|
8
|
+
output = super
|
9
|
+
adapt(output)
|
10
|
+
end
|
11
|
+
|
12
|
+
def adapt(output)
|
13
|
+
default_target = 'CNY'
|
14
|
+
output.keys.map do |base|
|
15
|
+
Cryptoexchange::Models::MarketPair.new({
|
16
|
+
base: base,
|
17
|
+
target: default_target,
|
18
|
+
market: Jubi::Market::NAME
|
19
|
+
})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptoexchange
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TM Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -166,6 +166,10 @@ files:
|
|
166
166
|
- lib/cryptoexchange/exchanges/ccex/market.rb
|
167
167
|
- lib/cryptoexchange/exchanges/ccex/services/market.rb
|
168
168
|
- lib/cryptoexchange/exchanges/ccex/services/pairs.rb
|
169
|
+
- lib/cryptoexchange/exchanges/chbtc/chbtc.yml
|
170
|
+
- lib/cryptoexchange/exchanges/chbtc/market.rb
|
171
|
+
- lib/cryptoexchange/exchanges/chbtc/services/market.rb
|
172
|
+
- lib/cryptoexchange/exchanges/chbtc/services/pairs.rb
|
169
173
|
- lib/cryptoexchange/exchanges/coin_exchange/market.rb
|
170
174
|
- lib/cryptoexchange/exchanges/coin_exchange/services/market.rb
|
171
175
|
- lib/cryptoexchange/exchanges/coin_exchange/services/pairs.rb
|
@@ -194,6 +198,9 @@ files:
|
|
194
198
|
- lib/cryptoexchange/exchanges/hitbtc/market.rb
|
195
199
|
- lib/cryptoexchange/exchanges/hitbtc/services/market.rb
|
196
200
|
- lib/cryptoexchange/exchanges/hitbtc/services/pairs.rb
|
201
|
+
- lib/cryptoexchange/exchanges/jubi/market.rb
|
202
|
+
- lib/cryptoexchange/exchanges/jubi/services/market.rb
|
203
|
+
- lib/cryptoexchange/exchanges/jubi/services/pairs.rb
|
197
204
|
- lib/cryptoexchange/exchanges/korbit/korbit.yml
|
198
205
|
- lib/cryptoexchange/exchanges/korbit/market.rb
|
199
206
|
- lib/cryptoexchange/exchanges/korbit/services/market.rb
|