Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

👽 update FEX api #1270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cryptoexchange/exchanges/fex/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Cryptoexchange::Exchanges
module Fex
class Market < Cryptoexchange::Models::Market
NAME = 'fex'
API_URL = 'http://api.fexpro.io/api'
API_URL = 'http://api.fexhk.com/api'
end
end
end
23 changes: 9 additions & 14 deletions lib/cryptoexchange/exchanges/fex/services/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,18 @@ def ticker_url

def adapt_all(output)
output.map do |ticker|
base, target = ticker['symbol'].split("/")
market_pair = Cryptoexchange::Models::MarketPair.new(
base: base,
target: target,
market: Fex::Market::NAME
)
adapt(ticker, market_pair)
adapt(ticker)
end
end

def adapt(output, market_pair)
ticker = Cryptoexchange::Models::Ticker.new
ticker.base = market_pair.base
ticker.target = market_pair.target
ticker.market = Fex::Market::NAME
ticker.ask = NumericHelper.to_d(output['sell'])
ticker.bid = NumericHelper.to_d(output['buy'])
def adapt(output)
base, target = output['symbol'].split('/')
ticker = Cryptoexchange::Models::Ticker.new
ticker.base = base
ticker.target = target
ticker.market = Fex::Market::NAME
ticker.ask = NumericHelper.to_d(output['sell'])
ticker.bid = NumericHelper.to_d(output['buy'])
# this is their typo
ticker.last = NumericHelper.to_d(output['colse'])
ticker.volume = NumericHelper.to_d(output['volume'])
Expand Down
28 changes: 14 additions & 14 deletions spec/cassettes/vcr_cassettes/Fex/integration_specs_fetch_pairs.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading