Browse Source

Handle recent types & settings changes on Operation and Account

- make sure no extra field is used in the app
- use currency settings to display confirmed/not-confirmed operation
- add blockHeight fetch when syncing account
master
meriadec 7 years ago
parent
commit
b6c77a88ae
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 209
      src/components/OperationsList/Operation.js
  2. 199
      src/components/OperationsList/index.js
  3. 29
      src/components/SettingsPage/sections/Currencies.js
  4. 249
      src/components/modals/OperationDetails.js
  5. 10
      src/helpers/btc.js
  6. 11
      src/reducers/accounts.js
  7. 25
      src/reducers/settings.js
  8. 9
      src/types/common.js
  9. 3
      yarn.lock

209
src/components/OperationsList/Operation.js

@ -0,0 +1,209 @@
// @flow
import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import styled from 'styled-components'
import moment from 'moment'
import noop from 'lodash/noop'
import { getIconByCoinType } from '@ledgerhq/currencies/react'
import type { Account, Operation as OperationType } from '@ledgerhq/wallet-common/lib/types'
import type { T } from 'types/common'
import { currencySettingsSelector, marketIndicatorSelector } from 'reducers/settings'
import { rgba, getMarketColor } from 'styles/helpers'
import Box from 'components/base/Box'
import Text from 'components/base/Text'
import CounterValue from 'components/CounterValue'
import FormattedVal from 'components/base/FormattedVal'
import ConfirmationCheck from './ConfirmationCheck'
const mapStateToProps = (state, props) => ({
minConfirmations: currencySettingsSelector(state, props.account.currency).confirmationsNb,
marketIndicator: marketIndicatorSelector(state),
})
const DATE_COL_SIZE = 100
const ACCOUNT_COL_SIZE = 150
const AMOUNT_COL_SIZE = 150
const CONFIRMATION_COL_SIZE = 44
const OperationRaw = styled(Box).attrs({
horizontal: true,
alignItems: 'center',
})`
cursor: pointer;
border-bottom: 1px solid ${p => p.theme.colors.lightGrey};
height: 68px;
&:last-child {
border-bottom: 0;
}
&:hover {
background: ${p => rgba(p.theme.colors.wallet, 0.04)};
}
`
const Address = ({ value }: { value: string }) => {
const addrSize = value.length / 2
const left = value.slice(0, 10)
const right = value.slice(-addrSize)
const middle = value.slice(10, -addrSize)
return (
<Box horizontal color="smoke" ff="Open Sans" fontSize={3}>
<div>{left}</div>
<AddressEllipsis>{middle}</AddressEllipsis>
<div>{right}</div>
</Box>
)
}
const AddressEllipsis = styled.div`
display: block;
flex-shrink: 1;
min-width: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`
const Day = styled(Text).attrs({
color: 'dark',
fontSize: 3,
ff: 'Open Sans',
})`
letter-spacing: 0.3px;
text-transform: uppercase;
`
const Hour = styled(Day).attrs({
color: 'grey',
})``
const Cell = styled(Box).attrs({
px: 4,
horizontal: true,
alignItems: 'center',
})`
width: ${p => (p.size ? `${p.size}px` : '')};
overflow: ${p => (p.noOverflow ? 'hidden' : '')};
`
type Props = {
account: Account,
minConfirmations: number,
onAccountClick: Function,
onOperationClick: Function,
marketIndicator: string,
t: T,
op: OperationType,
withAccount?: boolean,
}
class Operation extends PureComponent<Props> {
static defaultProps = {
onAccountClick: noop,
onOperationClick: noop,
withAccount: false,
}
render() {
const {
account,
minConfirmations,
onAccountClick,
onOperationClick,
t,
op,
withAccount,
marketIndicator,
} = this.props
const { unit, currency } = account
const time = moment(op.date)
const Icon = getIconByCoinType(account.currency.coinType)
const isNegative = op.amount < 0
const type = !isNegative ? 'from' : 'to'
const marketColor = getMarketColor({
marketIndicator,
isNegative,
})
return (
<OperationRaw onClick={() => onOperationClick({ operation: op, account, type, marketColor })}>
<Cell size={CONFIRMATION_COL_SIZE} align="center" justify="flex-start">
<ConfirmationCheck
type={type}
minConfirmations={minConfirmations}
confirmations={account.blockHeight - op.blockHeight}
marketColor={marketColor}
t={t}
/>
</Cell>
<Cell size={DATE_COL_SIZE} justifyContent="space-between" px={3}>
<Box>
<Box ff="Open Sans|SemiBold" fontSize={3} color="smoke">
{t(`operationsList:${type}`)}
</Box>
<Hour>{time.format('HH:mm')}</Hour>
</Box>
</Cell>
{withAccount &&
account && (
<Cell
noOverflow
size={ACCOUNT_COL_SIZE}
horizontal
flow={2}
style={{ cursor: 'pointer' }}
onClick={e => {
e.stopPropagation()
onAccountClick(account)
}}
>
<Box
alignItems="center"
justifyContent="center"
style={{ color: account.currency.color }}
>
{Icon && <Icon size={16} />}
</Box>
<Box ff="Open Sans|SemiBold" fontSize={3} color="dark">
{account.name}
</Box>
</Cell>
)}
<Cell grow shrink style={{ display: 'block' }}>
<Address value={op.address} />
</Cell>
<Cell size={AMOUNT_COL_SIZE} justify="flex-end">
<Box alignItems="flex-end">
<FormattedVal
val={op.amount}
unit={unit}
showCode
fontSize={4}
alwaysShowSign
color={op.amount < 0 ? 'smoke' : undefined}
/>
<CounterValue
color="grey"
fontSize={3}
date={time.toDate()}
ticker={currency.units[0].code}
value={op.amount}
/>
</Box>
</Cell>
</OperationRaw>
)
}
}
export default connect(mapStateToProps)(Operation)

199
src/components/OperationsList/index.js

@ -6,19 +6,17 @@ import moment from 'moment'
import { connect } from 'react-redux'
import { compose } from 'redux'
import { translate } from 'react-i18next'
import { getIconByCoinType } from '@ledgerhq/currencies/react'
import {
groupAccountOperationsByDay,
groupAccountsOperationsByDay,
} from '@ledgerhq/wallet-common/lib/helpers/account'
import type { Account, Operation as OperationType } from '@ledgerhq/wallet-common/lib/types'
import type { Account } from '@ledgerhq/wallet-common/lib/types'
import noop from 'lodash/noop'
import keyBy from 'lodash/keyBy'
import { getMarketColor, rgba } from 'styles/helpers'
import type { Settings, T } from 'types/common'
import type { T } from 'types/common'
import { MODAL_OPERATION_DETAILS } from 'config/constants'
@ -27,17 +25,10 @@ import { openModal } from 'reducers/modals'
import IconAngleDown from 'icons/AngleDown'
import Box, { Card } from 'components/base/Box'
import CounterValue from 'components/CounterValue'
import FormattedVal from 'components/base/FormattedVal'
import Text from 'components/base/Text'
import Defer from 'components/base/Defer'
import ConfirmationCheck from './ConfirmationCheck'
const DATE_COL_SIZE = 100
const ACCOUNT_COL_SIZE = 150
const AMOUNT_COL_SIZE = 150
const CONFIRMATION_COL_SIZE = 44
import Operation from './Operation'
const calendarOpts = {
sameDay: 'LL – [Today]',
@ -47,45 +38,6 @@ const calendarOpts = {
sameElse: 'LL',
}
const Day = styled(Text).attrs({
color: 'dark',
fontSize: 3,
ff: 'Open Sans',
})`
letter-spacing: 0.3px;
text-transform: uppercase;
`
const Hour = styled(Day).attrs({
color: 'grey',
})``
const OperationRaw = styled(Box).attrs({
horizontal: true,
alignItems: 'center',
})`
cursor: pointer;
border-bottom: 1px solid ${p => p.theme.colors.lightGrey};
height: 68px;
&:last-child {
border-bottom: 0;
}
&:hover {
background: ${p => rgba(p.theme.colors.wallet, 0.04)};
}
`
const Cell = styled(Box).attrs({
px: 4,
horizontal: true,
alignItems: 'center',
})`
width: ${p => (p.size ? `${p.size}px` : '')};
overflow: ${p => (p.noOverflow ? 'hidden' : '')};
`
const ShowMore = styled(Box).attrs({
horizontal: true,
flow: 1,
@ -102,141 +54,6 @@ const ShowMore = styled(Box).attrs({
}
`
const AddressEllipsis = styled.div`
display: block;
flex-shrink: 1;
min-width: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`
const Address = ({ value }: { value: string }) => {
const addrSize = value.length / 2
const left = value.slice(0, 10)
const right = value.slice(-addrSize)
const middle = value.slice(10, -addrSize)
return (
<Box horizontal color="smoke" ff="Open Sans" fontSize={3}>
<div>{left}</div>
<AddressEllipsis>{middle}</AddressEllipsis>
<div>{right}</div>
</Box>
)
}
const Operation = ({
account,
minConfirmations,
onAccountClick,
onOperationClick,
t,
op,
withAccount,
marketIndicator,
}: {
account: Account,
minConfirmations: number,
onAccountClick: Function,
onOperationClick: Function,
t: T,
op: OperationType,
withAccount?: boolean,
marketIndicator: string,
}) => {
const { unit, currency } = account
const time = moment(op.date)
const Icon = getIconByCoinType(account.currency.coinType)
const isNegative = op.amount < 0
const type = !isNegative ? 'from' : 'to'
const marketColor = getMarketColor({
marketIndicator,
isNegative,
})
return (
<OperationRaw onClick={() => onOperationClick({ operation: op, account, type, marketColor })}>
<Cell size={CONFIRMATION_COL_SIZE} align="center" justify="flex-start">
<ConfirmationCheck
confirmations={op.confirmations}
marketColor={marketColor}
minConfirmations={minConfirmations}
t={t}
type={type}
/>
</Cell>
<Cell size={DATE_COL_SIZE} justifyContent="space-between" px={3}>
<Box>
<Box ff="Open Sans|SemiBold" fontSize={3} color="smoke">
{t(`operationsList:${type}`)}
</Box>
<Hour>{time.format('HH:mm')}</Hour>
</Box>
</Cell>
{withAccount &&
account && (
<Cell
noOverflow
size={ACCOUNT_COL_SIZE}
horizontal
flow={2}
style={{ cursor: 'pointer' }}
onClick={e => {
e.stopPropagation()
onAccountClick(account)
}}
>
<Box
alignItems="center"
justifyContent="center"
style={{ color: account.currency.color }}
>
{Icon && <Icon size={16} />}
</Box>
<Box ff="Open Sans|SemiBold" fontSize={3} color="dark">
{account.name}
</Box>
</Cell>
)}
<Cell grow shrink style={{ display: 'block' }}>
<Address value={op.address} />
</Cell>
<Cell size={AMOUNT_COL_SIZE} justify="flex-end">
<Box alignItems="flex-end">
<FormattedVal
val={op.amount}
unit={unit}
showCode
fontSize={4}
alwaysShowSign
color={op.amount < 0 ? 'smoke' : undefined}
/>
<CounterValue
color="grey"
fontSize={3}
date={time.toDate()}
ticker={currency.units[0].code}
value={op.amount}
/>
</Box>
</Cell>
</OperationRaw>
)
}
Operation.defaultProps = {
onAccountClick: noop,
onOperationClick: noop,
withAccount: false,
}
const mapStateToProps = state => ({
settings: state.settings,
})
const mapDispatchToProps = {
openModal,
}
@ -251,7 +68,6 @@ type Props = {
withAccount?: boolean,
nbToShow: number,
title?: string,
settings: Settings,
}
export class OperationsList extends PureComponent<Props> {
@ -271,7 +87,6 @@ export class OperationsList extends PureComponent<Props> {
canShowMore,
nbToShow,
onAccountClick,
settings,
t,
title,
withAccount,
@ -295,7 +110,7 @@ export class OperationsList extends PureComponent<Props> {
{title}
</Text>
)}
{groupedOperations.map(group => {
{groupedOperations.sections.map(group => {
const d = moment(group.day)
return (
<Box flow={2} key={group.day.toISOString()}>
@ -312,8 +127,6 @@ export class OperationsList extends PureComponent<Props> {
<Operation
account={account}
key={`${account.id}-${op.hash}`}
marketIndicator={settings.marketIndicator}
minConfirmations={account.minConfirmations}
onAccountClick={onAccountClick}
onOperationClick={this.handleClickOperation}
op={op}
@ -338,4 +151,4 @@ export class OperationsList extends PureComponent<Props> {
}
}
export default compose(translate(), connect(mapStateToProps, mapDispatchToProps))(OperationsList)
export default compose(translate(), connect(null, mapDispatchToProps))(OperationsList)

29
src/components/SettingsPage/sections/Currencies.js

@ -25,9 +25,6 @@ import {
// instead of using same default for all.
//
const CURRENCY_DEFAULTS_SETTINGS: CurrencySettings = {
// will be overwritten
coinType: 0,
confirmationsToSpend: 10,
minConfirmationsToSpend: 10,
maxConfirmationsToSpend: 50,
@ -57,7 +54,7 @@ class TabCurrencies extends PureComponent<Props, State> {
getCurrencySettings() {
const { settings } = this.props
const { currency } = this.state
return settings.currencies.find(c => c.coinType === currency.coinType)
return settings.currenciesSettings[currency.coinType]
}
handleChangeCurrency = (currency: Currency) => this.setState({ currency })
@ -73,23 +70,23 @@ class TabCurrencies extends PureComponent<Props, State> {
const currencySettings = this.getCurrencySettings()
let newCurrenciesSettings = []
if (!currencySettings) {
newCurrenciesSettings = [
...settings.currencies,
{
newCurrenciesSettings = {
...settings.currenciesSettings,
[currency.coinType]: {
...CURRENCY_DEFAULTS_SETTINGS,
coinType: currency.coinType,
[key]: val,
},
]
}
} else {
newCurrenciesSettings = settings.currencies.map(c => {
if (c.coinType !== currency.coinType) {
return c
}
return { ...c, [key]: val }
})
newCurrenciesSettings = {
...settings.currenciesSettings,
[currency.coinType]: {
...currencySettings,
[key]: val,
},
}
}
saveSettings({ currencies: newCurrenciesSettings })
saveSettings({ currenciesSettings: newCurrenciesSettings })
}
render() {

249
src/components/modals/OperationDetails.js

@ -1,11 +1,13 @@
// @flow
import React from 'react'
import { connect } from 'react-redux'
import { shell } from 'electron'
import { translate } from 'react-i18next'
import styled from 'styled-components'
import moment from 'moment'
import type { Account, Operation } from '@ledgerhq/wallet-common/lib/types'
import type { T } from 'types/common'
import { MODAL_OPERATION_DETAILS } from 'config/constants'
@ -16,6 +18,8 @@ import Bar from 'components/base/Bar'
import FormattedVal from 'components/base/FormattedVal'
import Modal, { ModalBody, ModalTitle, ModalFooter, ModalContent } from 'components/base/Modal'
import { currencySettingsSelector } from 'reducers/settings'
import CounterValue from 'components/CounterValue'
import ConfirmationCheck from 'components/OperationsList/ConfirmationCheck'
@ -48,116 +52,155 @@ const B = styled(Bar).attrs({
size: 1,
})``
const OperationDetails = ({ t }: { t: T }) => (
<Modal
name={MODAL_OPERATION_DETAILS}
render={({ data, onClose }) => {
const { marketColor, operation, account, type } = data
const mapStateToProps = (state, props) => ({
minConfirmations: currencySettingsSelector(state, props.account.currency).confirmationsNb,
})
const { name, unit, currency, minConfirmations } = account
const { id, amount, confirmations, date, from, to } = operation
type Props = {
t: T,
operation: Operation,
account: Account,
type: 'from' | 'to',
onClose: Function,
minConfirmations: number,
marketColor: string,
}
const isConfirmed = confirmations >= minConfirmations
const OperationDetails = connect(mapStateToProps)((props: Props) => {
const { t, type, onClose, minConfirmations, operation, account, marketColor } = props
const { id, amount, date } = operation
return (
<ModalBody onClose={onClose}>
<ModalTitle>Operation details</ModalTitle>
<ModalContent flow={4}>
<Box alignItems="center" mt={3}>
<ConfirmationCheck
marketColor={marketColor}
confirmations={confirmations}
minConfirmations={minConfirmations}
style={{
transform: 'scale(2)',
}}
t={t}
type={type}
withTooltip={false}
// $FlowFixMe YEAH, I know those fields should not be present in operation
const { from, to } = operation
const { name, unit, currency } = account
const confirmations = account.blockHeight - operation.blockHeight
const isConfirmed = confirmations >= minConfirmations
return (
<ModalBody onClose={onClose}>
<ModalTitle>Operation details</ModalTitle>
<ModalContent flow={4}>
<Box alignItems="center" mt={3}>
<ConfirmationCheck
marketColor={marketColor}
confirmations={confirmations}
minConfirmations={minConfirmations}
style={{
transform: 'scale(2)',
}}
t={t}
type={type}
withTooltip={false}
/>
<Box mt={5} alignItems="center">
<Box>
<FormattedVal unit={unit} alwaysShowSign showCode val={amount} fontSize={8} />
</Box>
<Box mt={1}>
<CounterValue
color="grey"
fontSize={5}
date={date}
ticker={currency.units[0].code}
value={amount}
/>
<Box mt={5} alignItems="center">
<Box>
<FormattedVal unit={unit} alwaysShowSign showCode val={amount} fontSize={8} />
</Box>
<Box mt={1}>
<CounterValue
color="grey"
fontSize={5}
date={date}
ticker={currency.units[0].code}
value={amount}
/>
</Box>
</Box>
</Box>
<Line mt={4}>
<ColLeft>Acccount</ColLeft>
<ColRight>{name}</ColRight>
</Line>
<B />
<Line>
<ColLeft>Date</ColLeft>
<ColRight>{moment(date).format('LLL')}</ColRight>
</Line>
<B />
<Line>
<ColLeft>Status</ColLeft>
<ColRight color={isConfirmed ? 'positiveGreen' : null} horizontal flow={1}>
<Box>
{isConfirmed
? t('operationDetails:confirmed')
: t('operationDetails:notConfirmed')}
</Box>
<Box>({confirmations})</Box>
</ColRight>
</Line>
<B />
<Line>
<ColLeft>From</ColLeft>
<ColRight>
{from.map((v, i) => (
<CanSelect
key={i} // eslint-disable-line react/no-array-index-key
>
{v}
</CanSelect>
))}
</ColRight>
</Line>
<B />
<Line>
<ColLeft>To</ColLeft>
<ColRight>
{to.map((v, i) => (
<CanSelect
key={i} // eslint-disable-line react/no-array-index-key
>
{v}
</CanSelect>
))}
</ColRight>
</Line>
<B />
<Line>
<ColLeft>Identifier</ColLeft>
<ColRight>
<CanSelect>{id}</CanSelect>
</ColRight>
</Line>
</ModalContent>
<ModalFooter horizontal justify="flex-end" flow={2}>
<Button onClick={onClose}>Cancel</Button>
<Button
primary
onClick={() => shell.openExternal(`https://testnet.blockchain.info/tx/${id}`)}
>
View operation
</Button>
</ModalFooter>
</ModalBody>
</Box>
</Box>
<Line mt={4}>
<ColLeft>Acccount</ColLeft>
<ColRight>{name}</ColRight>
</Line>
<B />
<Line>
<ColLeft>Date</ColLeft>
<ColRight>{moment(date).format('LLL')}</ColRight>
</Line>
<B />
<Line>
<ColLeft>Status</ColLeft>
<ColRight color={isConfirmed ? 'positiveGreen' : null} horizontal flow={1}>
<Box>
{isConfirmed ? t('operationDetails:confirmed') : t('operationDetails:notConfirmed')}
</Box>
<Box>{`(${confirmations})`}</Box>
</ColRight>
</Line>
<B />
<Line>
<ColLeft>From</ColLeft>
<ColRight>
{from.map((v, i) => (
<CanSelect
key={i} // eslint-disable-line react/no-array-index-key
>
{v}
</CanSelect>
))}
</ColRight>
</Line>
<B />
<Line>
<ColLeft>To</ColLeft>
<ColRight>
{to.map((v, i) => (
<CanSelect
key={i} // eslint-disable-line react/no-array-index-key
>
{v}
</CanSelect>
))}
</ColRight>
</Line>
<B />
<Line>
<ColLeft>Identifier</ColLeft>
<ColRight>
<CanSelect>{id}</CanSelect>
</ColRight>
</Line>
</ModalContent>
<ModalFooter horizontal justify="flex-end" flow={2}>
<Button onClick={onClose}>Cancel</Button>
<Button
primary
onClick={() => shell.openExternal(`https://testnet.blockchain.info/tx/${id}`)}
>
View operation
</Button>
</ModalFooter>
</ModalBody>
)
})
type ModalRenderProps = {
data: {
account: Account,
operation: Operation,
type: 'from' | 'to',
marketColor: string,
},
onClose: Function,
}
const OperationDetailsWrapper = ({ t }: { t: T }) => (
<Modal
name={MODAL_OPERATION_DETAILS}
render={(props: ModalRenderProps) => {
const { data, onClose } = props
const { operation, account, type, marketColor } = data
return (
<OperationDetails
t={t}
operation={operation}
account={account}
type={type}
onClose={onClose}
marketColor={marketColor}
/>
)
}}
/>
)
export default translate()(OperationDetails)
export default translate()(OperationDetailsWrapper)

10
src/helpers/btc.js

@ -2,6 +2,7 @@
import ledger from 'ledger-test-library'
import bitcoin from 'bitcoinjs-lib'
import axios from 'axios'
import type { OperationRaw } from '@ledgerhq/wallet-common/lib/types'
import groupBy from 'lodash/groupBy'
@ -40,7 +41,7 @@ export function computeOperation(addresses: Array<string>, accountId: string) {
confirmations: t.confirmations,
date: t.received_at,
accountId,
blockHeight: 0,
blockHeight: t.block.height,
}
}
}
@ -196,6 +197,11 @@ export async function getAccount({
})
: getAddress({ type: 'external', index: 0 })
// TODO: in the future, it should be done with the libc call
const {
data: { height: blockHeight },
} = await axios.get('https://api.ledgerwallet.com/blockchain/v2/btc_testnet/blocks/current')
const account = {
...nextAddress,
coinType,
@ -204,6 +210,8 @@ export async function getAccount({
balanceByDay: getBalanceByDay(operations),
rootPath,
operations,
blockTime: new Date(),
blockHeight,
}
onProgress({

11
src/reducers/accounts.js

@ -101,7 +101,16 @@ export function serializeAccounts(accounts: any): Account[] {
}
export function deserializeAccounts(accounts: Account[]) {
return accounts.map(accountModel.encode)
return accounts.map(account => {
// as account can be passed by main process, the Date types
// can be converted to string. we ensure here that we have real
// date
if (typeof account.blockTime === 'string') {
account.blockTime = new Date(account.blockTime)
}
return accountModel.encode(account)
})
}
export default handleActions(handlers, state)

25
src/reducers/settings.js

@ -2,10 +2,12 @@
import { handleActions } from 'redux-actions'
import { getFiatUnit } from '@ledgerhq/currencies'
import type { Currency } from '@ledgerhq/currencies'
import get from 'lodash/get'
import type { Settings } from 'types/common'
import type { Settings, CurrencySettings } from 'types/common'
import type { State } from 'reducers'
export type SettingsState = Object
@ -18,8 +20,20 @@ const defaultState: SettingsState = {
isEnabled: false,
value: '',
},
currencies: [],
marketIndicator: 'eastern',
currenciesSettings: {},
}
const CURRENCY_DEFAULTS_SETTINGS: CurrencySettings = {
confirmationsToSpend: 10,
minConfirmationsToSpend: 10,
maxConfirmationsToSpend: 50,
confirmationsNb: 10,
minConfirmationsNb: 10,
maxConfirmationsNb: 50,
transactionFees: 10,
}
const state: SettingsState = {
@ -50,4 +64,11 @@ export const getLanguage = (state: Object) => get(state.settings, 'language', de
export const getOrderAccounts = (state: Object) =>
get(state.settings, 'orderAccounts', defaultState.orderAccounts)
export const currencySettingsSelector = (state: State, currency: Currency): CurrencySettings => {
const currencySettings = state.settings.currenciesSettings[currency.coinType]
return currencySettings || CURRENCY_DEFAULTS_SETTINGS
}
export const marketIndicatorSelector = (state: State) => state.settings.marketIndicator
export default handleActions(handlers, state)

9
src/types/common.js

@ -13,8 +13,6 @@ export type Devices = Array<Device>
// -------------------- Settings
export type CurrencySettings = {
coinType: number,
confirmationsToSpend: number,
minConfirmationsToSpend: number,
maxConfirmationsToSpend: number,
@ -26,16 +24,21 @@ export type CurrencySettings = {
transactionFees: number,
}
export type CurrenciesSettings = {
[coinType: number]: CurrencySettings,
}
export type Settings = {
language: string,
orderAccounts: string,
username: string,
counterValue: string,
password: {
isEnabled: boolean,
value: string,
},
currencies: CurrencySettings[],
marketIndicator: 'eastern' | 'western',
currenciesSettings: CurrenciesSettings,
}
export type T = (?string, ?Object) => string

3
yarn.lock

@ -8050,9 +8050,6 @@ ledger-test-library@KhalilBellakrid/ledger-test-library-nodejs#7d37482:
dependencies:
axios "^0.17.1"
bindings "^1.3.0"
electron "^1.8.2"
electron-builder "^20.0.4"
electron-rebuild "^1.7.3"
nan "^2.6.2"
prebuild-install "^2.2.2"

Loading…
Cancel
Save