diff --git a/README.md b/README.md index c8ec4db..94eab1a 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,8 @@ You should see something like this sample output: ๐Ÿ“ˆ Ask: 21000.2 USD ๐Ÿ“‰ Bid: 21000.1 USD -๐Ÿงพ Order: 0.21212121 XBT at 21000.1 USD - -๐Ÿ’ธ Placed order: buy 0.21212121 XBTUSD @ limit 21000.1 / TXID: 2121212121 +๐Ÿ’ธ Order: buy 0.21212121 XBTUSD @ limit 21000.1 +๐Ÿ“Ž Transaction ID: 2121212121 ``` ## ๐Ÿค‘ Stack sats diff --git a/index.js b/index.js index 37cda43..73c2b92 100644 --- a/index.js +++ b/index.js @@ -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) } })()