refactor: add trade id to trade entry object

This commit is contained in:
José Oliveira 2021-06-29 13:59:37 +01:00 committed by Josh Harvey
parent 700244e45b
commit 9b4bae4097
3 changed files with 10 additions and 8 deletions

View file

@ -8,7 +8,8 @@ const { ORDER_TYPES } = require('./consts')
const DEFAULT_PRICE_PRECISION = 2
const DEFAULT_AMOUNT_PRECISION = 8
function trade (side, account, cryptoAtoms, fiatCode, cryptoCode, exchangeName, tradeId) {
function trade (side, account, tradeEntry, exchangeName) {
const { cryptoAtoms, fiatCode, cryptoCode, tradeId } = tradeEntry
try {
const exchangeConfig = ALL[exchangeName]
if (!exchangeConfig) throw Error('Exchange configuration not found')