Move code out of main.cpp
This commit is contained in:
parent
418d0af70f
commit
18e5317baf
7 changed files with 117 additions and 82 deletions
21
script/main.wren
Normal file
21
script/main.wren
Normal file
|
@ -0,0 +1,21 @@
|
|||
import "bitcoinity" for Bitcoinity
|
||||
|
||||
class App {
|
||||
construct new(exchange, currency) {
|
||||
_currency = currency
|
||||
_exchange = exchange
|
||||
}
|
||||
|
||||
start() {
|
||||
var price_quick = Bitcoinity.ticker_quick()
|
||||
System.print("Ticker (quick): %(price_quick.price) %(price_quick.currency) on %(price_quick.exchange)")
|
||||
|
||||
var price_currency = Bitcoinity.ticker_currency(_currency)
|
||||
System.print("Ticker (%(_currency)): %(price_currency.price) %(price_currency.currency) on %(price_currency.exchange)")
|
||||
|
||||
var price = Bitcoinity.ticker(_exchange, _currency)
|
||||
System.print("Ticker (%(_exchange), %(_currency)): %(price.price) %(price.currency) on %(price.exchange)")
|
||||
}
|
||||
}
|
||||
|
||||
var the_app = App.new("kraken", "USD")
|
Loading…
Add table
Add a link
Reference in a new issue