From cbded16091bdf0b693e0ff0b474ad5f86777a251 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Mon, 3 Dec 2018 18:03:26 +0100 Subject: [PATCH] add "sequence" and "availableBalance" to Account --- src/actions/ethereum/DiscoveryActions.js | 2 ++ src/actions/ripple/DiscoveryActions.js | 7 +++++-- src/reducers/AccountsReducer.js | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/actions/ethereum/DiscoveryActions.js b/src/actions/ethereum/DiscoveryActions.js index ec88fbd7..3d28b423 100644 --- a/src/actions/ethereum/DiscoveryActions.js +++ b/src/actions/ethereum/DiscoveryActions.js @@ -82,6 +82,8 @@ export const discoverAccount = (device: TrezorDevice, discoveryProcess: Discover addressPath: path, address: ethAddress, balance: account.balance, + availableBalance: account.balance, + sequence: account.nonce, nonce: account.nonce, block: account.block, transactions: account.transactions, diff --git a/src/actions/ripple/DiscoveryActions.js b/src/actions/ripple/DiscoveryActions.js index 7738f425..c4c82b26 100644 --- a/src/actions/ripple/DiscoveryActions.js +++ b/src/actions/ripple/DiscoveryActions.js @@ -2,6 +2,7 @@ import TrezorConnect from 'trezor-connect'; import * as DISCOVERY from 'actions/constants/discovery'; +import { toDecimalAmount } from 'utils/formatUtils'; import type { PromiseAction, @@ -64,9 +65,11 @@ export const discoverAccount = (device: TrezorDevice, discoveryProcess: Discover network: network.shortcut, deviceID: device.features ? device.features.device_id : '0', deviceState: device.state || '0', - addressPath: account.path, + addressPath: account.path || [], address: account.address, - balance: account.balance, + balance: toDecimalAmount(account.balance, 6), + availableBalance: toDecimalAmount(account.availableBalance, 6), + sequence: account.sequence, nonce: account.sequence, block: account.block, transactions: account.transactions, diff --git a/src/reducers/AccountsReducer.js b/src/reducers/AccountsReducer.js index 480fa76a..e2fb75f3 100644 --- a/src/reducers/AccountsReducer.js +++ b/src/reducers/AccountsReducer.js @@ -20,6 +20,8 @@ export type Account = { +addressPath: Array; +address: string; balance: string; + availableBalance: string; + sequence: number; nonce: number; block: number; transactions: number;