Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:MyCryptoHQ/MyCrypto into paritys…
Browse files Browse the repository at this point in the history
…igner
  • Loading branch information
maciejhirsz committed Apr 6, 2018
2 parents 234d199 + c65296d commit 3f4a578
Show file tree
Hide file tree
Showing 42 changed files with 708 additions and 579 deletions.
4 changes: 2 additions & 2 deletions common/actions/config/actionTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TypeKeys } from './constants';
import { CustomNodeConfig, Web3NodeConfig } from 'types/node';
import { CustomNodeConfig, StaticNodeConfig } from 'types/node';
import { CustomNetworkConfig } from 'types/network';

/*** Toggle Offline ***/
Expand Down Expand Up @@ -80,7 +80,7 @@ export interface Web3UnsetNodeAction {
/*** Set Web3 as a Node ***/
export interface Web3setNodeAction {
type: TypeKeys.CONFIG_NODE_WEB3_SET;
payload: { id: 'web3'; config: Web3NodeConfig };
payload: { id: 'web3'; config: StaticNodeConfig };
}

export type CustomNetworkAction = AddCustomNetworkAction | RemoveCustomNetworkAction;
Expand Down
8 changes: 8 additions & 0 deletions common/components/BalanceSidebar/AccountInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getNetworkConfig, getOffline } from 'selectors/config';
import { AppState } from 'reducers';
import { NetworkConfig } from 'types/network';
import { TRefreshAccountBalance, refreshAccountBalance } from 'actions/wallet';
import { etherChainExplorerInst } from 'config/data';
import './AccountInfo.scss';

interface OwnProps {
Expand Down Expand Up @@ -193,6 +194,13 @@ class AccountInfo extends React.Component<Props, State> {
</NewTabLink>
</li>
)}
{network.name === 'ETH' && (
<li className="AccountInfo-list-item">
<NewTabLink href={etherChainExplorerInst.addressUrl(address)}>
{`${network.name} (${etherChainExplorerInst.origin})`}
</NewTabLink>
</li>
)}
{!!tokenExplorer && (
<li className="AccountInfo-list-item">
<NewTabLink href={tokenExplorer.address(address)}>
Expand Down
12 changes: 12 additions & 0 deletions common/components/ExtendedNotifications/TransactionSucceeded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
import translate from 'translations';
import { NewTabLink } from 'components/ui';
import { BlockExplorerConfig } from 'types/network';
import { etherChainExplorerInst } from 'config/data';

export interface TransactionSucceededProps {
txHash: string;
Expand All @@ -11,20 +12,31 @@ export interface TransactionSucceededProps {

const TransactionSucceeded = ({ txHash, blockExplorer }: TransactionSucceededProps) => {
let verifyBtn: React.ReactElement<string> | undefined;
let altVerifyBtn: React.ReactElement<string> | undefined;
if (blockExplorer) {
verifyBtn = (
<NewTabLink className="btn btn-xs" href={blockExplorer.txUrl(txHash)}>
{translate('VERIFY_TX', { $block_explorer: blockExplorer.name })}
</NewTabLink>
);
}
// TODO: In the future, we'll want to refactor staticNetworks so that multiple blockexplorers can be configured per network.
// This requires a large refactor, so for now we'll hard-code the etherchain link when etherscan is shown to verify your transaction
if (blockExplorer && blockExplorer.origin === 'https://etherscan.io') {
altVerifyBtn = (
<NewTabLink className="btn btn-xs" href={etherChainExplorerInst.txUrl(txHash)}>
{translate('VERIFY_TX', { $block_explorer: etherChainExplorerInst.name })}
</NewTabLink>
);
}

return (
<div>
<p>
{translate('SUCCESS_3')} {txHash}
</p>
{verifyBtn}
{altVerifyBtn}
<Link to={`/tx-status?txHash=${txHash}`} className="btn btn-xs">
{translate('NAV_CHECKTXSTATUS')}
</Link>
Expand Down
4 changes: 4 additions & 0 deletions common/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ const FRIENDS: Link[] = [
{
link: 'https://etherscan.io/',
text: 'Etherscan'
},
{
link: 'https://etherchain.org/',
text: 'Etherchain'
}
];

Expand Down
6 changes: 2 additions & 4 deletions common/components/Header/components/CustomNodeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
getCustomNodeConfigs,
getStaticNetworkConfigs
} from 'selectors/config';
import { CustomNode } from 'libs/nodes';
import { Input, Dropdown } from 'components/ui';
import './CustomNodeModal.scss';
import { shepherdProvider } from 'libs/nodes';

const CUSTOM = { label: 'Custom', value: 'custom' };

Expand Down Expand Up @@ -329,9 +329,7 @@ class CustomNodeModal extends React.Component<Props, State> {
: {})
};

const lib = new CustomNode(node);

return { ...node, lib };
return { ...node, lib: shepherdProvider };
}

private getConflictedNode(): CustomNodeConfig | undefined {
Expand Down
7 changes: 7 additions & 0 deletions common/config/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import NewTabLink from 'components/ui/NewTabLink';
import { getValues } from '../utils/helpers';
import packageJson from '../../package.json';
import { GasPriceSetting } from 'types/network';
import { makeExplorer } from 'utils/helpers';

export const languages = require('./languages.json');
export const discordURL = 'https://discord.gg/VSaTXEA';
Expand Down Expand Up @@ -33,6 +34,12 @@ export const BTCTxExplorer = (txHash: string): string => `${blockChainInfo}/tx/$
export const ETHAddressExplorer = (address: string): string => `${etherScan}/address/${address}`;
export const ETHTokenExplorer = (address: string): string => `${ethPlorer}/address/${address}`;

export const etherChainExplorerInst = makeExplorer({
name: 'Etherchain',
origin: 'https://www.etherchain.org',
addressPath: 'account'
});

export const donationAddressMap = {
BTC: '32oirLEzZRhi33RCXDF9WHJjEb8RsrSss3',
ETH: '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520',
Expand Down
13 changes: 11 additions & 2 deletions common/containers/Tabs/CheckTransaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AppState } from 'reducers';
import { NetworkConfig } from 'types/network';
import './index.scss';
import translate from 'translations';
import { etherChainExplorerInst } from 'config/data';

interface StateProps {
network: NetworkConfig;
Expand Down Expand Up @@ -43,6 +44,11 @@ class CheckTransaction extends React.Component<Props, State> {
public render() {
const { network } = this.props;
const { hash } = this.state;
console.log(network);
const CHECK_TX_KEY =
network.name === 'ETH'
? 'CHECK_TX_STATUS_DESCRIPTION_MULTIPLE'
: 'CHECK_TX_STATUS_DESCRIPTION_2';

return (
<TabSection>
Expand All @@ -52,9 +58,12 @@ class CheckTransaction extends React.Component<Props, State> {
<p className="CheckTransaction-form-desc">
{translate('CHECK_TX_STATUS_DESCRIPTION_1')}
{!network.isCustom &&
translate('CHECK_TX_STATUS_DESCRIPTION_2', {
translate(CHECK_TX_KEY, {
$block_explorer: network.blockExplorer.name,
$block_explorer_link: network.blockExplorer.origin
$block_explorer_link: network.blockExplorer.origin,
// On ETH networks, we also show Etherchain. Otherwise, these variables are ignored
$block_explorer_2: etherChainExplorerInst.name,
$block_explorer_link_2: etherChainExplorerInst.origin
})}
</p>
<TxHashInput hash={hash} onSubmit={this.handleHashSubmit} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import { connect } from 'react-redux';
import { Fields } from './components';
import { setDataField, TSetDataField } from 'actions/transaction';
import { Data } from 'libs/units';
import { Web3Node } from 'libs/nodes';
import RpcNode from 'libs/nodes/rpc';
import { Input, Dropdown } from 'components/ui';
import { INode } from 'libs/nodes';

interface StateProps {
nodeLib: RpcNode | Web3Node;
nodeLib: INode;
to: AppState['transaction']['fields']['to'];
dataExists: boolean;
}
Expand Down
18 changes: 0 additions & 18 deletions common/libs/nodes/custom/index.ts

This file was deleted.

29 changes: 0 additions & 29 deletions common/libs/nodes/etherscan/client.ts

This file was deleted.

14 changes: 0 additions & 14 deletions common/libs/nodes/etherscan/index.ts

This file was deleted.

84 changes: 0 additions & 84 deletions common/libs/nodes/etherscan/requests.ts

This file was deleted.

63 changes: 0 additions & 63 deletions common/libs/nodes/etherscan/types.ts

This file was deleted.

Loading

0 comments on commit 3f4a578

Please sign in to comment.