Merge pull request #1130 from josepfo/fix/tx-direction-on-sms-receipt
fix: sms receipt tx direction
This commit is contained in:
commit
b7e6dc2f02
4 changed files with 4 additions and 11 deletions
|
|
@ -65,10 +65,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
|
|||
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => calculateFeeDiscount(feeMultiplier))
|
||||
.then(newFee => {
|
||||
logger.info('** DEBUG MINERS FEE ** - Calculated fee discount: ', newFee)
|
||||
return fetch('settxfee', [newFee])
|
||||
})
|
||||
.then(newFee => fetch('settxfee', [newFee]))
|
||||
.then(() => fetch('sendtoaddress', [toAddress, coins]))
|
||||
.then((txId) => fetch('gettransaction', [txId]))
|
||||
.then((res) => _.pick(['fee', 'txid'], res))
|
||||
|
|
@ -87,10 +84,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
|
|||
function sendCoinsBatch (account, txs, cryptoCode, feeMultiplier) {
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => calculateFeeDiscount(feeMultiplier))
|
||||
.then(newFee => {
|
||||
logger.info('** DEBUG MINERS FEE ** - Calculated fee discount: ', newFee)
|
||||
return fetch('settxfee', [newFee])
|
||||
})
|
||||
.then(newFee => fetch('settxfee', [newFee]))
|
||||
.then(() => _.reduce((acc, value) => ({
|
||||
...acc,
|
||||
[value.toAddress]: _.isNil(acc[value.toAddress])
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ function buildSms (data, receiptOptions) {
|
|||
customerPhone: customer.phone,
|
||||
session: formattedTx.id,
|
||||
time: dateString,
|
||||
direction: formattedTx.direction === 'cashIn' ? 'Cash-in' : 'Cash-out',
|
||||
direction: formattedTx.txClass === 'cashIn' ? 'Cash-in' : 'Cash-out',
|
||||
fiat: `${formattedTx.fiat.toString()} ${formattedTx.fiatCode}`,
|
||||
crypto: `${sms.toCryptoUnits(BN(formattedTx.cryptoAtoms), formattedTx.cryptoCode)} ${formattedTx.cryptoCode}`,
|
||||
rate: `1 ${formattedTx.cryptoCode} = ${rate} ${formattedTx.fiatCode}`,
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ function sendCoins (settings, tx) {
|
|||
return fetchWallet(settings, tx.cryptoCode)
|
||||
.then(r => {
|
||||
const feeMultiplier = new BN(configManager.getWalletSettings(tx.cryptoCode, settings.config).feeMultiplier)
|
||||
console.log('** DEBUG MINERS FEE ** - Fee multiplier: ', feeMultiplier)
|
||||
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeMultiplier)
|
||||
.then(res => {
|
||||
mem.clear(module.exports.balance)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const BooleanCell = ({ name }) => {
|
|||
const BooleanPropertiesTable = memo(
|
||||
({ title, disabled, data, elements, save, forcedEditing = false }) => {
|
||||
const initialValues = R.fromPairs(
|
||||
elements.map(it => [it.name, data[it.name].toString() ?? null])
|
||||
elements.map(it => [it.name, data[it.name]?.toString() ?? null])
|
||||
)
|
||||
|
||||
const schemaValidation = R.fromPairs(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue