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. 27
      src/components/SettingsPage/sections/Currencies.js
  4. 69
      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 { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import { translate } from 'react-i18next' import { translate } from 'react-i18next'
import { getIconByCoinType } from '@ledgerhq/currencies/react'
import { import {
groupAccountOperationsByDay, groupAccountOperationsByDay,
groupAccountsOperationsByDay, groupAccountsOperationsByDay,
} from '@ledgerhq/wallet-common/lib/helpers/account' } 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 noop from 'lodash/noop'
import keyBy from 'lodash/keyBy' import keyBy from 'lodash/keyBy'
import { getMarketColor, rgba } from 'styles/helpers' import type { T } from 'types/common'
import type { Settings, T } from 'types/common'
import { MODAL_OPERATION_DETAILS } from 'config/constants' import { MODAL_OPERATION_DETAILS } from 'config/constants'
@ -27,17 +25,10 @@ import { openModal } from 'reducers/modals'
import IconAngleDown from 'icons/AngleDown' import IconAngleDown from 'icons/AngleDown'
import Box, { Card } from 'components/base/Box' 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 Text from 'components/base/Text'
import Defer from 'components/base/Defer' import Defer from 'components/base/Defer'
import ConfirmationCheck from './ConfirmationCheck' import Operation from './Operation'
const DATE_COL_SIZE = 100
const ACCOUNT_COL_SIZE = 150
const AMOUNT_COL_SIZE = 150
const CONFIRMATION_COL_SIZE = 44
const calendarOpts = { const calendarOpts = {
sameDay: 'LL – [Today]', sameDay: 'LL – [Today]',
@ -47,45 +38,6 @@ const calendarOpts = {
sameElse: 'LL', 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({ const ShowMore = styled(Box).attrs({
horizontal: true, horizontal: true,
flow: 1, 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 = { const mapDispatchToProps = {
openModal, openModal,
} }
@ -251,7 +68,6 @@ type Props = {
withAccount?: boolean, withAccount?: boolean,
nbToShow: number, nbToShow: number,
title?: string, title?: string,
settings: Settings,
} }
export class OperationsList extends PureComponent<Props> { export class OperationsList extends PureComponent<Props> {
@ -271,7 +87,6 @@ export class OperationsList extends PureComponent<Props> {
canShowMore, canShowMore,
nbToShow, nbToShow,
onAccountClick, onAccountClick,
settings,
t, t,
title, title,
withAccount, withAccount,
@ -295,7 +110,7 @@ export class OperationsList extends PureComponent<Props> {
{title} {title}
</Text> </Text>
)} )}
{groupedOperations.map(group => { {groupedOperations.sections.map(group => {
const d = moment(group.day) const d = moment(group.day)
return ( return (
<Box flow={2} key={group.day.toISOString()}> <Box flow={2} key={group.day.toISOString()}>
@ -312,8 +127,6 @@ export class OperationsList extends PureComponent<Props> {
<Operation <Operation
account={account} account={account}
key={`${account.id}-${op.hash}`} key={`${account.id}-${op.hash}`}
marketIndicator={settings.marketIndicator}
minConfirmations={account.minConfirmations}
onAccountClick={onAccountClick} onAccountClick={onAccountClick}
onOperationClick={this.handleClickOperation} onOperationClick={this.handleClickOperation}
op={op} 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)

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

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

69
src/components/modals/OperationDetails.js

@ -1,11 +1,13 @@
// @flow // @flow
import React from 'react' import React from 'react'
import { connect } from 'react-redux'
import { shell } from 'electron' import { shell } from 'electron'
import { translate } from 'react-i18next' import { translate } from 'react-i18next'
import styled from 'styled-components' import styled from 'styled-components'
import moment from 'moment' import moment from 'moment'
import type { Account, Operation } from '@ledgerhq/wallet-common/lib/types'
import type { T } from 'types/common' import type { T } from 'types/common'
import { MODAL_OPERATION_DETAILS } from 'config/constants' import { MODAL_OPERATION_DETAILS } from 'config/constants'
@ -16,6 +18,8 @@ import Bar from 'components/base/Bar'
import FormattedVal from 'components/base/FormattedVal' import FormattedVal from 'components/base/FormattedVal'
import Modal, { ModalBody, ModalTitle, ModalFooter, ModalContent } from 'components/base/Modal' import Modal, { ModalBody, ModalTitle, ModalFooter, ModalContent } from 'components/base/Modal'
import { currencySettingsSelector } from 'reducers/settings'
import CounterValue from 'components/CounterValue' import CounterValue from 'components/CounterValue'
import ConfirmationCheck from 'components/OperationsList/ConfirmationCheck' import ConfirmationCheck from 'components/OperationsList/ConfirmationCheck'
@ -48,17 +52,30 @@ const B = styled(Bar).attrs({
size: 1, size: 1,
})`` })``
const OperationDetails = ({ t }: { t: T }) => ( const mapStateToProps = (state, props) => ({
<Modal minConfirmations: currencySettingsSelector(state, props.account.currency).confirmationsNb,
name={MODAL_OPERATION_DETAILS} })
render={({ data, onClose }) => {
const { marketColor, operation, account, type } = data
const { name, unit, currency, minConfirmations } = account type Props = {
const { id, amount, confirmations, date, from, to } = operation 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
// $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 ( return (
<ModalBody onClose={onClose}> <ModalBody onClose={onClose}>
<ModalTitle>Operation details</ModalTitle> <ModalTitle>Operation details</ModalTitle>
@ -104,11 +121,9 @@ const OperationDetails = ({ t }: { t: T }) => (
<ColLeft>Status</ColLeft> <ColLeft>Status</ColLeft>
<ColRight color={isConfirmed ? 'positiveGreen' : null} horizontal flow={1}> <ColRight color={isConfirmed ? 'positiveGreen' : null} horizontal flow={1}>
<Box> <Box>
{isConfirmed {isConfirmed ? t('operationDetails:confirmed') : t('operationDetails:notConfirmed')}
? t('operationDetails:confirmed')
: t('operationDetails:notConfirmed')}
</Box> </Box>
<Box>({confirmations})</Box> <Box>{`(${confirmations})`}</Box>
</ColRight> </ColRight>
</Line> </Line>
<B /> <B />
@ -156,8 +171,36 @@ const OperationDetails = ({ t }: { t: T }) => (
</ModalFooter> </ModalFooter>
</ModalBody> </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 ledger from 'ledger-test-library'
import bitcoin from 'bitcoinjs-lib' import bitcoin from 'bitcoinjs-lib'
import axios from 'axios'
import type { OperationRaw } from '@ledgerhq/wallet-common/lib/types' import type { OperationRaw } from '@ledgerhq/wallet-common/lib/types'
import groupBy from 'lodash/groupBy' import groupBy from 'lodash/groupBy'
@ -40,7 +41,7 @@ export function computeOperation(addresses: Array<string>, accountId: string) {
confirmations: t.confirmations, confirmations: t.confirmations,
date: t.received_at, date: t.received_at,
accountId, accountId,
blockHeight: 0, blockHeight: t.block.height,
} }
} }
} }
@ -196,6 +197,11 @@ export async function getAccount({
}) })
: getAddress({ type: 'external', index: 0 }) : 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 = { const account = {
...nextAddress, ...nextAddress,
coinType, coinType,
@ -204,6 +210,8 @@ export async function getAccount({
balanceByDay: getBalanceByDay(operations), balanceByDay: getBalanceByDay(operations),
rootPath, rootPath,
operations, operations,
blockTime: new Date(),
blockHeight,
} }
onProgress({ onProgress({

11
src/reducers/accounts.js

@ -101,7 +101,16 @@ export function serializeAccounts(accounts: any): Account[] {
} }
export function deserializeAccounts(accounts: 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) export default handleActions(handlers, state)

25
src/reducers/settings.js

@ -2,10 +2,12 @@
import { handleActions } from 'redux-actions' import { handleActions } from 'redux-actions'
import { getFiatUnit } from '@ledgerhq/currencies' import { getFiatUnit } from '@ledgerhq/currencies'
import type { Currency } from '@ledgerhq/currencies'
import get from 'lodash/get' 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 export type SettingsState = Object
@ -18,8 +20,20 @@ const defaultState: SettingsState = {
isEnabled: false, isEnabled: false,
value: '', value: '',
}, },
currencies: [],
marketIndicator: 'eastern', 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 = { const state: SettingsState = {
@ -50,4 +64,11 @@ export const getLanguage = (state: Object) => get(state.settings, 'language', de
export const getOrderAccounts = (state: Object) => export const getOrderAccounts = (state: Object) =>
get(state.settings, 'orderAccounts', defaultState.orderAccounts) 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) export default handleActions(handlers, state)

9
src/types/common.js

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

3
yarn.lock

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

Loading…
Cancel
Save