✍️ Improve output
This commit is contained in:
@@ -46,9 +46,8 @@ You should see something like this sample output:
|
|||||||
📈 Ask: 21000.2 USD
|
📈 Ask: 21000.2 USD
|
||||||
📉 Bid: 21000.1 USD
|
📉 Bid: 21000.1 USD
|
||||||
|
|
||||||
🧾 Order: 0.21212121 XBT at 21000.1 USD
|
💸 Order: buy 0.21212121 XBTUSD @ limit 21000.1
|
||||||
|
📎 Transaction ID: 2121212121
|
||||||
💸 Placed order: buy 0.21212121 XBTUSD @ limit 21000.1 / TXID: 2121212121
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🤑 Stack sats
|
## 🤑 Stack sats
|
||||||
|
|||||||
10
index.js
10
index.js
@@ -29,11 +29,9 @@ const validate = process.argv[2] === '--validate'
|
|||||||
// Calculate volume and adjust precision
|
// Calculate volume and adjust precision
|
||||||
const volume = (amount / price).toFixed(8)
|
const volume = (amount / price).toFixed(8)
|
||||||
|
|
||||||
console.log('\n')
|
|
||||||
console.log('💰 Balance:', fiatBalance, fiat, '/', cryptoBalance, crypto, '\n')
|
console.log('💰 Balance:', fiatBalance, fiat, '/', cryptoBalance, crypto, '\n')
|
||||||
console.log('📈 Ask:', ask, fiat)
|
console.log('📈 Ask:', ask, fiat)
|
||||||
console.log('📉 Bid:', bid, fiat, '\n')
|
console.log('📉 Bid:', bid, fiat, '\n')
|
||||||
console.log('🧾 Order:', volume, crypto, 'at', price, fiat, '\n')
|
|
||||||
|
|
||||||
// Place order
|
// Place order
|
||||||
try {
|
try {
|
||||||
@@ -42,10 +40,10 @@ const validate = process.argv[2] === '--validate'
|
|||||||
|
|
||||||
const { result: { descr: { order }, txid } } = await kraken.api('AddOrder', details)
|
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) {
|
} catch (err) {
|
||||||
console.log(`🚨 Failure:`, err.message, '\n')
|
console.log(`\n🚨 Failure:`, err.message)
|
||||||
} finally {
|
|
||||||
if (validate) console.warn('🚨 THIS WAS JUST A VALIDATION RUN, NO ORDER HAS BEEN PLACED!', '\n')
|
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|||||||
Reference in New Issue
Block a user