feat: relay trade uuid to krakens api
This commit is contained in:
parent
bec80ec498
commit
8606d0cc94
6 changed files with 25 additions and 17 deletions
|
|
@ -19,23 +19,23 @@ function fetchExchange (settings, cryptoCode) {
|
|||
})
|
||||
}
|
||||
|
||||
function buy (settings, cryptoAtoms, fiatCode, cryptoCode) {
|
||||
function buy (settings, cryptoAtoms, fiatCode, cryptoCode, tradeId) {
|
||||
return fetchExchange(settings, cryptoCode)
|
||||
.then(r => {
|
||||
if (r.exchangeName === 'mock-exchange') {
|
||||
return mockExchange.buy(cryptoAtoms, fiatCode, cryptoCode)
|
||||
}
|
||||
return ccxt.trade('buy', r.account, cryptoAtoms, fiatCode, cryptoCode, r.exchangeName)
|
||||
return ccxt.trade('buy', r.account, cryptoAtoms, fiatCode, cryptoCode, r.exchangeName, tradeId)
|
||||
})
|
||||
}
|
||||
|
||||
function sell (settings, cryptoAtoms, fiatCode, cryptoCode) {
|
||||
function sell (settings, cryptoAtoms, fiatCode, cryptoCode, tradeId) {
|
||||
return fetchExchange(settings, cryptoCode)
|
||||
.then(r => {
|
||||
if (r.exchangeName === 'mock-exchange') {
|
||||
return mockExchange.sell(cryptoAtoms, fiatCode, cryptoCode)
|
||||
}
|
||||
return ccxt.trade('sell', r.account, cryptoAtoms, fiatCode, cryptoCode, r.exchangeName)
|
||||
return ccxt.trade('sell', r.account, cryptoAtoms, fiatCode, cryptoCode, r.exchangeName, tradeId)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue