diff options
| author | Adam Soltys <[email protected]> | 2020-08-05 13:38:16 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-08-05 13:38:16 -0700 |
| commit | 14f944f953dd59106821c9244a89c4eb4a956758 (patch) | |
| tree | 0e824a9d93ea9fb957bab49f3724f6a52ac7102d /lib/rates.js | |
| parent | fa3c3306ea8c9f1faf0f0c1f7428bd47a48b41d4 (diff) | |
| download | coinos-server-14f944f953dd59106821c9244a89c4eb4a956758.tar.gz coinos-server-14f944f953dd59106821c9244a89c4eb4a956758.zip | |
send single usd rate
Diffstat (limited to 'lib/rates.js')
| -rw-r--r-- | lib/rates.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rates.js b/lib/rates.js index a8818375..33982ba3 100644 --- a/lib/rates.js +++ b/lib/rates.js @@ -4,7 +4,7 @@ let binance = require("./binance")(); let fetchRates; (fetchRates = async () => { - let rates = require("./devrates"); + let fx = require("./devrates"); if (prod) { try { @@ -12,7 +12,7 @@ let fetchRates; `http://data.fixer.io/api/latest?access_key=${config.fixer}` ); - let fx = res.data.rates; + fx = res.data.rates; fx && Object.keys(fx).map(symbol => { @@ -23,13 +23,13 @@ let fetchRates; } } - app.set("fxrates", rates); + app.set("fx", fx); setTimeout(fetchRates, 7200000); })(); setInterval(() => { - broadcast("rates", app.get("rates")); + broadcast("rate", app.get("last")); }, 1000); setInterval(() => { |
