✍️ Improve output

This commit is contained in:
Dennis Reimann
2020-07-01 12:49:13 +02:00
parent 9da6eeb831
commit 04e0ed39ba
2 changed files with 6 additions and 9 deletions

View File

@@ -29,11 +29,9 @@ const validate = process.argv[2] === '--validate'
// Calculate volume and adjust precision
const volume = (amount / price).toFixed(8)
console.log('\n')
console.log('💰 Balance:', fiatBalance, fiat, '/', cryptoBalance, crypto, '\n')
console.log('📈 Ask:', ask, fiat)
console.log('📉 Bid:', bid, fiat, '\n')
console.log('🧾 Order:', volume, crypto, 'at', price, fiat, '\n')
// Place order
try {
@@ -42,10 +40,10 @@ const validate = process.argv[2] === '--validate'
const { result: { descr: { order }, txid } } = await kraken.api('AddOrder', details)
console.log('💸 Placed order:', order, '/ TXID:', txid, '\n')
console.log('💸 Order:', order)
if (txid) console.log('📎 Transaction ID:', txid.join(', '))
if (validate) console.log('\n🚨 THIS WAS JUST A VALIDATION RUN, NO ORDER HAS BEEN PLACED!')
} catch (err) {
console.log(`🚨 Failure:`, err.message, '\n')
} finally {
if (validate) console.warn('🚨 THIS WAS JUST A VALIDATION RUN, NO ORDER HAS BEEN PLACED!', '\n')
console.log(`\n🚨 Failure:`, err.message)
}
})()