Skip to content

Commit

Permalink
added examples/js/market-status-and-currency-status.js fix #3036
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 5, 2018
1 parent f1b1d17 commit 09d66b9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/js/market-status-and-currency-status.js
@@ -0,0 +1,29 @@
'use const'

const ccxt = require ('../../ccxt')
, log = require ('ololog')
, asTable = require ('as-table')

;(async function main () {

let kraken = new ccxt.kraken ({ enableRateLimit: true })
await kraken.loadMarkets ()

const markets = Object.values (kraken.markets).map (market => ({
symbol: market.symbol,
active: market.active,
}))

log.bright.green.noLocate ('Markets:')
log.green.noLocate (asTable (markets), '\n')

const currencies = Object.values (kraken.currencies).map (currency => ({
code: currency.code,
active: currency.active,
status: currency.status,
}))

log.bright.yellow.noLocate ('Currencies:')
log.yellow.noLocate (asTable (currencies))

}) ()

0 comments on commit 09d66b9

Please sign in to comment.