Skip to content

Commit

Permalink
adds coinasset trade_page_url
Browse files Browse the repository at this point in the history
  • Loading branch information
wongy91 committed Oct 31, 2018
1 parent 1e3cb6b commit 26e7433
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cryptoexchange/exchanges/coinasset/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ module Coinasset
class Market < Cryptoexchange::Models::Market
NAME = 'coinasset'
API_URL = 'https://api.coinasset.co.th/api/v1'

def self.trade_page_url(args={})
"https://coinasset.co.th/exchange/#{args[:target]}-#{args[:base]}"
end
end
end
end
5 changes: 5 additions & 0 deletions spec/exchanges/coinasset/integration/market_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
let(:client) { Cryptoexchange::Client.new }
let(:btc_thb_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'THB', market: 'coinasset', inst_id: 49) }

it 'has trade_page_url' do
trade_page_url = client.trade_page_url btc_thb_pair.market, base: btc_thb_pair.base, target: btc_thb_pair.target
expect(trade_page_url).to eq "https://coinasset.co.th/exchange/THB-BTC"
end

it 'fetch pairs' do
pairs = client.pairs('coinasset')
expect(pairs).not_to be_empty
Expand Down

0 comments on commit 26e7433

Please sign in to comment.