cryptoexchange 0.10.3 → 0.10.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb5f56f4960e4106321369f548e4447fdea9ff2
|
4
|
+
data.tar.gz: da706e292376563eb40f1fbf2d34219a47c79947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9d7c94137fb7444f74c00b5f3d73190e6df997628c6afa2a100c7988aed28b136c0e712c422ebcb1057b9482b0b462c9d9b0ac0b78acff7f9803a883cc342a6
|
7
|
+
data.tar.gz: 514812b1f6cd5a810e0305e248415a86c181580ea241809e0f4fe42701bcc83402ad9bb7fc25bc6370751767df9a060e22c3e2b755f3f3fad336e460b9e2d2b9
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ Or install it yourself as:
|
|
30
30
|
| Bitcoin Indonesia | Y | | | | User-Defined|
|
31
31
|
| Bitfinex | Y | | | | Y |
|
32
32
|
| Bitflyer | Y | | | | Y |
|
33
|
-
| Bithumb | Y | | | |
|
33
|
+
| Bithumb | Y | | | | Y |
|
34
34
|
| Bitso | Y | | | | Y |
|
35
35
|
| Bitstamp | Y | | | | User-Defined|
|
36
36
|
| Bittrex | Y | | | | Y |
|
@@ -4,21 +4,34 @@ module Cryptoexchange::Exchanges
|
|
4
4
|
class Market < Cryptoexchange::Services::Market
|
5
5
|
class << self
|
6
6
|
def supports_individual_ticker_query?
|
7
|
-
|
7
|
+
false
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
def fetch
|
12
|
-
output = super
|
13
|
-
|
11
|
+
def fetch
|
12
|
+
output = super ticker_url
|
13
|
+
adapt_all(output)
|
14
14
|
end
|
15
15
|
|
16
|
-
def ticker_url
|
17
|
-
"#{Cryptoexchange::Exchanges::Bithumb::Market::API_URL}/public/ticker
|
16
|
+
def ticker_url
|
17
|
+
"#{Cryptoexchange::Exchanges::Bithumb::Market::API_URL}/public/ticker/all"
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
|
20
|
+
def adapt_all(output)
|
21
|
+
output['data'].map do |target, ticker|
|
22
|
+
base = target
|
23
|
+
target = 'KRW'
|
24
|
+
market_pair = Cryptoexchange::Models::MarketPair.new(
|
25
|
+
base: base,
|
26
|
+
target: target,
|
27
|
+
market: Bithumb::Market::NAME
|
28
|
+
)
|
29
|
+
adapt(ticker, market_pair, output['data']['date'])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def adapt(output, market_pair, date)
|
34
|
+
market = output
|
22
35
|
ticker = Cryptoexchange::Models::Ticker.new
|
23
36
|
ticker.base = market_pair.base
|
24
37
|
ticker.target = market_pair.target
|
@@ -30,7 +43,7 @@ module Cryptoexchange::Exchanges
|
|
30
43
|
ticker.low = NumericHelper.to_d(market['min_price'])
|
31
44
|
#use 1day volume instead of 7days
|
32
45
|
ticker.volume = NumericHelper.to_d(market['volume_1day'])
|
33
|
-
ticker.timestamp =
|
46
|
+
ticker.timestamp = date.to_i / 1000
|
34
47
|
ticker.payload = market
|
35
48
|
ticker
|
36
49
|
end
|
@@ -2,6 +2,7 @@ module Cryptoexchange::Exchanges
|
|
2
2
|
module Bithumb
|
3
3
|
module Services
|
4
4
|
class Pairs < Cryptoexchange::Services::Pairs
|
5
|
+
PAIRS_URL = "#{Cryptoexchange::Exchanges::Bithumb::Market::API_URL}/public/ticker/all"
|
5
6
|
|
6
7
|
def fetch
|
7
8
|
output = super
|
@@ -9,16 +10,16 @@ module Cryptoexchange::Exchanges
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def adapt(output)
|
12
|
-
|
13
|
-
output.each do |
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
pairs = []
|
14
|
+
output['data'].keys.each do |base|
|
15
|
+
next if base == 'date'
|
16
|
+
pairs << Cryptoexchange::Models::MarketPair.new(
|
17
|
+
base: base,
|
18
|
+
target: 'KRW',
|
19
|
+
market: Bithumb::Market::NAME
|
20
|
+
)
|
19
21
|
end
|
20
|
-
|
21
|
-
market_pairs
|
22
|
+
pairs
|
22
23
|
end
|
23
24
|
end
|
24
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.10.
|
4
|
+
version: 0.10.4
|
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-09-
|
11
|
+
date: 2017-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,7 +147,6 @@ files:
|
|
147
147
|
- lib/cryptoexchange/exchanges/bitflyer/market.rb
|
148
148
|
- lib/cryptoexchange/exchanges/bitflyer/services/market.rb
|
149
149
|
- lib/cryptoexchange/exchanges/bitflyer/services/pairs.rb
|
150
|
-
- lib/cryptoexchange/exchanges/bithumb/bithumb.yml
|
151
150
|
- lib/cryptoexchange/exchanges/bithumb/market.rb
|
152
151
|
- lib/cryptoexchange/exchanges/bithumb/services/market.rb
|
153
152
|
- lib/cryptoexchange/exchanges/bithumb/services/pairs.rb
|