1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-01 04:38:15 +00:00

add "sequence" and "availableBalance" to Account

This commit is contained in:
Szymon Lesisz 2018-12-03 18:03:26 +01:00
parent 8bc2ec4206
commit cbded16091
3 changed files with 9 additions and 2 deletions

View File

@ -82,6 +82,8 @@ export const discoverAccount = (device: TrezorDevice, discoveryProcess: Discover
addressPath: path, addressPath: path,
address: ethAddress, address: ethAddress,
balance: account.balance, balance: account.balance,
availableBalance: account.balance,
sequence: account.nonce,
nonce: account.nonce, nonce: account.nonce,
block: account.block, block: account.block,
transactions: account.transactions, transactions: account.transactions,

View File

@ -2,6 +2,7 @@
import TrezorConnect from 'trezor-connect'; import TrezorConnect from 'trezor-connect';
import * as DISCOVERY from 'actions/constants/discovery'; import * as DISCOVERY from 'actions/constants/discovery';
import { toDecimalAmount } from 'utils/formatUtils';
import type { import type {
PromiseAction, PromiseAction,
@ -64,9 +65,11 @@ export const discoverAccount = (device: TrezorDevice, discoveryProcess: Discover
network: network.shortcut, network: network.shortcut,
deviceID: device.features ? device.features.device_id : '0', deviceID: device.features ? device.features.device_id : '0',
deviceState: device.state || '0', deviceState: device.state || '0',
addressPath: account.path, addressPath: account.path || [],
address: account.address, address: account.address,
balance: account.balance, balance: toDecimalAmount(account.balance, 6),
availableBalance: toDecimalAmount(account.availableBalance, 6),
sequence: account.sequence,
nonce: account.sequence, nonce: account.sequence,
block: account.block, block: account.block,
transactions: account.transactions, transactions: account.transactions,

View File

@ -20,6 +20,8 @@ export type Account = {
+addressPath: Array<number>; +addressPath: Array<number>;
+address: string; +address: string;
balance: string; balance: string;
availableBalance: string;
sequence: number;
nonce: number; nonce: number;
block: number; block: number;
transactions: number; transactions: number;