fix: create sweepable coins list

This commit is contained in:
Sérgio Salgado 2022-07-29 19:17:19 +01:00
parent 10245bbb19
commit cd8f29cc64
3 changed files with 7 additions and 3 deletions

View file

@ -807,7 +807,7 @@ function plugins (settings, deviceId) {
function sweepHd () { function sweepHd () {
const sql = `SELECT id, crypto_code, hd_index FROM cash_out_txs const sql = `SELECT id, crypto_code, hd_index FROM cash_out_txs
WHERE hd_index IS NOT NULL AND NOT swept AND status IN ('confirmed', 'instant') AND created < now() - interval '1 week'` WHERE hd_index IS NOT NULL AND NOT swept AND status IN ('confirmed', 'instant') AND created > now() - interval '1 week'`
return db.any(sql) return db.any(sql)
.then(rows => Promise.all(rows.map(sweepHdRow))) .then(rows => Promise.all(rows.map(sweepHdRow)))

View file

@ -33,6 +33,7 @@ import {
offErrorColor offErrorColor
} from 'src/styling/variables' } from 'src/styling/variables'
import { URI } from 'src/utils/apollo' import { URI } from 'src/utils/apollo'
import { SWEEPABLE_CRYPTOS } from 'src/utils/constants'
import * as Customer from 'src/utils/customer' import * as Customer from 'src/utils/customer'
import CopyToClipboard from './CopyToClipboard' import CopyToClipboard from './CopyToClipboard'
@ -405,7 +406,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
</ActionButton> </ActionButton>
)} )}
</div> </div>
{!R.isNil(tx.swept) && ( {!R.isNil(tx.swept) && R.includes(tx.cryptoCode, SWEEPABLE_CRYPTOS) && (
<div className={classes.swept}> <div className={classes.swept}>
<Label>Sweep status</Label> <Label>Sweep status</Label>
<span className={classes.bold}> <span className={classes.bold}>

View file

@ -8,6 +8,8 @@ const MANUAL = 'manual'
const IP_CHECK_REGEX = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ const IP_CHECK_REGEX = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
const SWEEPABLE_CRYPTOS = ['ETH']
export { export {
CURRENCY_MAX, CURRENCY_MAX,
MIN_NUMBER_OF_CASSETTES, MIN_NUMBER_OF_CASSETTES,
@ -15,5 +17,6 @@ export {
AUTOMATIC, AUTOMATIC,
MANUAL, MANUAL,
WALLET_SCORING_DEFAULT_THRESHOLD, WALLET_SCORING_DEFAULT_THRESHOLD,
IP_CHECK_REGEX IP_CHECK_REGEX,
SWEEPABLE_CRYPTOS
} }