cryptoexchange 0.2.1 → 0.3.1

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -5
  3. data/lib/cryptoexchange.rb +3 -1
  4. data/lib/cryptoexchange/client.rb +5 -17
  5. data/lib/cryptoexchange/exchanges/anx/services/market.rb +11 -11
  6. data/lib/cryptoexchange/exchanges/bitcoin_indonesia/services/market.rb +13 -13
  7. data/lib/cryptoexchange/exchanges/bitflyer/services/market.rb +10 -10
  8. data/lib/cryptoexchange/exchanges/bithumb/bithumb.yml +13 -0
  9. data/lib/cryptoexchange/exchanges/bithumb/market.rb +8 -0
  10. data/lib/cryptoexchange/exchanges/bithumb/models/market_pair.rb +8 -0
  11. data/lib/cryptoexchange/exchanges/bithumb/models/ticker.rb +8 -0
  12. data/lib/cryptoexchange/exchanges/bithumb/services/market.rb +40 -0
  13. data/lib/cryptoexchange/exchanges/bithumb/services/pairs.rb +26 -0
  14. data/lib/cryptoexchange/exchanges/bitstamp/market.rb +1 -1
  15. data/lib/cryptoexchange/exchanges/bitstamp/services/market.rb +13 -13
  16. data/lib/cryptoexchange/exchanges/bittrex/market.rb +8 -0
  17. data/lib/cryptoexchange/exchanges/bittrex/models/market_pair.rb +8 -0
  18. data/lib/cryptoexchange/exchanges/bittrex/models/ticker.rb +8 -0
  19. data/lib/cryptoexchange/exchanges/bittrex/services/market.rb +42 -0
  20. data/lib/cryptoexchange/exchanges/bittrex/services/pairs.rb +28 -0
  21. data/lib/cryptoexchange/exchanges/bleutrade/market.rb +8 -0
  22. data/lib/cryptoexchange/exchanges/bleutrade/models/market_pair.rb +8 -0
  23. data/lib/cryptoexchange/exchanges/bleutrade/models/ticker.rb +8 -0
  24. data/lib/cryptoexchange/exchanges/bleutrade/services/market.rb +50 -0
  25. data/lib/cryptoexchange/exchanges/bleutrade/services/pairs.rb +27 -0
  26. data/lib/cryptoexchange/exchanges/btcc/services/market.rb +12 -12
  27. data/lib/cryptoexchange/exchanges/bter/market.rb +8 -0
  28. data/lib/cryptoexchange/exchanges/bter/models/market_pair.rb +8 -0
  29. data/lib/cryptoexchange/exchanges/bter/models/ticker.rb +8 -0
  30. data/lib/cryptoexchange/exchanges/bter/services/market.rb +38 -0
  31. data/lib/cryptoexchange/exchanges/bter/services/pairs.rb +26 -0
  32. data/lib/cryptoexchange/exchanges/ccex/market.rb +8 -0
  33. data/lib/cryptoexchange/exchanges/ccex/models/market_pair.rb +8 -0
  34. data/lib/cryptoexchange/exchanges/ccex/models/ticker.rb +8 -0
  35. data/lib/cryptoexchange/exchanges/ccex/services/market.rb +48 -0
  36. data/lib/cryptoexchange/exchanges/ccex/services/pairs.rb +26 -0
  37. data/lib/cryptoexchange/exchanges/coin_exchange/market.rb +8 -0
  38. data/lib/cryptoexchange/exchanges/coin_exchange/models/market_pair.rb +8 -0
  39. data/lib/cryptoexchange/exchanges/coin_exchange/models/ticker.rb +8 -0
  40. data/lib/cryptoexchange/exchanges/coin_exchange/services/market.rb +70 -0
  41. data/lib/cryptoexchange/exchanges/coin_exchange/services/pairs.rb +24 -0
  42. data/lib/cryptoexchange/exchanges/coincheck/services/market.rb +12 -12
  43. data/lib/cryptoexchange/exchanges/coinone/services/market.rb +10 -10
  44. data/lib/cryptoexchange/exchanges/cryptopia/services/market.rb +13 -13
  45. data/lib/cryptoexchange/exchanges/ether_delta/market.rb +8 -0
  46. data/lib/cryptoexchange/exchanges/ether_delta/models/market_pair.rb +8 -0
  47. data/lib/cryptoexchange/exchanges/ether_delta/models/ticker.rb +8 -0
  48. data/lib/cryptoexchange/exchanges/ether_delta/services/market.rb +41 -0
  49. data/lib/cryptoexchange/exchanges/ether_delta/services/pairs.rb +26 -0
  50. data/lib/cryptoexchange/exchanges/gatecoin/services/market.rb +11 -11
  51. data/lib/cryptoexchange/exchanges/gemini/services/market.rb +4 -4
  52. data/lib/cryptoexchange/exchanges/hitbtc/market.rb +8 -0
  53. data/lib/cryptoexchange/exchanges/hitbtc/models/market_pair.rb +8 -0
  54. data/lib/cryptoexchange/exchanges/hitbtc/models/ticker.rb +8 -0
  55. data/lib/cryptoexchange/exchanges/hitbtc/services/market.rb +42 -0
  56. data/lib/cryptoexchange/exchanges/hitbtc/services/pairs.rb +24 -0
  57. data/lib/cryptoexchange/exchanges/korbit/services/market.rb +12 -12
  58. data/lib/cryptoexchange/exchanges/lakebtc/market.rb +8 -0
  59. data/lib/cryptoexchange/exchanges/lakebtc/models/market_pair.rb +8 -0
  60. data/lib/cryptoexchange/exchanges/lakebtc/models/ticker.rb +8 -0
  61. data/lib/cryptoexchange/exchanges/lakebtc/services/market.rb +51 -0
  62. data/lib/cryptoexchange/exchanges/lakebtc/services/pairs.rb +29 -0
  63. data/lib/cryptoexchange/exchanges/liqui/services/market.rb +6 -6
  64. data/lib/cryptoexchange/exchanges/livecoin/services/market.rb +12 -12
  65. data/lib/cryptoexchange/exchanges/novaexchange/services/market.rb +13 -13
  66. data/lib/cryptoexchange/exchanges/novaexchange/services/pairs.rb +6 -2
  67. data/lib/cryptoexchange/exchanges/okcoin/services/market.rb +12 -12
  68. data/lib/cryptoexchange/helpers/hash_helper.rb +20 -0
  69. data/lib/cryptoexchange/helpers/numeric_helper.rb +7 -0
  70. data/lib/cryptoexchange/version.rb +1 -1
  71. metadata +50 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1df6ea7c91d604d8106be0681b0ba54e90a6a95a
4
- data.tar.gz: a91d02633e2906ed8ac6d61c5e02720511abf698
3
+ metadata.gz: 05c26fb966defd809609e149871cccba4528c3ee
4
+ data.tar.gz: b14ce69ed0fd47f8134dcc092db30410f9e93291
5
5
  SHA512:
6
- metadata.gz: d816e318bfaad472126cd330757d78375289585b6476a948d3ae7f86b9939edb0a2de888ad43a49c420a7b0c7ae1f0319b8df96f0174be3d54cf6cf93b995f31
7
- data.tar.gz: 41cc533bbc4661992833b1fb9eeeb24d7c7bd8b7c91d4cab4bb704667d9942125f928b9d5dacbf9ca9a4b1e0ff784525adeda03cb777ab2b231d179c7e5a81d2
6
+ metadata.gz: 2d2c33ee222ef56cc2af238a3bb32edb35375b8d4457d40d605dece38d5ff858c256a275596d84fc6ec2e6e6a6b276ec21ea439e8d24c296b77c7d58f88d98c0
7
+ data.tar.gz: a088f917c5df27a2355881de81bebddd75f74d1f16787ecc648ec36b31fddf4bd1ac9318599460b25baa8a5cf389a2b454cbeaaa9f1d0af1e64f08d220b519bf
data/README.md CHANGED
@@ -28,13 +28,13 @@ Or install it yourself as:
28
28
  | Gatecoin | Y | | | | Y |
29
29
  | BTCC | Y | | | | User-Defined|
30
30
  | OKCoin | Y | | | | User-Defined|
31
- | LakeBTC | | | | | |
31
+ | LakeBTC | Y | | | | Y |
32
32
  | Huobi | | | | | |
33
33
  | Yunbi | | | | | |
34
34
  | BTC38 | | | | | |
35
35
  | CHBTC | | | | | |
36
36
  | Bitstamp | Y | | | | User-Defined|
37
- | Bittrex | | | | | |
37
+ | Bittrex | Y | | | | Y |
38
38
  | GDAX | | | | | |
39
39
  | Gemini | Y | | | | Y |
40
40
  | Kraken | | | | | |
@@ -46,18 +46,29 @@ Or install it yourself as:
46
46
  | Unocoin | | | | | |
47
47
  | Coinone | Y | | | | Y |
48
48
  | Korbit | Y | | | | User-Defined|
49
- | Bithumb | | | | | |
49
+ | Bithumb | Y | | | | Y |
50
50
  | Luno | | | | | |
51
51
  | BTC-e | | | | | |
52
- | Bleutrade | | | | | |
52
+ | Bleutrade | Y | | | | Y |
53
53
  | Yobit | | | | | |
54
54
  | Bitfinex | | | | | |
55
- | BTER | | | | | |
55
+ | BTER | Y | | | | Y |
56
56
  | Cryptopia | Y | | | | Y |
57
57
  | Livecoin | Y | | | | Y |
58
58
  | Nova Exchange | Y | | | | Y |
59
59
  | Bitcoin Indonesia | Y | | | | User-Defined|
60
60
  | Liqui | Y | | | | Y |
61
+ | HitBTC | Y | | | | Y |
62
+ | CCex | Y | | | | Y |
63
+ | CoinExchange | Y | | | | Y |
64
+ | EtherDelta | Y | | | | Y |
65
+ | Bitbay | | | | | |
66
+ | Bitso | | | | | |
67
+ | BTCChina | | | | | |
68
+ | Coinmate | | | | | |
69
+ | Itbit | | | | | |
70
+ | Jubi | | | | | |
71
+ | MercadoBitcoin | | | | | |
61
72
 
62
73
  ## Usage
63
74
 
@@ -2,12 +2,14 @@ require "cryptoexchange/version"
2
2
  require "cryptoexchange/client"
3
3
  require "cryptoexchange/lru_ttl_cache"
4
4
  require "cryptoexchange/helpers/string_helper"
5
+ require "cryptoexchange/helpers/numeric_helper"
6
+ require "cryptoexchange/helpers/hash_helper"
5
7
  require "cryptoexchange/models/ticker"
6
8
  require "cryptoexchange/models/market_pair"
7
9
  require "cryptoexchange/services/market"
8
10
  require "cryptoexchange/services/pairs"
9
11
 
10
- Cryptoexchange::Client::AVAILABLE_EXCHANGES.each do |market|
12
+ Cryptoexchange::Client.available_exchanges.each do |market|
11
13
  require "cryptoexchange/exchanges/#{market}/market"
12
14
  require "cryptoexchange/exchanges/#{market}/models/ticker"
13
15
  require "cryptoexchange/exchanges/#{market}/models/market_pair"
@@ -1,22 +1,10 @@
1
1
  module Cryptoexchange
2
2
  class Client
3
- AVAILABLE_EXCHANGES = %w(
4
- btcc
5
- anx
6
- bitcoin_indonesia
7
- bitflyer
8
- coincheck
9
- coinone
10
- korbit
11
- cryptopia
12
- gatecoin
13
- livecoin
14
- bitstamp
15
- okcoin
16
- novaexchange
17
- liqui
18
- gemini
19
- )
3
+ class << self
4
+ def available_exchanges
5
+ Dir.entries("./lib/cryptoexchange/exchanges")[2..-1]
6
+ end
7
+ end
20
8
 
21
9
  def initialize(ticker_ttl: 3)
22
10
  LruTtlCache.ticker_cache(ticker_ttl)
@@ -22,17 +22,17 @@ module Cryptoexchange::Exchanges
22
22
  base = output['data']['vol']['currency']
23
23
  target = output['data']['high']['currency']
24
24
 
25
- ticker.base = base
26
- ticker.target = target
27
- ticker.market = Anx::Market::NAME
28
- ticker.ask = output['data']['sell']['value']
29
- ticker.bid = output['data']['buy']['value']
30
- ticker.last = output['data']['last']['value']
31
- ticker.high = output['data']['high']['value']
32
- ticker.low = output['data']['low']['value']
33
- ticker.volume = output['data']['vol']['value']
34
- ticker.timestamp = output['data']['dataUpdateTime']
35
- ticker.payload = output
25
+ ticker.base = base
26
+ ticker.target = target
27
+ ticker.market = Anx::Market::NAME
28
+ ticker.ask = NumericHelper.to_d(output['data']['sell']['value'])
29
+ ticker.bid = NumericHelper.to_d(output['data']['buy']['value'])
30
+ ticker.last = NumericHelper.to_d(output['data']['last']['value'])
31
+ ticker.high = NumericHelper.to_d(output['data']['high']['value'])
32
+ ticker.low = NumericHelper.to_d(output['data']['low']['value'])
33
+ ticker.volume = NumericHelper.to_d(output['data']['vol']['value'])
34
+ ticker.timestamp = output['data']['dataUpdateTime'].to_i
35
+ ticker.payload = output
36
36
  ticker
37
37
  end
38
38
  end
@@ -20,19 +20,19 @@ module Cryptoexchange::Exchanges
20
20
  end
21
21
 
22
22
  def adapt(output, market_pair)
23
- output = output['ticker']
24
- ticker = BitcoinIndonesia::Models::Ticker.new
25
- ticker.base = market_pair.base
26
- ticker.target = market_pair.target
27
- ticker.market = BitcoinIndonesia::Market::NAME
28
- ticker.bid = output['buy']
29
- ticker.ask = output['sell']
30
- ticker.last = output['last']
31
- ticker.high = output['high']
32
- ticker.low = output['low']
33
- ticker.volume = output["vol_#{ticker.base.downcase}"].to_f
34
- ticker.timestamp = output['server_time']
35
- ticker.payload = output
23
+ output = output['ticker']
24
+ ticker = BitcoinIndonesia::Models::Ticker.new
25
+ ticker.base = market_pair.base
26
+ ticker.target = market_pair.target
27
+ ticker.market = BitcoinIndonesia::Market::NAME
28
+ ticker.bid = NumericHelper.to_d(output['buy'])
29
+ ticker.ask = NumericHelper.to_d(output['sell'])
30
+ ticker.last = NumericHelper.to_d(output['last'])
31
+ ticker.high = NumericHelper.to_d(output['high'])
32
+ ticker.low = NumericHelper.to_d(output['low'])
33
+ ticker.volume = NumericHelper.to_d(output["vol_#{ticker.base.downcase}"])
34
+ ticker.timestamp = output['server_time'].to_i
35
+ ticker.payload = output
36
36
  ticker
37
37
  end
38
38
  end
@@ -18,17 +18,17 @@ module Cryptoexchange::Exchanges
18
18
  end
19
19
 
20
20
  def adapt(output)
21
- ticker = Bitflyer::Models::Ticker.new
22
- base, target = output['product_code'].split('_')
23
- ticker.base = base
24
- ticker.target = target
25
- ticker.market = Bitflyer::Market::NAME
26
- ticker.ask = output['best_ask']
27
- ticker.bid = output['best_bid']
28
- ticker.last = output['ltp']
29
- ticker.volume = output['volume_by_product']
21
+ ticker = Bitflyer::Models::Ticker.new
22
+ base, target = output['product_code'].split('_')
23
+ ticker.base = base
24
+ ticker.target = target
25
+ ticker.market = Bitflyer::Market::NAME
26
+ ticker.ask = NumericHelper.to_d(output['best_ask'])
27
+ ticker.bid = NumericHelper.to_d(output['best_bid'])
28
+ ticker.last = NumericHelper.to_d(output['ltp'])
29
+ ticker.volume = NumericHelper.to_d(output['volume_by_product'])
30
30
  ticker.timestamp = Time.parse(output['timestamp']).to_i
31
- ticker.payload = output
31
+ ticker.payload = output
32
32
  ticker
33
33
  end
34
34
  end
@@ -0,0 +1,13 @@
1
+ :pairs:
2
+ - :base: BTC
3
+ :target: KRW
4
+ - :base: ETH
5
+ :target: KRW
6
+ - :base: DASH
7
+ :target: KRW
8
+ - :base: LTC
9
+ :target: KRW
10
+ - :base: ETC
11
+ :target: KRW
12
+ - :base: XRP
13
+ :target: KRW
@@ -0,0 +1,8 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bithumb
3
+ class Market
4
+ NAME = 'bithumb'
5
+ API_URL = 'https://api.bithumb.com'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bithumb
3
+ module Models
4
+ class MarketPair < Cryptoexchange::Models::MarketPair
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bithumb
3
+ module Models
4
+ class Ticker < Cryptoexchange::Models::Ticker
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,40 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bithumb
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
+ "#{Cryptoexchange::Exchanges::Bithumb::Market::API_URL}/public/ticker/#{market_pair.base}"
18
+ end
19
+
20
+ def adapt(output, market_pair)
21
+ market = output['data']
22
+ ticker = Bithumb::Models::Ticker.new
23
+ ticker.base = market_pair.base
24
+ ticker.target = market_pair.target
25
+ ticker.market = Bithumb::Market::NAME
26
+ ticker.ask = NumericHelper.to_d(market['sell_price'])
27
+ ticker.bid = NumericHelper.to_d(market['buy_price'])
28
+ ticker.last = NumericHelper.to_d(market['closing_price'])
29
+ ticker.high = NumericHelper.to_d(market['max_price'])
30
+ ticker.low = NumericHelper.to_d(market['min_price'])
31
+ #use 1day volume instead of 7days
32
+ ticker.volume = NumericHelper.to_d(market['volume_1day'])
33
+ ticker.timestamp = market['date'].to_i
34
+ ticker.payload = market
35
+ ticker
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,26 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bithumb
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 << Bithumb::Models::MarketPair.new(
15
+ base: pair[:base],
16
+ target: pair[:target],
17
+ market: Bithumb::Market::NAME
18
+ )
19
+ end
20
+
21
+ market_pairs
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -2,7 +2,7 @@ module Cryptoexchange::Exchanges
2
2
  module Bitstamp
3
3
  class Market
4
4
  NAME = 'bitstamp'
5
- API_URL = 'https://www.bitstamp.net/api/v2/ticker'
5
+ API_URL = 'https://www.bitstamp.net/api/v2'
6
6
  end
7
7
  end
8
8
  end
@@ -16,22 +16,22 @@ module Cryptoexchange::Exchanges
16
16
  def ticker_url(market_pair)
17
17
  base = market_pair.base.downcase
18
18
  target = market_pair.target.downcase
19
- "#{Cryptoexchange::Exchanges::Bitstamp::Market::API_URL}/#{base}#{target}"
19
+ "#{Cryptoexchange::Exchanges::Bitstamp::Market::API_URL}/ticker/#{base}#{target}"
20
20
  end
21
21
 
22
22
  def adapt(output, market_pair)
23
- ticker = Bitstamp::Models::Ticker.new
24
- ticker.base = market_pair.base
25
- ticker.target = market_pair.target
26
- ticker.market = Bitstamp::Market::NAME
27
- ticker.ask = output['ask']
28
- ticker.bid = output['bid']
29
- ticker.last = output['last']
30
- ticker.high = output['high']
31
- ticker.low = output['low']
32
- ticker.volume = output['volume'].to_f
33
- ticker.timestamp = output['timestamp']
34
- ticker.payload = output
23
+ ticker = Bitstamp::Models::Ticker.new
24
+ ticker.base = market_pair.base
25
+ ticker.target = market_pair.target
26
+ ticker.market = Bitstamp::Market::NAME
27
+ ticker.ask = NumericHelper.to_d(output['ask'])
28
+ ticker.bid = NumericHelper.to_d(output['bid'])
29
+ ticker.last = NumericHelper.to_d(output['last'])
30
+ ticker.high = NumericHelper.to_d(output['high'])
31
+ ticker.low = NumericHelper.to_d(output['low'])
32
+ ticker.volume = NumericHelper.to_d(output['volume'])
33
+ ticker.timestamp = output['timestamp'].to_i
34
+ ticker.payload = output
35
35
  ticker
36
36
  end
37
37
  end
@@ -0,0 +1,8 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bittrex
3
+ class Market
4
+ NAME = 'bittrex'
5
+ API_URL = 'https://bittrex.com/api/v1.1'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bittrex
3
+ module Models
4
+ class MarketPair < Cryptoexchange::Models::MarketPair
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bittrex
3
+ module Models
4
+ class Ticker < Cryptoexchange::Models::Ticker
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,42 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bittrex
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)
14
+ end
15
+
16
+ def ticker_url(market_pair)
17
+ base = market_pair.base
18
+ target = market_pair.target
19
+ "#{Cryptoexchange::Exchanges::Bittrex::Market::API_URL}/public/getmarketsummary?market=#{base}-#{target}"
20
+ end
21
+
22
+ def adapt(output)
23
+ ticker = Bittrex::Models::Ticker.new
24
+ market = output['result'][0]
25
+
26
+ ticker.base = market['MarketName'].split("-")[0]
27
+ ticker.target = market['MarketName'].split("-")[1]
28
+ ticker.market = Bittrex::Market::NAME
29
+ ticker.last = NumericHelper.to_d(market['Last'])
30
+ ticker.high = NumericHelper.to_d(market['High'])
31
+ ticker.low = NumericHelper.to_d(market['Low'])
32
+ ticker.ask = NumericHelper.to_d(market['Ask'])
33
+ ticker.bid = NumericHelper.to_d(market['Bid'])
34
+ ticker.volume = NumericHelper.to_d(market['BaseVolume'])
35
+ ticker.timestamp = DateTime.now.to_time.to_i
36
+ ticker.payload = market
37
+ ticker
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,28 @@
1
+ module Cryptoexchange::Exchanges
2
+ module Bittrex
3
+ module Services
4
+ class Pairs < Cryptoexchange::Services::Pairs
5
+ PAIRS_URL = "#{Cryptoexchange::Exchanges::Bittrex::Market::API_URL}/public/getmarkets"
6
+
7
+ def fetch
8
+ output = super
9
+ adapt(output)
10
+ end
11
+
12
+ def adapt(output)
13
+ pairs = output['result']
14
+ market_pairs = []
15
+ pairs.each do |pair|
16
+ market_pairs << Bittrex::Models::MarketPair.new(
17
+ base: pair['BaseCurrency'],
18
+ target: pair['MarketCurrency'],
19
+ market: Bittrex::Market::NAME
20
+ )
21
+ end
22
+
23
+ market_pairs
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end