🐛 Fix validate param and txid
This commit is contained in:
8
index.js
8
index.js
@@ -37,12 +37,14 @@ const validate = process.argv[2] === '--validate'
|
|||||||
|
|
||||||
// Place order
|
// Place order
|
||||||
try {
|
try {
|
||||||
const details = { pair, type: 'buy', ordertype: 'limit', price, volume, validate }
|
const details = { pair, type: 'buy', ordertype: 'limit', price, volume }
|
||||||
const { result: { descr: { order } }, txid } = await kraken.api('AddOrder', details)
|
if (validate) details.validate = true
|
||||||
|
|
||||||
|
const { result: { descr: { order }, txid } } = await kraken.api('AddOrder', details)
|
||||||
|
|
||||||
console.log('💸 Placed order:', order, '/ TXID:', txid, '\n')
|
console.log('💸 Placed order:', order, '/ TXID:', txid, '\n')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`🚨 Failure:`, err.message, '\n')
|
console.log(`🚨 Failure:`, err.message, '\n')
|
||||||
} finally {
|
} finally {
|
||||||
if (validate) console.warn('🚨 THIS WAS JUST A VALIDATION RUN, NO ORDER HAS BEEN PLACED!', '\n')
|
if (validate) console.warn('🚨 THIS WAS JUST A VALIDATION RUN, NO ORDER HAS BEEN PLACED!', '\n')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user