mirror of
https://github.com/trezor/trezor-wallet
synced 2025-06-07 00:28:46 +00:00
Merge pull request #541 from trezor/feature/transactions
Add transaction history - skeleton
This commit is contained in:
commit
505a27a3ef
@ -149,7 +149,7 @@
|
|||||||
"url": "https://api.coingecko.com/api/v3/coins/ripple"
|
"url": "https://api.coingecko.com/api/v3/coins/ripple"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"transactions": false,
|
||||||
"supportedBrowsers": {
|
"supportedBrowsers": {
|
||||||
"chrome": {
|
"chrome": {
|
||||||
"version": 59,
|
"version": 59,
|
||||||
|
@ -159,10 +159,12 @@ export const init = (): AsyncAction => async (
|
|||||||
|
|
||||||
if (buildUtils.isDev()) {
|
if (buildUtils.isDev()) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
window.__TREZOR_CONNECT_SRC =
|
window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string'
|
||||||
typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle
|
? LOCAL
|
||||||
// window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://localhost:8088/'; // eslint-disable-line no-underscore-dangle
|
: 'https://connect.sldev.cz/feature/eth-ripple-get-account-info/'; // eslint-disable-line no-underscore-dangle
|
||||||
window.TrezorConnect = TrezorConnect;
|
window.TrezorConnect = TrezorConnect;
|
||||||
|
// typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle
|
||||||
|
// window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://localhost:8088/'; // eslint-disable-line no-underscore-dangle
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -77,6 +77,11 @@ export const routes: Array<Route> = [
|
|||||||
pattern: '/device/:device',
|
pattern: '/device/:device',
|
||||||
fields: ['device'],
|
fields: ['device'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'wallet-account-transactions',
|
||||||
|
pattern: '/device/:device/network/:network/account/:account/transactions',
|
||||||
|
fields: ['device', 'network', 'account', 'transactions'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'wallet-account-summary',
|
name: 'wallet-account-summary',
|
||||||
pattern: '/device/:device/network/:network/account/:account',
|
pattern: '/device/:device/network/:network/account/:account',
|
||||||
|
@ -109,6 +109,16 @@ class TopNavigationAccount extends React.PureComponent<Props, LocalState> {
|
|||||||
<FormattedMessage {...l10nMessages.TR_NAV_SUMMARY} />
|
<FormattedMessage {...l10nMessages.TR_NAV_SUMMARY} />
|
||||||
</LinkContent>
|
</LinkContent>
|
||||||
</StyledNavLink>
|
</StyledNavLink>
|
||||||
|
{config.transactions && (
|
||||||
|
<StyledNavLink
|
||||||
|
activeClassName="has-bottom-border"
|
||||||
|
to={`${basePath}/transactions`}
|
||||||
|
>
|
||||||
|
<LinkContent>
|
||||||
|
<FormattedMessage {...l10nMessages.TR_NAV_TRANSACTIONS} />
|
||||||
|
</LinkContent>
|
||||||
|
</StyledNavLink>
|
||||||
|
)}
|
||||||
<StyledNavLink activeClassName="has-bottom-border" to={`${basePath}/receive`}>
|
<StyledNavLink activeClassName="has-bottom-border" to={`${basePath}/receive`}>
|
||||||
<LinkContent>
|
<LinkContent>
|
||||||
<FormattedMessage {...l10nMessages.TR_NAV_RECEIVE} />
|
<FormattedMessage {...l10nMessages.TR_NAV_RECEIVE} />
|
||||||
|
@ -3,6 +3,11 @@ import { defineMessages } from 'react-intl';
|
|||||||
import type { Messages } from 'flowtype';
|
import type { Messages } from 'flowtype';
|
||||||
|
|
||||||
const definedMessages: Messages = defineMessages({
|
const definedMessages: Messages = defineMessages({
|
||||||
|
TR_NAV_TRANSACTIONS: {
|
||||||
|
id: 'TR_NAV_TRANSACTIONS',
|
||||||
|
defaultMessage: 'Transactions',
|
||||||
|
description: 'Title of the navigation tab that contains tx history.',
|
||||||
|
},
|
||||||
TR_NAV_SUMMARY: {
|
TR_NAV_SUMMARY: {
|
||||||
id: 'TR_NAV_SUMMARY',
|
id: 'TR_NAV_SUMMARY',
|
||||||
defaultMessage: 'Summary',
|
defaultMessage: 'Summary',
|
||||||
|
13
src/views/Wallet/views/Account/Transactions/bitcoin/index.js
Normal file
13
src/views/Wallet/views/Account/Transactions/bitcoin/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Title from 'views/Wallet/components/Title';
|
||||||
|
import Content from 'views/Wallet/components/Content';
|
||||||
|
|
||||||
|
const BitcoinTransactions = () => {
|
||||||
|
return (
|
||||||
|
<Content>
|
||||||
|
<Title>Bitcoin Transactions</Title>
|
||||||
|
</Content>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BitcoinTransactions;
|
@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Title from 'views/Wallet/components/Title';
|
||||||
|
import Content from 'views/Wallet/components/Content';
|
||||||
|
|
||||||
|
const EthereumTransactions = () => {
|
||||||
|
return (
|
||||||
|
<Content>
|
||||||
|
<Title>Ethereum Transactions</Title>
|
||||||
|
</Content>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EthereumTransactions;
|
38
src/views/Wallet/views/Account/Transactions/index.js
Normal file
38
src/views/Wallet/views/Account/Transactions/index.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* @flow */
|
||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
|
import type { State } from 'flowtype';
|
||||||
|
|
||||||
|
import EthereumTransactions from './ethereum';
|
||||||
|
import RippleTransactions from './ripple';
|
||||||
|
import BitcoinTransactions from './bitcoin';
|
||||||
|
|
||||||
|
export type BaseProps = {|
|
||||||
|
selectedAccount: $ElementType<State, 'selectedAccount'>,
|
||||||
|
localStorage: $ElementType<State, 'localStorage'>,
|
||||||
|
|};
|
||||||
|
|
||||||
|
export default connect<BaseProps, any, _, _, _, _>(
|
||||||
|
(state: State): BaseProps => ({
|
||||||
|
selectedAccount: state.selectedAccount,
|
||||||
|
localStorage: state.localStorage,
|
||||||
|
}),
|
||||||
|
null
|
||||||
|
)((props: BaseProps) => {
|
||||||
|
const { config } = props.localStorage;
|
||||||
|
if (!config.transactions) return null; // turn off by feature tag
|
||||||
|
const { network } = props.selectedAccount;
|
||||||
|
if (!network || !config) return null;
|
||||||
|
|
||||||
|
switch (network.type) {
|
||||||
|
case 'ethereum':
|
||||||
|
return <EthereumTransactions />;
|
||||||
|
case 'ripple':
|
||||||
|
return <RippleTransactions />;
|
||||||
|
case 'bitcoin':
|
||||||
|
return <BitcoinTransactions />;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
13
src/views/Wallet/views/Account/Transactions/ripple/index.js
Normal file
13
src/views/Wallet/views/Account/Transactions/ripple/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Title from 'views/Wallet/components/Title';
|
||||||
|
import Content from 'views/Wallet/components/Content';
|
||||||
|
|
||||||
|
const RippleTransactions = () => {
|
||||||
|
return (
|
||||||
|
<Content>
|
||||||
|
<Title>Ripple Transactions</Title>
|
||||||
|
</Content>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RippleTransactions;
|
@ -18,6 +18,7 @@ import InstallBridge from 'views/Landing/views/InstallBridge/Container';
|
|||||||
// wallet views
|
// wallet views
|
||||||
import WalletContainer from 'views/Wallet';
|
import WalletContainer from 'views/Wallet';
|
||||||
import AccountSummary from 'views/Wallet/views/Account/Summary';
|
import AccountSummary from 'views/Wallet/views/Account/Summary';
|
||||||
|
import AccountTransactions from 'views/Wallet/views/Account/Transactions';
|
||||||
import AccountSend from 'views/Wallet/views/Account/Send';
|
import AccountSend from 'views/Wallet/views/Account/Send';
|
||||||
import AccountReceive from 'views/Wallet/views/Account/Receive';
|
import AccountReceive from 'views/Wallet/views/Account/Receive';
|
||||||
import AccountSignVerify from 'views/Wallet/views/Account/SignVerify/Container';
|
import AccountSignVerify from 'views/Wallet/views/Account/SignVerify/Container';
|
||||||
@ -109,6 +110,10 @@ const App = () => (
|
|||||||
path={getPattern('wallet-account-summary')}
|
path={getPattern('wallet-account-summary')}
|
||||||
component={AccountSummary}
|
component={AccountSummary}
|
||||||
/>
|
/>
|
||||||
|
<Route
|
||||||
|
path={getPattern('wallet-account-transactions')}
|
||||||
|
component={AccountTransactions}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path={getPattern('wallet-account-send')}
|
path={getPattern('wallet-account-send')}
|
||||||
component={AccountSend}
|
component={AccountSend}
|
||||||
|
Loading…
Reference in New Issue
Block a user