-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Markets configuration is now automatic
it fetches it through the API of every exchange
- Loading branch information
Camille
committed
Dec 14, 2019
1 parent
840906b
commit ed559fd
Showing
42 changed files
with
12,606 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/ruby | ||
# frozen_string_literal: true | ||
|
||
require "pp" | ||
require "json" | ||
require "faraday" | ||
|
||
pairs = %w[XBTEUR XBTIDR ETHNGN ETHZAR XBTMYR XBTNGN ETHXBT XBTZAR XBTZMW XBTSGD XBTUGX BCHXBT] | ||
config = {} | ||
|
||
pairs.each do |pair| | ||
raise "Can't deduce base/quote from #{pair}" if pair.size != 6 | ||
|
||
warn "fetching #{pair}" | ||
response = Faraday.get "https://www.luno.com/ajax/1/market_params?pair=#{pair}" | ||
config[pair] = JSON.parse(response.body) | ||
config[pair]["base_unit"] = pair[0..2] | ||
config[pair]["quote_unit"] = pair[3..5] | ||
end | ||
|
||
pp config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.