Skip to content

Commit

Permalink
Added Binance.US
Browse files Browse the repository at this point in the history
  • Loading branch information
aneonex committed Nov 20, 2021
1 parent 065aa76 commit 53b6c52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ object MarketsConfig {
Latoken(),
Bitrue(),
FtxUs(),
BinanceUs(),
)

val MARKETS: Map<String, Market> = registeredMarkets.map{it.key to it}.toMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import com.aneonex.bitcoinchecker.datamodule.model.market.generic.SimpleMarket
import com.aneonex.bitcoinchecker.datamodule.util.forEachJSONObject
import org.json.JSONObject

class Binance : SimpleMarket(
"Binance",
"https://api.binance.com/api/v3/exchangeInfo",
"https://api.binance.com/api/v3/ticker/24hr?symbol=%1\$s"
class Binance: BinanceBase("Binance", "com")
class BinanceUs: BinanceBase("Binance.US", "us")

open class BinanceBase(name: String, domain: String) : SimpleMarket(
name,
"https://api.binance.$domain/api/v3/exchangeInfo",
"https://api.binance.$domain/api/v3/ticker/24hr?symbol=%1\$s"
) {
@Throws(Exception::class)
override fun parseTickerFromJsonObject(requestId: Int, jsonObject: JSONObject, ticker: Ticker, checkerInfo: CheckerInfo) {
Expand Down

0 comments on commit 53b6c52

Please sign in to comment.