renamed cryptoUnits to cryptoAtoms for clarity
This commit is contained in:
parent
e462359299
commit
8d44c1d383
2 changed files with 9 additions and 9 deletions
|
|
@ -248,28 +248,28 @@ exports.pollQueries = function pollQueries (session, cb) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function _sendCoins (toAddress, cryptoUnits, cryptoCoin, cb) {
|
function _sendCoins (toAddress, cryptoAtoms, cryptoCoin, cb) {
|
||||||
var cryptoCode = cryptoCoin.unitCode
|
var cryptoCode = cryptoCoin.unitCode
|
||||||
var walletPlugin = walletPlugins[cryptoCode]
|
var walletPlugin = walletPlugins[cryptoCode]
|
||||||
var transactionFee = cachedConfig.exchanges.settings.transactionFee
|
var transactionFee = cachedConfig.exchanges.settings.transactionFee
|
||||||
if (cryptoCode === 'BTC') {
|
if (cryptoCode === 'BTC') {
|
||||||
walletPlugin.sendBitcoins(toAddress, cryptoUnits, transactionFee, cb)
|
walletPlugin.sendBitcoins(toAddress, cryptoAtoms, transactionFee, cb)
|
||||||
} else {
|
} else {
|
||||||
walletPlugin.sendCoins(toAddress, cryptoUnits, cryptoCoin, transactionFee, cb)
|
walletPlugin.sendCoins(toAddress, cryptoAtoms, cryptoCoin, transactionFee, cb)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeTx (session, tx, authority, cb) {
|
function executeTx (session, tx, authority, cb) {
|
||||||
db.addOutgoingTx(session, tx, function (err, toSend) {
|
db.addOutgoingTx(session, tx, function (err, toSend) {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
var cryptoUnitsToSend = toSend.cryptoUnits
|
var cryptoAtomsToSend = toSend.cryptoAtoms
|
||||||
if (cryptoUnitsToSend === 0) {
|
if (cryptoAtomsToSend === 0) {
|
||||||
return cb(null, {statusCode: 204, txId: tx.txId, txHash: null})
|
return cb(null, {statusCode: 204, txId: tx.txId, txHash: null})
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendCoins(tx.toAddress, cryptoUnitsToSend, function (_err, txHash) {
|
_sendCoins(tx.toAddress, cryptoAtomsToSend, function (_err, txHash) {
|
||||||
var fee = null // Need to fill this out in plugins
|
var fee = null // Need to fill this out in plugins
|
||||||
if (_err) toSend = {cryptoUnits: new BigNumber(0), fiat: 0}
|
if (_err) toSend = {cryptoAtoms: new BigNumber(0), fiat: 0}
|
||||||
db.sentCoins(session, tx, authority, toSend, fee, _err, txHash)
|
db.sentCoins(session, tx, authority, toSend, fee, _err, txHash)
|
||||||
|
|
||||||
if (_err) return cb(_err)
|
if (_err) return cb(_err)
|
||||||
|
|
|
||||||
4
todo.txt
4
todo.txt
|
|
@ -1,5 +1,5 @@
|
||||||
|
- rethink scale names: is unit satoshi or btc? cryptoAtom, cryptoAtom
|
||||||
|
- cryptoCoin is record, not code
|
||||||
- specify crypto and fiat for trades
|
- specify crypto and fiat for trades
|
||||||
- make sure ticker is in full coins
|
- make sure ticker is in full coins
|
||||||
- rethink scale names: is unit satoshi or btc?
|
|
||||||
- cryptoCoin is record, not code
|
|
||||||
- getDeviceRate should return bignumber
|
- getDeviceRate should return bignumber
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue