Add timestamp to TickerPrice

It's almost always 0, it's only filled when bitcoinity
replies with a "trade" data, other jsons don't give any
time stamps
This commit is contained in:
King_DuckZ 2022-05-14 22:49:01 +02:00
commit b3b77d5cad
5 changed files with 43 additions and 8 deletions

View file

@ -8,13 +8,13 @@ class App {
start() {
var price_quick = Bitcoinity.ticker_quick()
System.print("Ticker (quick): %(price_quick.price) %(price_quick.currency) on %(price_quick.exchange)")
System.print("Ticker (quick): %(price_quick.price) %(price_quick.currency) on %(price_quick.exchange) timestamp %(price_quick.timestamp)")
var price_currency = Bitcoinity.ticker_currency(_currency)
System.print("Ticker (%(_currency)): %(price_currency.price) %(price_currency.currency) on %(price_currency.exchange)")
System.print("Ticker (%(_currency)): %(price_currency.price) %(price_currency.currency) on %(price_currency.exchange) timestamp %(price_currency.timestamp)")
var price = Bitcoinity.ticker(_exchange, _currency)
System.print("Ticker (%(_exchange), %(_currency)): %(price.price) %(price.currency) on %(price.exchange)")
System.print("Ticker (%(_exchange), %(_currency)): %(price.price) %(price.currency) on %(price.exchange) timestamp %(price.timestamp)")
}
}