duckticker/script/main.wren

22 lines
793 B
Text
Raw Permalink Normal View History

2022-05-14 16:23:58 +00:00
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) timestamp %(price_quick.timestamp)")
2022-05-14 16:23:58 +00:00
var price_currency = Bitcoinity.ticker_currency(_currency)
System.print("Ticker (%(_currency)): %(price_currency.price) %(price_currency.currency) on %(price_currency.exchange) timestamp %(price_currency.timestamp)")
2022-05-14 16:23:58 +00:00
var price = Bitcoinity.ticker(_exchange, _currency)
System.print("Ticker (%(_exchange), %(_currency)): %(price.price) %(price.currency) on %(price.exchange) timestamp %(price.timestamp)")
2022-05-14 16:23:58 +00:00
}
}
var the_app = App.new("kraken", "USD")